Setting Up Wi-Fi Mesh Networks on OpenWrt: From Topology to Configuration
Wi-Fi mesh networks on OpenWrt use the 802.11s protocol to create self-organizing structures. Each node acts as a repeater, routing traffic through optimal paths. This differs from repeaters: in a mesh, data is transmitted only along the necessary route, minimizing load.
Physical topology determines device placement, while logical topology defines packet routes. Key types:
- Bus: Sequential connection, saves cable, but a break segments the network.
- Ring: Closed bus, resilient to single failures.
- Star: Each node connects to a central hub, isolating failures but requiring more cable.
- Mesh: Multiple connections, self-healing through alternative paths.
In wireless mesh, mesh at the L2 level combines with a star topology for clients. The backhaul is the wireless backbone between routers.
Designing Node Placement
Geometry matters more than transmitter power. If all nodes see each other, interference occurs: nodes compete for airtime via CSMA/CA, reducing throughput to a minimum (the "Mesh of Death" effect).
Optimal placement rules:
- Each router sees exactly two neighbors—maximizes airtime, bus topology.
- Close into a ring for fault tolerance and load balancing.
- Add a third neighbor at key points for redundancy.
Examples:
- 2 nodes: Any placement.
- 3 nodes: WAN router in the center.
- 4 nodes: In elongated spaces—linearly with WAN at 2nd/3rd; otherwise, first sees 2nd and 3rd, they see 4th.
Draw a diagram before installation, considering walls and interference.
802.11s Theory and Differences from Multi-AP
Mesh (802.11s) is not just an SSID on multiple access points. Nodes exchange management frames for discovery, routing (HWMP), and metrics. Supports multi-hop traffic.
Differences from controller-based systems (e.g., CAPWAP):
- Self-organization without a central node.
- Automatic reconfiguration during failures.
- Local traffic routing.
In OpenWrt, mesh is configured in /etc/config/wireless via wifi-device and wifi-iface sections with the mesh_id option.
Basic Mesh Setup in OpenWrt
On the main node (gateway):
config wifi-device 'radio0'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'pci0000:00/0000:00:00.0'
option htmode 'HT80'
option country 'RU'
config wifi-iface 'mesh_backhaul'
option device 'radio0'
option network 'lan'
option mode 'mesh'
option mesh_id 'my_mesh_net'
option encryption 'sae'
option key 'mesh_password'
option mesh_fwding '1'
On leaf nodes similarly, but without WAN. All nodes share the same mesh_id.
For clients:
config wifi-iface 'ap_client'
option device 'radio1'
option mode 'ap'
option ssid 'ClientSSID'
option encryption 'psk2'
option key 'clientpass'
option network 'lan'
Separate radios: one for backhaul (5 GHz), another for clients (2.4 GHz).
Roaming and Parameter Optimization
Seamless roaming requires 802.11r/k/v. In OpenWrt:
option ft_psk_generate_local 1for FT.option ieee80211r '1'.option mobility_domain 'abcd'on all APs.
Key parameters:
option max_neightbours 32—neighbor limit.option mesh_rssi_threshold 0—discovery threshold.option metric_mode 'default'—path selection (airtime).
Test RSSI: aim for -20 to -60 dBm for backhaul.
Scaling and Monitoring
Networks >10 nodes require VLAN for backhaul, QoS (cake/sqm). Monitoring: batman-adv over mesh or LuCI statistics.
Issues and solutions:
- Low speed—reduce neighbors, optimize channels.
- Failures—check ring topology.
- Overheating—dual-radio, ventilation.
Key takeaways:
- Place nodes by the "2 neighbors" rule for airtime efficiency.
- Use ring topology for fault tolerance.
- Separate radios: 5 GHz backhaul, 2.4 GHz clients.
- Enable 802.11r for seamless roaming.
- Monitor RSSI and airtime for optimization.
— Editorial Team
No comments yet.