Exploring IEEE 802.11s mesh networking
Configuration
To configure meshing, become root, then select the mac80211 driver platform (CONFIG_MAC80211) and the mesh property (CONFIG_MAC80211_MESH). For the ZD1211 WLAN card, you will need matching drivers, such as CONFIG_ZD1211RW. Now build and boot the new kernel.
In user space, again working as root, you will need the iw tool to configure the network card [5]. The tool is intended as a standardized, long-term replacement for iwconfig and its sibling commands, much as ip has become an alternative to ifconfig. Many distributions do not have a package for iw; you might need to download the iw source code via git:
git clone http://git.sipsolutions.net/iw.git
The package depends on libnl; you will need version 1.0-pre8 or newer [6]. Users with Debian or Ubuntu need the libnl-dev package.
To configure the mesh with the new tool, again as root, select a mesh ID. The mesh ID must be identical on each node. The ID can comprise a maximum of 32 characters; the example calls this MyMesh. Then go on to set up an interface – wmaster0 in this example:
iw dev wmaster0 interface add mesh0 type mp mesh_id MyMesh
This step creates a new interface, which you still need to set up for operations with the gateway 10.0.0.1. To set the IP address and netmask, you can use the standard ifconfig command, then use iwconfig to select, for example, channel 7 for the mesh network:
iwconfig mesh0 channel 7 ifconfig mesh0 10.0.0.1 netmask 255.255.255.0 up
After following these steps for all the devices on the mesh network, the mesh will start to converge. To check its progress, issue the following command:
iw dev mesh station dump
Nodes the command reaches are added to the list. This lets you check to see whether the protocol has set up connection between the nodes.
To finalize the configuration, you need to set up Internet access by configuring DHCP and NAT on the main node that will act as a gateway for the mesh network.
On Debian, you would configure the dhcp3-server package in /etc/dhcp/dhcpd.conf, as described in Listing 1. This step configures a private subnet of 10.0.0.0/24 for the mesh network my-mesh.org, sets the gateway to 10.0.0.0.1, and tells the clients to request the name server. The name server is available in the Debian bind9 package. In the simplest case, you would add the IP address of a known DNS server on the Internet to the forwarders section of /etc/bind/named.conf.options. As a final step, enable the setting
net.ipv4.ip_forward=1
in /etc/sysctl.conf to route packages out of the mesh network and onto the Internet. At the same time, add
iptables -A POSTROUTING -t nat -s 10.0.0.0/24 -j MASQUERADE
to enable masquerading for the private addresses on the wireless network on the router's public IP address. This step completes the setup for the main node.
Listing 1
Simple DHCP Configuration
Working as root, you still need to run iw on each node to configure the mesh network. The IP addresses and DNS details are provided courtesy of the DHCP server. If you intend to set up access for normal clients without mesh support, you need to configure additional wireless modules with Host AP mode support on these nodes [7].
Linux IEEE 802.11s support is still at an early stage. It will take some time for more mesh-ready NICs and drivers to appear. Users can look forward to IEEE 802.11s becoming far simpler in the next version of the kernel, with more and more drivers supporting the mac80211 subsystem.
Conclusions
Until the standard is widely adopted by vendors, don't be surprised if the details of the configuration tools change. In the meantime, assuming you have the right cards and tools, nothing is stopping you from setting up your very own mesh network right now.
Infos
- Meshing at One Laptop Per Child: http://wiki.laptop.org/go/Mesh_Network_Details
- IEEE 802.11s Task Group status report: http://grouper.ieee.org/groups/802/11/Reports/tgs_update.htm
- Open80211s Project: http://www.open80211s.org/trac/
- Wireless-testing.git repository: http://linuxwireless.org/en/users/Download#Checkingoutcompat-wireless-2.6.gittree
- iw HOWTO: http://linuxwireless.org/en/users/Documentation/iw/
- Netlink library: http://people.suug.ch/~tgr/libnl/
- Host AP drivers: http://hostap.epitest.fi
- Optimized Link State Routing (OLSR): http://www.olsr.org
- Open-mesh.net Batman pages: http://www.open-mesh.net/batman
- Batman Advanced: http://open-mesh.net/newsfolder/0-2-final-0-3-alpha-batman-advanced-battools-0-1-alpha
- Dijkstra algorithm: http://www.wikipedia.org/wiki/Dijkstra-Algorithmus
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.