330 likes | 511 Views
Congestion Control. Tanenbaum 5.3, 6.5. What? Why?. Congestion occurs when there is no reservation Demand exceeds Resources If congestion persists, resources must be increased If congestion happens in short bursts, buffers can avoid packet losses to some extent. Congestion Control, How?.
E N D
Congestion Control Tanenbaum 5.3, 6.5
What? Why? • Congestion occurs when • there is no reservation • Demand exceeds Resources • If congestion persists, resources must be increased • If congestion happens in short bursts, buffers can avoid packet losses to some extent. Congestion Control (A Loss Based Technique: TCP)
Congestion Control, How? • Network Layer • Congestion control point to point • Transport Layer • Congestion control end-to-end Maximum capacity of bottleneck link Packets Delivered Objective Congestion Congestion Collapse Packets Sent Congestion Control (A Loss Based Technique: TCP)
Network As Black Box Network/ Network Element Load State variable u What can U be? Round trip time (e2e) Throughput (e2e) Packet loss (e2e or p2p) Link utilization (p2p) Queue size (p2p) Congestion Control (A Loss Based Technique: TCP)
Congestion Control in Packet Switched Networks • Monitor some system state variable u • u may be link utilization (p2p), loss rate (p2p or e2e) • Instantaneous unow • Average value u computed as: • unew = a.ulast + (1- a) unow • 0 <= a <= 1 • Use of thresholds Congestion Control (A Loss Based Technique: TCP)
Congestion Control:Strategies • Open loop • Prevent congestion by design • E.g., resource reservation, admission control • Closed loop • Monitor some characteristics of system • Inform key elements that can take action • Adjust system operation whenever needed Congestion Control (A Loss Based Technique: TCP)
Network As Black Box Network Packet Loss, Round trip time, or Throughput Window Size Or Rate Congestion Control (A Loss Based Technique: TCP)
Packet Loss BasedCongestion Control TCP Congestion Control (Read Van Jacobson, “Congestion Avoidance and Control,” Sigcomm’88)
System (Connection) In Equilibrium Time Bandwidth Slow long-haul link High Speed LANs Congestion Control (A Loss Based Technique: TCP)
Keeping A System in Equilibrium • Suppose that a system is in equilibrium, how to keep it there? • If there are no losses, easy: just send a packet whenever an ack is received. • If losses occur, we need to distinguish between delayed packets (link capacity shortage) and lost packets need an accurate retransmission timer. Congestion Control (A Loss Based Technique: TCP)
How to Get A System To Equilibrium? • At the beginning, no packet is sent yet. • Propose a strategy. Let us discuss some strategies: Strategy 1: Blast a guessed number of packets. Strategy 2: Start with sending one packet (WS=1) and wait • when ack is received, send two packets (WS=2) • For each ack, send one packet, plus one packet when all window is acked (WS=3) Congestion Control (A Loss Based Technique: TCP)
How to Get A System To Equilibrium? • Strategy 2 may be inefficient • Consider a download of a 21 KB file using a 1 KB segment size over a 45 Mbps link with 25ms one way latency. • Compute the efficiency of such a transfer Congestion Control (A Loss Based Technique: TCP)
How to Get A System To Equilibrium? (Strategy 2) Congestion Control (A Loss Based Technique: TCP)
A Faster Strategy: Slow Start • For each acked packet, increase window by 1 Congestion Control (A Loss Based Technique: TCP)
Slow-Start to Get A System To Equilibrium? (Strategy 2) Congestion Control (A Loss Based Technique: TCP)
A System in Equilibrium MayUNDERUTILIZE the Link Capacity • If losses do not happen, this is an indication that link capacity may not be fully utilized • What to do? • Slightly INCREASE the window size after a complete window of data made it safely through the network (this happens every round trip time.) Congestion avoidance phase Congestion Control (A Loss Based Technique: TCP)
TCP Congestion Avoidance and Control • Start with congestion window=1 (CWND) • Use slow start until CWND reaches the threshold sstresh (sstresh is half the congestion window vale reached when last loss occured) • From CWND=sstresh, use congestion avoidance Congestion Control (A Loss Based Technique: TCP)
Example CWND Round trip time Congestion Control (A Loss Based Technique: TCP)
Code When a packet is acked if cwnd < ssthresh* { /* Slow-Start: increment cwnd every ack*/ cwnd = cwnd + 1; } else { /* Congestion avoidance: increment cwnd every RTT */ cwnd = cwnd + 1/cwnd } When a packet is lost (timeout) ssthresh = cwnd / 2; cwnd = init_cwnd; * ssthresh may be dynamically adjusted at start-up (see Janey Hoe work) Congestion Control (A Loss Based Technique: TCP)
Fast Recovery/ Fast Retransmit • When 3rd dupack received: • Fast Recovery: • ssthresh = cwnd / 2; • cwnd = ssthresh + 3; • Fast Retransmit: • Retransmit missing packet without waiting for timeout Congestion Control (A Loss Based Technique: TCP)
Example CWND 16 8 4 2 Round trip time Congestion Control (A Loss Based Technique: TCP)
TCP Performance: A Simple Derivation • Mathis et. Al: "The Macroscopic Behavior of the TCP Congestion Avoidance Algorithm” • Assume • a very simple loss model: periodical loss with loss rate p • No timeout • Neglect the start-up behavior Congestion Control (A Loss Based Technique: TCP)
loss loss loss loss TCP Performance: A Simple Derivation (2) cwnd W Startup Before Stabiliza. W/2 0 (RTT) W/2 W 3W/2 Congestion Control (A Loss Based Technique: TCP)
TCP Performance (3) • Facts: • A loss happens whenever packets are sent (periodical loss model). • A loss happens every RTTs • The total number of packets sent every cycle (time between consecutive 2 losses) is the area under the curve. • The area is Congestion Control (A Loss Based Technique: TCP)
TCP Performance (4) • Facts (cont’d): • The number of packets delivered per cycle is • Solving, • Throughput = # packets received per cycle/cycle duration • Throughput = (packets per second) Congestion Control (A Loss Based Technique: TCP)
Taking Into Account Timeout • Jitendra Padhye et. Al “Modeling TCP Reno Performance: A Simple Model and Its Empirical Validation” . • Wmax : Max window size (flow control) • RTT: round trip time • b = # of packets received by an ack. • p: probability of packet loss • To= Duration of first timeout Congestion Control (A Loss Based Technique: TCP)
Shortcomings/Limits of TCP • TCP is not suited for streams => how to exercise TCP like congestion control on streams (UDP)? • TCP, as is, will not scale well to very high speeds => How to adapt TCP to very high speed networks? Congestion Control (A Loss Based Technique: TCP)
Impact of Policies on Congestion Control • Link Layer policies • Retransmission • Out-of-order caching • Acknowledgement • Flow control Congestion Control (A Loss Based Technique: TCP)
Impact of Policies on Congestion Control (2) • Network Layer policies • Virtual circuit/datagram • Packet scheduling • Queue management • Routing algorithm • Packet lifetime management Congestion Control (A Loss Based Technique: TCP)
Impact of Policies on Congestion Control (3) • Transport Layer policies • Retransmission • Out-of-order caching • Acknowledgement • Flow control • Timeout determination Congestion Control (A Loss Based Technique: TCP)
Congestion Control in Packet Switched Networks • Monitor some system state variable u • u may be link utilization, loss rate • Instantaneous unow • Average value u computed as: • unew = a.ulast + (1- a) unow • 0 <= a <= 1 • Use of thresholds Congestion Control (A Loss Based Technique: TCP)
Techniques at Link Layer • DECBit (Warning bit) • Source Quench packets (choke packets) • Hop-by-hop choke packets • Load shedding • RED Congestion Control (A Loss Based Technique: TCP)