All You Need to Know About Zeroconf
The goal is autoconfiguration on a local network, and the trick is that on a local network you can just broadcast to find things. (Think AppleTalk, NetBIOS, but based on IP.)
Three pieces, oversimplified:
- IP autoconfiguration: choose an IP, ARP for it, and grab it if you didn't see anyone else ARPing for it
- multicast DNS: broadcast DNS queries to get localnet-wide responses; choose name with a backoff protocol like the IP one
- service discovery: a special DNS hierarchy with "hostnames" like
_ssh._tcp, where the DNS response includes hostnames supporting that protocol
The talk had all sorts of the nice demos you'd expect, like being able to hit "open ssh connection" in his terminal and seeing a list of ssh-able hosts nearby, or plugging in a webcam and getting its configuration page in Safari's browser links. I especially liked how he emphasized simplicity: he kept making references to maxims like "you know it's done when you can't remove anything more", and how it's getting implemented on tiny embedded devices.
All You Need to Know About Avahi
Apple has an open source implementation, but it's apparently non-free according to Debian(?). Avahi is an LGPL reimplementation of the spec. I asked Stuart (the speaker) what he thought about it and he seemed pretty excited, saying the Avahi devs had helped find bugs in other people's implementations.
The Avahi daemon answers requests and caches responses (so, for example, if some other computer queries the network for available printers, your computer can cache the response and not make the same request of its own). Services can be registered with the daemon via a file in a directory in
/etcor via an IPC call. They use DBUS for IPC. There are a bunch of cute supporting apps (like
service-discovery-applet, a Gnome panel applet) and simple programs to talk to the daemon, so running
avahi-publish-service "Desktop SSH" _ssh._tcp 22makes an entry "Desktop SSH" immediately appear in the drop-down list on the applet.
Avahi on Ubuntu installation instructions (some
apt-gets and some daemon restarts).
Why Evan Cares
- Home network uses DHCP, so maybe I can use mDNS to connect my laptop. Roommates use Windows and Macs, and I'd like to share files (iTunes?) with them.
- On the bus to work I've been thinking about how it'd be neat to do some sort of local IM or game; the internet connection sucks but local wireless ought to be fast. I have lots of social get-togethers involving laptops where there ought to be some neat sorts of exchanges.