TP-LINK TL-WR802N ( MT76 ) tcp problems with iperf3

Hi,
Making experiments with two tp-link tl-wr802n, I found a "weird" issue.

The experiment is the following:

  • #1 is hosting an access point;
  • #2 is connecting to this access point;

I put a iperf server on #1 and #2, and test from the other one, using first UDP (-u flag):

root@OpenWrt:~# iperf3 -u -b20M -c 192.168.1.1 -p 5200
Connecting to host 192.168.1.1, port 5200
[  5] local 192.168.1.223 port 51980 connected to 192.168.1.1 port 5200
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  2.38 MBytes  20.0 Mbits/sec  1726
[  5]   1.00-2.00   sec  2.38 MBytes  20.0 Mbits/sec  1727
[  5]   2.00-3.00   sec  2.38 MBytes  20.0 Mbits/sec  1726
[  5]   3.00-4.00   sec  2.38 MBytes  20.0 Mbits/sec  1726
[  5]   4.00-5.00   sec  2.38 MBytes  20.0 Mbits/sec  1727
[  5]   5.00-6.00   sec  2.38 MBytes  20.0 Mbits/sec  1727
[  5]   6.00-7.00   sec  2.38 MBytes  20.0 Mbits/sec  1726
[  5]   7.00-8.00   sec  2.38 MBytes  20.0 Mbits/sec  1727
[  5]   8.00-9.00   sec  2.38 MBytes  20.0 Mbits/sec  1726
[  5]   9.00-10.00  sec  2.36 MBytes  19.8 Mbits/sec  1707  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  23.8 MBytes  20.0 Mbits/sec  0.000 ms  0/17245 (0%)  sender
[  5]   0.00-10.05  sec  23.8 MBytes  19.9 Mbits/sec  1.481 ms  8/17244 (0.046%)  receiver

iperf Done.

The other way around:

root@OpenWrt:~# iperf3 -u -b20M -c 192.168.1.223 -p 5201                                                                                                                                                                          
Connecting to host 192.168.1.223, port 5201                                                                                                                                                                                       
[  5] local 192.168.1.1 port 54542 connected to 192.168.1.223 port 5201                                                                                                                                                           
[ ID] Interval           Transfer     Bitrate         Total Datagrams                                                                                                                                                             
[  5]   0.00-1.00   sec  2.38 MBytes  20.0 Mbits/sec  1726                                                                                                                                                                        
[  5]   1.00-2.00   sec  2.38 MBytes  20.0 Mbits/sec  1726                                                                                                                                                                        
[  5]   2.00-3.00   sec  2.38 MBytes  20.0 Mbits/sec  1727                                                                                                                                                                        
[  5]   3.00-4.00   sec  2.38 MBytes  20.0 Mbits/sec  1727                                                                                                                                                                        
[  5]   4.00-5.00   sec  2.38 MBytes  20.0 Mbits/sec  1726                                                                                                                                                                        
[  5]   5.00-6.00   sec  2.38 MBytes  20.0 Mbits/sec  1727                                                                                                                                                                        
[  5]   6.00-7.00   sec  2.38 MBytes  20.0 Mbits/sec  1726                                                                                                                                                                        
[  5]   7.00-8.00   sec  2.38 MBytes  20.0 Mbits/sec  1727                                                                                                                                                                        
[  5]   8.00-9.00   sec  2.38 MBytes  20.0 Mbits/sec  1726                                                                                                                                                                        
[  5]   9.00-10.00  sec  2.38 MBytes  20.0 Mbits/sec  1727                                                                                                                                                                        
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                                                                                                                 
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams                                                                                                                                              
[  5]   0.00-10.00  sec  23.8 MBytes  20.0 Mbits/sec  0.000 ms  0/17265 (0%)  sender                                                                                                                                              
[  5]   0.00-10.04  sec  23.8 MBytes  19.9 Mbits/sec  0.315 ms  0/17262 (0%)  receiver                                                                                                                                            
                                                                                                                                                                                                                                  
iperf Done.                                                                                                                                                                                                                       
root@OpenWrt:~#     

Now, comes the interesting thing: as soon as I remove the -u flag, using therefore TCP, the connection immediatly drops:

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.1, port 44530
[  5] local 192.168.1.223 port 5201 connected to 192.168.1.1 port 44532
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  21.2 KBytes   174 Kbits/sec
[  5]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   2.00-3.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
[  5]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.03  sec  21.2 KBytes  17.3 Kbits/sec                  receiver

It "works" (well, it doesn't work in facts) both way: from #1 to #2 or to #2 from #1, as soon as I drop the -u flag it breaks.

In the wpa_supplicant log, I can see many wlan0: CTRL-EVENT-BEACON-LOSS when using TCP with iperf3, but not with UDP.

So, what could be the problem? I mean, even with an abyssal rate (0.1Mbit/s), it breaks, so surely there is a problem somewhere. What would be the next steps to debug this problem?

I'm using a LEDE/OpenWrt snapshot, r5705-88a2cff, from Support for TP-LINK TL-WR802N V4

Thanks,

Rémy

edit: removing the "-b" from the TCP tests changes nothing (the -b is not used when using TCP)