3

I'm trying to set the DSCP field in the header of a UDP packet in Java, like so:

bcSock = new DatagramSocket(port, address);
bcSock.setTrafficClass(0xE0);

However, when looking at the packets with Wireshark, it shows the DSCP byte as 0x00.

I tried adding this to the "VM Options" (but it didn't help):

-Djava.net.preferIPv4Stack=true

I'm running the application on OS X 10.10.2

Any ideas how to set DSCP byte? Or any other way to set packet priority (or QoS) using Java?

Thanks for your thoughts & help.

Razib
  • 10,965
  • 11
  • 53
  • 80
briggsm
  • 455
  • 3
  • 15

1 Answers1

2

Ok, absolutely no explanation for this. I put my computer to sleep (for the night), decided to try a different router/access point, and saw that the DSCP byte WAS being changed now! Went back to my old access point, and it continued to work. Tried on both the Ethernet network adapter and Wi-Fi network adaptor on my MBP, and both worked fine.

Unfortunately, I currently have no idea what caused this to suddenly start working. I didn't reboot my computer or anything. Sorry I can't be of more help (yet) to anybody else out there seeing this issue.

Just for the record, it turns out I do still NEED this for it to work:

-Djava.net.preferIPv4Stack=true
briggsm
  • 455
  • 3
  • 15