Setting the Type of Service (ToS) field in the IP header of a packet
posted 15 years ago
Hi, 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?