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
-
PipeWire 1.0 Officially Released
PipeWire was created to take the place of the oft-troubled PulseAudio and has finally reached the 1.0 status as a major update with plenty of improvements and the usual bug fixes.
-
Rocky Linux 9.3 Available for Download
The latest version of the RHEL alternative is now available and brings back cloud and container images for ppc64le along with plenty of new features and fixes.
-
Ubuntu Budgie Shifts How to Tackle Wayland
Ubuntu Budgie has yet to make the switch to Wayland but with a change in approaches, they're finally on track to making it happen.
-
TUXEDO's New Ultraportable Linux Workstation Released
The TUXEDO Pulse 14 blends portability with power, thanks to the AMD Ryzen 7 7840HS CPU.
-
AlmaLinux Will No Longer Be "Just Another RHEL Clone"
With the release of AlmaLinux 9.3, the distribution will be built entirely from upstream sources.
-
elementary OS 8 Has a Big Surprise in Store
When elementary OS 8 finally arrives, it will not only be based on Ubuntu 24.04 but it will also default to Wayland for better performance and security.
-
OpenELA Releases Enterprise Linux Source Code
With Red Hat restricting the source for RHEL, it was only a matter of time before those who depended on that source struck out on their own.
-
StripedFly Malware Hiding in Plain Sight as a Cryptocurrency Miner
A rather deceptive piece of malware has infected 1 million Windows and Linux hosts since 2017.
-
Experimental Wayland Support Planned for Linux Mint 21.3
As with most Linux distributions, the migration to Wayland is in full force. While some distributions have already made the move, Linux Mint has been a bit slower to do so.
-
Window Maker Live 0.96.0-0 Released
If you're a fan of the Window Maker window manager, there's a new official release of the Linux distribution that champions the old-school user interface.