For some reason, every multicast example I run (the computer runs OpenSUSE Linux) will work. The clients all just sit silently. How do I figure out why the multicast is being blocked/ignored?
Some of the examples:
EXAMPLE 1
http://www.roseindia.net/java/example/java/net/udp/UDPMulticastServer.java
Example 2
http://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html
(uses these files:)
http://docs.oracle.com/javase/tutorial/networking/datagrams/examples/MulticastServer.java
http://docs.oracle.com/javase/tutorial/networking/datagrams/examples/MulticastServerThread.java
http://docs.oracle.com/javase/tutorial/networking/datagrams/examples/MulticastClient.java
http://docs.oracle.com/javase/tutorial/networking/datagrams/examples/one-liners.txt
When troubleshooting IP multicast, there are some big-picture things you can do to isolate whether this is a host issue, software issue, or network issue:
pingtest for IP multicast (using linux’ssocattool)The details for each step are outlined below…
Step 1
First, ensure that the linux multicast receivers are correctly advertising their group membership reports; keep in mind that a lot of things in multicast work backwards from unicast. For instance, multicasting requires that you send an IGMP join packet that contains the multicast group you want to receive.
Use
tcpdumportsharkto examine the interface in question… In the example below, I have a machine on192.168.12.238that is announcing (viaigmp) that it wants to receive multicast traffic from239.255.0.1Now check and see whether the multicast source’s traffic is getting to this interface (I’m assuming it was eth0, below):
If you see traffic sent to the proper multicast group, then proceed directly to Step 3; otherwise go to Step 2.
Step 2
Next ensure that your multicast server is sending the traffic to the correct group. In the example below, I run a command to sniff
eth0for traffic sent to239.255.0.1.If the multicast source is sending traffic to the right group here in Step 2, you saw IGMP group joins in Step 1, and Step 1 did not see traffic at the multicast receiver’s interface, then contact your network administrators about this problem.
Step 3
Assuming all that works, and you still want an acid test in case your multicast receiver software is somehow discarding multicast it receives from the IP stack… make sure you have
socatinstalled on your machine and do the following…On the multicast sender (server), use this command to send test multicast packets to
239.255.0.1:On the multicast receiver (client), use this command to listen to test multicast packets sent to
239.255.0.1oneth0:Assuming your network administrators are allowing multicast on
239.255.0.1, you will see a lot of traffic like this in the multicast receiver’s terminal window:NOTE: do not try this with a multicast group address that is already in production use on your network.
Step 4
If steps 1, 2, and 3 reveal that multicast traffic is being sent and received through your network, then call up the software developer and tell them you think there is a problem with the application and explain the steps you have taken so far.
If steps 1, 2, or 3 do not work, reconfigure your software / hosts / network until they do. Warning, multicast in IP networks is 3x harder to implement correctly than IP unicast.
Best of luck to you…