When we have IP multicast based clusters (ie. using the UDP transport) and have them configured as
Cluster-1: <UDP mcast_addr="126.96.36.199" mcast_port="5000" ... />
Cluster-2: <UDP mcast_addr="188.8.131.52" mcast_port="5000" ... />,
then there might be cross talking between Cluster-1 and Cluster-2 on certain Linux operating systems (not on Mac OSX or Windows XP). Cross talking means that both clusters will see each other's traffic.
The reason is that we don't bind the MulticastSocket to the multicast address at creation time (new MulticastSocket(SocketAddress)).
This was changed in JGRP-639, but there are problems related to IPv6 with this approach:
If the stack is IPv6 (default on most Linux distros nowadays) and we pass an IPv4 multicast address (e.g. 184.108.40.206), then the creation of the MulticastSocket will fail because IPv6 will not be able to interpret 220.127.116.11 as a valid IPv6 address. In this case, use a valid one, such as FFFF::18.104.22.168 or one defined by IANA, e.g. FF02:0:0:0:0:0:0:3. If this is the case, JGroups will catch the bind exception, create an unbound MulticastSocket and log a warning message. Alternatively, use -Djava.net.preferIPv4Stack=true to force use of the IPv4 stack.
If the stack is IPv4 and we pass an IPv6 multicast address, the bind and/or subsequent MulticastSocket.join() will fail if there is no IPv6 stack configured or -Djava.net.preferIPv4Stack=true is set. In this case, use an IPv4 multicast address instead, or force use of the IPv6 stack by setting -Djava.net.preferIPv6Addresses=true.
Unfortunately, there is currently no way to find out which stacks are available on a system and which one is the default, so we have to issue the warning.
Although this worked on Linux, binding didn't work on Windows XP (although the mcast_addr was correct and the stack was the right one too) and sending didn't work on Mac OSX.
I'm rolling back the changes I made in JGRP-639, and the behavior is the old one.
In JGroups 2.6.5 and 2.6.6 Bela made changes to the JGroups UDP and MPING protocols such that on Linux systems the cross-talking problem doesn't occur. JGroups now checks the os.name system property to see if the OS is Linux; if it is the MulticastSocket constructor described above is used.