Solved Wifi usb is slow on 12.1 and 12.2

Hi, I'm using FreeBSD 12.1p10 (update: I've updated to 12.2 to see if the changes to the wifi stuff has some impact but same results). I have an usb wifi device that is TP-LINK WN725N. This in short is a Realtek 802.11n NIC (RTL8188EU). This chipset is supported by rtwn(4).

I've found that the performance is weak. My ISP Internet speed is 50 Mbps down and 5 Mbps up. Seems the modem that my ISP provides, supports 802.11n but for any reason they have configured as 802.11g (54 Mbps) and this is what I'm getting at about 1.2 mt distance from the modem (yes, at that distance I can use cable and I do, but I'll move my PC and that's why I'm needing wifi):

FreeBSD 12.1p10 and 12.2
Using a USB 2.0 port:
Download: 34.6 Mbps to 37.7Mbps
Upload: 4.8 Mbps

Using a USB 3.0 port:
Download: 4.4 Mbps
Upload: 4.9 Mbps

And just for reference this is in the same machine but with a different OS:

Windows 10
Using a USB 2.0
Download: 49.2 Mbps
Upload: 5.3 Mbps
Using a USB 3.0
Download: 26.8 Mbps
Upload: 5.2 Mbps

AS you can see USB 3.0 performance on both OS are not desirable, while I'll like to understand that, at the moment I'll like to get good performance on FreeBSD (usb 2.0 is fine).

How can I get better performance for that device on FreeBSD? Maybe I'm missing some kind of configuration? This is my configuration for reference:

Bash:
➜ ~ sysctl net.wlan.devices
net.wlan.devices: rtwn0

/boot/loader.conf
Code:
if_rtwn_usb_load="YES"
legal.realtek.license_ack=1

/etc/rc.conf
Code:
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
defaultrouter="192.168.1.254"

/etc/wpa_supplicant.conf
Code:
network={
ssid="HOME-D0AC"
psk="MYPASSWORD"
}

Bash:
➜  ~ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether d0:37:45:b4:eb:e5
    inet 192.168.1.69 netmask 0xffffff00 broadcast 192.168.1.255
    groups: wlan
    ssid HOME-D0AC channel 11 (2462 MHz 11g ht/20) bssid e0:88:5d:c9:d0:ac
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF TKIP 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc
    wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Upgrade the system to 12.2 but same/similar results.
Now I can get a download of 37.7 Mbps

Just a small change to the output of ifconfig:

Code:
➜  ~ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether d0:37:45:b4:eb:e5
    inet 192.168.1.69 netmask 0xffffff00 broadcast 192.168.1.255
    groups: wlan
    ssid HOME-D0AC channel 11 (2462 MHz 11g ht/20) bssid e0:88:5d:c9:d0:ac
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF TKIP 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc
    -uapsd wme roaming MANUAL
    parent interface: rtwn0
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Hello, Yaazkal

when i was new to FreeBSD i asked myself the same question and found out that rtwn(4) and others currently only supports 11a and 11g.

I'm sitting here now with a Ralink RT5392 (only 11g card and wanted to get rid of USB), got used to the 2.x MB/s and don't find it that bad.

BTW, should you have a modern cell phone, tethering maybe can help to reach higher speeds but also have some delay.

You can also change to 11a to get a better signal etc.. By adding mode 11a to ifconfig_wlan0="WPA SYNCDHCP"
 
when i was new to FreeBSD i asked myself the same question and found out that rtwn(4) and others currently only supports 11a and 11g.
Hi, thanks for the clarification. It was not clear for me. At least I didn't see that in the man page or any other document.

The TP-Link TL-WN725N only supports b/g/n so no 11a that I can use (I don't think that my ISP modem also supports 11a). I've checked on windows and it is effectively using 11n, that explain the speed difference.

What does "mode 11ng" means then?

Unfortunately 12.2 has no arrived with 11n support for rtwn if I understand this information correctly https://svnweb.freebsd.org/base?view=revision&revision=365670

I'll investigate about tethering, sounds interesting.

Thanks again !
 
Regarding the slower speeds with the USB 3.0 ports, it could possibly be related to interference from the USB3.0 port itself, here is a paper from Intel on the subject:

https://www.intel.co.uk/content/www...al-bus/usb3-frequency-interference-paper.html

Nonetheless, I cannot get anything more than ~900KB/s download from an Edimax Nano Adapter (Realtek RTL8188CUS) with the FreeBSD rtwn driver, even though under Win10 using the same hardware it can easily reach around 3MB/s.
 
Back
Top