May - 11


Bonjour/ZeroConf/Rendezvous/mDNS across multiple subnets

Posted in Linux on May 8th, 2011 by Nicolas

Avahi, Zeroconf, mDNS, Bonjour, whatever you want to call it, is great for dealing with service discovery on your LAN where all hosts are located in the same broadcast domain. Indeed, the zeroconf protocol relies heavily on multicast for advertising and discovering services.

Sometimes, however, it is not possible to have a flat configuration and you have built different subnets for administrative purposes. Still, you think it would be cool to have services advertised by machines on a given subnet, available to machines on any other subnet.

One way of dealing with this is to use multicast routing and have your interconnection equipment pass multicast traffic from one subnet to another around your organisation. The zeroconf protocol uses only a few group addresses so this is not a big hassle to implement.

However, routing multicast is not always possible. As crazy as it may seem, even in the 21st century, some routers or wireless access points don’t support multicast routing :( Furthermore, as pointed out by one of the comments to this post, mDNS uses multicast groups which’s scope is limited to the local subnet and thus, even with multicast routing it wouldn’t work across subnets. In this case, another solution that exists is the use of service proxies.

A zeroconf proxy is a server software that will advertise services which are not hosted on the same machine. In this way, you could have one machine on subnet 1 advertising all the services that are provided by machines on subnet 2 and vice-versa.

For OS X there is the excellent network beacon from chaotic software available which should help you solve almost any problem with subnets and bonjour, zeroconf.

When it comes to linux, the avahi deamon is the way to go, twenty seconds, a simple file in /etc is all it takes to advertise a service.

On Windows on the other hand, the search can be quite longer. Indeed, you might find Rendezvous Proxy from iLeech to be quite nice until you start playing with multi-field TXT records (for any elaborated service such as Airfoil Speakers for example). At that point you’ll find out it is broken and generates malformed packets so you’ll search a little more and eventually come across a google code project named Bonjour Beacon and voilĂ , you’re all set!

To summarize a long post, bonjour, rendezvous, zeronconf, avahi, mDNS are the name of the protocol and the software implementations of it but they all do the same thing (and play nice with one another).

If you subnet, you have to use a proxy for services on one subnet to get advertised on another one (the protocol uses a link local multicast address).

Good proxies are, avahi on Linux, Bonjour Beacon on Windows and network beacon on OS X.