FreeBSD 802.11: | WiFi Main Page |
802.11s Wireless Mesh Networking
A wireless mesh network, sometimes called WMN, is a typical wireless network but using a mesh topology instead. These networks are often seen as special ad-hoc networks since there's no central node that will break connectivity (in contrast with common wireless networks that you have at home/office, where there's a central Access Point). 802.11s is an amendment to the 802.11-2007 wireless standard that describes how a mesh network should operate on top of the existing 802.11 MAC. If you want to know more, check the resources section. You may already know about the Wireless Distribution System, WDS for short, and if you do, just think of 802.11s as the standard that will expand and unite WDS. Note that 802.11s is much more complex than WDS (for example, 802.11s includes a routing protocol, an airtime link metric protocol and a congestion control signaling protocol, just to name a few).
This project aims to implement the upcoming 802.11s wireless mesh standard (not yet ratified) on the FreeBSD operating system (of course )
Development is occurring at the FreeBSD HEAD branch and an experimental support is present on FreeBSD 8.0.
This work was sponsored by The FreeBSD Foundation.
Compatibility with Linux implementation
Given that the Linux 802.11s implementation (in wireless-testing) was based on an early draft, we can't talk with Linux mesh nodes.
- ath(4) works
- ral(4) works
- mwl(4) works
- ipw(4), iwi(4), iwn(4), wi(4) will never work as they do a lot of processing in firmware (including encaping/sending packets)
- all the other drivers were not yet ported
How to setup a mesh network
- Pick a channel for the mesh network. In this example, we'll use 36 (11a).
- Choose a mesh identifier. This is the same as the SSID, but for mesh networks. We'll use 'freebsd-mesh'.
On every mesh node, type:
# ifconfig wlan0 create wlandev ath0 wlanmode mesh channel 36 meshid freebsd-mesh
Don't forget to setup different IP addresses on every mesh node:
# ifconfig wlan0 10.0.0.x/yy
You should have something like this:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:0b:6b:2d:dc:d8 inet 10.0.1.101 netmask 0xffffff00 broadcast 10.0.1.255 media: IEEE 802.11 Wireless Ethernet autoselect mode 11a <mesh> status: running meshid mymesh channel 36 (5180 Mhz 11a) bssid 00:0b:6b:2d:dc:d8 regdomain ETSI country PT ecm authmode OPEN privacy OFF txpower 17 mcastrate 6 mgmtrate 6 scanvalid 60 wme burst bintval 1000 meshttl 31 meshpeering meshforward meshmetric AIRTIME meshpath HWMP hwmprootmode DISABLED hwmpmaxhops 31
If everything goes well, you'll see the neighbor mesh stations with ifconfig wlan0 list sta.
$ ifconfig wlan0 list sta ADDR CHAN LOCAL PEER STATE RATE RSSI IDLE TXSEQ RXSEQ 00:0b:6b:2d:dc:d8 36 0 0 IDLE 0M 18.5 15 1 192 00:0b:6b:2d:db:ac 36 9827 a5b3 ESTAB 6M 14.0 0 2 28752 WME MESHCONF 00:0b:6b:2d:dd:17 36 afdb ab30 ESTAB 6M 19.0 0 5 25024 WME MESHCONF 00:0b:6b:87:1c:f0 36 1904 825c ESTAB 6M 6.0 0 30 192 WME MESHCONF
The first line is your own interface and you can ignore it. STATE is the most important column. In order for a mesh station be reachable, it must establish a peering instance with another mesh station, so if STATE shows anything else but ESTAB, peering hasn't occurred or it was not successful. Don't worry about the tx rate for now. 6M is the rate for management packets and that's basically what we have exchanged for now. When you start sending packets, the rate will change.
After trying to exchange packets with neighbors and non-neighbors the routing table will get filled. In this example, I'm using a star network topology, all packets go through a central node. ifconfig wlan0 list mesh will show the routing table:
$ ifconfig wlan0 list mesh DEST NEXT HOP HOPS METRIC LIFETIME MSEQ FLAGS 00:0b:6b:2d:dd:17 00:0b:6b:2d:dc:d8 1 2842 5000 0 V 00:0b:6b:2d:dc:d8 00:0b:6b:2d:dc:d8 0 0 5000 0 V 00:0b:6b:2d:db:ac 00:0b:6b:2d:dc:d8 1 347 5000 0 V
Note a meshid must be specified and the channel must be fixed; eventually you'll be able to scan for mesh networks and join using a wildcard meshid. Also, understand a meshid is different from the SSID you may be familiar with. In a mesh network beacon frames will always have an empty SSID string.
Testing different mesh network topologies
If you have 3 or more systems and would like to try playing with a different mesh topology, you can use ifconfig MAC ACL commands to do it. This requires that each system be configured to include device wlan_acl in the kernel configuration (or the module loaded with kldload). For example, imagine you have three mesh points (mesh nodes) MESH1, MESH2 and MESH3 and you want to create the following network topology:
MESH1 <-> MESH2 <-> MESH3
This means that MESH2 will route packets between MESH1 and MESH3. On MESH1 and MESH3 you type:
ifconfig wlan0 mac:allow mac:add mesh2_mac_address
And on MESH2 you type:
ifconfig wlan0 mac:allow mac:add mesh1_mac_address mac:add mesh3_mac_address
Notice the mac:allow command. This means that you only allow some nodes to peer.
Check tools/tools/net80211/scripts/mesh for example scripts that can help you setup different topologies.
meshttl is the time to live of mesh data packets.
meshpeering allows you to control whether peering is enabled or not.
meshforward allows you to control whether forwarding is enabled or not.
meshmetric allows you to select the link metric algorithm. Only AIRTIME is implemented for now.
meshpath allows you to select the link metric algorithm. Only HWMP is imeplemented for now.
hwmprootmode can be 'DISABLED', 'NORMAL', 'PROACTIVE' and 'RANN'. 'NORMAL' uses Path Requests to find all nodes. 'PROACTIVE' is just like 'NORMAL' but every node will reply with Path Reply even if the path is already setup. 'RANN' is like 'NORMAL' but uses Root Announcement information elements instead of path requests information elements.
hwmpmaxhops, also known as network diameter, is the number of hops a HWMP message is allowed to go through.
Bridging mesh with wired or wireless
There's experimental support for bridging a mesh interface to another interface, either wired or wireless. The bridge(4) man page has several examples on how to setup bridging.