Long distance – 10km with openwrt tuning need fine tuning advice

Currently I have the following long distance link existing running so far so good
Ubnt NanoStation M5(Orginal AirOS 5.6) 16dbi gain STA mode <-10km visible-> China commercial 10dbi AP
The ping response around 2ms stable and signal level -78dBm, throughput around 3Mbps DL and 10Mbps UL.

Here is the NanoStation M5 ath0 info:

Channel/Frequency:136 / 5680 MHz
Channel Width:20 MHz
Frequency Band:5670 - 5690 MHz
Distance:6.3 miles (10.2 km)
TX/RX Chains:2X2
TX Power:27 dBm
Antenna:

ath0      IEEE 802.11na  ESSID:"xxxxxx"  Nickname:""
          Mode:Managed  Frequency:5.68 GHz  Access Point: xxxxxxxxxx
          Bit Rate:26 Mb/s   Tx-Power=27 dBm   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=18/94  Signal level=-78 dBm  Noise level=-88 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

br0       no wireless extensions.

XM.v5.6.15-cs.30572.170328.1107# ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1): 56 data bytes
64 bytes from 172.20.0.1: seq=0 ttl=64 time=1.997 ms
64 bytes from 172.20.0.1: seq=1 ttl=64 time=2.062 ms
64 bytes from 172.20.0.1: seq=2 ttl=64 time=2.598 ms
64 bytes from 172.20.0.1: seq=3 ttl=64 time=2.479 ms
64 bytes from 172.20.0.1: seq=4 ttl=64 time=101.370 ms
64 bytes from 172.20.0.1: seq=5 ttl=64 time=2.434 ms
64 bytes from 172.20.0.1: seq=6 ttl=64 time=2.374 ms
64 bytes from 172.20.0.1: seq=7 ttl=64 time=3.070 ms
64 bytes from 172.20.0.1: seq=8 ttl=64 time=2.496 ms
64 bytes from 172.20.0.1: seq=9 ttl=64 time=3.075 ms
64 bytes from 172.20.0.1: seq=10 ttl=64 time=2.233 ms
64 bytes from 172.20.0.1: seq=11 ttl=64 time=2.867 ms
64 bytes from 172.20.0.1: seq=12 ttl=64 time=2.736 ms
64 bytes from 172.20.0.1: seq=13 ttl=64 time=2.784 ms
64 bytes from 172.20.0.1: seq=14 ttl=64 time=2.830 ms
64 bytes from 172.20.0.1: seq=15 ttl=64 time=3.077 ms
64 bytes from 172.20.0.1: seq=16 ttl=64 time=2.146 ms
64 bytes from 172.20.0.1: seq=17 ttl=64 time=2.284 ms
64 bytes from 172.20.0.1: seq=18 ttl=64 time=2.746 ms
64 bytes from 172.20.0.1: seq=19 ttl=64 time=2.358 ms
^C
--- 172.20.0.1 ping statistics ---
20 packets transmitted, 20 packets received, 0% packet loss
round-trip min/avg/max = 1.997/7.500/101.370 ms
XM.v5.6.15-cs.30572.170328.1107#

Any now on I upgrade the facility with Ubnt lbe-5ac-gen2 in order to get a better signal level, of course the latest airos of Ubnt WISP device wouldn’t let me to connect non-Ubnt AirMAX device, so I load this new ubnt device with openwrt snapshot.
And connection has been tested over on 1km link throughput around 150Mbps.

But when I try to get back to the right place for 10km long distance link, the signal level around -65dBm but the ping test was very unstable even I try to force the option distance '9000' to ‘15000’ on /etc/config/wireless of new lbe-5ac-gen2.

May I know is that any other setting need to fine tune in order to make openwrt working stable over 10 kilo meter 5Ghz? Thank you

Here is lbe-5ac-gen2 debug output:

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0'
        option cell_density '0'
        option country 'HK'
        option htmode 'VHT80'
        option distance '13000'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'sta'
        option ssid 'xxxxxx'
        option encryption 'none'
        option network 'wwan'

root@OpenWrt:~# ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1): 56 data bytes
64 bytes from 172.20.0.1: seq=0 ttl=64 time=166.585 ms
64 bytes from 172.20.0.1: seq=1 ttl=64 time=719.524 ms
64 bytes from 172.20.0.1: seq=2 ttl=64 time=1050.629 ms
64 bytes from 172.20.0.1: seq=3 ttl=64 time=50.425 ms
64 bytes from 172.20.0.1: seq=4 ttl=64 time=225.627 ms
64 bytes from 172.20.0.1: seq=5 ttl=64 time=119.430 ms
64 bytes from 172.20.0.1: seq=6 ttl=64 time=22.632 ms
64 bytes from 172.20.0.1: seq=7 ttl=64 time=38.841 ms
64 bytes from 172.20.0.1: seq=8 ttl=64 time=212.567 ms
64 bytes from 172.20.0.1: seq=9 ttl=64 time=293.584 ms
64 bytes from 172.20.0.1: seq=10 ttl=64 time=544.871 ms
64 bytes from 172.20.0.1: seq=11 ttl=64 time=275.539 ms
64 bytes from 172.20.0.1: seq=12 ttl=64 time=25.218 ms
64 bytes from 172.20.0.1: seq=13 ttl=64 time=900.581 ms
64 bytes from 172.20.0.1: seq=14 ttl=64 time=809.706 ms
64 bytes from 172.20.0.1: seq=15 ttl=64 time=3.899 ms
64 bytes from 172.20.0.1: seq=16 ttl=64 time=429.494 ms
64 bytes from 172.20.0.1: seq=17 ttl=64 time=456.208 ms
64 bytes from 172.20.0.1: seq=18 ttl=64 time=490.216 ms
64 bytes from 172.20.0.1: seq=19 ttl=64 time=2506.701 ms
64 bytes from 172.20.0.1: seq=20 ttl=64 time=1506.495 ms
64 bytes from 172.20.0.1: seq=21 ttl=64 time=506.061 ms

--- 172.20.0.1 ping statistics ---
23 packets transmitted, 22 packets received, 4% packet loss
round-trip min/avg/max = 3.899/516.128/2506.701 ms
root@OpenWrt:~# vi /etc/config/wireless
root@OpenWrt:~# iw dev wlan0 station dump
Station xxxxx (on wlan0)
        inactive time:  6256 ms
        rx bytes:       1673170
        rx packets:     8057
        tx bytes:       12240
        tx packets:     107
        tx retries:     3
        tx failed:      1
        beacon loss:    0
        beacon rx:      3029
        rx drop misc:   1857
        signal:         -65 [-69, -72] dBm
        signal avg:     -65 [-68, -71] dBm
        beacon signal avg:      -65 dBm
        tx bitrate:     117.0 MBit/s VHT-MCS 6 VHT-NSS 2
        tx duration:    31268 us
        rx bitrate:     13.0 MBit/s VHT-MCS 0 VHT-NSS 2
        rx duration:    596324 us
        airtime weight: 256
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no
        DTIM period:    1
        beacon interval:100
        short slot time:yes
        connected time: 315 seconds
        associated at [boottime]:       72805.821s
        associated at:  18446725628691252439 ms
        current time:   1652966940 ms

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0'
        option cell_density '0'
        option country 'HK'
        option htmode 'VHT80'
        option distance '10200'



config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'sta'
        option ssid 'xxxx'
        option encryption 'none'
        option network 'wwan'

root@OpenWrt:~# wifi

root@OpenWrt:~# ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1): 56 data bytes
64 bytes from 172.20.0.1: seq=0 ttl=64 time=19.894 ms
64 bytes from 172.20.0.1: seq=1 ttl=64 time=3.398 ms
64 bytes from 172.20.0.1: seq=1 ttl=64 time=4.642 ms (DUP!)
64 bytes from 172.20.0.1: seq=2 ttl=64 time=3.034 ms
64 bytes from 172.20.0.1: seq=3 ttl=64 time=537.883 ms
64 bytes from 172.20.0.1: seq=4 ttl=64 time=586.183 ms
64 bytes from 172.20.0.1: seq=5 ttl=64 time=222.381 ms
64 bytes from 172.20.0.1: seq=6 ttl=64 time=1622.094 ms
64 bytes from 172.20.0.1: seq=7 ttl=64 time=621.826 ms
64 bytes from 172.20.0.1: seq=8 ttl=64 time=2.869 ms
64 bytes from 172.20.0.1: seq=9 ttl=64 time=3.320 ms
64 bytes from 172.20.0.1: seq=10 ttl=64 time=2.526 ms
64 bytes from 172.20.0.1: seq=11 ttl=64 time=749.308 ms
64 bytes from 172.20.0.1: seq=12 ttl=64 time=2.380 ms
64 bytes from 172.20.0.1: seq=13 ttl=64 time=696.492 ms
64 bytes from 172.20.0.1: seq=14 ttl=64 time=31.496 ms
64 bytes from 172.20.0.1: seq=15 ttl=64 time=2.531 ms
64 bytes from 172.20.0.1: seq=16 ttl=64 time=562.851 ms
64 bytes from 172.20.0.1: seq=17 ttl=64 time=96.911 ms
64 bytes from 172.20.0.1: seq=18 ttl=64 time=758.038 ms
64 bytes from 172.20.0.1: seq=19 ttl=64 time=349.261 ms
64 bytes from 172.20.0.1: seq=20 ttl=64 time=43.264 ms
^C
--- 172.20.0.1 ping statistics ---
21 packets transmitted, 21 packets received, 1 duplicates, 0% packet loss
round-trip min/avg/max = 2.380/314.662/1622.094 ms
root@OpenWrt:~# iw dev wlan0 station dump
Station xxxxxx (on wlan0)
        inactive time:  4732 ms
        rx bytes:       233793
        rx packets:     777
        tx bytes:       4100
        tx packets:     33
        tx retries:     0
        tx failed:      0
        beacon loss:    0
        beacon rx:      254
        rx drop misc:   508
        signal:         -70 [-73, -74] dBm
        signal avg:     -69 [-72, -73] dBm
        beacon signal avg:      -67 dBm
        tx bitrate:     104.0 MBit/s VHT-MCS 5 VHT-NSS 2
        tx duration:    9463 us
        rx bitrate:     6.5 MBit/s VHT-MCS 0 VHT-NSS 1
        rx duration:    127388 us
        airtime weight: 256
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no
        DTIM period:    1
        beacon interval:100
        short slot time:yes
        connected time: 26 seconds
        associated at [boottime]:       73139.559s
        associated at:  18446725628691629126 ms
        current time:   1653012677 ms
root@OpenWrt:~#

With that's some highly varied ping times. Was this on a fully unloaded link? Or was the far access point buffer bloated due to local traffic?

Also enable RTS/CTS on the client device I would think.

Any recommend value for RTS and CTS for 10km distance?
there have no any other traffic when I perform the ping test.

If this is a point to point link with just one set of traffic then RTS/CTS probably doesn't help. But if it's a multipoint link then I think set the RTS/CTS threshold to something like 200bytes and test.

This seems weird. Because you aren't dropping packets but you have hundreds of milliseconds delay. If you have a bad connection I'd expect packet loss. What is causing this delay?

It is multipoint link, just applied option rts '200' but no luck whatever the signal level -64 dBm

root@OpenWrt:~# ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1): 56 data bytes
64 bytes from 172.20.0.1: seq=0 ttl=64 time=54.245 ms
64 bytes from 172.20.0.1: seq=1 ttl=64 time=3.446 ms
64 bytes from 172.20.0.1: seq=2 ttl=64 time=3.222 ms
64 bytes from 172.20.0.1: seq=3 ttl=64 time=2.438 ms
64 bytes from 172.20.0.1: seq=4 ttl=64 time=2879.274 ms
64 bytes from 172.20.0.1: seq=5 ttl=64 time=1879.039 ms
64 bytes from 172.20.0.1: seq=6 ttl=64 time=878.765 ms
64 bytes from 172.20.0.1: seq=8 ttl=64 time=110.833 ms
64 bytes from 172.20.0.1: seq=9 ttl=64 time=1813.113 ms
64 bytes from 172.20.0.1: seq=10 ttl=64 time=812.908 ms
64 bytes from 172.20.0.1: seq=11 ttl=64 time=1617.007 ms
64 bytes from 172.20.0.1: seq=12 ttl=64 time=616.808 ms
64 bytes from 172.20.0.1: seq=13 ttl=64 time=628.333 ms
64 bytes from 172.20.0.1: seq=14 ttl=64 time=357.267 ms
64 bytes from 172.20.0.1: seq=15 ttl=64 time=111.526 ms
64 bytes from 172.20.0.1: seq=16 ttl=64 time=553.972 ms
64 bytes from 172.20.0.1: seq=17 ttl=64 time=121.858 ms
64 bytes from 172.20.0.1: seq=18 ttl=64 time=783.104 ms
64 bytes from 172.20.0.1: seq=19 ttl=64 time=379.802 ms
64 bytes from 172.20.0.1: seq=20 ttl=64 time=25.089 ms
64 bytes from 172.20.0.1: seq=21 ttl=64 time=536.602 ms
64 bytes from 172.20.0.1: seq=22 ttl=64 time=2.249 ms
64 bytes from 172.20.0.1: seq=23 ttl=64 time=449.598 ms
64 bytes from 172.20.0.1: seq=24 ttl=64 time=345.793 ms
64 bytes from 172.20.0.1: seq=25 ttl=64 time=793.953 ms
64 bytes from 172.20.0.1: seq=26 ttl=64 time=161.191 ms
64 bytes from 172.20.0.1: seq=27 ttl=64 time=256.156 ms
64 bytes from 172.20.0.1: seq=28 ttl=64 time=1.756 ms
64 bytes from 172.20.0.1: seq=29 ttl=64 time=117.248 ms
64 bytes from 172.20.0.1: seq=30 ttl=64 time=249.979 ms
64 bytes from 172.20.0.1: seq=31 ttl=64 time=40.316 ms
64 bytes from 172.20.0.1: seq=32 ttl=64 time=86.951 ms
^C
--- 172.20.0.1 ping statistics ---
33 packets transmitted, 32 packets received, 3% packet loss
round-trip min/avg/max = 1.756/521.057/2879.274 ms
root@OpenWrt:~# iw dev wlan0 station dump
Station xxxxxx (on wlan0)
        inactive time:  1132 ms
        rx bytes:       399623
        rx packets:     1258
        tx bytes:       5926
        tx packets:     48
        tx retries:     0
        tx failed:      0
        beacon loss:    0
        beacon rx:      482
        rx drop misc:   770
        signal:         -65 [-68, -71] dBm
        signal avg:     -64 [-67, -70] dBm
        beacon signal avg:      -64 dBm
        tx bitrate:     117.0 MBit/s VHT-MCS 6 VHT-NSS 2
        tx duration:    14347 us
        rx bitrate:     6.5 MBit/s VHT-MCS 0 VHT-NSS 1
        rx duration:    229268 us
        airtime weight: 256
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no
        DTIM period:    1
        beacon interval:100
        short slot time:yes
        connected time: 49 seconds
        associated at [boottime]:       83920.193s
        associated at:  18446725628713215898 ms
        current time:   1663816687 ms
root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0'
        option country 'HK'
        option distance '10200'
        option cell_density '0'
        option rts '200'


config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'sta'
        option ssid 'xxxxx'
        option encryption 'none'
        option network 'wwan'

root@OpenWrt:~#

Try telling ping to use a 300 byte payload just to see if RTS/cts changes anything

Hi @cracker, you can also play with the retry parameter, e.g.:

iw phy phy0 set retry short 25
iw phy phy0 set retry long 30

I have no idea which value is the best for your case.

Note: if your device has two radios, then you may need to use phy1 instead.

Regards

Thanks all of your suggestions, but still no luck and I given up.