Zero Configuration Networking with picoTCP

Jelle De Vleeschouwer is implementing the Zero Configuration Networking module for picoTCP for his college education final project. In this post he explains what it is all about.

Zero Configuration Networking with picoTCP

As a result of the growing ‘Internet of Things’-revolution, more and more embedded devices are connected to a network. The need arises for a simple solution to configure these devices in order to let them communicate with each other. Very often, these devices don’t even have a direct user-interface, so configuring them isn’t as plug and play as we would like them to be. You might prefer them to work out of the box. A possible solution for this problem is Zero Configuration Networking.

Zero Configuration Networking

Zero Configuration Networking (zeroconf in short) is, as the name implies, networking without any (human) intervention. It is a combination of technologies to provide the possibility to do networking without having to configure them manually using three technologies: Addressing, Naming and Service Discovery. If you’re an Apple user, you might have already used zeroconf. Somehow all of your iDevices are able to find eachother and can exchange information. Apple calls their zeroconf implementation Bonjour.

AirPlay uses Bonjour to discover available streaming devices on the network automatically

AirPlay uses Bonjour to discover available streaming devices on the network automatically

Addressing

First of all, if you want to communicate with a device in a network, it needs an IP address. There are several ways to obtain one, but the most common and straightforward way is using DHCP. If the DHCP-server is somehow unable to hand out IPs, zeroconf networks can handle this gracefully using link-local addressing. Such an address is only valid on the local link (known as the part of the network that never passes a router) which makes a device reachable within the network without relying on a server.

Naming

We have obtained an IP address to communicate with, but we don’t want to have to remember the IP of devices such as a printer. If it was auto configured, you don’t really know the IP and in fact you don’t want to know. Therefore a name to address a device would be easier to remember. DNS serves this purpose on the internet but having a DNS server in your local network is not preferable. That’s where multicast DNS (mDNS for short comes) into play. It uses the same packet format, resource records, etc. but you don’t need a server. All the hosts in the network work together to maintain the local domains. A common naming system would be to use a “.local” address, e.g. printer_color.local

Service Discovery

Instead of an IP, we remember the device’s name but there’s even better technology! Devices that offer a service can be made discoverable for others on the network. For example, if we are using VLC media player we’d like to discover video streaming services on the network or If we we want to print something, we want to discover all the printing services available. DNS based Service Discovery can do just that. DNS-SD is a layer on top of mDNS which includes SRV and TXT records. These records contain information such as a protocol, a port number etc. on how to connect to a specific service.

With information about services being exchanged by mDNS, hosts can discover them whenever they need something from the network without significantly impacting the link. This makes zeroconf networking especially interesting for ‘Internet of Things’-devices, which often have limited resources available. Zeroconf and picoTCP go hand in hand to provide fully automatic network configuration on embedded devices.

Check out the following info video by Cisco to learn more on mDNS and DNS-SD

Goal and status

The goal of this project is to provide a working DNS-SD module for picoTCP and using it to set up a zeroconf video streaming service. Jelle is very interested in this topic and is delighted to work with us and play a part in the picoTCP development.

Currently the mDNS module is a work in progress. Once it is finished, the DNS-SD functionality will be added. The roadmap for the mDNS module defines a working implementation by early April. If you are interested in the progress feel free to follow Jelle’s development logbook on GitHub.