Unlimited mobile data on weekends*

Christmas is just around the corner... which means that in France it is the time of the year when mobile service carriers offer sweet deals. Here's what they came up with this year:

  • Bouygues Telecom: Unlimited calls/SMS/MMS + 20 GB of mobile data for 3.99€/month
  • Free Mobile: Unlimited calls/SMS/MMS + 50 GB of mobile data for 2.99€/month [1]
  • Sosh: Unlimited calls/SMS/MMS + 20 GB of mobile data for 9.99€/month

Now, one of these providers offers an option called Unlimited Internet data on Weekends for 5€/month. That seems nice at first, until you read the fine prints:

Internet usage in mainland France from a compatible mobile phone is not counted towards the data limit during weekends (except for multi-SIM option and tethering mode)

Not so nice anymore, isn't it... well, we'll see.

I enabled this option to see if the provider was actually enforcing this rule, or if this was just some words on paper. I setup a wifi access point on my Android phone to tether its 4G connection, joined the network from my computer and started downloading a 500MB file. Here's what my usage chart looked like after this (usage before was around 2.2GB):
I burned 2.76GB of my 20GB quota

Gosh, it appears my provider is actually enforcing the "no tethering" rule. But, how does it work? Fortunately, StackExchange has an answer listing some of the technical methods of detecting tethering. Among the different possibilities, the following one caught my eye:

Inspecting the network packets for their TTL (time to live)

Every network packet travelling across a TCP/IP network, like the internet, has a built-in time-to-live (TTL) set on it, so that in case there is a problem with that packet reaching its destination this will stop it travelling around the network forever clogging everything up.

The way this works is that the packet starts with a TTL number (say 128) set on it when it leaves the sending device (your phone, or laptop), and then every time that packet travels through a router of any kind (like your home broadband router, or a router at your ISP or phone company) that router subtracts one from the TTL (which would decrement the TTL to 127 in this example), the next router it travels through will in turn decrement the TTL again, and so on, if the TTL ever reaches zero then the router it's at discards the packet and doesn't transmit it again.

When your phone is tethering it acts like a router so, as the packet passes from your tethered laptop through your phone and onto the phone network, your phone will subtract "1" from the TTL to show that the packet has passed through its first router. The phone networks know what the expected TTLs from common devices are (for instance packets from an iPhone always start at a TTL of 64), and so they can spot when they're one less (or totally different) than they're expecting.

One way to work around this TTL check is to set the starting TTL value of IP packets coming from the computer to the default TTL value of the phone plus one.
Since Android is based on Linux, it is quite easy to get the default TTL value:

adb shell
bullhead:/ $ cat /proc/sys/net/ipv4/ip_default_ttl
64

Changing the default TTL in Windows requires creating a new DWORD value called DefaultTTL in the following Registry key: [2]

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

I set DefaultTTL to 65 (decimal value), rebooted my computer and then began downloading a 1GB file. Here's the usage chart I got right after:

No additional data were counted towards my quota

Looks like it works!😃


  1. This may seem like a very good deal, but this provider's 4G Service coverage is notoriously bad... though I hear it's starting to get better. ↩︎

  2. See Microsoft TechNet documentation on DefaultTTL. Funny how the unit is "seconds", when it is actually a "hop". ↩︎