TCP Congestion Control TCP Tahoe TCP Reno TCP

  • Slides: 22
Download presentation
TCP Congestion Control TCP Tahoe TCP Reno TCP Vegas

TCP Congestion Control TCP Tahoe TCP Reno TCP Vegas

Internet Congestion Collapse n Host In the late 80 s, the Internet suffered a

Internet Congestion Collapse n Host In the late 80 s, the Internet suffered a congestion collapse Data + Retransmissions Congestion! Packet drops!! Collapse More Drops!!!

Why is Today’s Topic Important? The algorithm for TCP congestion control is the main

Why is Today’s Topic Important? The algorithm for TCP congestion control is the main reason we can use the Internet successfully today despite largely unpredictable user access patterns and despite resource bottlenecks and limitations. Without TCP congestion control, the Internet could have become history a long time ago.

Resource Management Solutions n Handling congestion n n pre-allocate resources so as to avoid

Resource Management Solutions n Handling congestion n n pre-allocate resources so as to avoid congestion control congestion if (and when) is occurs Source 10 -M 1 bps Ethe rnet Router 1. 5 -Mbps T 1 link Destination DI Source 2 n s FD p b M - 100 Two points of implementation n n routers inside the network (queuing discipline) hosts at the edges of the network (transport protocol)

Detecting Congestion n Packet drops indicate congestion n n Is that really true? Why

Detecting Congestion n Packet drops indicate congestion n n Is that really true? Why does it work? Packet Dst Src Drop Ack Timeout! No Ack = Congestion!

Controlling Congestion – The Effect of Window Size n Note that sender’s window is

Controlling Congestion – The Effect of Window Size n Note that sender’s window is equal to the number of sender packets in flight (in the network). Why? Window Source Destination A Window’s worth of pa ckets X acks X more p ackets

Controlling Congestion n Reduce window less packets in the network Increase window more packets

Controlling Congestion n Reduce window less packets in the network Increase window more packets in the network Idea: Concept of a congestion window – window is smaller when congestion is larger and vice versa

Additive Increase, Multiplicative Decrease n Each time a packet drop occurs, slash window size

Additive Increase, Multiplicative Decrease n Each time a packet drop occurs, slash window size in half (multiplicative decrease) n n Multiplicative decrease is necessary to avoid congestion When no losses are observed, gradually increase window size (additive increase)

AIMD (cont) Algorithm n n n increment Congestion. Window by one packet per RTT

AIMD (cont) Algorithm n n n increment Congestion. Window by one packet per RTT (linear increase) divide Congestion. Window by two whenever a timeout occurs (multiplicative decrease) Destination … n Source In practice: increment a little for each ACK Increment = (MSS*MSS)/Congestion. Window += Increment

AIMD (cont) KB n Trace: sawtooth behavior 70 60 50 40 30 20 10

AIMD (cont) KB n Trace: sawtooth behavior 70 60 50 40 30 20 10 1. 0 2. 0 3. 0 4. 0 5. 0 Time (seconds) 6. 0 7. 0 8. 0 9. 0 10. 0

Problems n What should the window size be n n n Pessimistic window size?

Problems n What should the window size be n n n Pessimistic window size? (e. g. , 1) n n Initially? Upon packet loss and timeout? Additive increase is too slow in ramping up window size – short connections will not fully utilize available bandwidth Optimistic window size? n Large initial burst may cause router queue overflow

Slow Start n Objective: determine the available capacity quickly Idea: n n Use Congestion.

Slow Start n Objective: determine the available capacity quickly Idea: n n Use Congestion. Threshold as an optimistic Congestion. Window estimate begin with Congestion. Window = 1 packet double Congestion. Window each RTT (increment by 1 packet for each ACK) When Congestion. Threshold is crossed, use additive increase Source Destination … n

Fast Retransmit n n Problem: coarse-grain TCP timeouts lead to idle periods Fast retransmit:

Fast Retransmit n n Problem: coarse-grain TCP timeouts lead to idle periods Fast retransmit: n n n Send an ack on every packet reception Send duplicate of last ack when a packet is received out of order Use duplicate ACKs to trigger retransmission Sender Receiver Packet 1 Packet 2 Packet 3 ACK 1 Packet 4 ACK 2 Packet 5 ACK 2 Packet 6 ACK 2 Retransmit packet 3 ACK 6

Self Clocking and Slow Start n Each packet’s transmission is “clocked” by an ACK

Self Clocking and Slow Start n Each packet’s transmission is “clocked” by an ACK – no bursts develop … W=1 W=2 W=4 Slow Start W=5 W=6 W=7

Self Clocking in Operation n Each packet’s transmission is “clocked” by an ACK –

Self Clocking in Operation n Each packet’s transmission is “clocked” by an ACK – no bursts develop … … W=32

Self Clocking Interrupted n During timeouts, ACKs are drained from the network. Self clocking

Self Clocking Interrupted n During timeouts, ACKs are drained from the network. Self clocking is interrupted. Next transmission causes a burst. Hence, slow start! … ACKs Drained!! Lost Ack 32 … 16 packet burst W=32 Timeout Retransmission Cut window in 1/2

Self Clocking and Fast Retransmit / Fast Recovery n When fast retransmit is used,

Self Clocking and Fast Retransmit / Fast Recovery n When fast retransmit is used, the packet is retransmitted before all ACKs are drained. Slow start is not needed … Lost … Fast Retransmission W=32 Cut window in 1/2

TCP Vegas n Uses congestion avoidance instead of congestion control n n n Vegas:

TCP Vegas n Uses congestion avoidance instead of congestion control n n n Vegas: Congestion avoidance: Predict and avoid congestion before it occurs Tahoe, Reno: Congestion control: React to congestion after it occurs Question: How to predict congestion?

TCP Vegas n Idea: source watches for some sign that router’s queue is building

TCP Vegas n Idea: source watches for some sign that router’s queue is building up and congestion will happen too; e. g. , n n RTT grows sending rate flattens

Observation cwnd n Packet accumulation in the network can be inferred by monitoring RTT

Observation cwnd n Packet accumulation in the network can be inferred by monitoring RTT and sending rate Send ing R ate Overloaded Bottleneck Link Router Sending Rate = cwnd / RTT

Algorithm n n Let Base. RTT be the minimum of all measured RTTs (commonly

Algorithm n n Let Base. RTT be the minimum of all measured RTTs (commonly the RTT of the first packet) If not overflowing the connection, then Expect. Rate = Congestion. Window/Base. RTT n n Source calculates Actual. Rate once per RTT Source compares Actual. Rate with Expect. Rate Diff = Expected. Rate - Actual. Rate if Diff < a increase Congestion. Window linearly else if Diff > b decrease Congestion. Window linearly else leave Congestion. Window unchanged

Algorithm (cont) n Parameters - a = 1 packet b = 3 packets

Algorithm (cont) n Parameters - a = 1 packet b = 3 packets