COMT 4291 Communications Protocols and TCP/IP COMT 429
2 TCP Sliding Window Operation Sender Receiver snd.unasnd.nxt snd.una +snd.wnd rcv.nxt +rcv.wnd snd.wnd rcv.wnd
COMT 4293 Example... Sender Receiver Received and acked; not yet picked up by client Available receive window space Sent but no ack received yet Next segment to send Available window for further sends
COMT 4294 Segment Dispatch Dispatch segment to IP Set RTO (Retransmit Time Out) timer –Proportional to the Round Trip Time (RTT) Sender Sent but no ack received yet Next segment to send Available window for further sends
COMT 4295 Segment Receipt with Pickup Send Ack segment with Ack=2001 Window = 4000 Receiver Received and picked up by client Available receive window space
COMT 4296 Segment Receipt w/o Pickup Send Ack packet with Ack = 2001 Window = 3500 Receiver Received and picked up by client Available receive window space Received but not picked up by client
COMT 4297 Acknowledgement Receipt Seg received with Ack=2001, Win=3500 –Left window edge to 2001 –Right window edge to 5501 Sender before after 5501
COMT 4298 Segment Receipt After Segment Loss Send a “duplicate” acknowledgement –Send Ack packet with Ack = 2001 –Window = 3500 Receiver Received and picked up by client Received but not picked up by client Last segment received Missing segment
COMT 4299 Retransmission Highest Ack Number received is 2001 –Duplicate Ack=2001 may have been received RTO timer for segment 2001 expires and 2001 is retransmitted –Trigger congestion avoidance algorithm Sender
COMT Retransmit Timing and Window Size - Single Error BDP (Bandwidth Delay Product) –Ethernet: 1ms * 10Mbps = 1250 bytes –Satcom T1: 500ms * 1.5Mbps = 94 kbytes Assume window size = BDP –RTO > 2*RTT –“Recovery Ack” after retransmit needs 1 RTT –Channel idles for length of RTO (“drained pipe”)
COMT Retransmission Timer Implementation Running estimate (based on Acks) of –Average RTT –RTT variance factor Exclude retransmissions Set RTO to RTT times RTT variance factor (with a hard upper bound) –Around 2 RTT for lightly loaded links –As high as 16 RTT for congested links
COMT The Congestion Collapse Problem Original TCP specs used the window for flow control, and 2*RTT for the RTO Congestion of a link causes the RTO timers to “go off” before an ack can be returned The network goes into steady state congestion where every segement is transmitted about three times
COMT Congestion Issues Slow Start - New Connection –Set send window to MSS –Increase the window by MSS for each ack received –Exponential increase in send window size xxxxxxx
COMT Congestion Issues cont... Slow Start - After retransmission –Exponential slow-start up to 1/2 of the original window size –Increase the window by MSS for each send window acked without loss –Linear increase in send window size xxxxxxx
COMT Congestion Issues cont... Congestion Avoidance, Timer Back-Off –Reduce send window to 1/2 of previous size for each retransmit (exponential back- off) –After a segment is retransmitted, set the new RTO timer for that segment to 2*RTO, up to a hard upper bound (2*MSL, Maximum Segment Life)
COMT Fast Retransmit Duplicate Ack=2001 have been received Re-send segment 2001 before RTO expires –“Guess” that 2001 was lost –Wait for >=3 dup acks (segements could just have arrived out-of-order) –Enter congestion avoidance with allowance for duplicate acks Sender
COMT Selective Acknowledgement Enabled during Syn and Syn/Ack Receiver send segment with –Ack = 2001, Window = 3500 –SACK option: block start=2501, end=2600 Receiver Last segment received Missing Segment
COMT Resources RFC Transmission Control Protocol Draft-ietf-tcplw-sack-02 - Selective Ack. RCF TCP Extensions Van Jacobson Note on Fast Recovery (attached)