Say my ipad is on a wireless lan connected to a dsl router and the dsl goes down. The ipad also has a 4g nic too as it happens. But the ipad doesn't know the router's wan links have gone down, and in any case it always prefers the wireless lan i/f over the 4g i/f, so it never switches over to using 4g if the dsl goes out to lunch.
It only switches to 4g if the wireless lan medium itself goes down.
This is a damn nuisance. If only routers could broadcast routing information, using whatever, BGP or RIP or something and if ios could listen out for that.
The only other thing I could think of would be for an os to regularly ping some target machine on the real internet via the preferred nic, but no one would want to pay for all that traffic and there would be a timing delay before it realises a link is bad. Apart from the cost and the battery drain it would actually be a good thing as it would test for real connectivity so it would cover the case where dsl was up but the internet connection was still in fact useless, eg where there was no working path beyond the first hop because of connectivity problems between wholesale sp (eg btw or tt) and your real isp, or routing problems within the isp itself. You could say that any incoming traffic counts as confirmation that the link was good, so that would reduce the pinging a bit of course. It's only what AA do anyway via PPP echo requests and there are ping boxes which do ICMP pings regularly for service monitoring. You could consider having a really limited hop count (low ttl), or traceroute one time and then ping a particular chosen node only m < n hops upstream. But choosing a well-known test target provided by eg apple using anycast routing would be a better option as it would test the whole of ‘real internet connectivity’ rather than being fooled by broken isps where just the dsl works but nothing much further upstream.
My old netgear DG834 router could speak RIP. My firebrick router cannot but it speaks BGP and OSPF. I don't know if it could be set up to do what I need here and export routing status info to the LAN side. If only there were something like a RIP listener in ios.
I suppose a less good alternative would be for a router to send ICMP error packets to tell an ipad that the internet connection has gone down. But ideally you want the notifications to be unsolicited and standalone, ie not having to be in response to anything outbound so that there would be a timely notification that an internet connection has gone down which is picked up straight away, before an ipad tries to send to it. I wonder if an existing icmp type would do the job or whether something new would have to be standardised. Whatever it was, it would have to be something that was selectively blocked, filtered out appropriately so that it could not be misused as a dos technique by internet malefactors, or perhaps checking in the recipient ios that it has the src ip address of the router itself or might be enough.
Musing; I would love to design a server protocol for a local info-server, which would give out info about the lan, local site, router and internet connection’s properties, plus offering facilities to subscribe to dynamic status info updates ideally using multicast udp but probably also offering other protocol types for lame client apps so as to encourage wide takeuchi. The question is how best to deploy it, and whether or not to try and get it tightly integrated into routers or have some other cheap box or existing box run the server code. In the latter case it might be too hard to get all the required info out of the router. DHCP does a lot of stuff already, but it doesn't give you info about say the name of the site, performance characteristics, any general servers that you need to know about, network loading, costs of traffic, protocols supported or blocked, services that are available, isp characteristics, geographic info, and stuff that is completely extensible including user-defined stuff that uses proper type id URNs and well-behaved namespaces so that info-type clashes and global namespace pollution do not become a bad bad thing. My worry about such a project is scope creep; it could grow into a nightmare huge monster.