Join our Newsletter — 33% off our NHI Course
Home› Glossary› Foundations & NHI Taxonomy› Karn’s Algorithm
Foundations & NHI Taxonomy

Karn’s Algorithm

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Foundations & NHI Taxonomy

Karn's Algorithm is a TCP retransmission rule that avoids using round trip time samples from packets that were retransmitted. It prevents ambiguous timing measurements from distorting the TCP smoothed RTT and retransmission timeout calculations, especially when acknowledgements could match either the original send or the resend.

How Karn's Algorithm works

Karn's Algorithm is a retransmission timing rule for TCP. Its core idea is simple, if a segment has been retransmitted, the acknowledgement that follows cannot reliably tell you how long the original transmission took, so that sample should not be used to update the smoothed RTT estimate.

This matters because TCP uses RTT data to tune retransmission timeout behavior. When timing samples are polluted by ambiguous acknowledgements, the connection can become too aggressive or too cautious, which affects loss recovery and overall transport stability.

Why retransmission ambiguity matters

The ambiguity comes from the network, not from the sender's intention. If a packet is resent, an ACK may correspond either to the first copy or the retransmission, and either interpretation can distort latency measurement.

By ignoring RTT samples from retransmitted packets, Karn's Algorithm preserves the quality of the timing signal that TCP relies on for congestion recovery. That makes the estimate more conservative, but also more trustworthy.

Relationship to TCP timeout and recovery behavior

Karn's Algorithm is closely tied to the logic that decides when to retransmit again. If TCP believes the path is slower than it really is, it can wait too long before resending. If it believes the path is faster than it really is, it can trigger needless retransmissions and create extra load.

The rule therefore acts as a guardrail for control-loop stability. It does not eliminate loss recovery, but it helps ensure that recovery decisions are based on cleaner measurements rather than ambiguous feedback from retransmitted traffic.

Where the algorithm still leaves open questions

Karn's Algorithm solves one measurement problem, but it does not by itself produce a perfect RTT estimate in all conditions. Loss, jitter, reordering, and variable queuing delay can still make TCP timing noisy, so implementations often combine the rule with additional heuristics and timeout logic.

In practice, the value of Karn's Algorithm is less about precision in any single sample and more about preventing systematic error from accumulating in the retransmission estimator.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-57 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-57Key Management RecommendationsCovers timing and lifecycle discipline for security-relevant parameter selection.
Recommendation — Use stable measurement rules to avoid making recovery decisions from ambiguous samples.
NIST CSF 2.0PR.DS-02 — Data-in-transit is protectedTCP retransmission handling affects the reliability of in-transit transport behavior.
Recommendation — Monitor transport behavior so retransmission timing does not degrade protected communications.

Practitioner Guidance

Why practitioners should care: When you are reasoning about TCP performance, retransmission timing is only as good as the samples behind it. Karn's Algorithm is one of the small but important rules that keeps the RTT estimator from being distorted by ambiguous acknowledgements.

Practitioner takeaway: Treat retransmission-derived timing as suspect unless the implementation has a clear rule for excluding ambiguous samples, because timeout quality depends on measurement discipline as much as on the network path itself.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org