Slow transfers over Wifi

@Ravenlost, welcome to the community.

Don't waste your n00b post limit - use one post to respond to others, we can all read.

And this seems rather normal for a device with a likely bottleneck. With a 333 MHz processor trying to transfer at 1000 Mbps, that's not a far-fetched notion.

1 Like

I'd love to do the upgrade, but had a pretty hard time back then to get it working properly with my ADSL... Had to manually change so files (i.e. adsl.bin,etc), plus I've got quite a big setup in here (proxy, vpn, and other stuff)... Don't really feel like bitting the bullet (just yet) and spend to much time on it trying to get everything working ...

I've installed iperf as per your suggestion. Here are the results going from my Linux box --(wifi)--> router --(eth)--> NAS

Running iperf server on my NAS here, and client on Linux:

First, Bi-directional sequential test

[raven@Papounix ~]$ iperf -c 192.168.2.2 -r
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.2, TCP port 5001
TCP window size:  110 KByte (default)
------------------------------------------------------------
[  5] local 192.168.2.183 port 60488 connected with 192.168.2.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.3 sec  49.0 MBytes  40.0 Mbits/sec
[  4] local 192.168.2.183 port 5001 connected with 192.168.2.2 port 46441
[  4]  0.0-10.1 sec  32.6 MBytes  27.1 Mbits/sec

Second, Bi-directional simultaneous test

[raven@Papounix ~]$ iperf -c 192.168.2.2 -d
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.2, TCP port 5001
TCP window size: 93.5 KByte (default)
------------------------------------------------------------
[  5] local 192.168.2.183 port 60500 connected with 192.168.2.2 port 5001
[  4] local 192.168.2.183 port 5001 connected with 192.168.2.2 port 48827
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.2 sec  38.5 MBytes  31.5 Mbits/sec
[  4]  0.0-10.7 sec  3.62 MBytes  2.84 Mbits/sec

Finally, here is my network and wireless config:

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.lan=interface
network.lan.force_link='1'
network.lan.type='bridge'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan.ifname='eth0.1'
network.lan.ipaddr='192.168.2.1'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch[0].mirror_source_port='0'
network.@switch[0].mirror_monitor_port='0'
network.@switch[0].enable_vlan4k='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='0 1 2 5t'
network.atm=atm-bridge
network.atm.encaps='llc'
network.atm.payload='bridged'
network.atm.vci='35'
network.atm.vpi='8'
network.wan=interface
network.wan.ifname='nas0'
network.wan.proto='pppoe'
network.wan.ipv6='1'
network.wan.username='USERNAME'
network.wan.password='PASSWORD'
network.wan.peerdns='0'
network.wan.dns='208.67.222.222 208.67.220.220'
network.wan6=interface
network.wan6.ifname='@wan'
network.wan6.proto='dhcpv6'
network.dsl=adsl
network.dsl.annex='mm'
network.dsl.firmware='/lib/firmware/adsl.bin'
network.vpn0=interface
network.vpn0.ifname='tun0'
network.vpn0.proto='none'
network.vpn0.auto='1'
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device='switch0'
network.@switch_vlan[1].vlan='2'
network.@switch_vlan[1].ports='3 5t'
network.waneth=interface
network.waneth.proto='static'
network.waneth.ifname='eth0.2'
network.waneth.ipaddr='192.168.1.2'
network.waneth.netmask='255.255.255.0'
network.waneth.gateway='192.168.1.1'
network.waneth.dns='192.168.1.1'
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.hwmode='11g'
wireless.radio0.path='pci0000:00/0000:00:0e.0'
wireless.radio0.htmode='HT40'
wireless.radio0.txpower='16'
wireless.radio0.country='BE'
wireless.radio0.distance='7'
wireless.radio0.channel='3'
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device='radio0'
wireless.@wifi-iface[0].network='lan'
wireless.@wifi-iface[0].mode='ap'
wireless.@wifi-iface[0].encryption='psk-mixed'
wireless.@wifi-iface[0].key='PASSWORD'
wireless.@wifi-iface[0].ssid='SSIDNAME'
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'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
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.@zone[1].network='wan wan6 waneth'
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='fe80::/10'
firewall.@rule[3].src_port='547'
firewall.@rule[3].dest_ip='fe80::/10'
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.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@rule[7]=rule
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].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@redirect[0]=redirect
firewall.@redirect[0].target='DNAT'
firewall.@redirect[0].src='wan'
firewall.@redirect[0].dest='lan'
firewall.@redirect[0].proto='tcp'
firewall.@redirect[0].src_dport='11000-11999'
firewall.@redirect[0].dest_ip='192.168.2.2'
firewall.@redirect[0].dest_port='11000-11999'
firewall.@redirect[0].name='NASTorrent'
firewall.@redirect[1]=redirect
firewall.@redirect[1].target='DNAT'
firewall.@redirect[1].src='wan'
firewall.@redirect[1].dest='lan'
firewall.@redirect[1].proto='tcp'
firewall.@redirect[1].dest_ip='192.168.2.2'
firewall.@redirect[1].dest_port='21'
firewall.@redirect[1].name='NASFTP'
firewall.@redirect[1].src_dport='21'
firewall.@redirect[2]=redirect
firewall.@redirect[2].name='HTTP Transparent Proxy Redirect'
firewall.@redirect[2].src='lan'
firewall.@redirect[2].proto='tcp'
firewall.@redirect[2].src_dport='80'
firewall.@redirect[2].src_dip='!192.168.2.1'
firewall.@redirect[2].dest_ip='192.168.2.1'
firewall.@redirect[2].dest='lan'
firewall.@redirect[2].dest_port='8118'
firewall.@redirect[3]=redirect
firewall.@redirect[3].name='HTTPS Transparent Proxy Redirect'
firewall.@redirect[3].src='lan'
firewall.@redirect[3].proto='tcp'
firewall.@redirect[3].src_dport='443'
firewall.@redirect[3].src_dip='!192.168.2.1'
firewall.@redirect[3].dest_ip='192.168.2.1'
firewall.@redirect[3].dest='lan'
firewall.@redirect[3].dest_port='8118'
firewall.@redirect[3].enabled='0'
firewall.@redirect[4]=redirect
firewall.@redirect[4].name='HTTP Proxy for VPN'
firewall.@redirect[4].src='vpn_corbeau'
firewall.@redirect[4].proto='tcp'
firewall.@redirect[4].src_dport='80'
firewall.@redirect[4].src_dip='!192.168.2.1'
firewall.@redirect[4].dest_ip='192.168.2.1'
firewall.@redirect[4].dest='lan'
firewall.@redirect[4].dest_port='8118'
firewall.@redirect[4].enabled='0'
firewall.Allow_OpenVPN_Inbound=rule
firewall.Allow_OpenVPN_Inbound.target='ACCEPT'
firewall.Allow_OpenVPN_Inbound.src='*'
firewall.Allow_OpenVPN_Inbound.dest_port='1194'
firewall.Allow_OpenVPN_Inbound.name='Allow_OpenVPN_Inbound'
firewall.Allow_OpenVPN_Inbound.proto='udp'
firewall.vpn_corbeau=zone
firewall.vpn_corbeau.name='vpn_corbeau'
firewall.vpn_corbeau.network='vpn0'
firewall.vpn_corbeau.input='ACCEPT'
firewall.vpn_corbeau.forward='REJECT'
firewall.vpn_corbeau.output='ACCEPT'
firewall.vpn_corbeau.masq='1'
firewall.vpn_corbeau_forwarding_lan_in=forwarding
firewall.vpn_corbeau_forwarding_lan_in.src='vpn_corbeau'
firewall.vpn_corbeau_forwarding_lan_in.dest='lan'
firewall.vpn_corbeau_forwarding_lan_out=forwarding
firewall.vpn_corbeau_forwarding_lan_out.src='lan'
firewall.vpn_corbeau_forwarding_lan_out.dest='vpn_corbeau'
firewall.vpn_corbeau_forwarding_wan=forwarding
firewall.vpn_corbeau_forwarding_wan.src='vpn_corbeau'
firewall.vpn_corbeau_forwarding_wan.dest='wan'
firewall.@redirect[5]=redirect
firewall.@redirect[5].target='DNAT'
firewall.@redirect[5].proto='tcp'
firewall.@redirect[5].src_dport='80'
firewall.@redirect[5].dest_ip='192.168.2.2'
firewall.@redirect[5].dest_port='80'
firewall.@redirect[5].src='wan'
firewall.@redirect[5].dest='lan'
firewall.@redirect[5].name='NASWeb'
firewall.@rule[9]=rule
firewall.@rule[9].src='lan'
firewall.@rule[9].dest='wan'
firewall.@rule[9].name='Block_Inet'
firewall.@rule[9].enabled='0'
firewall.@rule[9].target='REJECT'

You'll find I have a 2nd vlan which I needed to create in order to daisy chain this router to my new net provider's router. Mine didn't have a VDSL port (only ADSL!), but I still wanted to use mine for FW, etc. So in short, I converted one of my regular ETH port to an internet eth port. All of my local lan is connected to MY router. My provider's router only send internet to my router...

Regardless, I know this special setup of daisy chain has nothing to do with my problem, since I always had this problem even when I had only my router with my previous inet provider (using adsl). Plus, all my lan is on my router, and nothing is connected to the provider's as I said...

That's a lot of information.. Hope it's not too much to go through...

@ [lleachii] : sorry, you're right. I should of just send one reply. Apologies. So, you think the only bottle neck would be the CPU on my router ?

Thanks :slight_smile:

I would suggest to raise that a lot.
Other than that is looks like the network is able to pass more than the traffic that you see when transfering the files. You can experiment with the window size and reach better numbers, but anyway that is already evidence that wifi/switch is not the culprit here.

2 Likes

This is no longer necessary with current release. The install is clean. Don't keep settings when upgrading just make a note or copy and start from a clean install

Alright, perhaps I'll try an upgrade / fresh install of Openwrt later on next week, but for sure will backup everything up first. Can I always backtrack version if need be ?

Has for my wireless.radio0.distance='7', how much is "a lot" [trendy] ? Is this really gonna change anything ? I can try for the hell of it at say 15... ?

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

If this is the Distance Optimization setting...you need to read this:

Especially this part:

I've also found that values < 100 do not work on OpenWrt.

Okay, well, before at distance 7, I had:

[raven@Papounix ~]$ iperf -c 192.168.2.2 -r -f MBytes
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 0.08 MByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.2, TCP port 5001
TCP window size: 0.11 MByte (default)
------------------------------------------------------------
[  5] local 192.168.2.183 port 60640 connected with 192.168.2.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.2 sec  26.4 MBytes  2.59 MBytes/sec
[  4] local 192.168.2.183 port 5001 connected with 192.168.2.2 port 58322
[  4]  0.0-10.1 sec  27.1 MBytes  2.69 MBytes/sec

I've placed in 100 as the distance in Luci, saved and applied. Redid the iperf test:

root@router:~# uci show wireless | grep distance
wireless.radio0.distance='100'

[raven@Papounix ~]$ iperf -c 192.168.2.2 -r -f MBytes
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 0.08 MByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.2, TCP port 5001
TCP window size: 0.10 MByte (default)
------------------------------------------------------------
[  5] local 192.168.2.183 port 60798 connected with 192.168.2.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.5 sec  30.8 MBytes  2.92 MBytes/sec
[  4] local 192.168.2.183 port 5001 connected with 192.168.2.2 port 34304
[  4]  0.0-10.1 sec  31.4 MBytes  3.11 MBytes/sec

About the same results. Would I need to perhaps reboot the router ?

No, they improved...but can you try this on Wired instead (to eliminate this as a wireless issue)???

If you Saved and Applied, no.

Yes.

Well, I was able to try a wired connection using my Macbook laptop. Here are the results from it:

macbook:~ raven$ iperf -c 192.168.2.2 -r -f MBytes
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 0.12 MByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.2, TCP port 5001
TCP window size: 0.13 MByte (default)
------------------------------------------------------------
[  5] local 192.168.2.101 port 60919 connected with 192.168.2.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec  1110 MBytes   111 MBytes/sec
[  5] local 192.168.2.101 port 5001 connected with 192.168.2.2 port 39666
[  5]  0.0-10.0 sec  1108 MBytes   111 MBytes/sec

Seems about 40x faster...

Should I just close this case and have the verdict to be: Nothing to do! Router's CPU is the limitation! ?

There is 10x rate difference in your wifi iperf test.

Apologies mbo2o: I don't understand what you mean, and I think its because I dont properly understand the output of iperf...

You are talking about the B-directrional simultaneous test I did earlier:

...
[  5]  0.0-10.2 sec  38.5 MBytes  31.5 Mbits/sec
[  4]  0.0-10.7 sec  3.62 MBytes  2.84 Mbits/sec

?

What do you mean by there's a There is 10x rate difference ? I see that you've simply divided 31.5 by 2.84, but do not understand why.... (again cause I dont understand output of iperf properly probably.)

I'd say wireless was the limitation. Your device has to send the packet across the bridge twice for WiFi, and 0 times for a LAN wired connection.

...and BTW, I totaled a ~36x improvement on wired over wireless.

Is that normal ? And how did you determined that ? Can I, and should I fix this ?

The iperf test is reporting the speed over consecutive ten second periods.

It seems to have started at around 38 then slowed down to 2.8

2.8 is similar to the speed achieved while transfering large files in your realtime graph. This suggests CPU bottleneck on your router.

1 Like

Some tests are in Mbits/s others in Mbytes/s. Keep them the same for better understanding.
You had 4Mbits/s peak in the first post.
iwinfo reports about 94Mbits/s speed (best case scenario, not applicable though)
first iperf reported 40Mbits/s and 27Mbits/s (pretty feasible)
Before raising the distance you had ~2,55Mbytes/s =21Mbits/s and Raising the distance to 100 gives you ~3Mbytes/s= 24Mbits/sec both ways. That's an improvement.
Wired iperf gives you 111Mbytes/s=888Mbits/s (very close to theoretical speed)

Experimenting a bit with the window option and UDP can give you optimized results.
However it seems to me that your bottleneck is CPU (you can verify that by running top when you transfer the files) and the bus between wired switch and wireless device.

As @mbo2o suggested, go ahead and upgrade the OpenWrt version, it might help things and will definitely keep you secure from vulnerabilities.

2 Likes

I don't think the current release will achieve higher speeds but is obviously secure and more stable

1 Like
  • Yes (and it indicates the CPU cannot handle the throughput - running top as @trendy noted would show you more clearly)
  • Easy - you have an Ethernet LAN and a WiFi connected to it
  • Fix what??? (You can get a router with a faster CPU, though)

Okay sorry lleachii. I miss-read you device has to send.... I understand better now.

Guess I'll still check in the coming weeks to update OpenWRT on it, and see if it changes anything. Regardless, I'll also start to check for a new router. Guess I shouldn't ask for a recommandation on this post, as I'm sure they are plenty of other posts for that question :wink:

An example of top's output while copying a 5GB ISO file....

Mem: 35656K used, 24664K free, 752K shrd, 2416K buff, 12008K cached
CPU:   0% usr   0% sys   0% nic  58% idle   0% io   0% irq  40% sirq
Load average: 0.05 0.13 0.29 2/58 4439
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 4401  3892 root     R     1360   2%   1% top
 1648     1 root     S     7380  12%   0% /sbin/dsl_cpe_control -i05_00_04_00_4
  943     1 root     S     1564   3%   0% /sbin/netifd
 3891  1142 root     S     1216   2%   0% /usr/sbin/dropbear -F -P /var/run/dro
   40     2 root     SW       0   0%   0% [kworker/0:1]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
 1288     1 root     S     3224   5%   0% /usr/sbin/openvpn --syslog openvpn(Co
 3117     1 root     S     1644   3%   0% /usr/sbin/hostapd -P /var/run/wifi-ph
 4439   943 root     S     1628   3%   0% /usr/sbin/pppd nodetach ipparam wan i
 1247     1 root     S     1624   3%   0% /usr/sbin/uhttpd -f -h /www -r router
  905     1 root     S     1528   3%   0% /sbin/rpcd
    1     0 root     S     1404   2%   0% /sbin/procd
 1704     1 root     S     1360   2%   0% /usr/sbin/ntpd -n -S /usr/sbin/ntpd-h
 1114     1 root     S     1360   2%   0% /usr/sbin/crond -f -c /etc/crontabs -
 3892  3891 root     S     1360   2%   0% -ash
  975     1 root     S     1168   2%   0% /usr/sbin/odhcpd
 1142     1 root     S     1148   2%   0% /usr/sbin/dropbear -F -P /var/run/dro
  896     1 root     S     1040   2%   0% /sbin/logd -S 16
 1309     1 nobody   S      944   2%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq
^C222  1220 nobody   S      900   1%   0% /usr/sbin/tinyproxy -c /var/etc/tinyp

So... not sure what I'm supposed to see here.. I left the copy going for quite some time before checking top... All I can as the difference in top when NOT copying data is my CPU idle time which is at around 87% idle instead of 58% ...

...

  • That's what you're looking for.
  • Where is your NAS? (On LAN...on WAN...on WiFi???)

Do you ever see kworker or ksoftirqd rise?

My NAS is connected via LAN(eth) to my router, and my desktop is connected via Wifi to my router.

As for the kworker or ksoftirqd, I see them showing up once in a while while it refreshes, but %CPU isn't moving for both of them. It pretty much stays at around 0% ...

1 Like