TCP Puzzlers (2016)
tritondatacenter.com
tritondatacenter.com
I have this problem right now, between applications in on-premise DC and public cloud, talking over a VPN. If there is a blip on the network, or a firewall failover happens, the other side continues to think its connected. So, to ensure my application side is resilient, we configure the listeners to go back to listening mode, if nothing received for 5 minutes. This ensures we don't have to manually intervene and the connection comes back up on its own.
Afaik current best practice is to reimplement application level keepalives everywhere. But it seems to me like both protocol pollution and prone to subtle leak-like bugs for dead conns. It would be nice if keep-alives could be used instead.
Also: NATs and firewalls put timeouts in their “routing tables”(?) so that conns are dead after X seconds anyway. Does anyone here know from experience what X is typically, in practice?
The usual term for the table is NAT table or connection tracking table.
The usual timeout is as long as a piece of string.
I've seen timeouts as short as a few seconds. These are sometimes configured in environments where applications are expected to pause for longer than a few seconds, so the software reports a timeout on many actions.
I've also seen timeouts hours long. These are sometimes configured in environments where tuples are reused rapidly so the NAT device drops new connections which land on the same tuple because those connections are "old".
Networking is great.
> See `TCP_KEEPCNT` and friends
Yeah, 3 options with manually tuning even the number of probes. And this is for one OS only. This is one reason why application level pinging is just more feasible. I am using Go and gave up on tcp keepalives (even though they do have an std api) because the resulting behavior was a mess.
I don’t know if it should be the job of stdlibs or the OS, but at application level I’d prefer something like a single keepalive param with reasonable behavior.
Luckily, the Internet Archive has a version with correct formatting, which I find miles easier to read: https://web.archive.org/web/20220823105029/https://www.trito...
TCP Puzzlers (2016) - https://news.ycombinator.com/item?id=20839902 - Aug 2019 (7 comments)
TCP Puzzlers - https://news.ycombinator.com/item?id=12315814 - Aug 2016 (70 comments)
[0] https://web.archive.org/web/20221010031002/https://www.trito...