0

I'm writing an application to get multicast updates from a current-measuring device which is plugged into my LAN. The device sends out packets to multicast group 224.192.32.19:22600 every few minutes, and I can read them fine from one of the hosts (a raspberry pi).

The weird thing is that when I tried to add a second listener host, I couldn't find any multicast traffic from that group on its interface.

The network layout is the following: network layout

All of the network is in the same physical location, under the same 192.168.x.x subnet. Between the sender and receiver(s) there are 2 TP-Link WDR3600 routers running DD-WRT, and a "dumb" TP-Link 8-port gigabit switch (used as a port expander). Everything is wired via ethernet.

Further details:

  • "NOK" hosts include a windows 7 laptop, bridged Linux VM on the same laptop, and a different linux laptop
  • plugging a "NOK" host directly to the dumb switch where the "OK" host is has no effect
  • plugging directly to the secondary router (1 ethernet "hop" closer to the source) has no effect
  • I can't find any IGMP traffic for that group on any of the hosts, including the working one
  • snooping the network traffic for IGMP I can see 2 join requests going out to 224.0.0.22 when my application starts.

The group membership gets registered by the kernel and is displayed by

~ $ netstat -ng
IPv6/IPv4 Group Memberships
Interface       RefCnt Group
--------------- ------ ---------------------
lo              1      224.0.0.1
eth0            1      224.192.32.19
eth0            1      224.0.0.251
eth0            1      224.0.0.1

Python code that initializes the socket from the listener application is this:

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((self.mcast_group, self.mcast_port))
mreq = struct.pack("4sl", socket.inet_aton(self.mcast_group), socket.INADDR_ANY)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)

What am I missing here? Simply running the listener application on the working host was enough to receive the multicast traffic, why is it not the case for the additional listeners?

1 Answers1

0

Turns out this was a router issue, after restarting the secondary router all of the hosts started receiving the multicast packets as expected.

I'd say it was either a DD-WRT bug, or some state corruption that compromised the multicast traffic distribution.