Slow speed on USB tethering

Hey everyone,

I have a Xiaomi Mi WiFi Mini - device page - and I followed the Smartphone USB tethering guide to connect a TCL 20 R 5G (Android 11) to the router. kernel: [   23.409912] usb 1-1: new high-speed USB device number 2 using ehci-platform
kern.err kernel: [   23.569912] usb 1-1: device descriptor read/64, error -32 kernel: [   23.897443] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-101c0000.ehci-1, RNDIS device, XXX

It was pretty straightforward, but while I easily get speeds > 300mbps using either the phone directly, its (802.11ac 5GHz) wifi hotspot, or USB tethering with a computer, on the router's 802.11ac 5GHz network it tops at 100 or 110 mbps.

So, I'm basically getting 1/3 of the expected speed when using the router. It might be faster to just configure the router as a wifi repeater, which was not my plan. Both devices are USB 2.0, which should reach >300mbps easily (and it does, since I tested the USB tethering directly to a computer).

Can someone give me some light on why this may be happening, and hopefully suggest a solution to get the full throughput potential?

Thank you!

It's a MT7620 chip-- 580 MHz single core MIPS. Those really aren't built for triple digit speed.

What does the CPU load look like?

I understand it's not super powerful, but it's a WiFi AC router so it doesn't make much sense to me that it'd basically only be able to offer WiFi N speeds. It doesn't have any Gigabit ethernet ports, so in some scenarios that would be the expected top speed, true.

While doing a speed test, the load reaches values above 1 for a short time:

Could this be the saturation? Can I do something to reduce the load? I thought of turning it into a dumb AP (no DHCP, no NAT) but firstly, I failed to do it successfully, and secondly, I'm not sure it would make much of a difference.

then the routing is handled by your phone, which might actually be more powerful than your router.

1 Like

Yes that's worth trying. Make an unmanaged bridge with the phone usb0 and a wifi AP.

Can you guide me a bit on creating the unmanaged bridge? I'm trying to follow the Dumb AP guide, but I think I'm missing the part where I make the traffic go to usb0. I'm using LuCI to configure things.

I was able to bridge the interface: Basically, followed the Dumb AP guide I mentioned above, but in Network -> Interfaces -> Devices tab I edited the "br-lan" bridge device that's used by my lan interface and added "usb0" to the bridge ports - so now it lists eth0.1 and usb0 in the bridge ports.

I can now reach ~170mbps, up from ~110mbps. I think this confirms the CPU load hypotheses for the slow USB tethering speeds. If you have any more tips on reducing the load to get even higher speeds, let me know!

Thank you.

it's great that you managed to get up to 170mbps as in my tests a smaller mt7620 wasn't even able to reach 100mbps via usb-lan adapter

That's not the best way to do it, as the exiting LAN configuration of a static IP and DHCP server will be competing with the phone. Your clients may not always have Internet access if the router's DHCP server gives them the wrong configuration instead of the DHCP server in the phone.

I would make a new bridge on the wan side (call it br-wan) and have the phone and a wifi AP in it. This would be an AP with a separate SSID dedicated to direct connection with the phone. The router itself would also have a WAN link to the phone, so it can continue to operate lan->wan if you want.

I disabled the DHCP server on the LAN interface. It does have a static IP (which is useful to access the router's management), but I think that's unlikely to cause trouble.

From /etc/config/network:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'
	list ports 'usb0'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask ''
	option ip6assign '60'
	option ipaddr ''
	option gateway ''
	list dns ''

The wifi-ifaces in /etc/config/wireless:

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key '<redacted>'
	option ssid '<redacted>'

config wifi-iface 'wifinet1'
	option device 'radio0'
	option mode 'ap'
	option encryption 'psk2'
	option key '<redacted>'
	option network 'lan'
	option ssid '<redacted>'

And the LAN interface being ignored in /etc/config/dhcp:

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option ignore '1'

Do you see any issue with this?

No that can work.

You could run lan as a dhcp client then it will get an IP from the phone. As you're only needing this box as a very simple converter to provide better wifi than the phone itself does, you really should not need to log into OpenWrt any more.

That's true, but I'd rather keep it for the time being. If I notice any conflicts, I'll reconsider, but hopefully the LAN IP is outside the range of the DHCP server (I can't confirm that on the phone). Thank you!

FYI it seems Android 11 changes the DHCP range/gateway IP over time, so I should probably configure the router as a DHCP client as you suggested.