Summary

  • When TCP retransmits the same sequence range, a later cumulative ACK may confirm delivery without revealing whether the original or the retransmitted copy caused it; Karn's algorithm therefore bars that event from ordinary RTT sampling.
  • Exponential backoff stays in force until newly sent and acknowledged data supplies a clean measurement, while TCP timestamps provide the specified exception when they remove transmission-instance ambiguity.

Every recovery protocol eventually faces an awkward question: when the acknowledgment finally arrives, which transmission is it thanking?

Picture a sender that fires one TCP segment and arms its retransmission timer. The timer expires with no reply, so the sender fires the same sequence range again. Then a cumulative ACK comes back. For reliability, the news is good: the receiver has taken responsibility for those bytes. For measurement, the news is useless. The ACK does not say whether the first copy was merely slow, whether the retransmission arrived first, or whether both copies landed and one reply covered them both.

Start a stopwatch at the first transmission and you get one round trip. Start it at the retransmission and you get another. The wire carries no ordinary identifier that picks between them. Feed either guess into the smoothed round-trip estimate, and a recovery action quietly corrupts the very clock that decides the next recovery action.

The packet-radio problem that named a rule

The man who made this famous was Phil Karn, working on TCP/IP over amateur packet radio in the 1980s. Radio links were slow, noisy, and wildly variable in delay; retransmissions were routine, and the naive RTT estimator kept tripping over them. With Craig Partridge, Karn laid out the fix in a 1987 paper, “Improving Round-Trip Time Estimates in Reliable Transport Protocols.” The rule that carries his name is almost embarrassingly simple: when a segment has been retransmitted, do not sample its round-trip time.

RFC 793 had described the essential loop back in 1981. Data carrying sequence numbers enter a retransmission queue and start a timer. An acknowledgment removes covered data; expiry sends the earliest unacknowledged segment again. Its illustrative timeout procedure measured elapsed time from sending a numbered octet until an acknowledgment covering it arrived, then used that value to update a smoothed RTT and derive an RTO.

That made the estimator adaptive. It also left a measurement problem sitting exactly where reliability duplicated a transmission. The same cumulative acknowledgment number can cover the same bytes no matter which copy reached the receiver. A protocol signal can be decisive for one state transition and still be inadmissible for another. The ACK closes the delivery obligation for those bytes; it does not necessarily carry enough provenance to update the latency model.

RFC 1122 makes it a requirement

By RFC 1122 in 1989, the repair had hardened into a host requirement. Section 4.2.3.1 states that a host TCP “MUST implement” both Karn's algorithm and Jacobson's algorithm for retransmission-timeout calculation, and that the implementation “MUST include” exponential backoff. The first sentence names those two requirements without a SHOULD qualifier.

The document kept their jobs distinct. Jacobson's calculation folded measured RTT variance into the estimator. Karn's selection rule kept ambiguous measurements out of that estimator in the first place. Better arithmetic could not rescue an observation whose causal start time was unknown. RFC 6298's later statement that it upgrades RTO-algorithm support from SHOULD to MUST describes the general standard algorithm; it does not demote those two explicit RFC 1122 sentences to recommendations.

The same section required exponential backoff for successive RTO values on the same segment. That companion rule matters because rejecting a sample must not leave a sender aggressively repeating the old timeout. After expiry, the active RTO grows. The sender becomes more conservative while the path offers no clean evidence that would justify a lower estimate.

RFC 6298 draws the sharp boundary

RFC 6298 later stated the rule with a clean edge. TCP must use Karn's algorithm, and RTT samples must not be taken from retransmitted segments because it is ambiguous whether the reply belongs to the first packet instance or a later one. This is not a preference for fewer measurements. It is an admissibility test tied to the history of a particular sequence range.

The exclusion is also narrower than the slogan “ignore ACKs after retransmission.” The acknowledgment still advances cumulative delivery state and manages the retransmission queue. Karn's rule says only that this event cannot ordinarily serve as an RTT sample for the retransmitted data. New data can later be sent and acknowledged without the same ambiguity. RFC 6298 notes that such a clean measurement can restart the estimator and may collapse an RTO that had grown through backoff.

That sequence explains why backoff and sampling are coupled without being the same mechanism. When the timer expires, RFC 6298 calls for retransmitting the earliest unacknowledged segment, doubling the RTO, and restarting the timer with the backed-off value; an implementation may apply the optional maximum permitted by section 2.5. Karn's rule stops the ambiguous reply from immediately dragging the estimate toward a guessed delay. Only a valid later sample can supply the evidence for recalculation. After repeated backoff, an implementation may even clear its stored SRTT and RTTVAR and reinitialize them from the next valid measurement.

The timestamp exception proves the logic

The specification names one important exception. If the TCP timestamp option is used, timestamp information can remove the ambiguity about which instance triggered the acknowledgment. A retransmitted segment may then yield a safe RTT sample. The exception proves the logic of the rule: retransmission itself is not morally disqualified. What matters is whether the observation carries enough identity to bind the reply to a transmission event.

What Karn's algorithm is not

Karn's algorithm is not a loss detector. The timeout, duplicate-ACK logic, or other recovery machinery decides that retransmission should occur. It is not congestion control: a timeout may also reduce the sender's congestion window, but Karn does not set that sending authority. It is not selective acknowledgment: SACK can report byte ranges at the receiver without necessarily identifying which copy supplied an RTT sample. And it is not delayed-ACK policy, which governs when a receiver sends acknowledgments rather than how the sender classifies their measurement value.

The history is therefore a lesson in separating meanings inside one signal. An ACK can prove progress in the byte stream, retire data from a retransmission queue, restart or stop a timer, and yet remain unsuitable for estimating the path's round-trip time. Treating all those meanings as interchangeable would let TCP's own recovery behavior poison its future decisions.

Sources