Waydroid network issues when mobile network has a low MTU

I am currently trying out a different mobile network provider and it turns out their LTE data connection has quite a low MTU. Their MTU is 1358. My existing provider has MTU 1500 so this never came up before. [Untrue statement, see next post.]

The MTU is automatically known and set on the wwan0 interface in PureOS on the Librem 5. Native application software works correctly with no apparent networking issues.

However, in Waydroid, apps experience severe networking issues with symptoms consistent with MTU issues. Many websites entirely fail to load in browser apps, or only load after very long delays. (Long enough that I would consider it worthwhile to go away and do something else rather than waiting.)

The problems in Waydroid go away as soon as I run ip link set eth0 mtu 1358 in the Waydroid shell, as you might predict, but surely this (non-persistent) workaround should not be necessary.

Without adjusting the MTU of the virtual Ethernet interface (i.e. leaving it at the default 1500, rather tahn running the command above to change it), I tried running ping -c1 -s 1331 to send 1359-byte packets to various addresses in the Waydroid shell, and I found that the first ping to any given host will receive the expected ICMP ‘Fragmentation needed’ response. In addition, ip route get will show that the cached path MTU to that host will be updated to reflect the discovered path MTU. The cached path MTU also gets updated when addresses are accessed within a web browser running in Waydroid. Yet, the browser still cannot load things, as though it is ignoring (or not aware of) the now-known path MTU.

I don’t think I’m going to get to the bottom of this.

As a workaround, I think I’ll try to write a script to call ip link set eth0 mtu <mtu> in waydroid shell, cloning the MTU of whichever network interface is currently providing my Internet connection, and have it run when Waydroid starts and whenever the internet connection changes.

But I wondered whether anyone has experienced these kinds of problems before with Waydroid and whether anyone knows why it happens or can think of a better workaround or solution.

I did try setting the MTU of my Wi-Fi connection to 1358 to see if I could reproduce the same problems with a different network, but the problems only seem to arise when connected to the low-MTU LTE network.

2 Likes

I just now thought to check my facts about the MTU of my existing mobile network provider and I find that it is actually not 1500 as I previously thought, but 1380. So, whatever issue I’m having is apparently quite strongly related to the specific mobile network I’ve been trying out, rather than the MTU in and of itself.

2 Likes

Reminds me of the days when we would optimize our host traffic packet size to something other than 1500.

1 Like