Jump to content

Karn's algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Adamianash (talk | contribs) at 04:39, 13 December 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Accurate round trip estimation times in TCP can be difficult to calculate because of ambiguous acknowledgement. Ambiguous acknowledgements are acknowledgements for segments that have been sent more than once. Karn's Algorithm presents

a solution to transmissions and retransmissions
failing to give  accurate round trip times.

It does this by not updating the round trip time based on retranmissions of segments. Round trip time estimation is only based on unambiguous acknowledgements which are acknowledgements for segments having been sent only once.

      This simplistic implementatation of 

Karn's algorithm can lead to failure as well. Consider what happens when TCP sends a segment after sharp increase in delay. Using the existing round trip time estimate, TCP computes a timeout and retransmits a segment. If TCP never acknowledges retransmitted packets, the round trip estimate time will never be updated, and TCP will continue retransmitting segments and not adjust to the increased delay.

       A solution to this problem is 

the incorporation of transmission timeouts with a timer backoff strategy. The timer backoff strategy computes an initial timeout. If the timer expires and causes a retransmission, TCP increases the timeout generally by a factor of 2.

         new_timeout = 2*timeout

This algorithm has proven to be extremelly effective in networks with high packet loss.

  • Comer, Douglas E. (2006). Internetworking with TCP/IP (5 ed.). Prentice Hall: Upper Saddle River, NJ..