Connections die pretty quickly if you aren't sending anything through them on mobile networks and you don't receive reliable notice of that. OS doesn't know about it either and the device is generally asleep when this happens. Need to decide how often to wake to keep them going.
Conversation
Is this NAT-hell only? In principle it shouldn't happen on a real IPv6 network, which we'll hopefully be able to assume in a few years...
1
An IPv6 network without stateful firewalls shouldn't have this issue, but stateful firewalls will still end up dropping old / inactive connections. There's also just a whole lot of broken stuff. I think there are a lot of pure IPv6 mobile networks already and it still happens.
2
Why would you put stateful firewalls on an IPv6 network with millions of nodes? Do they just *want* to burn money and spew CO2?
1
I don't know what they are doing or why, but carriers love dropping connections. *shrug*
2
en.wikipedia.org/wiki/Carrier-g is definitely the main issue, but IPv6 definitely isn't 100% reliable either. The code really needs to be designed to actively figure this out.
1
Shouldn't TCP keepalive at the kernel level be able to handle it?
1
The device goes to sleep though and that's not going to wake it up. The only way it could work is if it was offloaded to hardware that kept running. It's totally possible that exists, I don't know.
2
But kernel can and *should* schedule periodic wakeups just to do stuff like keepalive. Unlike gigantic userspace apps it could do it very efficiently.
2
My point is that this could all be made to work correctly with standard APIs (poll) and no GCM mediation hell, without lost or seriously delayed messages, if the kernel (and its configuration) were doing its job and making the standard APIs work the way they're supposed to.
1
If apps are given the option to keep the device awake or constantly wake it up, the end result is just that the device is always awake and draining power though. It applies even to well meaning open source apps, because they cut corners and treat themselves as the most important.

