Problem with multicast, only works for 1 packet

I have a device connected to one of the ethernet ports on my TpLink AC50, which has a unicast Mac address.(00aaaaaaaa00) Ive got another device connected over WiFi. (MtnElect_dd)

I have followed the IGMP tutorial on OpenWRTs website and setup igmp_proxy. I can see both the wifi device and ethernet device join the multicast group.

When I send a packet, the very first one is sent to the multicast IP and I get a response to the multicast IP, but then the router does some optimization to switch it to unicast because its over WiFi and then I start to receive ICMP 70 Destination Unreachable Msgs.

Below is a tshark output, after DHCP, IP 247 sends a packet to the multicast IP and then IP 194 responds (line 12/14). And then right after, it switches to a unicast and it no longer works (line 19)

1 0.000000000      0.0.0.0 → 255.255.255.255 DHCP 350 DHCP Discover - Transaction ID 0x5851f42d                                                                                                                                                                                                                           
    2 0.000388468      0.0.0.0 → 255.255.255.255 DHCP 350 DHCP Request  - Transaction ID 0x5851f42d                                                                                                                                                                                                                           
    3 0.000389278 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Who has 192.168.1.194? Tell 0.0.0.0                                                                                                                                                                                                                                 
    4 0.364823874 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Who has 192.168.1.194? Tell 0.0.0.0                                                                                                                                                                                                                                 
    5 0.992516135 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Who has 192.168.1.194? Tell 0.0.0.0                                                                                                                                                                                                                                 
    6 0.992517584 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Gratuitous ARP for 192.168.1.194 (Request)                                                                                                                                                                                                                          
    7 0.992518527 192.168.1.194 → 224.5.60.60  IGMPv2 60 Membership Report group 224.5.60.60                                                                                                                                                                                                                                  
    8 1.201303574 192.168.1.194 → 224.5.60.60  IGMPv2 60 Membership Report group 224.5.60.60                                                                                                                                                                                                                                  
    9 2.037586102 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Gratuitous ARP for 192.168.1.194 (Request)                                                                                                                                                                                                                          
   10 2.869670018 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Gratuitous ARP for 192.168.1.194 (Request)                                                                                                                                                                                                                          
   11 3.865275003 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Gratuitous ARP for 192.168.1.194 (Request)                                                                                                                                                                                                                          
   12 8.865529925 192.168.1.247 → 224.5.60.60  UDP 54 42069 → 42069 Len=12                                                                                                                                                                                                                                                    
   13 8.878740638 192.168.1.247 → 224.0.0.22   IGMPv3 54 Membership Report / Join group 224.5.60.60 for any sources                                                                                                                                                                                                           
   14 9.179716620 192.168.1.194 → 224.5.60.60  UDP 60 42069 → 42069 Len=2                                                                                                                                                                                                                                                     
   15 9.506901232 192.168.1.247 → 224.0.0.22   IGMPv3 54 Membership Report / Join group 224.5.60.60 for any sources                                                                                                                                                                                                           
   16 9.865780801 192.168.1.247 → 192.168.1.194 UDP 54 42069 → 42069 Len=12                                                                                                                                                                                                                                                   
   17 10.021105323 00:aa:aa:aa:aa:00 → Broadcast    ARP 60 Who has 192.168.1.247? Tell 192.168.1.194                                                                                                                                                                                                                          
   18 10.021129616 MtnElect_dd:64:12 → 00:aa:aa:aa:aa:00 ARP 42 192.168.1.247 is at 24:05:0f:dd:64:12                                                                                                                                                                                                                         
   19 10.072681158 192.168.1.194 → 192.168.1.247 ICMP 70 Destination unreachable (Port unreachable)                                                                                                                                                                                                                           
   20 10.866989271 192.168.1.247 → 192.168.1.194 UDP 54 42069 → 42069 Len=12                                                                                                                                                                                                                                                  
   21 10.924780408 192.168.1.194 → 192.168.1.247 ICMP 70 Destination unreachable (Port unreachable)                                                                                                                                                                                                                           
   22 11.868252980 192.168.1.247 → 192.168.1.194 UDP 54 42069 → 42069 Len=12                                                                                                                                                                                                                                                  
   23 12.076158146 192.168.1.194 → 192.168.1.247 ICMP 70 Destination unreachable (Port unreachable)                                                                                                                                                                                                                           
   24 12.868899736 192.168.1.247 → 192.168.1.194 UDP 54 42069 → 42069 Len=12                                                                                                                                                                                                                                                  
   25 13.081786706 192.168.1.194 → 192.168.1.247 ICMP 70 Destination unreachable (Port unreachable)                                                                                                                                                                                                                           
   26 13.430690323 192.168.1.247 → 224.0.0.22   IGMPv3 54 Membership Report / Leave group 224.5.60.60                                                                                                                                                                                                                         
   27 14.243731300 192.168.1.247 → 224.0.0.22   IGMPv3 54 Membership Report / Leave group 224.5.60.60      

I have tried forcing both to be on IGMPv2, but it didn't matter because IGMPv3 seems to be backwards compatible. I have turned snooping on and off, but nothing changed.

Here is my igmproxy settings:

config igmpproxy
	option quickleave 1
#	option verbose [0-3](none, minimal[default], more, maximum)

config phyint
	option network wan
	option zone wan
	option direction upstream
	list altnet 192.168.1.0/24

config phyint
	option network lan
	option zone lan
	option direction downstream

Here are my firewall settings:

config rule
	option name 'Allow-IGMP'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'
	option dest 'lan'

And here is my network settings:

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option igmp_snooping 0

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 6t'
	option igmp_snooping 0

This is for a robotics project I am working on (SSL Robocup), the eventual goal is to have 6-10 robots connect over WiFi to a multicast group to receive instructions, and respond with status msgs. During competition, the robots can be switched out and we need to be able to dynamically adapt to how many robots are in the group. We also want to be able to have robots connect over WiFi to different multicast groups for different purposes (one group for gameplay, one group for diagnostics, etc..).

Any guidance/help will be greatly appreciated, thank you for your time

Edit: Realized IGMPv2 can only have 1 src. So now I send packets back on a regular IP on the ethernet device, but multicast on the group ip for the wifi device. The same problem persists, once the router switches to unicast, it can't deliver the packets.

Hi!
It is possible to turn multicast to unicast conversion off with option multicast_to_unicast '0'.
(under config interface lan)
But it should work with this setting turned on.
What are you exactly trying to do?
Does your wan and lan network both have a 192.168.1.0/24 network?
It seems like the packets are rejected by a firewall?

1 Like

If you're doing this for robotics, it seems you probably have control over the software. Why do you use ipv4? Ipv6 is going to be WAY better for multicast applications. For one thing, it negotiates multicast over IP packets not over a separate IGMP protocol. For another thing, it's built into every aspect of ipv6 so for ipv6 to even work at all, multicast has to be working, which means it's way more debugged than ipv4 where most people get along just fine without it.

Second, if you're going to use WiFi for multicast let me recommend that you go through and eliminate basic_rates and supported_rates below 12Mbps or maybe 18Mbps. Multicast will always be sent at the lowest basic_rate is what I understand. This means you can choke up your entire AP with just 1Mbps if you allow the lower 802.11b modulations, and with just 6Mbps if you allow the lowest 802.11g/n modulation. SO just set your lowest basic rate to something reasonable. You will limit your range this way, but you'll avoid latency and bandwidth starvation issues.

Next, how is it converting multicast to unicast? Who is doing that? I believe this is controlled in the /sys/devices/.../net/*/brport/multicast_to_unicast control files.

find /sys -name multicast_to_unicast

to find them. I can't find docs online... :frowning:

It is possible turn this off for the entire bridge.
Actually I remember that there was setting to turn this off for wifi only but I can't find this setting anymore.
But I suspect a different problem here.

In IPv6 you should just be able to open a multicast channel to a link-local multicast address (in the ff02::/16 space), so something like

ff02::c3d0:42d2:bb8

or maybe a site-local multicast address, if you want to debug that :slight_smile:

ff05::c3d0:42d2:bb8

https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml

And anyone listening on those addresses will hear you. :crossed_fingers:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.