Wireless network
What are the differents set-ups ?
- WDS (master / client) - wireless repeater: - (+) performance - (-) all client need to be close to the master
- Mesh (802.11s): - (+) permits to have a network in a large space (traffic go through different nodes) - (-) performance with many nodes - (+) (optional) extended with B.A.T.M.A.N: permits to have VLan, multiple internet gateways
Definitions
OFDMA
une technique de modulation qui permet de mutualiser les canaux dans le but de transmettre des données en simultané aux différents appareils. Pour schématiser, c’est comme si l’on pouvait livrer en même temps plusieurs clients avec un seul camion là où il fallait un camion par client en Wi-Fi 5. L’OFDMA est particulièrement intéressant dans les environnements denses et pour des usages modérés tels que de la navigation web.
MU-MIMO
déjà présent en Wi-Fi 5 (mais fonctionnant maintenant dans les deux sens), le MU-MIMO permet au routeur de communiquer avec plusieurs appareils en simultané. En reprenant notre exemple des camions, on peut donc utiliser plusieurs camions, qui circuleraient en parallèle pour livrer plus de marchandises. Cette technique fonctionne d’ailleurs parfaitement avec un seul client, permettant ainsi d’augmenter substantiellement le débit vers une machine ayant de gros besoins en bande passante pour de la lecture vidéo ou du streaming par exemple.
source (wifi 5, wifi 6, wifi 6e)
Basic Commands
List wireless interfaces
iw list
Max number of SSID for a given card
Here the limit is 4 ssids.
valid interface combinations:
* #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 4,
total <= 4, #channels <= 1, STA/AP BI must match
Set-up mesh
opkg update
opkg install kmod-batman-adv
opkg install batctl-full
opkg remove wpad-basic
opkg remove wpad-basic-wolfssl
opkg install wpad-mesh-openssl
Notes (on snapshot version - first time I did the installation):
- removing
wpad-basic
did not work, I had to remove other packages, check withopkg find wpad*
. - I think to make it worked I installed
wpad-mesh-wolfssl
If you have no internet access you can directly install the .ipk
package (depends on architecture and os version).
/etc/config/wireless
config wifi-device 'radio1'
option type 'mac80211'
option path '1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
option hwmode '11a'
option channel '36'
option band '5g'
option htmode 'HE80'
option disabled '0'
option cell_density '0'
option country 'FR'
config wifi-iface 'mesh0'
option device 'radio1'
option ifname 'mesh0'
option network 'nwi_mesh0'
option mode 'mesh'
option mesh_fwding '0'
option mesh_id 'meshlr6'
option key 'xxx'
option mesh_rssi_threshold '0'
option encryption 'sae'
Notes:
- specify the
key
- some encryption are incompatible with 802.11s (e.g., wpa2-psk)
sae
is a WPA3-SAE encryptionhwmode
is deprecated and replaced by band on21.02+
/etc/config/network
config interface 'bat0'
option proto 'batadv'
option routing_algo 'BATMAN_IV'
option aggregated_ogms 1
option ap_isolation 0
option bonding 0
option fragmentation 1
#option gw_bandwidth '10000/2000'
option gw_mode 'off'
#option gw_sel_class 20
option log_level 0
option orig_interval 1000
option bridge_loop_avoidance 1
option distributed_arp_table 1
option multicast_mode 1
option network_coding 0
option hop_penalty 30
option isolation_mark '0x00000000/0x00000000'
config interface 'wlan'
option mtu '2304'
option proto 'batadv_hardif'
option master 'bat0'
Debug Mesh
Listening everything on the wifi-iface: batctl tcpdump mesh0
Check mesh connectivity:
iw dev mesh0 station dump
iw dev mesh0 mpath dump
Through logs with logread -l 20 -f
:
root@lr6-node1:/etc/config# logread -l 20 -f
Fri Sep 17 07:43:47 2021 daemon.notice netifd: Network device 'mesh0' link is up
Fri Sep 17 07:43:47 2021 daemon.notice netifd: Interface 'nwi_mesh0' has link connectivity
Fri Sep 17 07:43:47 2021 daemon.notice netifd: Interface 'nwi_mesh0' is setting up now
Fri Sep 17 07:43:47 2021 daemon.notice wpa_supplicant[4056]: mesh0: CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed [id=0 id_str=]
Fri Sep 17 07:43:47 2021 daemon.notice wpa_supplicant[4056]: mesh0: MESH-GROUP-STARTED ssid="meshlr6" id=0
Fri Sep 17 07:43:47 2021 kern.info kernel: [ 2457.705513] IPv6: ADDRCONF(NETDEV_CHANGE): mesh0: link becomes ready
Fri Sep 17 07:43:47 2021 kern.info kernel: [ 2457.724934] batman_adv: bat0: Adding interface: mesh0
Fri Sep 17 07:43:47 2021 kern.info kernel: [ 2457.730120] batman_adv: bat0: Interface activated: mesh0
Fri Sep 17 07:43:47 2021 daemon.notice netifd: Interface 'nwi_mesh0' is now up
Fri Sep 17 07:43:52 2021 daemon.notice wpa_supplicant[4056]: mesh0: new peer notification for 26:5a:4c:99:f4:15
Fri Sep 17 07:43:53 2021 daemon.notice wpa_supplicant[4056]: mesh0: mesh plink with 26:5a:4c:99:f4:15 establis
The output of batctl o
and/or batctl n
should indicate that the various batman-adv nodes are “seeing” each other over the mesh.
Since watch
is not available:
while true; do batctl o; sleep 1s; clear; done
Resources:
- http://archivebox.parmentier.io/archive/openwrt.org/docs/guide-user/network/wifi/mesh/80211s
- http://archivebox.parmentier.io/archive/openwrt.org/docs/guide-user/network/wifi/mesh/batman
- http://archivebox.parmentier.io/archive/bmaupin.github.io/wiki/other/openwrt/openwrt-80211s.html
- http://archivebox.parmentier.io/archive/cgomesu.com/blog/Mesh-networking-openwrt-batman/
- http://archivebox.parmentier.io/archive/www.radiusdesk.com/old_wiki/technical_discussions/batman_basic
Check mesh performance
root@lr6-gw:~# batctl tp 26:5a:4c:99:a8:c5
Test duration 10720ms.
Sent 769373856 Bytes.
Throughput: 68.45 MB/s (574.16 Mbps)
Resources
- wireless configuration
- https://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config
- https://forum.openwrt.org/t/home-set-up-with-openwrt-and-ubiquiti/104502/4
- https://forum.openwrt.org/t/mesh-with-batman-and-dhcp-per-vlan-only-one-vlan-get-an-ip/106679
- https://forum.openwrt.org/t/internet-issue-in-a-mesh-network/88937/28?u=lpyparmentier
- https://forum.openwrt.org/t/mesh-network-bad-performance/97447/6
- https://cgomesu.com/blog/Mesh-networking-openwrt-batman/