Difference between revisions of "Mesh/Firmware/Overview"

From Sudo Room
Jump to navigation Jump to search
m (Redconfetti moved page Mesh/SudoWRT Tour to Mesh/Firmware/Overview: overview for misc notes and links to other more detailed pages)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Accessing Home Node via SSH =
= OpenWRT Build =


Your home node is accessible via the [https://wiki.openwrt.org/doc/uci/dropbear Dropbear] Secure Shell (SSH) server.
The SudoMesh project maintains firmware builds for a certain set of Wireless routers (home nodes) and extender antennas. The code used to create these builds is available in [https://github.com/sudomesh/sudowrt-firmware SudoWRT-Firmware].


== Network Settings ==
== Included Software Packages ==


The private network configuration uses the 172.22.0.x network.  
The SudoWRT-Firmware code contains a configured list of software packages that are included within the builds for home nodes and the extender antennas.  


Reconfigure your machine to use the following network settings, then connect it to Ethernet port 1 to connect on the local private network interface.
* Home Node Packages - [https://github.com/sudomesh/sudowrt-firmware/blob/master/openwrt_config/packages openwrt_config/packages].
* Extender Antenna Packages - [https://github.com/sudomesh/sudowrt-firmware/blob/master/openwrt_config/packages.extender-node openwrt_config/packages.extender-node]


* IP Address: 172.22.0.9
=== uhttpd ===
* Netmask: 255.255.255.0
* Gateway: 0.0.0.0


See Network Configuration Guides: [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20Linux Linux] [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20MacOS%20X Mac]
[https://wiki.openwrt.org/doc/howto/http.uhttpd uhttpd] is an efficient and stable web server daemon, suitable for lightweight tasks commonly used with embedded devices and proper integration with [https://wiki.openwrt.org/doc/uci OpenWrt's configuration framework (UCI)]. In particular, it is configured by default for the [https://wiki.openwrt.org/doc/techref/luci LuCI web interface] to administer OpenWrt. SudoMesh uses it's own [https://github.com/sudomesh/sudowrt-web-ui SudoWRT-Web-UI], see [[Mesh/Firmware/Web_Admin_Development]] for more information.


== Default Build Configuration ==
=== uhttpd-mod-ubus ===


The IP address of your home node is <tt>172.22.0.1</tt> prior to configuration via the [https://github.com/sudomesh/makenode makenode] utility. You can SSH into the node as <tt>root</tt> using the password 'meshtheplanet'.
[https://wiki.openwrt.org/doc/techref/ubus#access_to_ubus_over_http uhttpd-mod-ubus] is a module for uhttpd that acts as a proxy between the HTTP interface of the home node, and the local ubus that is available to processes running on the home node.


== Post Makenode Configuration ==
= Web Interface =  


The IP of your home node on the private network is <tt>172.30.0.1</tt>, with the root password you specified when running <tt>makenode</tt> to configure it.
The [https://wiki.openwrt.org/doc/howto/webinterface.overview web interface] for OpenWRT is supported by a framework of components known as [https://wiki.openwrt.org/doc/techref/luci LuCI].


  ssh root@172.30.0.1
= Discovering Network Configuration =
  The authenticity of host '172.30.0.1 (172.30.0.1)' can't be established.
  RSA key fingerprint is b8:9d:4a:2f:1b:f5:e1:ae:b8:19:5b:70:92:8b:7f:34.
  Are you sure you want to continue connecting (yes/no)?


After accepting the key by entering 'yes' and pressing ENTER, it will ask you for the root password.
== IP ==


== SSH Keys ==
Run <tt>ip addr show</tt> to discover the IP addresses assigned to your home node.


If you'd like to add your ssh key to the router (instead of using a root password), add it to the <tt>configs/authorized_keys</tt> file. You'll see that there are 3 other keys there for our developers. You can remove them if you'd like, but they're currently the only way we can provide remote support. During the alpha test phase we ask that you consider whether you are able to do diagnostics/debugging yourself before you remove them.
== IW ==


= Discovering Interfaces =
Use <tt>iw</tt> to inspect the wireless interfaces that are configured.
 
Run <tt>ip addr show</tt> to discover the IP addresses assigned to your home node. Use <tt>iw addr show</tt> to see the wireless interfaces that are configured.


<tt>iw phy</tt> will display physical interfaces and capabilities, seeing each radio that is available.
<tt>iw phy</tt> will display physical interfaces and capabilities, seeing each radio that is available.
Line 62: Line 56:
   uci show notdhcpserver[0].addresses
   uci show notdhcpserver[0].addresses


= Debugging =
= Babeld =


Babel provides the entire routing table for the network.
[https://wiki.openwrt.org/doc/uci/babeld Babel] provides the entire routing table for the network.


   babeld -i
   babeld -i


This provides you with the data on every node on the entire network. Everything connected to the mesh that you can reach will be listed (nodes and extender nodes, not hosts).
This provides you with the data on every node on the entire network. Every node and extender node connected to the mesh that you can reach will be listed. babeld is the daemon that broadcasts routes that are available via the ad-hoc network connection (pplsopen.net-node2node). The age shown in the output provides how long ago the node announced it's existence on the network. When a node becomes too old, it gets dropped from the table.


babel is the daemon that broadcasts routes that are available via the ad-hoc network connection. The age provides how long ago the node announced it's existence. When a node becomes too old, it gets dropped from the table.
The mesh node will always try to route via the node that has the lowest metric. It tracks the metric also. The 'nexthop' value helps provide information used for routing. It's very lightweight, not complex.


The mesh node will always try to route via the node that has the lowest metric. It tracks the metric also. The 'nexthop' value helps provide information used for routing. It's very lightweight, not complex.
SudoMesh uses a modified version of [https://github.com/sudomesh/babeld babeld], with support for adding or removing interfaces while babeld is running added.  


We're using a modified version of babel. It wasn't possible to dynamically configure babel while it is running, so we added that feature. Right now your mesh node is routing traffic to the exit node that SudoMesh / PeoplesOpen.net setup, which is the gateway from the VPN to the Internet.
= Exit Node =


== Extender Node ==
Every home node routes traffic to the exit node that was setup for PeoplesOpen.net. This exit node acts as the gateway from the Virtual Private Network (VPN) used by PeoplesOpen.net to contain the SudoMesh network to the Internet.


In the sudowrt-firmware code on Github, there is a file under openwrt_config/packages.extender-node contains the packages that are installed in the extender node.
= Extender Antenna Nodes =


libopenssl, uhttpd and uttpd-mod-ubus (module for uhttpd that acts as proxy between HTTP interface and local ubus, running on port 80)
A client/server system called [https://github.com/sudomesh/notdhcp notdhcp] was developed to help extender nodes obtain an IP address and establish a trust relationship with a SudoMesh home node upon physical connection.


It would be ideal to have an SSL between. Marc has this ready, he'll apply this later after a ubus solution is implemented.
As of May 2016 the wired interface between the extender node and the home node does not use SSL for communication, however this is planned for implementation after the completion of the [https://github.com/sudomesh/ubus-https-forwarder ubus-https-forwarder].


You do have to provide a password when accessing the ubus interface. That may not be setup with extender nodes.
The ubus-https-forwarder software will be responsible for enabling the home nodes to receive requests on the HTTP interface provided by [https://wiki.openwrt.org/doc/techref/ubus#access_to_ubus_over_http uhttpd-mod-ubus] that are addressed for the extender nodes instead of the home node, and then forwarding those requests to the extender nodes.


The extenders are registered with notdhcp, so it would also be best if we could ask notdhcp for the passwords needed to auth and communicate with the ubus HTTP. It's currently not possible to ask notdhcp for that information while it's running (but planned to be implemented).
Authentication is required when accessing the ubus HTTP interface, which may not yet be setup for the extender nodes. A possible approach is to update [https://github.com/sudomesh/notdhcp notdhcp] so that it provisions a password to the extender node upon physical connection. Then the notdhcp server could make the password available to the home node or the web interface client.

Latest revision as of 21:02, 5 May 2016

OpenWRT Build

The SudoMesh project maintains firmware builds for a certain set of Wireless routers (home nodes) and extender antennas. The code used to create these builds is available in SudoWRT-Firmware.

Included Software Packages

The SudoWRT-Firmware code contains a configured list of software packages that are included within the builds for home nodes and the extender antennas.

uhttpd

uhttpd is an efficient and stable web server daemon, suitable for lightweight tasks commonly used with embedded devices and proper integration with OpenWrt's configuration framework (UCI). In particular, it is configured by default for the LuCI web interface to administer OpenWrt. SudoMesh uses it's own SudoWRT-Web-UI, see Mesh/Firmware/Web_Admin_Development for more information.

uhttpd-mod-ubus

uhttpd-mod-ubus is a module for uhttpd that acts as a proxy between the HTTP interface of the home node, and the local ubus that is available to processes running on the home node.

Web Interface

The web interface for OpenWRT is supported by a framework of components known as LuCI.

Discovering Network Configuration

IP

Run ip addr show to discover the IP addresses assigned to your home node.

IW

Use iw to inspect the wireless interfaces that are configured.

iw phy will display physical interfaces and capabilities, seeing each radio that is available.

iw dev will display devices

Switch Configuration

swconfig is an OpenWRT binary for switch configuration. The routers have a switch that can be used to recognized Virtual LAN (VLAN). You 5 different Ethernet devices, but it's not that there are 5 different Ethernet interfaces, but instead the router is a switch that uses VLANs. You can configure traffic coming in on a specific VLAN so that it can be recognized (VLAN tagged) and routed as needed. You can have multiple layer 2 Ethernet networks on the same wire.

Use swconfig to see if there are other switches available by running `swconfig list`. Once you identify the device, run `swconfig dev eth0 show`. You will see the various physical ports first, then you will see each VLAN.

The uplink port may show up in the list depending on the device.

Get the IP for the extenders from: less /etc/config/notdhcpserver

There is a library that can be used to read from this config file, as well as a command, called `uci` (unified configuration interface) that allows you to obtain information such as the IP address of the extender nodes.

 uci show notdhcpserver
 uci show notdhcpserver[0].addresses

Babeld

Babel provides the entire routing table for the network.

 babeld -i

This provides you with the data on every node on the entire network. Every node and extender node connected to the mesh that you can reach will be listed. babeld is the daemon that broadcasts routes that are available via the ad-hoc network connection (pplsopen.net-node2node). The age shown in the output provides how long ago the node announced it's existence on the network. When a node becomes too old, it gets dropped from the table.

The mesh node will always try to route via the node that has the lowest metric. It tracks the metric also. The 'nexthop' value helps provide information used for routing. It's very lightweight, not complex.

SudoMesh uses a modified version of babeld, with support for adding or removing interfaces while babeld is running added.

Exit Node

Every home node routes traffic to the exit node that was setup for PeoplesOpen.net. This exit node acts as the gateway from the Virtual Private Network (VPN) used by PeoplesOpen.net to contain the SudoMesh network to the Internet.

Extender Antenna Nodes

A client/server system called notdhcp was developed to help extender nodes obtain an IP address and establish a trust relationship with a SudoMesh home node upon physical connection.

As of May 2016 the wired interface between the extender node and the home node does not use SSL for communication, however this is planned for implementation after the completion of the ubus-https-forwarder.

The ubus-https-forwarder software will be responsible for enabling the home nodes to receive requests on the HTTP interface provided by uhttpd-mod-ubus that are addressed for the extender nodes instead of the home node, and then forwarding those requests to the extender nodes.

Authentication is required when accessing the ubus HTTP interface, which may not yet be setup for the extender nodes. A possible approach is to update notdhcp so that it provisions a password to the extender node upon physical connection. Then the notdhcp server could make the password available to the home node or the web interface client.