morrownr / USB-WiFi

USB WiFi Adapter Information for Linux
2.4k stars 161 forks source link

Slow tx rate for CF-952AX and CF-953AX under AP mode #316

Closed fishBone000 closed 8 months ago

fishBone000 commented 9 months ago

I tried to bring them up to AP mode with your conf file (commit 80721a), with bridge and wpa disabled.
After bringing them up, I tested the transmit rate by connecting my pad to it and running nc.
The problem is, although my pad says both APs are in WIFI6 mode, iw wlanX info shows the AP is operating under 80MHz, the tx rate of my APs are slow (around 1MB/s), while rx rate is fast (30~40MB/s).
I tried to search through the issues but found nothing so far.
Note all 3 USB ports on my laptop are USB 2, although one of them is blue and I do have USB 3 hub listed in lsusb, but all devices connected to the 'fake' USB 3 port are actually connected to USB 2.

fishBone000 commented 9 months ago

Alright, here comes some funny stuff:
The 'nc' tests were performed on 'termux' on my pad. Results weren't good, but when I put 'termux' to background I noticed the transfer rate meter on my pad goes from ~800K/s to 12M/s, then drops to 0.00K/s due to broken connection, most probably because I put 'termux' to background.
So I tried iperf3 over nc, and the result is fine:

Accepted connection from 192.168.23.2, port 57254
[  5] local 192.168.23.1 port 5201 connected to 192.168.23.2 port 57258
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  22.7 MBytes   191 Mbits/sec    0    445 KBytes
[  5]   1.00-2.00   sec  21.7 MBytes   182 Mbits/sec    0    468 KBytes
[  5]   2.00-3.00   sec  22.2 MBytes   187 Mbits/sec    0    468 KBytes
[  5]   3.00-4.00   sec  21.5 MBytes   180 Mbits/sec    0    495 KBytes
[  5]   4.00-5.00   sec  19.1 MBytes   161 Mbits/sec    0    495 KBytes
[  5]   5.00-6.00   sec  16.2 MBytes   136 Mbits/sec    0    495 KBytes
[  5]   6.00-7.00   sec  17.1 MBytes   143 Mbits/sec    0    495 KBytes
[  5]   7.00-8.00   sec  17.1 MBytes   143 Mbits/sec    0    495 KBytes
[  5]   8.00-9.00   sec  16.3 MBytes   137 Mbits/sec    0    495 KBytes
[  5]   9.00-10.00  sec  21.6 MBytes   181 Mbits/sec    0    495 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   196 MBytes   164 Mbits/sec    0             sender

I used -R flag on my pad so this is the result of transmission from adapter to my pad.
Hah, I always thought nc is capable of doing speed tests.

Anyhow, there's another funny stuff:
I heard sharp but not strong noises in my wired earphone when performing tests, that was just an LOL moment.

This issue should be closed soon after I run more tests.

fishBone000 commented 8 months ago

I think it's netcat's problem, when I run cat /dev/zero | pv -cN zero > /dev/null, pv (pipe viewer, used as speed meter here) says the speed is around 3.4GiB/s.
But when I do cat /dev/zero | pv -cN zero | nc -lp 4000 and nc localhost 4000 | pv -cN nc > /dev/null, pv says the speed is around 400MiB/s.

Although there's still some weird stuff:

  1. nc from laptop to pad is just too slow (~1MB/s), even if nc slows down the rate when acting as a relay in chained pipes, this is just way too slow.
  2. nc from pad to laptop is just fine, although nc is run on termux on my pad, plus the version of my pad's nc is diff from the one on my laptop.

Anyways now it seems nc indeed has some problem, so iperf3 is preferred over 'nc'.

Off topic: damn it took me days to realize it, if I took more days to realize it or gave up half way, I had already refunded all my adapters, making me think that those CF adapters all have problems.