Iperf gives weird Results

Hello, I try to use iperf3 to measure my network speeds. I am especially interested in measuring mesh wifi vs. a wifi access point connected by cable.

I installed iperf3 both on my OpenWRT 23.05 Linksys WRT1900ACS router and my Macbook. Then I run iperf like this on OpenWRT:

root@openwrt:~# iperf3 -s
Server listening on 5201 (test #1)
Accepted connection from, port 63441
[  5] local port 5201 connected to port 63442
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.10   sec  3.88 MBytes  29.5 Mbits/sec
[  5]   1.10-2.07   sec  3.75 MBytes  32.5 Mbits/sec
[  5]   2.07-3.05   sec  3.75 MBytes  32.1 Mbits/sec
[  5]   3.05-4.08   sec  4.00 MBytes  32.5 Mbits/sec
[  5]   4.08-5.04   sec  3.50 MBytes  30.6 Mbits/sec
[  5]   5.04-6.01   sec  3.75 MBytes  32.3 Mbits/sec
[  5]   6.01-7.04   sec  4.00 MBytes  32.7 Mbits/sec
[  5]   7.04-8.03   sec  3.12 MBytes  26.4 Mbits/sec
[  5]   8.03-9.07   sec  3.88 MBytes  31.3 Mbits/sec
[  5]   9.07-10.02  sec  3.62 MBytes  31.8 Mbits/sec
[  5]  10.02-10.25  sec  1.00 MBytes  36.6 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.25  sec  38.2 MBytes  31.3 Mbits/sec                  receiver

And this is the client:

╰─ iperf3 -c                                                                       ─╯
Connecting to host, port 5201
[  5] local port 63442 connected to port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  6.08 MBytes  51.0 Mbits/sec
[  5]   1.00-2.00   sec  3.62 MBytes  30.4 Mbits/sec
[  5]   2.00-3.00   sec  3.79 MBytes  31.8 Mbits/sec
[  5]   3.00-4.00   sec  4.11 MBytes  34.5 Mbits/sec
[  5]   4.00-5.00   sec  3.31 MBytes  27.7 Mbits/sec
[  5]   5.00-6.00   sec  4.01 MBytes  33.7 Mbits/sec
[  5]   6.00-7.00   sec  3.95 MBytes  33.1 Mbits/sec
[  5]   7.00-8.00   sec  2.08 MBytes  17.5 Mbits/sec
[  5]   8.00-9.00   sec  4.87 MBytes  40.8 Mbits/sec
[  5]   9.00-10.00  sec  3.48 MBytes  29.2 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  39.3 MBytes  33.0 Mbits/sec                  sender
[  5]   0.00-10.25  sec  38.2 MBytes  31.3 Mbits/sec                  receiver

iperf Done.

This result is ultra weird, my repeater has a 600 Mbit connection to OpenWRT and results don't get better by connecting by LAN. Also the Google speedtest to the internet delivers 300 Mbit. Both my router and Macbook have low CPU load while measuring. Even if I connect my laptop directly with a cable to the router I only get about 90 Mbit.

What am I doing wrong? Why is iperf delivering lower results than Google speedtest?

Running iperf on the router consumes a lot of CPU cycles therefore slowing the router down. Not saying this accounts for the whole speed loss

When I test wifi throughput I test between en laptop connected via the LAN and a laptop on wifi or my android phone running magic iperf.

I also test wifi with multistream e.g. with -P 8 (I was told that that gives a more consistent and realistic number) .

I also test a little bit longer than the default 10 seconds e.g. -t 30

Of course I make sure the wifi spectrum is clean

1 Like

I think this thing simply has rotten WiFi (it probably still is a decent wired-only router)... Marvel WiFi was IIRC sold of to some one else and promptly forgotten...

1 Like

Multistream and longer time did not help at all. Also testing it with an iperf server on a Raspberry Pi connected to the OpenWRT LAN port does not help.

FYI: I do not use the Linksys WRT1900ACS wifi, I connect to a Fritzbox and Fritzbox repeater. But even without wifi, directly connecting to the OpenWRT Linksys I only get 90 Mbit apparently it was the cable, with a fresh cat 7 cable I get 340 Mbit on the LAN port of the OpenWRT Linksys.

The big question is why the Google speedtest delivers close to 300 Mbit through wifi, but iperf 40.

What is the google speedtest (could you post an URL, please)?

Ah, what was the consequence, link with 100 Mbps (fast ethernet) or simply many ethernet errors?

The Google speedtest is this: https://support.google.com/websearch/answer/6283840

And yes, it was an old unshielded patchcable that only did 100 Mbit, though the connection said gigabit.

But there also seems to be something wrong with the Fritzbox, maybe some kind of traffic shaping. If I connect by LAN to the Fritzbox and iperf the Fritzbox I get 300 Mbit, if I iperf the Linksys one hop away on Fritzboxes WAN port I get 45 Mbit.

1 Like

You operate the Fritzbox under FritzOS or under OpenWrt? What model of Fritzbox are you using?

It is a 7590 with stock firmware. I use OpenWRT for multiwan failover and wireguard.

The two tests are quite different:

  • The Google speed test runs between your computer and a Google speedtest server somewhere. This means the traffic goes through your router, but does not terminate on it.

  • The iPerf tests that you are running go between your computer and your router. This means that the traffic terminates on your router (either source or sink).

Most consumer grade routers have the ability to route traffic very rapidly thanks to specialized hardware that is optimized specifically for routing. But, because it is highly optimized for routing and not general purpose computing, that same hardware is not designed to be able to rapidly source or sink the traffic itself, so when you run iPerf on the router, the bandwidth will be limited by the speed at which the SoC can do general purpose computing. You can think of it as mail through the postal mail system (i.e. 'snail mail') -- the postal service is really good at moving parcels through their system, but if they were tasked with opening, reading, and re-sealing each piece of mail, you'd see a much slower flow of mail through the system.

As a general rule, if you want to run iPerf (or any bandwidth measurement tool) to understand the throughput of routers/switches/APs, you need to run the traffic through the device under test, using two devices capable of 'general purpose' computing (i.e. laptops/desktops, reasonably powerful SBCs, even phones/tablets) as the endpoints, also taking into account any bandwidth bottlenecks that these may have (for example, a Pi4 is fast and can easily saturate a gigabit ethernet link, but the wifi on the device is terrible and will significantly reduce the measured bandwidth if the Pi4 is used via wifi for a test).

Ah, what DSL link did you use it at last? VDSL2 50/10 by chance? FritzOS has some way to traffic shape that might have been set in the past and that might still be active somehow.

I do simple QoS, SSH and VoIP get high priority, bittorrent low. Nothing fancy.

My Setup is like this:

  • Fritzbox 7590 does wifi, DECT VoIP, fax, smart home - my regular clients connect here, WAN goes to OpenWRT
  • Fritz Repeater 3000 - Wifi mesh for the home office, connects to Fritzbox via wifi
  • OpenWRT does multiwan failover and wireguard VPN - simply encrypts and routes to the two WAN ports
  • Cable Modem with a primary 300 Mbit line - wan1 on OpenWRT
  • LTE Modem as backup - wan2 on OpenWRT

I actually wanted to measure the speed gain when I connect the repeater via ethernet cable to the Fritzbox.

Ah, the fritzbox essentially operates as AP then? I guess the easiest would be to hook up to the primary router via a LAN port, but that would require disabling the Fritzbox's DHCP server and might not work with the VoIP functionality... However the 7590 generation should be fast enough to route/NAT traffic at close to 1 Gbps WAN line rate. I really wonder whether you not somehow enabled the Fritzbox's traffic shaping somehow? (Last time I used FritzOS was beginning of the 2000s, not sure the few things I still remember are still applicable, but I did run strace on a recent dsl deamon from AVM and it looks like they do use linux traffic shapers like HTB, at least under some conditions).

OK, thank you all for the tipps, I will try to fiddle around more next week.

OK, I found the issue.

It is actually not an OpenWRT problem at all. The Fritzbox does traffic shaping. I had entered the speed of my internet connection (300 down, 50 up) in the Fritzbox, and apparently it shapes the traffic to 50 Mbit if it goes both ways. If I enter 1000 Mbit as connection speed I get around 500 Mbit iperf to the OpenWRT box instead of the 50.

Sorry for the confusion, and thank you for the help.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.