Mesh network not behaving as expected

Hi!

I am setting up an 802.11s mesh but it is not behaving as expected in a multi‑hop scenario. Here is my setup:

  • Mesh gate (MG): This is either a Heltec or Alfa Halow router set up as a Mesh gate through the UI wizard. It runs a DHCP server to hand out IP addresses to all devices on the network
  • Laptop: It is connected to the Mesh Gate via ethernet no other router or upstream network.
  • Mesh Point 1 (MP1): This is a Heltec router. It is in range of the Mesh Gate via Halow.
  • Mesh Point 2 (MP2): This is my custom hardware. It uses a static IP. It is basically a camera that transmits video via Halow. It uses AsiaRF’s Halow module, and is controlled by an i.MX8M-Mini running Yocto.

What works

  • If MP1 and MP2 are both in range of the Mesh Gate, they associate directly to MG and everything works.
  • I can stream video from MP2 to the laptop via MG without issues.

What fails

When I move MP2 so that:

  • MP2 is out of range of MG,
  • but MP2 is in range of MP1

then:

  • MP2 associates to MP1 (shows up in MP1’s associated stations list),
  • but MG cannot ping MP2 and no traffic is forwarded through MP1.
  • On MG/MP1, MP2’s MAC shows up, but the UI never learns an IP for it (“?”)

Below is the wpa_supplicant_s1g file running on MP2.

 ctrl_interface=/var/run/wpa_supplicant_s1g
 update_config=1
 country=US
 pmf=2
 sae_pwe=1
 max_peer_links=10
 mesh_fwding=1

 network={
    ssid="\[SSID\]"
    key_mgmt=SAE
    sae_password="\[PASSWORD\]"
    pairwise=CCMP
    ieee80211w=2

    # Mesh mode
    mode=5

    # 904.5 MHz, 1 MHz BW, US
    channel=5
    op_class=68
    country="US"
    s1g_prim_chwidth=0
    s1g_prim_1mhz_chan_index=0

   beacon_int=1000
   dtim_period=1
   mesh_rssi_threshold=-85
}

I have tried a lot of different settings and configurations, but I am unable to get it to work. Perhaps my understanding of 802.11s is flawed, or somehow the hardware does not support it.

Any help is much appreciated!

Hi @SanderV

I’m definitely no mesh expert myself, but will run this by someone internally who may know more. There are a few things that stand out to me, and some things to consider in the meantime.

  • mesh_fwding might need to be included in the network block. Other configs I’ve seen place it there rather than the global section.
  • traffic will need to flow before MG builds the ARP table to map the IP to the MAC address. This could even be a DHCP exchange, but a ping will suffice (once the routing is working).
  • On the other nodes running OpenWrt, you can find their mesh configuration at /var/run/wpa_supplicant-wlanX.conf. It would be worth inspecting this and comparing your configuration.

The other thing I’m uncertain about is how mesh11sd may be interacting. It shouldn’t cause what you’re seeing, so have a look at the above first and then we can consider mesh11sd.

Hi @ajudge

Thanks for your reply!

I moved the mesh_fwding property to the network block, but the behavior remains unchanged.

During testing I did notice that when I first connect MP2 to MG so it get an IP address, and then move MP2 out of range from MG, but in range of MP1 I can ping it just fine. So your theory on the ARP table seems likely.

Find below the wpa_supplicant on the routers used. The only difference between MG and MP1 here is the dot11MeshGateAnnouncements property.

country=US
ctrl_interface=/var/run/wpa_supplicant_s1g
sae_pwe=1
max_peer_links=10
mesh_fwding=1
network={

    ssid="RescueRatMesh"
    key_mgmt=SAE
    mode=5
    channel=5
    op_class=68
    country="US"
    s1g_prim_chwidth=0
    s1g_prim_1mhz_chan_index=0
    dtim_period=1
    mesh_rssi_threshold=-85
    dot11MeshHWMPRootMode=0
    dot11MeshGateAnnouncements=1
    mbca_config=1
    mbca_min_beacon_gap_ms=25
    mbca_tbtt_adj_interval_sec=60
    dot11MeshBeaconTimingReportInterval=10
    mbss_start_scan_duration_ms=2048
    mesh_beaconless_mode=0
    mesh_dynamic_peering=0
    sae_password="[PASSWORD]"
    pairwise=CCMP
    ieee80211w=2
    beacon_int=1000
    mac_addr=3
    mac_value=e4:38:19:1f:f0:17

}

Without having had a chance to test anything. Can you make sure your kernel has the mac80211: Mesh Support patch as per mac80211: Mesh support · MorseMicro/linux@272137c · GitHub (which targets the 6.12.21 kernel for example).

Without this, path selection may not function correctly on a link with management frame protection enabled (ieee80211w).

Thanks! I did not apply that patch when building the image.

I am running the kernel version below. Is that patch available for it?

root@ucm-imx8m-mini:~# uname -r
5.10.35-ucm-imx8m-mini-2.2.1+ge47d436930ca

We have patches for a 5.10.11 kernel, which should be close enough that it will apply. For the mesh support, see mac80211: Mesh support · MorseMicro/linux@77e5dc0 · GitHub

You might want to consider examining the full list. For patches provided as of our 1.16 release, see mm/linux-5.10.11/1.16.x

Great, I found a few that might be worth applying. I won’t have time in the next couple of days, but I will check back in once I have done this with the results.

1 Like

@ajudge

I applied the patches below, but unfortunately the behavior remains unchanged.

Do you have any other suggestions on what to try next?

Thanks!

I’ll have to try to reproduce this I think.

In the meantime, do you see the same behaviour if you put your custom hardware (MP2) in the middle? i.e. move MP1 around instead.
I’m curious if there is something awry with the Heltec router when it needs to forward frames in the mesh.

I replaced MP2 to also be a Heltec router. SO MP1 and MP2 are mesh point Heltec router and it works as expected. From my laptop I can ping MP2 even when it is outside the range of MG.

For you information. This is how I initialize the mesh point on my custom hardware. Maybe the static IP throws a wrench in things, but I doubt it.

#!/bin/sh

LOG=/var/log/rc.local.log
echo "rc.local starting at $(date)" >> "$LOG"

# Wait for wlan0
sleep 5

# Start S1G wpa_supplicant in background
wpa_supplicant_s1g -i wlan0 -c /etc/morse/wpa_supplicant_s1g.conf -D nl80211 -d -B \
  || echo "wpa_supplicant_s1g failed" >> "$LOG"

# Set static IP (ignore if already set)
ip addr add 192.168.3.11/24 dev wlan0 2>>"$LOG" \
  || echo "ip addr add 192.168.3.11 failed (maybe already exists)" >> "$LOG"

# Start your Python app with error logging
python3 /home/root/Main.py >> "$LOG" 2>&1 \
  || echo "python3 /home/root/Main.py failed" >> "$LOG"

echo "rc.local finished at $(date)" >> "$LOG"

exit 0

Still haven’t been able to reproduce this yet.

I highly doubt the IP address configuration would cause a problem here - static or dhcp shouldn’t matter. Though to be sure, on your custom hardware please share the output of ip route show to check if there is anything wrong with the routing config.

Can you also share the output of iw dev wlan0 mpath dump when in the “failing” state?

It may also be helpful to see the output of iw dev wlan0 station dump and iw dev wlan0 mpp dump

Lastly, if possible, it would be nice to see a tcpdump/wireshark capture of the wlan0 interface of your failing devixe, and concurrently perform a capture on the mesh gates interface.
Attempt to run a ping while the captures are running - this will tell us if layer 2 traffic (arps) are getting through the mesh.

Thanks @ajudge, I have captured the requested information. see below.

When connected directly to AP

root@ucm-imx8m-mini:~# ip route show
192.168.3.0/24 dev wlan0 proto kernel scope link src 192.168.3.11
root@ucm-imx8m-mini:~# iw dev wlan0 mpath dump
DEST ADDR         NEXT HOP          IFACE       SN      METRIC QLEN     EXPTIME         DTIM    DRET    FLAGS   HOP_COUNT      PATH_CHANGE
00:c0:ca:b6:5c:be 00:c0:ca:b6:5c:be wlan0       11      343    04092    0       0       0x15    1       1
root@ucm-imx8m-mini:~# iw dev wlan0 station dump
Station 00:c0:ca:b6:5c:be (on wlan0)
        inactive time:  4 ms
        rx bytes:       315762
        rx packets:     3299
        tx bytes:       18329
        tx packets:     87
        tx retries:     5
        tx failed:      0
        rx drop misc:   7
        signal:         -69 dBm
        signal avg:     -67 dBm
        Toffset:        445697566 us
        tx bitrate:     39.0 MBit/s VHT-MCS 4 VHT-NSS 1
        tx duration:    0 us
        rx bitrate:     52.0 MBit/s VHT-MCS 5 VHT-NSS 1
        rx duration:    0 us
        expected throughput:    23.253Mbps
        mesh llid:      0
        mesh plid:      0
        mesh plink:     ESTAB
        mesh airtime link metric: 343
        mesh connected to gate: yes
        mesh connected to auth server:  no
        mesh local PS mode:     ACTIVE
        mesh peer PS mode:      ACTIVE
        mesh non-peer PS mode:  ACTIVE
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            yes
        TDLS peer:      no
        DTIM period:    1
        beacon interval:1000
        connected time: 1598 seconds
        associated at [boottime]:       18.762s
        associated at:  1616581532375 ms
        current time:   1616583127892 ms
root@ucm-imx8m-mini:~# iw dev wlan0 mpp dump
DEST ADDR         PROXY NODE        IFACE
84:69:93:68:02:f8 00:c0:ca:b6:5c:be wlan0
root@ucm-imx8m-mini:~#

In the failing state, so 2 hops away from AP

root@ucm-imx8m-mini:~# ip route show
192.168.3.0/24 dev wlan0 proto kernel scope link src 192.168.3.11
root@ucm-imx8m-mini:~# iw dev wlan0 mpath dump
iw dev wlan0 station dump
DEST ADDR         NEXT HOP          IFACE       SN      METRIC  QLEN    EXPTIME         DTIM DRET    FLAGS   HOP_COUNT       PATH_CHANGE
root@ucm-imx8m-mini:~# iw dev wlan0 station dump
root@ucm-imx8m-mini:~# iw dev wlan0 mpp dump
DEST ADDR         PROXY NODE        IFACE
root@ucm-imx8m-mini:~#

In the attached ZIP are the captures on the laptop connected to the mesh gate and the failing device MP2. I ran a ping from the laptop to MP2. The capture on MP2 is essentially empty. I did occasionally see the message below, but not during the capture:

root@ucm-imx8m-mini:~# sudo tcpdump -i wlan0 -U -w
[  148.665606] device wlan0 entered promiscuous mode
[  148.670546] audit: type=1700 audit(1616581662.716:3): dev=wlan0 prom=256 old_prom=0 auid=4                                                                                                294967295 uid=0 gid=0 ses=4294967295
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
reading from file -, link-type EN10MB (Ethernet), snapshot length 262144
10:27:54.856984 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 16) fe80::20a:52ff:fe0                                                                                                9:18ad > ff02::2: [icmp6 sum ok] ICMP6, router solicitation, length 16
          source link-address option (1), length 8 (1): 00:0a:52:09:18:ad
            0x0000:  000a 5209 18ad
^Ctcpdump: pcap_loop: error readi[  262.199124] device wlan0 left promiscuous mode
ng dump file: Interrupted system [  262.206085] audit: type=1700 audit(1616581776.256:4): dev                                                                                                =wlan0 prom=0 old_prom=256 auid=4294967295 uid=0 gid=0 ses=4294967295
call
1 packet captured
1 packet received by filter
0 packets dropped by kernel
root@ucm-imx8m-mini:~#

I hope this helps narrow down the issue!

The lack of a station dump output looks like your device isn’t actually joining the mesh network at all :thinking:

This doesn’t match some of your earlier experiments where you did remain connected when you initially connected to MG and then moved out of range.

Do the Heltec devices have any configuration in /etc/config/mesh11sd ?

Apologies, in that test I only booted it up while already out of range. So here it is again.

First I connected MP2 and MP1 while to the MG while they are both in range of MG. I then move away such that MP2 can only see MP1 and MP1 can see MG and MP1. I get successful ping, see below:

root@ucm-imx8m-mini:~# ping 192.168.3.201
PING 192.168.3.201 (192.168.3.201): 56 data bytes
64 bytes from 192.168.3.201: seq=2 ttl=64 time=312.702 ms
64 bytes from 192.168.3.201: seq=3 ttl=64 time=158.104 ms
64 bytes from 192.168.3.201: seq=4 ttl=64 time=32.746 ms
64 bytes from 192.168.3.201: seq=5 ttl=64 time=33.962 ms
64 bytes from 192.168.3.201: seq=6 ttl=64 time=32.856 ms
^C
--- 192.168.3.201 ping statistics ---
7 packets transmitted, 5 packets received, 28% packet loss
round-trip min/avg/max = 32.746/114.074/312.702 ms
root@ucm-imx8m-mini:~# ip route show
192.168.3.0/24 dev wlan0 proto kernel scope link src 192.168.3.11
iw dev wlan0 mpath dump
root@ucm-imx8m-mini:~# iw dev wlan0 mpath dump
DEST ADDR         NEXT HOP          IFACE       SN      METRIC  QLEN    EXPTIME         DTIM    DRET    FLAGS   HOP_COUNT       PATH_CHANGE
5a:6e:0f:98:85:d4 5a:6e:0f:98:85:d4 wlan0       3       1546    0       0       0       0       0x14    1       1
00:c0:ca:b6:5c:be 5a:6e:0f:98:85:d4 wlan0       13      3956    0       3816    0       0       0x15    2       4
iw dev wlan0 station dump
root@ucm-imx8m-mini:~# iw dev wlan0 station dump
Station 5a:6e:0f:98:85:d4 (on wlan0)
        inactive time:  1196 ms
        rx bytes:       90774
        rx packets:     922
        tx bytes:       1740
        tx packets:     17
        tx retries:     0
        tx failed:      0
        rx drop misc:   10
        signal:         -102 dBm
        signal avg:     -102 dBm
        Toffset:        31082083 us
        tx bitrate:     6.5 MBit/s VHT-MCS 0 VHT-NSS 1
        tx duration:    0 us
        rx bitrate:     14.4 MBit/s VHT-MCS 1 short GI VHT-NSS 1
        rx duration:    0 us
        expected throughput:    5.126Mbps
        mesh llid:      0
        mesh plid:      0
        mesh plink:     ESTAB
        mesh airtime link metric: 1546
        mesh connected to gate: no
        mesh connected to auth server:  no
        mesh local PS mode:     ACTIVE
        mesh peer PS mode:      ACTIVE
        mesh non-peer PS mode:  ACTIVE
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            yes
        TDLS peer:      no
        DTIM period:    1
        beacon interval:1000
        connected time: 425 seconds
        associated at [boottime]:       18.575s
        associated at:  1616581532410 ms
        current time:   1616581953894 ms
Station 00:c0:ca:b6:5c:be (on wlan0)
        inactive time:  81824 ms
        rx bytes:       67088
        rx packets:     680
        tx bytes:       5408
        tx packets:     42
        tx retries:     64
        tx failed:      9
        rx drop misc:   31
        signal:         -108 dBm
        signal avg:     -106 dBm
        tx bitrate:     6.5 MBit/s VHT-MCS 0 VHT-NSS 1
        tx duration:    0 us
        rx bitrate:     72.2 MBit/s VHT-MCS 7 short GI VHT-NSS 1
        rx duration:    0 us
        mesh llid:      0
        mesh plid:      0
        mesh plink:     ESTAB
        mesh airtime link metric: 1705
        mesh connected to gate: yes
        mesh connected to auth server:  no
        mesh local PS mode:     ACTIVE
        mesh peer PS mode:      ACTIVE
        mesh non-peer PS mode:  ACTIVE
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            yes
        TDLS peer:      no
        DTIM period:    1
        beacon interval:1000
        connected time: 424 seconds
        associated at [boottime]:       18.743s
        associated at:  1616581532578 ms
        current time:   1616581953894 ms
root@ucm-imx8m-mini:~# iw dev wlan0 mpp dump
DEST ADDR         PROXY NODE        IFACE
00:c0:ca:b6:5c:bc 00:c0:ca:b6:5c:be wlan0
root@ucm-imx8m-mini:~# ping 192.168.3.201
PING 192.168.3.201 (192.168.3.201): 56 data bytes
64 bytes from 192.168.3.201: seq=0 ttl=64 time=47.146 ms
64 bytes from 192.168.3.201: seq=1 ttl=64 time=28.906 ms
^C
--- 192.168.3.201 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 28.906/38.026/47.146 ms

Leaving everything in the exact same location I reboot MP2 and leave it for a few mins. It does not reconnect and I get this:

root@ucm-imx8m-mini:~# ping 192.168.3.201
PING 192.168.3.201 (192.168.3.201): 56 data bytes
^C
--- 192.168.3.201 ping statistics ---
6 packets transmitted, 0 packets received, 100% packet loss
root@ucm-imx8m-mini:~# ip route show
192.168.3.0/24 dev wlan0 proto kernel scope link src 192.168.3.11
iw dev wlan0 mpath dump
root@ucm-imx8m-mini:~# iw dev wlan0 mapath dump
DEST ADDR         NEXT HOP          IFACE       SN      METRIC  QLEN    EXPTIME         DTIM    DRET    FLAGS   HOP_COUNT       PATH_CHANGE
iw dev wlan0 station dump
root@ucm-imx8m-mini:~# iw dev wlan0 station dump
root@ucm-imx8m-mini:~# iw dev wlan0 mpp dump
DEST ADDR         PROXY NODE        IFACE
root@ucm-imx8m-mini:~# ping 192.168.3.201
PING 192.168.3.201 (192.168.3.201): 56 data bytes
^C
--- 192.168.3.201 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss

As for the Heltec mesh11sd file it looks like this:

root@HT-H7608-F017:~# cat /etc/config/mesh11sd

config mesh11sd 'setup'
        option debuglevel '1'
        option checkinterval '10'
        option interface_timeout '10'
        option enabled '1'

config mesh11sd 'mesh_params'
        option mesh_fwding '1'
        option mesh_max_peer_links '10'
        option mesh_rssi_threshold '-85'
        option mesh_ttl '31'
        option mesh_hwmp_rootmode '0'
        option mesh_gate_announcements '0'
        option mesh_nolearn '0'

config mesh11sd 'mbca'
        option mbca_config '1'
        option mesh_beacon_timing_report_int '10'
        option mbss_start_scan_duration_ms '2048'
        option mbca_min_beacon_gap_ms '25'
        option mbca_tbtt_adj_interval_sec '60'

config mesh11sd 'mesh_beaconless'
        option mesh_beacon_less_mode '0'

config mesh11sd 'mesh_dynamic_peering'
        option enabled '0'

Hope this clarifies the issue!

It looks like at the edge there the device is getting RSSI values of <-100 dBm. Your Heltec gateways are configured with a mesh_rssi_threshold of -85. I doubt these devices would boot you off the mesh as you move towards the edge, but once you’ve rebooted, they’re likely not letting you back on due to the rssi threshold.

Try reducing the RSSI threshold on the Heltec gateways to -110dB, and see if it resolves your issue in the same spot.

In saying that, I wouldn’t recommend an rssi threshold that low in a real deployment. You want to try to maximise the rate the links are operating to claim as much bandwidth as possible, as your link throughput will halve through each hop. But it’s a good experiment nonetheless.

Another test is to move the device to a location that it is with the -85 rssi threshold of MP1, but out of the range of MG. Does the behaviour you were seeing originally still exhibit in this instance?

I see. I assumed that was the signal strength of MG that MP2 sees. MP2 is only a few meters away from MP1 with only minor obstruction, so I doubt that that is its RSSI.

Anyway, I will check once I am back on site in about two weeks.

You are correct. I’m just assuming the signal strength is bidirectional (because it usually is). Do check your config for the rssi threshold of MP2. It will also reject joining mesh peers with low rssi.

If it’s possible, I’d be interested knowing the signal strength of MP2 that MP1 sees in that state.

For only a couple of meters away, I’m surprised by that rssi. It should be higher.

I have returned to the site and have gotten the requested information.

See below the rssi threshold parameters on MP2

root@ucm-imx8m-mini:/etc/morse# cat wpa_supplicant_s1g.conf
ctrl_interface=/var/run/wpa_supplicant_s1g

update_config=1
country=US
pmf=2
sae_pwe=1
max_peer_links=10
mesh_fwding=1

network={
    ssid="RescueRatMesh"
    key_mgmt=SAE
    sae_password="[PASSWORD]"
    pairwise=CCMP
    ieee80211w=2

    # Mesh mode
    mode=5

    # 904.5 MHz, 1 MHz BW, US
    channel=5
    op_class=68
    country="US"
    s1g_prim_chwidth=0
    s1g_prim_1mhz_chan_index=0

    beacon_int=1000
    dtim_period=1

    mesh_rssi_threshold=-85
}
root@ucm-imx8m-mini:/etc/morse#

Below is a screenshot of the connected devices on MG. Basically only MP1 is shown

Below is a screenshot of the connected devices on MP1. We can see MG with a similar RSSI. And then below is MP2 with a good RSSI, but no IP address and MCS 0.

Let me know if there are any other tests I can do, thanks!

An RX rate of 0 MHz is pretty suspicious, I wonder if it hasn’t actually completed the authentication/association process (OpenWrt can show devices in the associated stations list early during the association process). The reported TX rate also looks invalid. This would align with you seeing it in OpenWrt, but nothing in the mesh paths or station dump commands.

I’d be interested to know what’s actually going on in the air. If you have a fourth device, you can put it into monitor mode (see https://www.morsemicro.com/resources/appnotes/MM_APPNOTE-36_How_to_do_a_Sniffer_Capture.pdf) and configure it for the same channel as the mesh (morse_cli -i wlan0 channel -o 1 -p 1 -c 904500 -n 0) , then boot your problematic device. Specifically wanting to capture the authentication and association process here.

Good idea. I have done as you said.

These are the commands run on the sniffer:

root@HT-H7608-F017:~# iw dev wlan0 del
root@HT-H7608-F017:~# iw phy phy1 interface add mon0 type monitor
root@HT-H7608-F017:~# ifconfig mon0 up && ifconfig morse0 up
root@HT-H7608-F017:~# morse_cli -i mon0 channel -o 1 -p 1 -c 904500 -n 0
Full Channel Information
        Operating Frequency: 904500 kHz
        Operating BW: 1 MHz
        Primary BW: 1 MHz
        Primary Channel Index: 0
root@HT-H7608-F017:~#

I placed the sniffer close to MP1 so it is in range of all the devices. Attached is the pcap file. MAC addresses are MG (02:c0:ca:b6:5c:be), MP1 (e4:38:19:1f:f0:57) and MP2 (00:0a:52:09:18:ad).

I also did a test where MP2 is in range of MG to show what it looks like when they do connect. Followed by some Pings to confirm.

I hope this helps narrow it down!

Sniffer captures.zip (54.7 KB)