Ask / Submit

Intelligent failover between cellular and wifi connectivity

asked 2015-07-29 10:29:15 +0200

tore gravatar image

updated 2016-08-17 10:58:15 +0200

jiit gravatar image

Currently, SailfishOS treats cellular and wifi connectivity as strictly either/or. That is, when in range of a known wifi network, SFOS will connect to it, and if successful will disconnect the cellular data connectivity. This does not appear to take into the quality of the wireless network, which could suck big-time for a number of reasons, such as the the signal quality being poor, there being high levels of interference from other wireless networks or devices, saturated wifi bandwidth, etc. Furthermore, even when the wifi link itself is working flawlessly, it could work badly for other reasons, such as the internet uplink being saturated (something I often experience in hotels for example).

For this reason, I often find myself simply disabling wifi and running exclusively with a cellular uplink. This even happens in my own apartment: I have two floors with concrete floors between, and one AP on each floor, but when I move between the floors there is a significant delay before SFOS will roam to the nearest AP, and until it does, the network connectivity hardly works at all. Unless I'm staying put on one location, cellular connectivity is simply more reliable for me. However, when wifi actually works, it is both faster and can be used freely without worrying about extra cost. So simply disabling wifi is not an ideal solution either.

RFC 6555: Happy Eyeballs discusses a similar problem, where you have essentially two available methods of connectivity, and discusses how you can do a fast failover to the secondary connectivity if the primary one does not seem to work. While this document specifically speaks about IPv4 vs IPv6 connectivity, the basic principle could be applied to other types of alternate connectivity as well, such as wifi vs cellular. So what I'd like to propose is to make it possible to keep cellular connectivity active even when wifi is connected, and when attempting to make a connection to some external destination, quickly (within a few 100ms) fall back on cellular connectivity if wifi fails to work. This would allow me to keep wifi on without having a poor user experience when the wifi is working poorly. (Note that the fallback would probably need to be implemented in a high-level "connect-by-name" API, as the standard UNIX socket API is not flexible enough to allow for this).

For what it's worth, Apple recently announced that they've implemented this in iOS. See pages 30-32 in the linked PDF.

edit retag flag offensive close delete


This affects me a lot. My ISP has left me with no internet for about 5 days now, and my jolla connects to an internet-less WLAN, and disconnects from cellular data. It's extremely annoying.

WhyNotHugo ( 2015-07-30 02:05:22 +0200 )edit

Well for that you can temporarily disable your home wifi APN in the Jolla WLAN APN list. Just let it connect to it, then tick the APN. It will grey out and only connect to the rest until you reactivate it.

MoritzJT ( 2015-07-30 13:47:13 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2015-07-29 16:18:54 +0200

tigeli gravatar image

@tore Yes, we would need something like this and connman already supports per application routing (so called session API) though there were just few patches on the mailing list which will fix some issues with it.

I can't promise anything when this kind of behaviour would be implemented but for instance the "connect-by-name"-api could be implemented into connection helper (see attemptToConnectNetwork() at and just modify the per application routing policies etc.

If someone has free time.. please look at it. :)

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2015-07-29 10:29:15 +0200

Seen: 479 times

Last updated: Jul 29 '15