Add New Page: You are not allowed to add pages Select section/namespace. New page title.

How Commotion Works

See also:

Commotion as of this writing is a lot of things, but what things, and how are they put toge11ther? Here's an attempt at a simple explanation without getting into implementation (OpenWRT) specifics.1

Many people are familiar with wireless networks these days, using laptops in coffee shops, airports, libraries, wireless internet in many homes, and other “Wi-Fi” hot spots. Wi-Fi refers to a particular type of radio and data transmission standard which it is often used interchangebly with the term wireless network.

There are two major common types of wireless networks: managed networks also known as infrastructure networks, and ad-hoc networks.

Most people using wireless networking use infrastructure networks most of the time, for example in businesses, coffee shops, and in many homes. Infrastructure networks are hierarchical – clients connect to access points and all communication, even between clients, must pass through the access point. Access points are the conduit to larger, often corporate networks, and usually also what we call the internet – they are gateways and gatekeepers. Off-the-shelf wireless routers by default act as infrastructure-mode access points, and most of our computers are accustomed to locating and connecting to access points.

In ad-hoc networks, devices communicate directly with each other without intervening access points, and can therefore be deployed dynamically, with no pre-existing infrastructure ( Ad-hoc network devices can forward data for one another to enable commmunication between nodes which are not in radio range of each another. In a fixed or slowly-changing ad-hoc network, this forwarding can be arranged by managing routing tables by hand, but in larger and “mobile ad-hoc networks”: forwarding is managed dynamically with various “routing protocols ”: with the result often being termed a “mesh network”: Mesh network routing makes an ad-hoc poorly-connected network function like be a fully-connected network (except for network broadcasts).

Commotion wants to provide service in emergencies and other dynamic situations, so ad-hoc networking with a mobile routing protocol is used.

Commotion's ad-hoc network in the current implementation uses channel 5, SSID, and BSSID 02:CA:FF:EE:BA:BE. Mesh routing is provided by the OLSR protocol via the OLSR daemon (olsrd) from Some of Commotion's important olsrd parameters are LinkQualityLevel=2 LinkQualityAlgorithm=etx_ffeth and Ip4Broadcast= (_either olsrd's defaults have changed to this, or something else has changed, because these parameters are no longer supplied by commotion_).

Most people's network devices – phones, computers, gaming stations – are set up to connect easily with access points, not ad-hoc networks. For them, Commotion routers provide a normal wireless access point too, and once connected, those “normal” wireless clients are connected to the ad-hoc mesh too. You can find Commotion access points in your list of wireless networks since they are (currently) called “commotion-ap_###_###_###”.

An additional encrypted access point is also provided, with an ssid “commotion-secure_###_###_###”, connected into the 102.* subnet.

The Wired Networking Piece

Commotion runs on routers which typically have two or more wired network ports in addition to their wireless capabilities. More later about that.

IP Addresses, Routing, and The Internet

Every host on a connected network segment must have a unique IP address. On a managed, access-point style network, the access point hands out unique IP addresses using the DHCP protocol. On small ad-hoc networks people usually coordinate informally to choose unique IP addresses. Mesh ad-hoc networks can be quite large, so the problem of choosing unique IP addresses without a central authority, or prior coordination, is multiplied.

Every network device, including wireless devices, has a unique 6-byte identifier called a MAC (for Media Access Control) address, sometimes called a hardware address, which is usually shown as six groups of two hexadecimal digits, sometimes separated by colons or dashes. It is often printed on a sticker on the device.

Commotion routers choose their IPv4 addresses from a portion of the device's unique MAC address, which therefore have a good probability of being unique (Note that IPv6 addresses are large enough to contain the MAC and more, so the unique addressing problem should go away).

Specifically a Commotion node's mesh IP address is 5.m4.m5.m6 where m4, m5, and m6 are the 4th, 5th, and 6th bytes of the network device's MAC address, with a netmask of Since the IP addresses are technically routable and are being formally allocated on the internet, a commotion mesh should be treated like a private network. (see for rationale about another network's choice of

Commotion access points use the IP addresses 101.m5.m6.1 where m5 and m6 are from the MAC (see above), and hand out DHCP addresses 101.m5.m6.[2-252] to wireless clients.

Access points normally use NAT (network address translation) to make all their connected clients appear to the upstream networking world to be using a single IP address, but Commotion's access point doesn't do this, which brings advantages and disadvantages (which most users won't ever even notice).

NAT acts pretty much as a one-way routing valve, in that NAT clients can connect externally through their router, for example to, but since every NAT client on that router appears on the internet to be using the router's IP address, people on “the internet” can't connect directly to a NAT client (with some exceptions like port forwarding).

Since Commotion doesn't use NAT, once your computer is connected via Commotion, every computer on the mesh can connect directly to yours. All the computers are equally accessable. That's cool if you're running your own web server or peer-to-peer applications, and it also means you probably want a functioning firewall.

Like the 5/8 IPv4 addresses, 101.*/24 addresses are routable and allocatable on the internet.

Routing information about the 101.* networks, and other networks connected to the ad-hoc Commotion mesh, are shared throughout the mesh using HNA messages. OLSR HNA messages basically communicate “I, 5.m4.m5.m6, can forward to the network 101.m5.m6.0/24”. If a Commotion node has an internet connection, it'll advertise an HNA saying “I, 5.m4.m5.m6, can forward to the network”. Each node's routing tables are dynamically updated with these network routes. Clients of Commotion APs don't have direct knowledge of these routes, but can contact those networks anyway through their default gateway which is their local Commotion node itself.

Sadly, in today's world of Facebook and Google, people will probably be most interested in connecting to the internet rather than to their neighbors' computers.

One of the wired ports (functioning very similar to the “WAN” port on non-Commotion routers, which may be a useful term to use in Commotion documentation) on a Commotion router, if connected to “the internet” (for example through a cable modem), will enable that router and all the others in the mesh, and therefore all the clients of Commotion mesh nodes, to also connect to the internet. Olsrd's dyn_gw plugin detects the route to the internet, and publishes an OLSR HNA route for it.

Commotion routers handle the 5/8, 0/0, 101.*.*/24 (and 102.*.*/24 wired) networks automatically. Any other networks will require manual configuration.

Hosts with Names, DNS

A client connected to a Commotion router's access point is told while acquiring its IP address with DHCP, to use the router itself to resolve host name lookups (DNS queries). That means the Commotion router's DNS handles the mesh-specific and normal DNS, rather than the client, just as using the Commotion router as the client's default gateway offloads routing from clients.

Suppose a Commotion router's “WAN” is connected to another network or the internet. In that process, it is told (by virtue of being a DHCP client) which nameserver(s) to use for DNS lookups. That information is shared also with the router's DNS, so that lookups from clients use those nameservers too. This is a standard feature of dyndns and OpenWRT and not specific to Commotion, and is the normal way for clients to resolve host names when connected to wireless routers.

Commotion also enables the olsrd nameservice plugin, and configures each node with a node name of the form “commotion_m4_m5_m6.mesh” (yes careful reader, underscores are not legal in host names). Once shared through olsrd, these names are made available through the DNS servers in Commotion routers, thus anyone on the mesh can access Commotion nodes with names instead of IP addresses.

(It is unclear to me at this time if or whether the current Commotion software handles the case of distributing other DNS information. For example if Commotion node A is connected wirelessly with node B, and B to the internet (and thus B knows internet-capable DNS nameservers), can A or A's clients automatically find This appears to be the point of the olsrd bmf and mDNS plugins, both of which would require the Commotion node to use, and perhaps forward, mDNS protocol queries, and it's not clear whether that is configured or planned. -paul bame) _Recent commotion hard-codes two DNS servers on the “plug” subnet_