Subject: Support for mDNS?

Support for mDNS?

From: Matt Gruenke <mgruenke_at_intellivid.com>
Date: Thu, 15 Feb 2007 16:42:24 -0500

Has any work been done to add mDNS support to c-ares? (For more info,
see http://www.multicastdns.org/ and http://en.wikipedia.org/wiki/MDNS )

One option I've investigated is adding support for glibc's NSS mechanism
("Name Service Switch"). This would allow resolution mechanisms to be
added without modifying c-ares. Furthermore, it would enable c-ares
apps to respect the behavior specified in /etc/nsswitch.conf (the lack
of which might be a source of confusion and frustration for users and
admins).

The primary disadvantage is that the NSS mechanism doesn't define any
asynchronous lookups, so c-ares' behavior would degrade to synchronous.
However, since NSS does nothing to restrict what symbols plugins
contain, there's no reason c-ares couldn't define and attempt to use
some asynchronous extensions, before falling back to synchronous ones.

You can read more about NSS, here:

    
http://www.gnu.org/software/libc/manual/html_node/Name-Service-Switch.html

An attractive aspect of this approach is that there's already a NSS
plug-in that supports mDNS:

    http://0pointer.de/lennart/projects/nss-mdns/

Another benefit of going the plug-in route becomes apparent, as one
investigates the mDNS protocol - it relies somewhat heavily on both
passive and active caching, in order for network efficiency to scale
well with the number of devices and lookups. This means each client
machine would ideally run its own daemon that caches lookups for local
programs. Adding support via plug-ins has the benefit that any
dependency on a specific daemon would be pushed out to the plug-in,
allowing users to choose their own plug-in/daemon pair (FYI, nss-mdns
supports the Avahi mDNS daemon - http://avahi.org/ ).

Of course, the other option would be to add direct support for mDNS.
This has the disadvantage of either being inefficient (due to no
persistent, passive caching) or adding a dependency on a particular mDNS
daemon.

Thoughts? Opinions?

I'm already half way down the path of adding NSS support, but I'm not
sure if/when I'll have time to finish.

Matt
Received on 2007-02-15