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
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.