Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8072384

Setting IP_TOS on java.net sockets not working on unix

XMLWordPrintable

    • b01

        Submitter reporting some problems around setting of TOS on the classic networking sockets. No issues seen on NIO sockets.

        A typical use case might be :
                ServerSocket ss = new ServerSocket();
                jdk.net.Sockets.setOption(ss, java.net.StandardSocketOptions.IP_TOS, 128);
                // bind
                // accept

         The remaining Java related problems are:
         1. Blocking TCP IPv6 Server sockets (java.net). This is not working neither on Oracle Solaris 10 1/13 or a recent Linux (CentOS 7).
         2. Blocking TCP IPv4 Server sockets (java.net) on Linux. Here the initial SYN packet is missing the TOS flag.

         Solaris system:
         java version "1.7.0_80-ea"
         Java(TM) SE Runtime Environment (build 1.7.0_80-ea-b04)
         Java HotSpot(TM) Server VM (build 24.80-b07, mixed mode)

         cat /etc/release
                            Oracle Solaris 10 1/13 s10x_u11wos_24a X86
          Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights
        reserved.
                                    Assembled 17 January 2013

         Results:
         
         IPv6
         TCP:
         Client Socket: OK
         Server Socket: Not OK
         
         TCPNIO:
         Client Socket: OK
         Server Socket: OK
         
         UDP:
         Client Socket: OK
         Server Socket: OK
         
         IPv4(all with -Djava.net.preferIPv4Stack=true)
         
         TCP:
         Client Socket: OK
         Server Socket: OK
         
         TCPNIO:
         Client Socket: OK
         Server Socket: OK
         
         UDP:
         Client Socket: OK
         Server Socket: OK

              coffeys Sean Coffey
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: