I am trying to mark DSCP values ββusing setTrafficClass. I have a server and a client configured on two different machines, and I can print the DSCP value, but I do not see it in WireShark. I went through several posts on the Internet, but nothing helped. I am using a professional Windows 7. Any help would be greatly appreciated. Thanks!
I am testing more how this can be done. Here is the client code:
try {
Socket socket = new Socket(addr, 2345); socket.setTrafficClass(10); PrintWriter out = new PrintWriter( socket.getOutputStream(), true); out.println("Current DSCP value: " + socket.getTrafficClass()); out.close(); socket.close(); } catch (Exception e) { e.printStackTrace(); } }
Server:
try { ServerSocket serverSocket = new ServerSocket(1234); Socket clientSocket = serverSocket.accept(); BufferedReader in = new BufferedReader(new InputStreamReader( clientSocket.getInputStream())); String fromClient = in.readLine(); System.out.println(fromClient); in.close(); clientSocket.close(); serverSocket.close(); } catch (Exception e) { e.printStackTrace(); } }
In the server-side console: Current DSCP value: 10
My server code and client are on separate machines.
In wirehark, I see:
Differentiated Services Field: 0x00 (DSCP 0x00: default, ECN: 0x00: non-ECT (ECN not supported))
I expect to see changes in wirehark, and I only see the default value of 0.
java network-programming wireshark
ron_g_1
source share