11/19/2009 TCP Congestion Control TCP Congestion Control TCP TCP Congestion Control Congestion Control • Essential strategy :: The TCP host sends packets into the network without a reservation and then the host reacts to observable events. • Originally TCP assumed FIFO queuing. g y q g Lecture material taken from • Basic idea :: each source determines how “Computer Networks A Systems Approach ”, much capacity is available to a given flow in the network. Fourth Edition,Peterson and Davie, • ACKs are used to ‘pace’ the transmission of Morgan Kaufmann, 2007. packets such that TCP is “self-clocking”. 1 2 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control AIMD AIMD Additive Increase (AI) Additive Increase (AI) (Additive Increase / Multiplicative (Additive Increase / Multiplicative Decrease) Decrease) • Additive Increase is a reaction to perceived available capacity (referred to as congestion avoidance stage). • CongestionWindow (cwnd) is a variable held by the TCP source for each connection. • Frequently in the literature, additive increase is defined by parameter α (where the default is α = 1 ). • Linear Increase :: For each “cwnd’s worth” of packets MaxWindow :: min ( CongestionWindow , AdvertisedWindow) sent, increase cwnd by 1 packet. sent increase cwnd by 1 packet EffectiveWindow = MaxWindow – (LastByteSent -LastByteAcked ) • In practice, cwnd is incremented fractionally for each • cwnd is set based on the perceived level of arriving ACK. congestion. The Host receives implicit (packet drop) or explicit (packet mark) indications of increment = MSS x (MSS /cwnd) internal congestion. cwnd = cwnd + increment 3 4 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Multiplicative Decrease (MD) Multiplicative Decrease (MD) * Key assumption :: a dropped packet and resultant Source Destination timeout are due to congestion at a router. • Frequently in the literature, multiplicative decrease is defined by parameter β (where the default is β = 0.5 ) Add one packet Multiplicate Decrease:: TCP reacts to a timeout by p y each RTT halving cwnd . • Although defined in bytes, the literature often discusses cwnd in terms of packets (or more formally in MSS == Maximum Segment Size). • cwnd is not allowed below the size of a single Figure 6.8 Additive Increase Figure 6.8 Additive Increase packet . Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 5 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 6 1
11/19/2009 AIMD AIMD (Additive Increase / Multiplicative (Additive Increase / Multiplicative Decrease) Decrease) • It has been shown that AIMD is a necessary 70 60 condition for TCP congestion control to be stable. 50 40 30 • Because the simple CC mechanism involves 20 10 timeouts that cause retransmissions, it is important p 1.0 1 0 2.0 2 0 3.0 3 0 4.0 4 0 5.0 5 0 6.0 6 0 7 0 7.0 8 0 8.0 9 0 9.0 10.0 10 0 that hosts have an accurate timeout mechanism. Time (seconds) • Timeouts set as a function of average RTT and standard deviation of RTT. Figure 6.9 Typical TCP Figure 6.9 Typical TCP • However, TCP hosts only sample round-trip time Sawtooth Pattern Sawtooth Pattern once per RTT using coarse-grained clock. 7 8 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Slow Start Slow Start Slow Start Slo Start • The source starts with cwnd = 1. • Linear additive increase takes too long to ramp up a new TCP connection from cold • Every time an ACK arrives, cwnd is start. incremented. • Beginning with TCP Tahoe, the slow start � cwnd is effectively doubled per RTT “epoch”. mechanism was added to provide an initial mechanism was added to provide an initial exponential increase in the size of cwnd . • Two slow start situations: � At the very beginning of a connection {cold start }. Remember mechanism by: slow start � When the connection goes dead waiting for a prevents a slow start. Moreover, slow start timeout to occur (i.e, the advertized window goes is slower than sending a full advertised to zero!) window’s worth of packets all at once. 9 10 10 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Slow Start Slow Start Source Destination • However, in the second case the source has more information. The current value Slow Start of cwnd can be saved as a congestion Add one packet threshold. threshold per ACK • This is also known as the “slow start threshold” ssthresh . Figure 6.10 Slow Start Figure 6.10 Slow Start Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 11 11 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 12 12 2
11/19/2009 70 60 50 40 30 ssthresh ssthresh 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 Time (seconds) Figure 6.11 Behavior of TCP Figure 6.11 Behavior of TCP Congestion Control Congestion Control 13 13 14 14 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Fast Retransmit Fast Retransmit Fast Retransmit Fast Retransmit • Coarse timeouts remained a problem, and Fast retransmit was added with TCP Tahoe . • Generally, fast retransmit eliminates about half • Since the receiver responds every time a packet the coarse-grain timeouts. arrives, this implies the sender will see duplicate • This yields roughly a 20% improvement in ACKs. throughput throughput. Basic Idea:: use duplicate ACKs to signal lost packet Basic Idea:: use duplicate ACKs to signal lost packet. • Note – fast retransmit does not eliminate all Fast Retransmit the timeouts due to small window sizes at the source. Upon receipt of three duplicate ACKs, the TCP Sender retransmits the lost packet. 15 15 16 16 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Sender Receiver Packet 1 Packet 2 ACK 1 Packet 3 70 ACK 2 Packet 4 60 50 Fast Retransmit ACK 2 Packet 5 40 Packet 6 30 ACK 2 20 ACK 2 Based on three Based on three 10 duplicate ACKs 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Retransmit packet 3 Time (seconds) ACK 6 Figure 6.13 TCP Fast Retransmit Figure 6.13 TCP Fast Retransmit Trace Trace Figure 6.12 Fast Retransmit Figure 6.12 Fast Retransmit Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 17 17 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 18 18 3
11/19/2009 Fast Recovery Fast Recovery Modified Modified Slow Start Slow Start • Fast recovery was added with TCP Reno . • Basic idea:: When fast retransmit detects • With fast recovery, slow start only three duplicate ACKs, start the recovery occurs: process from congestion avoidance region and use ACKs in the pipe to pace the –At cold start sending of packets. sending of packets –After a coarse-grain timeout Fast Recovery • This is the difference between After Fast Retransmit, half cwnd and commence TCP Tahoe and TCP Reno !! recovery from this point using linear additive increase ‘primed’ by left over ACKs in pipe. 19 19 20 20 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Figure 5.6 Three Figure 5.6 Three- -way TCP way TCP Many TCP ‘flavors’ Many TCP ‘flavors’ Handshake Handshake • TCP New Reno • TCP SACK – requires sender and receiver both to support TCP SACK – possible state machine is complex. ibl t t hi i l • TCP Vegas – adjusts window size based on difference between expected and actual RTT. • TCP Cubic 21 21 22 22 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control Adaptive Retransmissions Adaptive Retransmissions Original Algorithm Original Algorithm RTT:: Round Trip Time between a pair of • Keep a running average of RTT and hosts on the Internet. compute TimeOut as a function of this • How to set the TimeOut value (RTO)? RTT. – The timeout value is set as a function of Th ti t l i t f ti f – Send packet and keep timestamp t s . the expected RTT. – When ACK arrives, record timestamp t a . – Consequences of a bad choice? SampleRTT = t a - t s Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 23 23 Computer Networks: TCP Congestion Control Computer Networks: TCP Congestion Control 24 24 4
Recommend
More recommend