Multicast across subnets

I have moved my HomeAssistant to a new subnet but left my Google Assistant/speaker on the original subnet. Since doing this HA can no longer broadcast to the Google Speaker.

Testing multicasting using the below shows that this is not working:
iperf -s -u -B 239.255.255.250 -i 1
and
iperf -c 239.255.255.250 -u -b 1M -t 10

After some googling, I enabled Avahi and added the interfaces for both subnets.

Right now the firewall rules on both subnets are set to a single allow all rule.

Can’t tell what equipment you’re using, but assuming the firewall is setup properly, check that your switch isn’t blocking multicast across subnets.

There are two different protocols in use for domesic AV equipment and you need different services to make those work acress routed networks:

  • mDNS (used e.g. by Apple AirPlay) → udp broadcast relay, or AVAHI (don’t use both!)
  • SSDP (used by DLNA/UPnP) → udp broadcast relay

I don’t know what Google is using, possibly Chromecast, and I dont know anything about Chromecast, but googling shows it may use SSDP.

Your best guess is UDP Broadcast Relay (additional package to install using the package manager):

mDNS and SSDP are not supposed to work across routed networks.

SSDP even sets the TTL to 1 so the packets are not routed.

This is why you need a repeater software on the router to receive the multicast datagrams and then send them to the other VLANs/networks.

I am using some Cisco Catalyst 2960X switches. I will still need to enable IGMP snooping on them, correct?

Totally true, but some switches disable multicast altogether by default. It can cause real havoc on busy networks. I think you’re right that it’s probably not the case here.

IGMP Snooping probably does not make a difference. I have it turned of on all devices and everything works as expected.

This is an optimization to reduce traffic ports that don’t have clients using those groups. I am not sure whether the SSDP and mDNS discovery protocols are implemented correctly everywhere so that the clients join to the group using IGMP. If there are incorrectly implemented clients this IGMP Snooping optimization wil break their discovery phase. This is why I turned it off.

Ok, so I have the following:

I am still setting things up so the rules are basically open.


and

But the HomeAssistant broadcast still does not work.

Should I be seeing anything when running the iperf commands on a machine in each subnet?

My approach would be do look with Wireshark in the VLANs where the devices are located that you want to work together. Then you will see what a device in a VLAN 1 is sending and whether those datagrams are repeated on the other VLAN 2.

your UDP relay has been set up for SSDP, and your firewall rules are set up for mDNS. I would expect that this cannot work.

I suggest that you set both, the relay and the firewall rules, up to allow both, SSDP and mDNS.

oK, so sorted it. I asked ChatGPT to rewrite the solution for Chromecast and got

For Google devices:
Google devices commonly use the following multicast group and UDP ports:

  • Multicast group: 224.0.0.251 (mDNS - Multicast DNS)
  • UDP port: 5353 (for mDNS traffic used for device discovery)

Configuration for Google Devices:
Create a new UDP Broadcast Relay instance (if you’re separating it from the Sonoff setup, otherwise you can combine them):

  • Interfaces: Select the VLANs/networks where the Google devices and controllers (e.g., phones, tablets) are located.
  • Spoof Source: Set to Keep original.
  • Destination UDP port: Set to 5353.
  • Multicast group: Set to 224.0.0.251

Using the below to test, I could see the multicast traffice on both subnets.

  • tcpdump -i igc2.20 host 224.0.0.251 and port 5353
  • tcpdump -i igc1 host 224.0.0.251 and port 5353

I then ran the desired script on Home Assistant and all was sweet.

Many thanks for pointing me in the right direction.

Just making sure: Have you checked that the Chromecast devices now work together as expected?

Yes, did a proper check and all is well :slight_smile:

And my HomeAssistant automations are broadcasting announcements again to the Google speaker.