File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting the Type of Service (ToS) field in the IP header of a packet

Neelesh Chitari
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a Voice over IP project (PC to Phone).
I am packetising the audio data in a DatagramSocket and sending it over the net to the destination using UDP.
When I sniff the packets that are coming from the destination. I found that all of these packets have their Type of Service (ToS) field set to 14(Hex).
I also want to set the same field to the same number for my packets before sending them to the destination.
I lloked into the Java documents for the DatagramSocket class.
I did not find any API there that can set this field.
Actually thr reason may be that, the ToS field is a part of IP header of the packet.
My question is : How can I set the Type of Service(ToS) field in the IP header of a UDP packet through Java ? Is there any way to do it?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic