Suddenly low bandwidth on iperf through onboard wifi access point

Creating a bug report/issue

I’m getting way lower network bandwidth than expected. Before I was able to saturate my internet bandwidth, now it can only do around 95~ in local. I was using fedora arm before and it was fine. I tested again with fedora arm (just replaced the sdcard with fedora one) and there was no issue.

Required Information

  • DietPi version | cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=20
G_DIETPI_VERSION_RC=1
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='applied'
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
bookworm 0
  • Kernel version | uname -a
Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | dpkg --print-architecture

arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

RPi 4 Model B (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)
    Official pi powersupply, I don’t know the further details
  • SD card used | (EG: SanDisk ultra)
    Samsung Evo Plus 128gb Microsd

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. Install iperf3
  2. run iperf3 -s to run the server
  3. run iperf3 -c <rpi ip> on the device connected to the access point.

Expected behaviour

I should be getting higher than 100Mbps

$ iw wlan0 link                                                                                                                                                                                                                  [21:58:25]
Connected to xx:xx:xx:xx:xx:xx (on wlan0)
	SSID: xxxx_AP
	freq: 5180
	RX: 659790522 bytes (680581 packets)
	TX: 1778273046 bytes (161651 packets)
	signal: -47 dBm
	rx bitrate: 433.3 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 1
	tx bitrate: 433.3 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 1

	bss flags:	short-slot-time
	dtim period:	2
	beacon int:	100

Actual behaviour

Getting 92~ Mbps in average in iperf3

$ iperf3 -c 10.3.141.1 -t 65 -Z                                                                                                                                                                                                  [21:58:28]
Connecting to host 10.3.141.1, port 5201
[  5] local 10.3.141.111 port 43436 connected to 10.3.141.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  12.6 MBytes   105 Mbits/sec    0    188 KBytes
[  5]   1.00-2.00   sec  11.7 MBytes  98.2 Mbits/sec    0    188 KBytes
[  5]   2.00-3.00   sec  11.3 MBytes  94.5 Mbits/sec    0    188 KBytes
[  5]   3.00-4.00   sec  10.3 MBytes  86.8 Mbits/sec    0    188 KBytes
[  5]   4.00-5.00   sec  10.8 MBytes  90.4 Mbits/sec    0    188 KBytes
[  5]   5.00-6.00   sec  9.55 MBytes  80.2 Mbits/sec    0    188 KBytes
[  5]   6.00-7.00   sec  11.1 MBytes  93.0 Mbits/sec    0    188 KBytes
[  5]   7.00-8.00   sec  11.6 MBytes  97.6 Mbits/sec    0    198 KBytes
[  5]   8.00-9.00   sec  11.4 MBytes  95.6 Mbits/sec    0    188 KBytes
[  5]   9.00-10.00  sec  10.1 MBytes  84.8 Mbits/sec    0    188 KBytes
[  5]  10.00-11.00  sec  9.31 MBytes  78.1 Mbits/sec    0    188 KBytes
[  5]  11.00-12.00  sec  11.4 MBytes  95.6 Mbits/sec    0    194 KBytes
[  5]  12.00-13.00  sec  10.8 MBytes  90.4 Mbits/sec    0    188 KBytes
^C[  5]  13.00-13.45  sec  5.82 MBytes   108 Mbits/sec    0    188 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-13.45  sec   148 MBytes  92.1 Mbits/sec    0             sender
[  5]   0.00-13.45  sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated

Extra details

Bellow is my hostapd config, I have tried different configurations, theres no difference, it only gets worse.

driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
auth_algs=1
wpa_key_mgmt=WPA-PSK
beacon_int=100
ssid=xxxxxx
channel=36
hw_mode=a
ieee80211n=0
wpa_passphrase=xxxxxxx
interface=wlan0
wpa=2
wpa_pairwise=CCMP
country_code=TR
ignore_broadcast_ssid=0

wmm_enabled=1
ieee80211n=1
require_ht=1
ht_capab=[MAX-AMSDU-3839][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]
ieee80211ac=1
require_vht=1
ieee80211d=0
ieee80211h=0
vht_capab=[MAX-AMSDU-3839][SHORT-GI-80]
vht_oper_chwidth=1
channel=36
vht_oper_centr_freq_seg0_idx=42
1 Like

did you tried to change channel to a higher level? Something around 100? Does it make a difference?

did you tried to change channel to a higher level? Something around 100? Does it make a difference?

Yes I have, it didnt make much of a difference. also 100 doesn’t work for me.

how does CPU utilization look if your do a speed test? Does it reach 100% utilization?

Here is how htop looks like while running iperf

and heres mpstat 1 output while running iperf:

dietpi@DietPi: ~
$ mpstat 1                                                                                                                                                                                                                       [22:46:43]
Linux 6.1.21-v8+ (DietPi) 	08/11/23 	_aarch64_	(4 CPU)

22:46:43     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
22:46:44     all    0.00    0.00    7.03    0.00    0.00    2.08    0.00    0.00    0.00   90.89
22:46:45     all    0.25    0.00   10.72    0.00    0.00    3.49    0.00    0.00    0.00   85.54
22:46:46     all    0.26    0.00    8.51    0.00    0.00    2.58    0.00    0.00    0.00   88.66
22:46:47     all    0.25    0.00   10.80    0.00    0.00    2.26    0.00    0.00    0.00   86.68
22:46:48     all    0.50    0.00   10.55    0.00    0.00    2.51    0.00    0.00    0.00   86.43
22:46:49     all    0.00    0.00    8.12    0.25    0.00    3.05    0.00    0.00    0.00   88.58
22:46:50     all    0.00    0.00    8.48    0.00    0.00    2.57    0.00    0.00    0.00   88.95
22:46:51     all    0.00    0.00    9.87    0.00    0.00    3.29    0.00    0.00    0.00   86.84
22:46:52     all    0.26    0.00    9.00    0.00    0.00    2.31    0.00    0.00    0.00   88.43
22:46:53     all    0.25    0.00    8.91    0.00    0.00    3.31    0.00    0.00    0.00   87.53
22:46:54     all    0.50    0.00    9.82    0.00    0.00    2.52    0.00    0.00    0.00   87.15
22:46:55     all    0.26    0.00    8.70    0.00    0.00    2.81    0.00    0.00    0.00   88.24
22:46:56     all    0.00    0.00    7.11    0.00    0.00    2.28    0.00    0.00    0.00   90.61

@MichaIng @trendy any ideas what could cause slowness on WiFi?

Please try to use channel=0 or remove the line entirely. It then chooses the least crowded channel automatically. I aim to remove it with next DietPi release from our default config when adding 5 GHz support to our hotspot options.

I see you enabled WiFi 4 and WiFi 5 + QoS.

If I understand it correctly, ht_capab enables and fine-tunes 40 MHz wide channels. As long as you are not in a very crowded WiFi area, I’d remove this and trust in defaults being sane.

Not sure what require_ht and require_vht is?

Require stations to support HT/VHT PHY (reject association if they do not)

Ah found it, “HT” == “High Throughput” and basically means WiFi 4, “VHT” == “Very High Throughput” == WiFi 5. WiFi 6 seems to not add something to that, but WiFi 7 adds “EHT” == “Extremely High Throughput”.

So you are enforcing WiFi 4 and WiFi 5 support with these two directives. I assume it means the clients must support those, not the AP. And then you disabled ieee80211d and ieee80211h which are both disabled by default.

Did you compare the hostapd.conf with the one used in Fedora? It is a standard software and should be mostly the same on both distros, probably a slightly newer version on Fedora. Does Fedora also use the RPi kernel sources, or mainline kernel?

Ah, can you check one thing:

apt policy firmware-brcm80211

I tried removing some options from hostapd and tried many combinations, they dont seem to help. I also tried channel=0, which didnt help.

Did you compare the hostapd.conf with the one used in Fedora? It is a standard software and should be mostly the same on both distros, probably a slightly newer version on Fedora. Does Fedora also use the RPi kernel sources, or mainline kernel?

I’m not sure which kernel fedora uses it seems to be mainline since I couldnt get cpu temperatures on that kernel. hostapd config is the same.

apt policy output:

$ apt policy firmware-brcm80211                                                                                                                                                                                                  [14:10:55]

firmware-brcm80211:
  Installed: 1:20230210-5~bpo11+1+rpt1
  Candidate: 1:20230210-5~bpo11+1+rpt1
  Version table:
 *** 1:20230210-5~bpo11+1+rpt1 500
        500 https://archive.raspberrypi.org/debian bullseye/main arm64 Packages
        100 /var/lib/dpkg/status
     20230210-5 500
        500 https://deb.debian.org/debian bookworm/non-free-firmware arm64 Packages

I tried downgrading firmware-brcm80211, it didnt work. and updated again later.

Okay, the firmware version is as intended the one from the RPi instead of the one from Debian, so that should be fine.

I think next we should find someone else to replicate it. And it would be great to test the same with RPi OS.

Ah and we should be able to install Debian’s mainline kernel build, the linux-image-arm64 package. An initramfs will be required and the /boot/config.txt adjusted to load the new kernel image, dtb and initramfs. I hope it works well with the bootloader from the RPi repo.

Sorry, am I supposed to do something right now? or do I just wait.

actually, we need to find out differences between our installation and fedora. If you have time, it might be helpful if you could check with plain RPI OS, running same kernel and configs.

Just because the bitrate says 433Mbps, do not expect such speeds. It is theoretical speed, not achievable in reality. Even access points with better radio can barely get half of what they advertise.
On top of that, the wifi of the Raspberry is nothing fancy and I would not consider it a reliable source for speedtests.
Maybe you’ll be able to get a bit higher with channel and distance optimization, but eventually not so much.

Yes you are right, but I was getting consistent saturation of my internet bandwidth on speedtests, when on dietpi I’m only getting 92mbps~. I’m supposed to get 110mbps, which is still achievable and reproducible when I just plug in the fedora arm sdcard.

here are iperf3 results from fedora arm on the pi: