Mobile network tethering limitation workaround

This post had been living in my head for a few years, and it is about time I wrote it down.

I once found myself in a situation where I had to use the 4G network on my laptop, and the obvious way to do it was to install the SIM card on my phone, enable mobile hotspot, and connect to the hotspot’s SSID on my laptop. However, there was a major limitation to the SIM card - a data usage cap. After exceeding the cap, while the phone could still enjoy unlimited data at a throttled speed, tethered traffic would be blocked entirely.

That made me think, how is it implemented? How does the network provider tell between tethered and non-tethered traffic at all?

Turns out it is related to the TTL field in Internet Protocol. While IPv4 RFC states that TTL is measured in seconds, it is measured in hops in reality. This value in the packet is set by the originating device, and the default value is usually a number like 64 or 128, which is also what the network provider (ISP) sees at their edge. If the packet comes from a tethered device, as there is an additional hop at the tethering device, the ISP will see a TTL value of 63 or 127, and think that it is tethered traffic.

Then it became obvious how to fix it. Modify the default TTL in your operating system with sudo sysctl -w net.ipv4.ip_default_ttl=65, and voilĂ .

Tags// , ,
More Reading