Slow WIFI transfer between router and bridge

Hi there,
I have a 2 WIFI routers Linksys WRT32X AC3200 (OpenWrt 19.07.2) and TP-Link TD-W8970 (OpenWrt SNAPSHOT r13342-e35e40ad82) as bridge connected with WIFI and WDS. Both of them have a USB HDD.

1st issue: The transfer between the HDDs is very poor, around 2Mbits/s.
I installed iperf3 on both device; WRT32X as client, TD-W8970 as server.
First test was:

iperf3 -c 192.168.1.2
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  40.0 MBytes  33.6 Mbits/sec    0             sender
[  5]   0.00-10.08  sec  39.7 MBytes  33.0 Mbits/sec                  receiver

iperf3 -c 192.168.1.2 -R
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.05  sec  74.5 MBytes  62.1 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  73.9 MBytes  62.0 Mbits/sec                  receiver

2nd issue, transfer from client to server is slower.
At this time "Distance Optimization" was 8
After reading, I changed to 150 and get

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  38.9 MBytes  32.7 Mbits/sec    0             sender
[  5]   0.00-10.07  sec  38.5 MBytes  32.0 Mbits/sec                  receiver

iperf3 -c 192.168.1.2 -R
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.04  sec   109 MBytes  91.0 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   109 MBytes  91.1 Mbits/sec                  receiver

This improved the reverse transfer.
My config is:
WRT32X (client)

uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.hwmode='11a'
wireless.radio0.path='soc/soc:pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
wireless.radio0.country='IE'
wireless.radio0.legacy_rates='1'
wireless.radio0.distance='15'
wireless.radio0.channel='auto'
wireless.radio0.htmode='VHT80'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='OpenWrt'
wireless.default_radio0.macaddr='xxxxxx'
wireless.default_radio0.encryption='psk-mixed'
wireless.default_radio0.key='Passwd'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.hwmode='11g'
wireless.radio1.path='soc/soc:pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
wireless.radio1.country='IE'
wireless.radio1.channel='auto'
wireless.radio1.htmode='HT40'
wireless.radio1.distance='150'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.network='lan'
wireless.default_radio1.ssid='OpenWrt'
wireless.default_radio1.macaddr='xxxxxxx'
wireless.default_radio1.encryption='psk-mixed'
wireless.default_radio1.key='Passwrd'
wireless.default_radio1.mode='ap'
wireless.default_radio1.wds='1'
wireless.radio2=wifi-device
wireless.radio2.type='mac80211'
wireless.radio2.hwmode='11a'
wireless.radio2.path='platform/soc/soc:internal-regs/f10d8000.sdhci/mmc_host/mmc0/mmc0:0001/mmc0:0001:1'
wireless.radio2.htmode='VHT80'
wireless.radio2.legacy_rates='1'
wireless.radio2.channel='auto'
wireless.radio2.country='IE'
wireless.default_radio2=wifi-iface
wireless.default_radio2.device='radio2'
wireless.default_radio2.network='lan'
wireless.default_radio2.mode='ap'
wireless.default_radio2.ssid='OpenWrt'
wireless.default_radio2.encryption='psk-mixed'
wireless.default_radio2.key='xxxxxx'

uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].network='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
firewall.@zone[1].network='wan' 'wan6'
firewall.@zone[1].input='REJECT'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fc00::/6'
firewall.@rule[3].dest_ip='fc00::/6'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@redirect[0]=redirect
firewall.@redirect[0].target='DNAT'

iwinfo | grep -e Rate -e Mode -e Signal
          Mode: Master  Channel: 36 (5.180 GHz)
          Signal: unknown  Noise: -96 dBm
          Bit Rate: unknown
          Type: nl80211  HW Mode(s): 802.11nac
          Mode: Master  Channel: 6 (2.437 GHz)
          Signal: -64 dBm  Noise: -94 dBm
          Bit Rate: 144.4 MBit/s
          Type: nl80211  HW Mode(s): 802.11bgn
          Mode: Master (VLAN)  Channel: 6 (2.437 GHz)
          Signal: -74 dBm  Noise: -94 dBm
          Bit Rate: 216.7 MBit/s
          Type: nl80211  HW Mode(s): 802.11bgn
          Mode: Master  Channel: 36 (5.180 GHz)
          Signal: unknown  Noise: -92 dBm
          Bit Rate: unknown
          Type: nl80211  HW Mode(s): 802.11bgnac

TD-W8970 (server)

uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.hwmode='11g'
wireless.radio0.path='pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio0.disabled='0'
wireless.radio0.channel='auto'
wireless.radio0.country='IE'
wireless.radio0.distance='150'
wireless.wifinet0=wifi-iface
wireless.wifinet0.ssid='OpenWrt'
wireless.wifinet0.encryption='psk2'
wireless.wifinet0.device='radio0'
wireless.wifinet0.mode='sta'
wireless.wifinet0.bssid='xxxxx'
wireless.wifinet0.key='Passwrd'
wireless.wifinet0.wds='1'
wireless.wifinet0.network='lan'

# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[0].network='lan WDSLink'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'

iwinfo | grep -e Rate -e Mode -e Signal
          Mode: Client  Channel: 6 (2.437 GHz)
          Signal: -66 dBm  Noise: -95 dBm
          Bit Rate: 117.0 MBit/s
          Type: nl80211  HW Mode(s): 802.11bgn

What is wrong in my config?
What is the limit of "Distance"? Is bigger faster?
How to improve the speed client to server?
Thanks

I did tests for Distance Optimization; 1150, 900, 500, 200, 100
5 runs with iperf3 -c 192.168.1.2, I took note of the last 2 lines. Sender and receiver are roughly similar.

At 100, mini: 36, maxi: 48
At 200, mini: 46, maxi: 51
At 500, mini: 44, maxi: 49
At 900, mini: 43, maxi: 48
At 1150, mini: 42, maxi: 50

I'll keep Distance Optimization: 200
With this value, iperf3 -c 192.168.1.2 -R give me
mini: 83, maxi: 90

Why I have almost x2 speed for reverse? Any idea?

You're a kilometer away from your router!?!?!?

:open_mouth:

EDIT: ...and BTW, what's wrong with that speed?

Not at all, even less than 10 m but as you wrote in another thread here :

WOW, 15 is still too low...way too low!!!

So I tested some distances to see what happen, why not > 1000 , nobody answered my above question "Is bigger faster?". In the results I can see that between 100 and 200 is the threshold.

I don't understand exactly the results of iperf3 but when I see

my guess is that one way is triple faster than the another.
WHY?, hardware, software or configuration?

You didn't read all of it:

The user set a value that didn't work (i.e. 10 meters). I think you took this out of context.

Likely because the question fundamentally shows that you don't understand what Distance Optimization actually is. I have no clue how to answer "is a bigger Distance Optimization value faster"...faster than what???

If you are not actually a kilometer away from the router...with such a vague question and little information on why you're editing the value so high, I'd say slower.

:confused:

I don't see a problem, so again I don't know how to answer. I think with such a vague question, I'd say hardware. Moving this service to a dedicated machine may "fix" this concern you have.

Because one of your devices only has a 500 MHz CPU, perhaps (which seems normal). :thinking:

I did some reading, I now have a better understanding about Distance optimization and iperf.
My 2 devices are about 7 m apart.
I did measurements in the slower way, main router to bridge, first main router as client and second as server (with -R option).
Command was iperf3 -c 192.168.1.2 -O 2 -t 25
The bridge has the scnapshot, I set the Distance optimization to auto
I changed the Distance optimization on the main router: 7, 15, 20, 30, 50, 100, 110.
All the results are between mini 48 and maxi 51 Mbits/s. There is no relevant difference with all the distance values.

You are right about the CPU in the bridge. When receiving the idle is 11-16%, when sending around 45%.

Now I understand your

I'll go further and connect the HDD on the USB on the bridge and measure the full chain.
Thank you for your valuable help

1 Like

For information and reference
My system is:
Desktop =LAN= MainRouter with USB3 HDD =wifi= Bridge with USB2 HDD =LAN= RPi2 with USB2 HDD or key.

Transfer speed measure with file size 155 MB, ssh each device, measure with scp command output:
MainRouter to/from Bridge => 10 Mbits/s
MainRouter to RPi2 => 77 Mbits/s
RPi2 to MainRouter => 25 Mbits/s
Bridge to RPi2 => 15 Mbits/s
RPi2 to Bridge => 13 Mbits/s
Desktop to Rpi2 => 72 Mbits/s

Bonus
Laptop wire (1Gb) connected to the Bridge
Desktop to laptop => 95 Mbits/s
Laptop to desktop => 40 Mbits/s
What I see:
Bridge is bad with USB HDD due to CPU
Bridge have good transfer from wifi to wire but not good from wire to wifi
RPi2 has limited speed
Please correct me if I am wrong in my method and comments.
Thank you