Ubuntu 23.10(和 22.04/23.04)RTL USB wifi dongle 的下载速度比上传速度慢

Ubuntu 23.10(和 22.04/23.04)RTL USB wifi dongle 的下载速度比上传速度慢

我真的很困惑和沮丧。我尝试了很多在互联网上找到的东西。我真的不明白为什么我的桌面上的下载速度比我通过 USB wifi dongle 的上传速度慢。我尝试了 3 个不同的加密狗,每个都是 Realtek 驱动程序 (RTL*) 的某个版本。

这是我的速度测试输出:

$ speedtest
Retrieving speedtest.net configuration...
Testing from Ting Fiber (XXX.XXX.XXX.XXX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by CCT (Wiggins, CO) [104.29 km]: 12.241 ms
Testing download speed................................................................................
Download: 25.01 Mbit/s
Testing upload speed......................................................................................................
Upload: 113.27 Mbit/s

这是我尝试将文件从我的笔记本电脑传输到台式机,然后返回到同一个 wifi 网络(好吧,Google 网状网络)。

$ scp linux desktop.local:
linux                                                100%  134MB   3.3MB/s   00:41
$ scp desktop.local:linux .
linux                                                100%  134MB  15.2MB/s   00:08

您可以清楚地看到,到我的桌面的流量比来自我的桌面的流量慢大约 5 倍。这些scp命令正在我的笔记本电脑上执行。

关闭 Wifi Powersave 也没有帮助。不过,我又把它打开了。

以下是一些有用的数据:

$ lsmod | grep rtw
rtw88_8822bu           12288  0
rtw88_usb              24576  1 rtw88_8822bu
rtw88_8822b           229376  1 rtw88_8822bu
rtw88_core            356352  2 rtw88_usb,rtw88_8822b
mac80211             1724416  2 rtw88_core,rtw88_usb
cfg80211             1314816  2 rtw88_core,mac80211
$ sudo lshw -C network
  *-network
       description: Ethernet interface
       product: NetXtreme BCM5761 Gigabit Ethernet PCIe
       vendor: Broadcom Inc. and subsidiaries
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: enp5s0
       version: 10
       serial: bc:30:5b:9b:3a:f9
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=6.5.0-10-generic firmware=5761-v3.68 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:49 memory:f5de0000-f5deffff memory:f5df0000-f5dfffff
  *-network
       description: Wireless interface
       physical id: 5
       bus info: usb@1:3
       logical name: wlx90de80e6a2bf
       serial: 90:de:80:e6:a2:bf
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtw_8822bu driverversion=6.5.0-10-generic firmware=N/A ip=192.168.86.20 link=yes multicast=yes wireless=IEEE 802.11
$ iwconfig
...
wlx90de80e6a2bf  IEEE 802.11  ESSID:"HOMEWIFI"
          Mode:Managed  Frequency:5.745 GHz  Access Point: 24:05:88:36:76:99
          Bit Rate=390 Mb/s   Tx-Power=30 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=64/70  Signal level=-46 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:32   Missed beacon:0
...

我真的希望有人可以帮助解决这个问题。我没有主意并且非常沮丧。

编辑1:

$ speedtest
Retrieving speedtest.net configuration...
Testing from Ting Fiber (0.0.0.0)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Highline (Denver, CO) [17.76 km]: 25.325 ms
Testing download speed................................................................................
Download: 28.19 Mbit/s
Testing upload speed......................................................................................................
Upload: 117.28 Mbit/s
$ ifconfig | grep mtu
br-ed9e125ad585: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
enp6s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
veth381ed2f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
veth48a03b9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
vethe4c210c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
vethe4d9061: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
wlx90de80e6a2bf: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1492

答案1

检查您的 WiFi MTU,使用

ip link

或者

ip l | grep $(ip r | awk '/default/ {print $5}' ) | awk '{print $2, $4, $5}'

还要注意您的 WiFi 接口的名称。

(最大传输单元MTU)是单次网络传输中可以发送的最大数据包的大小。如果数据包超出了 MTU链路的容量,则必须将数据分割成多个数据包(分片)。这些多个数据包必须通过链路发送、接收、确认并在远端重新组装。如果您的链路配置错误,并且您必须对发送的每个数据包进行分段,则实际数据传输速率会下降。

以太网(有线)网络使用MTU1500 字节。

由于 WiFi 每个数据包的额外开销(8 字节 PPPoE 标头),WiFi 使用MTU1492。

MTU应该由 DHCP 服务器设置,检查路由器的配置。

您可以设置自己的MTU(设置不会在重新启动后保留)

sudo ip link set dev name mtu 1492

其中“name”是上面的接口名称。

这是一个例子:

walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
walt@squid:~(0)$   sudo ip link set dev wlxf46d04b1790f mtu 1492
[sudo] password for walt: 
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff

我的 WiFi“接口名称”是“ wlxf46d04b1790f”。

相关内容