Exploring Android – Part 5 – Wi-Fi Offloading

Next in line on my Android exploration path is how Wi-Fi is integrated into the system and how the OS switches between 3G and Wi-Fi use automatically. The implementation in fact is straight forward. If a Wi-Fi network is detected for which security details are available, Android automatically changes from 3G to Wi-Fi use. For running applications that means that their current TCP/UDP context is broken and that they have to reestablish contact with the server. For my most often used applications, Opera Mini and Profimail, that works quite well as most of the time they don't transfer data and therefore the switch usually happens when they can live with an interruption anyway. If I remember well, I was once told that the iPhone performs a 3G/Wi-Fi switch in the same way.

But what happens when there is an ongoing data transmission while the bearer is switched? I gave it a try with a podcast application that can also stream a podcast from a server. As expected the OS did not care that there was an ongoing transmission and the stream download was interrupted. The streaming application presented an error and had to be restarted manually. Not so nice.

Symbian on the other hand uses a different algorithm that prevents such behavior. Different networks can be grouped and priorities can be given for each network in the group. Individual applications can then either use the networks of the default group or can be assigned another group. For my podcasting application for example, I use a "home" group that only contains my private Wi-Fi network. This ensures that I don't use the 3G connection for large downloads by accident. I've also configured the SIP telephony client to the "home" group so it automatically starts up once the home Wi-Fi is detected. Changes between the networks in a group are not allowed while at least one application is running that uses the network group. This way the loss of TCP/UDP contexts is prevented.

In practice I think few people will use all the possibilities offered by the more complex Symbian implementation. They will most likely only have a single group with all known networks part of it. To prevent TCP/UDP context loss, Wi-Fi is only used when all applications are closed. That might have been o.k. a couple of years ago when applications were closed after use but with email programs and web browsers running in the background all the time now, it's not ideal anymore. But neither is a drop of the TCP/UDP context as in the Android implementation.

There is of course a remedy by using one form or another of mobile-IP to rescue the IP address when switching between access networks. There are several different ways to do this, unfortunately, which is likely going to hinder implementation and use in the foreseeable future. But sometimes a simple implementation trumps over more complicated ones if the drawbacks are acceptable.

One thought on “Exploring Android – Part 5 – Wi-Fi Offloading”

  1. I came across to this page and I enjoy reading your blog. Great content and info!

Comments are closed.