Bonjour not working behind a switch

bonjour

I have a router, two devices (amongst other things) named device1.local and device2.local & 2 switches. Each switch is connected to the router. The two devices are not connected to the same switch. With this configuration, the devices are not able to communicate with each other through Bonjour. Using their IPs, on the other hand, works like a charm.

Now if I connect one of the devices directly to the router, everything is working fine.

Is this a Bonjour limitation? If so, it doesn't make much sense to me. What's the rationale behind this? Is there any to make this work at all (using additional configuration, in the switches or anything else)?

Best Answer

Bonjour is two systems running together: mDNS (Multicast DNS) and DNS-SD (DNS Service Discovery).

mDNS allows hosts (devices/computers) to be identified, while DNS-SD allows them to publish what services they are running.

Multicast DNS, as the name suggests, relies on IP Multicast, and specifically the multicast IP 224.0.0.251 (IPv4) or ff02::fb (IPv6) (in your case, most likely the former). It seems DNS-SD works over unicast between clients.

I suspect the problem is likely in the forwarding of multicast packets. Some switches/routers will not pass broadcast/multicast packets between some network interfaces.

In the simplest case, for example, you don't want broadcasts/multicasts from your own local network going out to the web. In a large corporate environment, you may want to limit such traffic to defined organisational units or groups of computers.

At a guess I'd say your switches/router are configured to either block multicast packets going 'upstream' (to the router) or (possibly) limit the number of hops (not actually sure if that's possible). I'm not familiar with the Netgear switches, but a quick google search suggests there's a configuration option called 'Block Unknown MultiCast Address'. You may want to try disabling this in the switches, and/or specifying 244.0.0.251 as a 'known' address if that's possible.

It may be that in the specific configuration (device1 - switch - router - switch - device2) the switches don't think the router is participating in the 244.0.0.251 multicast, and so doesn't bother forwarding out that port. The router may be doing the same for the switches, or may not be multicast aware.

It could be educational to try connecting one switch to the other, rather than each via the router. They may 'play nicer' when directly connected together (just a guess though, and probably not helpful for your intended deployment).

This discussion could also be helpful to better understanding the multicast limitations of those switches too.