A TCP connection can be perfectly capable of sending another copy of a segment and still be entirely right to give up. Those are two separate decisions, taken on two separate clocks, and for most of the protocol's life only one of them had a name anybody could point at.

The retransmission timer answers a mechanical question: when should this segment go out again? The user timeout answers a commercial one: how long is this connection still worth the memory it is sitting in? RFC 793 sketched the second. RFC 9293 drew the line between them in ink. And RFC 5482 — the TCP User Timeout Option — did the genuinely subtle thing: it let one endpoint tell the other how long it intended to wait, without ever handing over the switch.

In brief

  • The retransmission timeout decides when to send again; the TCP user timeout decides when unresolved delivery has lasted long enough to abort the connection outright.
  • RFC 5482 carried a peer's preference in a four-octet option, then left local applications, mandatory bounds and the CHANGEABLE flag holding final authority.

Two clocks, two questions, one connection state

Picture a connection with data in flight and no useful acknowledgment coming back. The retransmission machinery estimates when another copy should go out. That timer expires, the oldest queued segment goes back on the wire, and the clock restarts. Repeating that action says nothing at all about how long the application is willing to keep the connection alive.

The user timeout supplies the other decision. RFC 793 described it as a bound on how long transmitted data may remain unsuccessfully delivered before TCP aborts. RFC 9293 makes the distinction explicit: a retransmission-timeout event resends the first queued segment and reinitializes the retransmission timer, while a USER TIMEOUT event flushes the queues, reports the connection as aborted, deletes the transmission control block, and enters CLOSED.

So the two clocks can disagree without either being wrong. Another retransmission may be perfectly schedulable at the exact moment the persistence budget has run out. RTO adapts retry timing to observed round trips and to the ambiguity of loss. USER TIMEOUT expresses something else entirely: how long unresolved delivery remains worth state, memory and application uncertainty.

This is also why the user timeout is not an application request timeout wearing a disguise. An application may abandon one operation and keep the connection for later work, or it may need the transport connection itself to vanish when outstanding data cannot be delivered. TCP's parameter belongs to connection state, and it governs the second case.

RFC 5482 put the suggestion on the wire in four octets

The original timeout was strictly local. One endpoint had no way to know how long the other intended to nurse a disrupted connection along. RFC 5482 introduced the TCP User Timeout Option so a host could state its preferred persistence interval to its peer.

The option is Kind 28 and four octets long. After the kind and length bytes, a single granularity bit selects the unit — zero for seconds, one for minutes — and the remaining 15 bits carry the unsigned timeout suggestion. That compact form spans one second to a little over nine hours at second granularity, and one minute to more than twenty-two days at minute granularity.

Those ranges made the option expressive, not authoritative. A received value tells the peer what the sender expects of the connection. The peer then considers whether to adjust its own USER_TIMEOUT. It does not surrender its resource policy, and it does not hand the remote endpoint a remote abort button.

Four variables and one stubborn flag

RFC 5482 described four pieces of per-connection state. USER_TIMEOUT was the established local parameter. ADV_UTO held the value to advertise. ENABLED decided whether the option could be sent and processed, and defaulted to false. CHANGEABLE decided whether a received suggestion was allowed to modify the local timeout.

That last flag guarded the important boundary. If an application had already chosen a specific timeout, CHANGEABLE could be false, and an incoming option then had to leave USER_TIMEOUT untouched. TCP should still tell the application what the peer suggested. Evidence crossed the connection; authority did not.

The bounds are mandatory, not decorative

Even where CHANGEABLE permits adaptation, RFC 5482 requires implementations to impose upper and lower limits. Set the floor too low and connections die while merely passing through a transient disruption or a high-delay path. Set the ceiling too high and buffers and connection state linger long after useful progress has stopped.

The long-timeout risk is not abstract bookkeeping. A peer that completes many handshakes and then requests generous persistence can make a server hold state at a surprisingly modest attack traffic rate. The RFC discusses authentication and per-peer resource limits as mitigations, while leaving the actual policy choice to the implementation and its application environment.

Interoperability also had to survive absence. Implementations that do not understand UTO silently ignore it under the ordinary option rules. Supporting hosts may still be unable to include it when TCP's forty-byte option space has already been consumed by other options. A missing UTO in a trace therefore proves nothing about whether an application has a user timeout.

Nor does endpoint policy govern every stateful device along the path. A firewall may discard its connection record after an inactivity interval regardless of what the endpoints agreed. A captured option proves only that a suggestion appeared at that observation point — not that the receiver adopted it, and not that an intermediary will preserve state for the same duration.

Keepalive had to wait its turn

Keepalive and user timeout answer neighboring but different questions. Keepalive probes an otherwise idle connection according to an implementation's liveness policy. USER TIMEOUT limits unresolved delivery of outstanding data. With both active, competing abort policies could render the advertised persistence preference meaningless.

RFC 5482 settled the ordering mechanically: the keepalive timer must be greater than the adopted USER_TIMEOUT. Otherwise keepalive could terminate the connection before the user-timeout policy ever got to govern it. The rule does not merge the two mechanisms. It simply establishes which deadline owns the earlier decision.

What operators should distinguish

Diagnosis should separate the current RTO, the retransmission count, the local USER_TIMEOUT, the advertised UTO, the received UTO, the adopted value and the CHANGEABLE state. A packet trace may reveal the two wire suggestions while saying nothing about the local bounds or the application decision that transformed — or refused to transform — them.

The second-order effect is a cleaner separation between retry, liveness and abandonment. The irreversible risks sit at both extremes: letting an unauthenticated peer consume state indefinitely, or letting a tiny suggestion terminate a valuable connection. RFC 5482 made the suggestion visible and the limits mandatory, and left the final deadline exactly where its costs are paid.

That is the whole trick, and it is a good one. Four bytes of humility on the wire — here is how long I would wait, and here is your right to disagree.

Sources