Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Transmission Control Protocol
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Reliable transmission==== TCP uses a ''sequence number'' to identify each byte of data. The sequence number identifies the order of the bytes sent from each computer so that the data can be reconstructed in order, regardless of any [[out-of-order delivery]] that may occur. The sequence number of the first byte is chosen by the transmitter for the first packet, which is flagged SYN. This number can be arbitrary, and should, in fact, be unpredictable to defend against [[TCP sequence prediction attack]]s. Acknowledgments (ACKs) are sent with a sequence number by the receiver of data to tell the sender that data has been received to the specified byte. ACKs do not imply that the data has been delivered to the application, they merely signify that it is now the receiver's responsibility to deliver the data. Reliability is achieved by the sender detecting lost data and retransmitting it. TCP uses two primary techniques to identify loss. Retransmission timeout (RTO) and duplicate cumulative acknowledgments (DupAcks). When a TCP segment is retransmitted, it retains the same sequence number as the original delivery attempt. This conflation of delivery and logical data ordering means that, when acknowledgment is received after a retransmission, the sender cannot tell whether the original transmission or the retransmission is being acknowledged, the so-called ''retransmission ambiguity''.{{sfn|Karn|Partridge|1991|p=364}} TCP incurs complexity due to retransmission ambiguity.{{sfn|RFC 9002|loc=4.2. Monotonically Increasing Packet Numbers}} =====Duplicate-ACK-based retransmission===== If a single segment (say segment number 100) in a stream is lost, then the receiver cannot acknowledge packets above that segment number (100) because it uses cumulative ACKs. Hence the receiver acknowledges packet 99 again on the receipt of another data packet. This duplicate acknowledgement is used as a signal for packet loss. That is, if the sender receives three duplicate acknowledgments, it retransmits the last unacknowledged packet. A threshold of three is used because the network may reorder segments causing duplicate acknowledgements. This threshold has been demonstrated to avoid spurious retransmissions due to reordering.<ref>{{cite journal|last1=Mathis|last2=Mathew|last3=Semke|last4=Mahdavi|last5=Ott|title=The macroscopic behavior of the TCP congestion avoidance algorithm|journal=ACM SIGCOMM Computer Communication Review|volume=27|issue=3|pages=67β82|year=1997|doi=10.1145/263932.264023|citeseerx=10.1.1.40.7002|s2cid=1894993}}</ref> Some TCP implementations use [[selective acknowledgement]]s (SACKs) to provide explicit feedback about the segments that have been received. This greatly improves TCP's ability to retransmit the right segments. Retransmission ambiguity can cause spurious fast retransmissions and congestion avoidance if there is reordering beyond the duplicate acknowledgment threshold.{{sfn|RFC 3522|p=4}} In the last two decades more packet reordering has been observed over the Internet<ref>{{cite journal |last1=Leung |first1=Ka-cheong |last2=Li |first2=Victor O.k. |last3=Yang |first3=Daiqin |date=2007 |title=An Overview of Packet Reordering in Transmission Control Protocol (TCP): Problems, Solutions, and Challenges |url=https://ieeexplore.ieee.org/document/4118693 |journal=IEEE Transactions on Parallel and Distributed Systems |volume=18 |issue=4 |pages=522β535 |doi=10.1109/TPDS.2007.1011}}</ref> which led TCP implementations, such as the one in the Linux Kernel to adopt heuristic methods to scale the duplicate acknowledgment threshold.<ref>{{cite thesis |last=Johannessen |first=Mads |date=2015 |title=Investigate reordering in Linux TCP |publisher=University of Oslo |url=http://urn.nb.no/URN:NBN:no-51662 |degree=MSc}}</ref> Recently, there have been efforts to completely phase out duplicate-ACK-based fast-retransmissions and replace them with timer based ones.<ref>{{cite conference |url=https://www.ietf.org/proceedings/94/slides/slides-94-tcpm-6.pdf |title=RACK: a time-based fast loss detection for TCP draft-cheng-tcpm-rack-00 |last1=Cheng |first1=Yuchung |date=2015 |publisher=IETF |location=Yokohama |conference=IETF94}}</ref> (Not to be confused with the classic RTO discussed below). The time based loss detection algorithm called Recent Acknowledgment (RACK){{Sfn|RFC 8985}} has been adopted as the default algorithm in Linux and Windows.<ref>{{cite conference |url=https://datatracker.ietf.org/meeting/100/materials/slides-100-tcpm-draft-ietf-tcpm-rack-01.pdf |title=RACK: a time-based fast loss recovery draft-ietf-tcpm-rack-02 |last1=Cheng |first1=Yuchung |last2=Cardwell |first2=Neal |last3=Dukkipati |first3=Nandita |last4=Jha |first4=Priyaranjan |date=2017 |publisher=IETF |location=Yokohama |conference=IETF100}}</ref> =====Timeout-based retransmission===== When a sender transmits a segment, it initializes a timer with a conservative estimate of the arrival time of the acknowledgment. The segment is retransmitted if the timer expires, with a new timeout threshold of twice the previous value, resulting in [[exponential backoff]] behavior. Typically, the initial timer value is {{math|smoothed RTT + max(''G'', 4{{times}}RTT variation)}}, where {{mvar|G}} is the clock granularity.{{sfn|RFC 6298|p=2}} This guards against excessive transmission traffic due to faulty or malicious actors, such as [[man-in-the-middle attack|man-in-the-middle]] [[denial of service attack]]ers. Accurate RTT estimates are important for loss recovery, as it allows a sender to assume an unacknowledged packet to be lost after sufficient time elapses (i.e., determining the RTO time).{{sfn|Zhang|1986|p=399}} Retransmission ambiguity can lead a sender's estimate of RTT to be imprecise.{{sfn|Zhang|1986|p=399}} In an environment with variable RTTs, spurious timeouts can occur:{{sfn|Karn|Partridge|1991|p=365}} if the RTT is under-estimated, then the RTO fires and triggers a needless retransmit and slow-start. After a spurious retransmission, when the acknowledgments for the original transmissions arrive, the sender may believe them to be acknowledging the retransmission and conclude, incorrectly, that segments sent between the original transmission and retransmission have been lost, causing further needless retransmissions to the extent that the link truly becomes congested;{{sfn|Ludwig|Katz|2000|p=31-33}}{{sfn|Gurtov|Ludwig|2003|p=2}} selective acknowledgement can reduce this effect.{{sfn|Gurtov|Floyd|2004|p=1}} {{harvtxt|RFC 6298}} specifies that implementations must not use retransmitted segments when estimating RTT.{{sfn|RFC 6298|p=4}} [[Karn's algorithm]] ensures that a good RTT estimate will be produced—eventually—by waiting until there is an unambiguous acknowledgment before adjusting the RTO.{{sfn|Karn|Partridge|1991|p=370-372}} After spurious retransmissions, however, it may take significant time before such an unambiguous acknowledgment arrives, degrading performance in the interim.{{sfn|Allman|Paxson|1999|p=268}} TCP timestamps also resolve the retransmission ambiguity problem in setting the RTO,{{sfn|RFC 6298|p=4}} though they do not necessarily improve the RTT estimate.{{sfn|RFC 7323|p=7}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)