Mesh/Firmware/Zeroconf

From Sudo Room
Revision as of 20:19, 27 June 2018 by Tunabananas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We need a basic DNS client (and server) on the nodes. Zero-configuration (zeroconf) networking is software which configures a domain name server (DNS), dynamic host configuration protocol (DHCP), and other network settings with no configuration. The domain server returns a service (or files) from a destination (typically based on an IP address).

Publish

To broadcast a service on the network (the long way) and load on boot:

To broadcast a service (the easy way):

  • Use avahi-publish
    $ avahi-publish -s <NAME> <SERVICE TYPE> <PORT> <KEY VALUES>

When you broadcast through command line you can add as many keyvalues to your service. Our service browser has the following key values:

  • scope - registering the serivce with a service-browser
  • type - category of service
  • region - the area where the service is hosted (to minimize latency)

Example: $ avahi-publish -s search _http._tcp 80 scope=peoplesopen.net type=search region=oakland

Software

The mDNS responder (avahi) browses and controls mDNS software (nss-mdns). The mDNS responder allows you to broadcast and resolve a computer's address on the (mesh) network. When services are available on the computer, they can be accessible through the resolved name, but they aren't broadcasted until listed in the avahi services folder (etc/avahi/services).

avahi

An implementation of the DNS Service Discovery and Multicast DNS specifications for zero configuration networking. It uses D-Bus for communication between user applications and a system daemon. The daemon is used to coordinate application efforts in caching replies, necessary to minimize the traffic imposed on networks.

Avahi allows you to access computers using their hostnames. (documentation from archwiki) The services on the network can be hosted and discovered through the command line. Note: you must install nss-mdns for this to work, and have avahi-daemon.service enabled and running.

The program consists of these programs:

  • avahi-daemon - the mDNS/DNS-SD daemon
  • avahi-browse - a text-based browser for mDNS/DNS-SD services using the daemon
  • avahi-discover - a graphical browse list for mDNS/DNS-SD network services
  • avahi-publish - register an mDNS/DNS-SD service or host name or address mapping through the daemon
  • avahi-resolve - resolves one or more mDNS/DNS host name(s) to IP address(es) (and vice versa) using the Avahi daemon
  • avahi-daemon.conf - the configuration file for avahi-daemon
  • avahi-dnsconfd - a unicast DNS server made from mDNS/DNS-SD configuration daemon
  • avahi-autoipd - a IPv4LL network address configuration daemon

Features:

  • Embeddable mDNS stack (i.e. mDNS stack available as library)
  • Ability to reflect mDNS traffic between multiple subnets
  • Ability to configure a unicast DNS server automatically from server data published on the LAN
  • Wide area DNS-SD support (read-only for now)
  • Interface to GLIBC NSS using nss-mdns

Installation (for ubuntu)

  • Obtain an IPv4LL address
    $ sudo avahi-autoipd -D <INTERFACE> (interface: wlan0, eth0)
  • Install nss-mdns
  • Edit configuration file
    $ sudo vim /etc/avahi/avahi-daemon.conf
  • Enable and run avahi-daemon

nss-mdns

This software broadcasts mDNS queries on every interface that supports multicasts, thereby allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS domain (*.local). You don't interface with this software, but you need it for an mDNS responder (avahi).

The program consists of these programs:

Installation (for ubuntu)

  • Download the compressed file
  • Extract the files: $ tar -xvf <FILENAME> (example: nss-mdns.0.10.tar.gz)
  • Go into the directory: $ cd <FOLDER> (example: nss-mdns.0.10)
  • $ ./configure
  • $ make
  • $ sudo make install

mdns-utils

The OpenWRT package mdns-utils is actually just compiling part of Apple's mDNSResponder.

The mDNSClient utility only outputs lines to stderr (name, service type, and domain):

      • Found name = 'Foo', type = '_afpovertcp._tcp.', domain = 'local.'

The code that outputs this line is in the file mDNSResponder/mDNSPosix/Client.c in the function BrowseCallback.

Documentation

New DNS technologies on the LAN: mDNS, DNS-SD, LLMNR, PNRP

mesh DNS software: HypeDNS vs decentralized servers