The short version
- A TCP connection can stay silent for hours and still be perfectly healthy. Keepalive asks only whether the far end's TCP will answer at all — not whether the service behind it is alive.
- It stayed optional, per-connection configurable and off by default because silence has more than one possible cause, and the transport layer cannot tell them apart.
- One unanswered probe proves nothing. Middlebox memory, user timeout and battery drain make any single universal interval a bad fit for somebody.
Reliability stops where the last byte stops
Two hosts can sit on an established TCP connection for hours saying nothing at all, and both be perfectly right. That is not a bug, an outage or a stalled application. It is Tuesday.
RFC 793 gave TCP a crisp job whenever data exist. Bytes enter a sequence space. Acknowledgments advance. Missing data trigger retransmission. Eventually an endpoint succeeds, receives a reset, or hits a failure policy somebody configured on purpose.
An idle connection offers none of that scaffolding. There is no new byte awaiting an ACK, and no unacknowledged byte whose timer can expose a broken path. The two endpoints may be alive and deliberately quiet. One host may have crashed. A cable, a route, a firewall rule or an address mapping may have quietly evaporated. From the local TCP state alone, all of those worlds look identical.
This is not a weakness in reliable delivery. It is a limit on what delivery evidence can say when nobody is delivering anything.
A probe aimed just behind the frontier
RFC 1122 wrote TCP keepalive into the record in 1989 as a disputed, optional mechanism — a compromise, not a triumph. The customary probe carries SEG.SEQ = SND.NXT-1: a sequence number one byte behind the next new byte the sender could transmit.
That placement is deliberately awkward. The number should land outside the receiver's current acceptable window, prompting the remote TCP to answer with an ACK showing what it still expects. The probe normally carries no data and never advances the application stream. A one-byte "garbage" variant survived only to interoperate with implementations that had got the arithmetic wrong.
The reply answers a narrow question: a TCP endpoint, reachable through some working return path, processed this segment just now. It says nothing about whether the remote application consumed earlier work, still holds valid credentials, can reach its database, or will answer the next business request. It is a knock on the door, not a conversation through it.
Why the default was off, and why it was two hours
RFC 1122 required no TCP to implement keepalive at all. If an implementation offered it, the application had to be able to switch it on or off per connection, and the default had to be off. The idle interval had to be configurable and had to default to at least two hours.
Those constraints kept transport machinery from quietly choosing an application's failure semantics on its behalf. A terminal session, a routing adjacency, a database pool and a sleeping sensor assign wildly different costs to false closure, slow detection, extra packets and retained state. The common transport layer cannot infer those costs from the absence of bytes. It has no idea what the bytes were for.
Two hours was never a claim that a peer dies at 7,200 seconds. It was a conservative boundary: unsolicited probing should be rare unless the application deliberately chooses otherwise. The consolidated modern specification, RFC 9293, keeps the arrangement intact. Decades of deployment never promoted the optional probe into an automatic definition of life.
One lost probe is not a death certificate
TCP does not reliably retransmit pure ACKs as independent data. A keepalive probe can be lost. Its ACK can be lost. Congestion can delay either one. So RFC 1122 and RFC 9293 explicitly forbid treating a single unanswered probe as proof of a dead connection.
That restraint matters because closure is an action, not an observation. Once local TCP tears down state and reports failure, an application may abandon a transaction, elect a replacement leader, release a lock or open a fresh connection. The consequences outlive the packet loss that triggered the inference.
Repeated probes and a configured threshold make failure more plausible. They still express a local risk decision: after this much missing evidence, holding uncertainty costs more than closing. They never convert absence into testimony.
User timeout asks a different question
TCP already had a user-timeout concept for data that remain unacknowledged. RFC 5482 later defined an option for communicating a timeout preference across the connection. Its question is not "has an idle peer spoken?" but "how long may transmitted data stay unacknowledged before this endpoint gives up?"
Keeping the two apart prevents conflicting clocks. RFC 5482 notes that some keepalive policies can abort a connection that would otherwise have survived a temporary outage. When keepalive and the User Timeout Option are combined under that specification, the keepalive timer must exceed the adopted user timeout.
Application data, an idle probe and a close decision belong to related but distinct evidence chains. Conflate them and a convenience timer quietly overrules a delivery policy somebody thought about harder.
The middlebox grew a memory of its own
Early end-to-end discussions assumed the endpoints owned all connection state. NATs and stateful middleboxes inserted a second, expiring ledger into the path. An idle TCP connection could remain perfectly valid at both hosts while an intermediary discarded the mapping the next packet would need.
RFC 5382 turned the two-hour default into a compatibility floor. A qualifying NAT that cannot determine whether established endpoints are still active must not drop the mapping before two hours and four minutes — the extra interval absorbs packets already in flight.
That rule protects endpoint expectations without crowning the NAT as owner of the connection, and it does not guarantee universal obedience. Operators routinely meet shorter state lifetimes and answer with more frequent probes. The probes may preserve the mapping, but they are paying an intermediary tax: endpoints generating traffic not for their own application semantics, but to stop a private box from forgetting them.
The battery found the opposite cost
Frequent probes sound harmless on a server plugged into mains power. On an energy-constrained device, every transmission can wake a radio and stretch an expensive active period. RFC 9006 captures the collision: the long TCP default may fail to preserve some middlebox state, while shorter keepalives can flatten a battery.
No transport constant settles that allocation. The application knows whether a delayed reconnect is tolerable. The operator knows the path's state lifetime. The device knows its energy budget. The right policy depends on all three — and sometimes the rational choice is to stop keeping the connection alive altogether.
A heartbeat that cannot hear the application
Transport keepalive is often called a heartbeat, but for many failures it listens at the wrong layer. A kernel may ACK while the service process sits deadlocked. A proxy may answer TCP while an upstream dependency has already failed. A remote application may be healthy and deliberately suspended.
An application-layer heartbeat can ask a stronger, domain-specific question: can the service parse a request, consult its state and produce a valid response? That strength carries its own cost, and it still cannot prove every future operation. Stacking both mechanisms without knowing which failure each is meant to catch buys traffic, not clarity.
Keepalive also differs from zero-window probing. A zero-window probe ensures that reopening a receiver window is not lost while the peer has explicitly advertised no capacity. Keepalive begins when the connection is otherwise idle. Similar small packets, entirely different contracts.
Silence kept its presumption of innocence
The lasting design choice was never the peculiar SND.NXT-1 segment. It was the refusal to let a transport implementation turn silence into guilt by default.
A received ACK is evidence of recent TCP reachability, not of application health. A missing ACK is uncertainty, not death. A configured run of misses can justify a local close because an application chose a failure budget — not because the Internet handed down a verdict.
Keepalive stayed optional because the endpoint that bears the consequence should hold the decision. TCP supplied a way to ask. It never claimed the authority to explain why nobody answered — and that restraint, more than the odd sequence number, is the part worth keeping.
Sources and what they do not prove
RFC 793 establishes the original connection and user-timeout machinery. RFC 1122 records the 1989 keepalive contract. RFC 5382 defines NAT timing expectations. RFC 5482 separates user timeout from keepalive abort policy. RFC 9006 documents the energy trade-off. RFC 9293 provides the consolidated current rules.
None of them settles every platform default, every middlebox timeout, or what your application means by healthy.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






