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

Linux: Problem with multicast socket on dual stack (ipv4 and ipv6) on the loopback interface

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux_redhat_4.0

      Description

      The Java ES monitoring framework implements a discovery mechanism.

      This discovery (local to the node) is implemented using a Multicast channel bound to
      either the loopback (recommended) or the default interface (greatly inspired from the
      JDMK discovery mechanism).

      Linux RH4.X automatically enables IPV6 interfaces.
      On this boxes, our discovery mechanisnm does not work.
      If we disables IPV6 interfaces (lo and eth0) using the command :
      ifconfig lo del <address>
      ifconfig eth0 del <address>
      the discovery works fine.


      The attached test program illustrate the problem.
      To reproduce:
      =============
      All Scenario PRE-REQUISITE: make sure ipv6 is enabled on the loopback, for example:
      # ifconfig lo0 inet6 plumb

      Scenario 1: Default <-> Default: BREAK
      --------------------------------------

      start the 1st & 2nd instance:
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack
      -> none of the instances receive each other packet.
      -> in this case only the loopback interface is forced

      Scenario 1: IPv4 <-> IPv4: WORKS
      --------------------------------

      start the 1st & 2nd instance:
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -4
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -4
      -> both instances receive each other packet.
      -> in this case we use System.setProperty("java.net.preferIPv4Stack", "true");

      Scenario 2: IPv4 <-> IPv6: WORKS
      --------------------------------

      start the 1st & 2nd instance:
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -4
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -6
      -> both instances receive each other packet.

      Scenario 3: IPv6 <-> IPv6: BREAK
      --------------------------------

      start the 1st & 2nd instance:
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -6
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -6
      -> none of the instances receive each other packet.
      -> in this case we use System.setProperty("java.net.preferIPv6Stack", "true");


      Disabling the loopback in all the scenario make them work.
      This can be achieved using:
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -l
      or
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -4 -l
      or
      /usr/lang/JAVA/jdk1.5/bin/java TestMulticastLoopBack -6 -l

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yuwangsunw Yujiang Wang (Inactive)
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: