Difference between revisions of "Mesh/Firmware/Zeroconf"

Jump to navigation Jump to search
1,763 bytes added ,  21:19, 27 June 2018
no edit summary
(changed the formatting)
 
(14 intermediate revisions by one other user not shown)
Line 1: Line 1:
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. We want to use the [http://en.wikipedia.org/wiki/Service_Location_Protocol Service Location Protocol] (SLP) to implement a domain service. The domain server returns a service (or files) from a destination (typically based on an IP address). Such that peoplesopen.net resolves 199.175.52.221 as the IP address.  
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:
* [http://avahi.org/download/avahi.service.5.xml avahi service file] - the xml tags used by avahi
* [http://www.dns-sd.org/ServiceTypes.html service types] - the services available for the <code><type></code> and <code><subtype></code> tags
* [http://fedorasolved.org/Members/fenris02/zero-configuration-networking-avahi avahi service examples] - a few examples of services
 
To broadcast a service (the easy way):
* Use <code>avahi-publish</code>
*: <code>$ avahi-publish -s <NAME> <SERVICE TYPE> <PORT> <KEY VALUES></code>
 
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: <code>$ avahi-publish -s search _http._tcp 80 scope=peoplesopen.net type=search region=oakland</code>''


=Software=
=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).


== [http://avahi.org/ avahi] ==  
== [http://avahi.org/ avahi] ==  
Line 10: Line 30:
'''Note: you must install nss-mdns for this to work, and have avahi-daemon.service enabled and running.'''  
'''Note: you must install nss-mdns for this to work, and have avahi-daemon.service enabled and running.'''  


The program consists of these programs:  
The program consists of these programs:
* [http://linux.die.net/man/1/avahi-browse avahi-browse] - browse for mDNS/DNS-SD services using the daemon
* [http://linux.die.net/man/8/avahi-daemon avahi-daemon] - the mDNS/DNS-SD daemon
* [http://linux.die.net/man/8/avahi-daemon avahi-daemon] - the mDNS/DNS-SD daemon
* [http://linux.die.net/man/1/avahi-browse avahi-browse] - a text-based browser for mDNS/DNS-SD services using the daemon
* [http://linux.die.net/man/1/avahi-discover avahi-discover] - a graphical browse list for mDNS/DNS-SD network services
* [http://linux.die.net/man/1/avahi-publish-address avahi-publish] - register an mDNS/DNS-SD service or host name or address mapping through the daemon
* [http://linux.die.net/man/1/avahi-resolve avahi-resolve] - resolves one or more mDNS/DNS host name(s) to IP address(es) (and vice versa) using the Avahi daemon
* [http://linux.die.net/man/5/avahi-daemon.conf avahi-daemon.conf] - the configuration file for avahi-daemon
* [http://linux.die.net/man/5/avahi-daemon.conf avahi-daemon.conf] - the configuration file for avahi-daemon
* [http://linux.die.net/man/1/avahi-discover avahi-discover] - show a real-time graphical browse list for mDNS/DNS-SD network services
* [http://linux.die.net/man/8/avahi-dnsconfd avahi-dnsconfd] - a unicast DNS server made from mDNS/DNS-SD configuration daemon
* [http://linux.die.net/man/8/avahi-dnsconfd avahi-dnsconfd] - a Unicast DNS server made from mDNS/DNS-SD configuration daemon
* [http://linux.die.net/man/8/avahi-autoipd avahi-autoipd] - a IPv4LL network address configuration daemon  
* [http://linux.die.net/man/8/avahi-autoipd avahi-autoipd] - a IPv4LL network address configuration daemon  


Line 30: Line 52:
*: <code>$ sudo avahi-autoipd -D <INTERFACE></code> (interface: wlan0, eth0)
*: <code>$ sudo avahi-autoipd -D <INTERFACE></code> (interface: wlan0, eth0)
* Install <code>nss-mdns</code>
* Install <code>nss-mdns</code>
* Edit configuration file
*: <code>$ sudo vim /etc/avahi/avahi-daemon.conf</code>
* Enable and run <code>avahi-daemon</code>
* Enable and run <code>avahi-daemon</code>


== [http://0pointer.de/lennart/projects/nss-mdns/ nss-mdns] ==
== [http://0pointer.de/lennart/projects/nss-mdns/ 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).
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).  


* Install nss-mdns
The program consists of these programs:
*: Download the compressed file
* [http://netbsd.gw.com/cgi-bin/man-cgi?nsswitch.conf+5+NetBSD-current nsswitch.conf] - the name-service switch configuration file
*: Extract the files: <code>$ tar -xvf <FILENAME></code> (example: nss-mdns.0.10.tar.gz)
 
*: Go into the directory: <code>$ cd <FOLDER></code> (example: nss-mdns.0.10)
'''Installation''' (for ubuntu)
*: <code>$ ./configure</code>
* Download the compressed file
*: <code>$ make</code>
* Extract the files: <code>$ tar -xvf <FILENAME></code> (example: nss-mdns.0.10.tar.gz)
*: <code>$ sudo make install</code>
* Go into the directory: <code>$ cd <FOLDER></code> (example: nss-mdns.0.10)
* <code>$ ./configure</code>
* <code>$ make</code>
* <code>$ sudo make install</code>


== mdns-utils ==
== mdns-utils ==
Line 50: Line 77:
The mDNSClient utility only outputs lines to stderr (name, service type, and domain):
The mDNSClient utility only outputs lines to stderr (name, service type, and domain):


  *** Found name = 'Foo', type = '_afpovertcp._tcp.', domain = 'local.'
*** 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.
The code that outputs this line is in the file mDNSResponder/mDNSPosix/Client.c in the function BrowseCallback.
Line 59: Line 86:


[http://wiki.projectmeshnet.org/DNS mesh DNS software]: HypeDNS vs decentralized servers
[http://wiki.projectmeshnet.org/DNS mesh DNS software]: HypeDNS vs decentralized servers
[[Category:Mesh]]
1,194

edits

Navigation menu