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

    • x86
    • linux_redhat_4.0

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: