Congestion Control EE 122: Intro to Communication Networks Fall 2010 (MW 4-5:30 in 101 Barker) Scott Shenker TAs: Sameer Agarwal, Sara Alspaugh, Igor Ganichev,

Slides:



Advertisements
Similar presentations
1 EE 122:TCP Congestion Control Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,
Advertisements

24-1 Chapter 24. Congestion Control and Quality of Service (part 1) 23.1 Data Traffic 23.2 Congestion 23.3 Congestion Control 23.4 Two Examples.
Congestion Control Jennifer Rexford Advanced Computer Networks Tuesdays/Thursdays 1:30pm-2:50pm.
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Congestion Control Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
TCP Congestion Control Dina Katabi & Sam Madden nms.csail.mit.edu/~dina 6.033, Spring 2014.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
Congestion Control Reading: Sections COS 461: Computer Networks Spring 2011 Mike Freedman
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
1 Congestion Control EE122 Fall 2011 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Computer Networks : TCP Congestion Control1 TCP Congestion Control.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Data Communication and Networks
1 Internet Networking Spring 2004 Tutorial 10 TCP NewReno.
Networks : TCP Congestion Control1 TCP Congestion Control.
Networks : TCP Congestion Control1 TCP Congestion Control Presented by Bob Kinicki.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
L13: Sharing in network systems Dina Katabi Spring Some slides are from lectures by Nick Mckeown, Ion Stoica, Frans.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
1 EE 122: Advanced TCP Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,
Courtesy: Nick McKeown, Stanford 1 TCP Congestion Control Tahir Azim.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 15: Congestion Control I Slides used with.
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
CSE 461 University of Washington1 Topic How TCP implements AIMD, part 1 – “Slow start” is a component of the AI portion of AIMD Slow-start.
EE 122: Congestion Control and Avoidance Kevin Lai October 23, 2002.
1 Mao W07 Midterm Review EECS 489 Computer Networks Z. Morley Mao Monday Feb 19, 2007 Acknowledgement: Some.
Copyright 2008 Kenneth M. Chipps Ph.D. Controlling Flow Last Update
Project 2 – Implement Reliable Transport
1 TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in.
Lecture 9 – More TCP & Congestion Control
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Principles of Congestion Control Some slides.
Winter 2008CS244a Handout 71 CS244a: An Introduction to Computer Networks Handout 7: Congestion Control Nick McKeown Professor of Electrical Engineering.
Recap of Lecture 19 If symptoms persist, please consult Dr Jacobson.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Congestion Control 0.
CS 268: Lecture 5 (TCP Congestion Control) Ion Stoica February 4, 2004.
1 Congestion Control EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
1 Flow & Congestion Control Some slides are from lectures by Nick Mckeown, Ion Stoica, Frans Kaashoek, Hari Balakrishnan, and Sam Madden Prof. Dina Katabi.
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Chapter 6 TCP Congestion Control
COMP 431 Internet Services & Protocols
Introduction to Congestion Control
EECS 122: Introduction to Computer Networks Congestion Control
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
TCP.
Lecture 19 – TCP Performance
Chapter 6 TCP Congestion Control
COMP/ELEC 429/556 Introduction to Computer Networks
CS640: Introduction to Computer Networks
TCP Congestion Control
EE 122: Lecture 10 (Congestion Control)
Transport Layer: Congestion Control
Congestion Michael Freedman COS 461: Computer Networks
Presentation transcript:

Congestion Control EE 122: Intro to Communication Networks Fall 2010 (MW 4-5:30 in 101 Barker) Scott Shenker TAs: Sameer Agarwal, Sara Alspaugh, Igor Ganichev, Prayag Narula Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and other colleagues at Princeton and UC Berkeley

2 Goals of Today’s Lecture Congestion Control: Overview –End system adaptation controlling network load Congestion Control: Some Details –Additive-increase, multiplicative-decrease (AIMD) –How to begin transmitting: Slow Start (really “fast start”) Why AIMD? Listing of Additional Congestion Control Topics Will repeat myself several times in this lecture Easy to think you understand congestion control Trust me, you don’t……because I don’t either!

3 Course So Far…. We know: How to process packets in a switch How to route packets in the network How to send packets reliably How to not overload a receiver How to split infinitives…… We don’t know: How to not overload the network!

4 Congestion Control Overview

5 It’s Not Just The Sender & Receiver Flow control keeps one fast sender from overwhelming a slow receiver Congestion control keeps a set of senders from overloading the network Huge academic literature on congestion control –Advances in mid-80s by Jacobson “saved” the Internet –Well-defined performance question: easy to write papers –Less of a focus now (bottlenecked access links?)… –…but still far from academically settled oE.g. battle over “fairness” with Bob Briscoe…

Because Internet traffic is bursty! If two packets arrive at the same time –The node can only transmit one –… and either buffers or drops the other If many packets arrive in a short period of time –The node cannot keep up with the arriving traffic –… delays, and the buffer may eventually overflow 6 Congestion is Natural

7 Load and Delay Average Packet delay Load Typical behavior of queuing systems with bursty arrivals: Power Load Ideal: low delays and high utilization Reality: must balance the two Maximizing “power” is an example “optimal load” Question: How do we balance utilization and delay?

8 Dynamic Adjustment by End systems Probe network to test level of congestion –Speed up when no congestion –Slow down when congestion Drawbacks: –Suboptimal (always above or below optimal point) –Messy dynamics –Relies on end system cooperation Might seem complicated to implement –But algorithms are pretty simple (Jacobson/Karels ‘88) –Understanding global behavior is not simple….

9 Basics of TCP Congestion Control Each source determines the available capacity –… so it knows how many packets to have in flight Congestion window (CWND) –Maximum # of unacknowledged bytes to have in flight –Congestion-control equivalent of receiver window –MaxWindow = min{congestion window, receiver window} –Send at the rate of the slowest component Adapting the congestion window –Decrease upon detecting congestion –Increase upon lack of congestion: optimistic exploration Note: TCP congestion control done only by end systems, not by mechanisms inside the network

10 Detecting Congestion How can a TCP sender determine that the network is under stress? Network could tell it (ICMP Source Quench) –Risky, because during times of overload the signal itself could be dropped (and add to congestion)! Packet delays go up (knee of load-delay curve) –Tricky: noisy signal (delay often varies considerably) Packet loss –Fail-safe signal that TCP already has to detect –Complication: non-congestive loss (checksum errors)

11 How to Adjust CWND? Increase linearly, decrease multiplicatively (AIMD) –Consequences of over-sized window much worse than having an under-sized window oOver-sized window: packets dropped and retransmitted oUnder-sized window: somewhat lower throughput –Will come back to this later Additive increase –On success for last window of data, increase linearly oTCP uses an increase of one packet (MSS) per RTT Multiplicative decrease –On loss of packet, TCP divides congestion window in half

12 Leads to the TCP “Sawtooth” t Window halved Loss

13 AIMD Starts Too Slowly! t Window It could take a long time to get started! Need to start with a small CWND to avoid overloading the network.

14 “Slow Start” Phase Start with a small congestion window –Initially, CWND is 1 MSS –So, initial sending rate is MSS/RTT That could be pretty wasteful –Might be much less than the actual bandwidth –Linear increase takes a long time to accelerate Slow-start phase (actually “fast start”) –Sender starts at a slow rate (hence the name) –… but increases the rate exponentially –… until the first loss event

15 Slow Start in Action Double CWND per round-trip time Simple implementation: on each ack, CWND += MSS D A DD AADD Src Dest D D AAAA 8

Each ACK releases two packets cwnd = 1 cwnd = 2 16 Another Picture of Slow-Start segment 1 segment 2 segment 3 cwnd = 4 segment 4 segment 5 segment 6 segment 7 cwnd = 7 cwnd = 3 cwnd = 8 cwnd = 6 cwnd = 5

17 Slow Start and the TCP Sawtooth Loss Exponential “slow start” t Window Why is it called slow-start? Because TCP originally had no congestion control mechanism. The source would just start by sending a whole window’s worth of data.

18 This has been incredibly successful Leads to the theoretical puzzle: If TCP congestion control is the answer, then what was the question? Not about optimizing, but about robustness –Hard to capture…

19 Congestion Control Details

20 Increasing CWND Increase by MSS for every successful window Increase a fraction of MSS per received ACK # packets (thus ACKs) per window: CWND / MSS Increment per ACK: CWND += MSS * (MSS / CWND) Termed: Congestion Avoidance –Very gentle increase

Detecting Packet Loss If retransmitting, already assuming packet loss –Two criteria for retransmissions Packet can timeout (RTO timer expires) –But RTO is often ~ 500msec Fast retransmit –When same packet gets acked 4 times (3 DupACKs) Congestion control treats these events differently 21

22 Fast Retransmission Packet n is lost, but packets n+1, n+2, …, arrive On each arrival of a packet not in sequence, receiver generates an ACK –ACK is for seq.no. just beyond highest in-sequence So as n+1, n+2, … arrive, receiver generates repeated ACKs for seq.no. n –“duplicate” acknowledgments since they look the same Sender sees 3 of these dupACKs and immediately retransmits packet n (and only n) Multiplicative decrease and keep going –CWND halved

23 CWND with Fast Retransmit segment 1 cwnd = 1 ACK 2 cwnd = 2 segment 2 segment 3 ACK 4 cwnd = 4 segment 4 segment 5 segment 6 segment 7 ACK 4 ACK 3 cwnd = 3 ACK 4 segment 4 3 duplicate ACKs cwnd = 2

24 Loss Detected by Timeout Sender starts a timer that runs for RTO seconds Every time ack for new data arrives, restart timer If timer expires: –Set SSTHRESH  CWND / 2 (“Slow-Start Threshold”) –Set CWND  MSS (avoid a burst) –Retransmit first lost packet –Execute Slow Start until CWND > SSTHRESH –After which switch to Additive Increase

25 Summary of Decrease Cut CWND half on loss detected by NACK –“fast retransmit” Cut CWND all the way to 1 MSS on timeout –Set ssthresh to cwnd/2 Never drop CWND below 1 MSS

Summary of Increase “Slow-start”: increase cwnd by MSS for each ack Leave slow-start regime when either: –cwnd > SSThresh –Packet drop Enter AIMD regime –Increase by MSS for each window’s worth of acked data 26

27 Repeating Slow Start After Timeout t Window Slow-start restart: Go back to CWND of 1 MSS, but take advantage of knowing the previous value of CWND. Slow start in operation until it reaches half of previous CWND, I.e., SSTHRESH Timeout Fast Retransmission SSThresh Set to Here

28 Slow Start/AIMD Pseudocode (Not FR) Initially: cwnd = MSS; ssthresh = infinite; New ack received: if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + MSS; else /* Congestion Avoidance */ cwnd = cwnd + MSS/cwnd; Timeout: /* Multiplicative decrease */ ssthresh = cwnd/2; cwnd = MSS;

29 5 Minute Break Questions Before We Proceed?

Announcements No office hours today HW3a grades released On Monday Igor will review Networking Libraries –For 45 minutes Then I will cover Overlays and P2P…. 30

31 Why AIMD? In what follows refer to cwnd in units of MSS

Three Congestion Control Challenges Single flow adjusting to bottleneck bandwidth –Without any a priori knowledge –Could be a Gbps link; could be a modem Single flow adjusting to variations in bandwidth –When bandwidth decreases, must lower sending rate –When bandwidth increases, must increase sending rate Multiple flows sharing the bandwidth –Must avoid overloading network –And share bandwidth “fairly” among the flows 32

33 Problem #1: Single Flow, Fixed BW Want to get a first-order estimate of the available bandwidth –Assume bandwidth is fixed –Ignore presence of other flows Want to start slow, but rapidly increase rate until packet drop occurs (“slow-start”) Adjustment: –cwnd initially set to 1 (MSS) –cwnd++ upon receipt of ACK

34 Problems with Slow-Start Slow-start can result in many losses –Roughly the size of cwnd ~ BW*RTT Example: –At some point, cwnd is enough to fill “pipe” –After another RTT, cwnd is double its previous value –All the excess packets are dropped! Need a more gentle adjustment algorithm once have rough estimate of bandwidth

Problem #2: Single Flow, Varying BW Want to track available bandwidth Oscillate around its current value If you never send more than your current rate, you won’t know if more bandwidth is available Possible variations: (in terms of change per RTT) Multiplicative increase or decrease: cwnd  cwnd * / a Additive increase or decrease: cwnd  cwnd +- b 35

Four alternatives AIAD: gentle increase, gentle decrease AIMD: gentle increase, drastic decrease MIAD: drastic increase, gentle decrease –too many losses: eliminate MIMD: drastic increase and decrease 36

Why AIMD? What’s wrong with AIAD? What’s wrong with MIMD? 37

38 Problem #3: Multiple Flows Want steady state to be “fair” Many notions of fairness, but here just require two identical flows to end up with the same bandwidth This eliminates MIMD and AIAD –As we shall see… AIMD is the only remaining solution! –Not really, but close enough….

39 Buffer and Window Dynamics No congestion  x increases by one packet/RTT every RTT Congestion  decrease x by factor 2 AB C = 50 pkts/RTT x

40 AIMD Sharing Dynamics AB x1x1 DE No congestion  rate increases by one packet/RTT every RTT Congestion  decrease rate by factor 2 Rates equalize  fair share x2x2

41 AIAD Sharing Dynamics AB x1x1 DE No congestion  x increases by one packet/RTT every RTT Congestion  decrease x by 1 x2x2

42 Simple Model of Congestion Control Two TCP connections –Rates x 1 and x 2 Congestion when sum>1 Efficiency: sum near 1 Fairness: x’s converge User 1: x 1 User 2: x 2 Efficiency line 2 user example overload underload

43 Example User 1: x 1 User 2: x 2 fairness line efficiency line 1 1 Total bandwidth 1 Inefficient: x 1 +x 2 =0.7 (0.2, 0.5) Congested: x 1 +x 2 =1.2 (0.7, 0.5) Efficient: x 1 +x 2 =1 Not fair (0.7, 0.3) Efficient: x 1 +x 2 =1 Fair (0.5, 0.5)

44 AIAD User 1: x 1 User 2: x 2 fairness line efficiency line (x 1h,x 2h ) (x 1h -a D,x 2h -a D ) (x 1h -a D +a I ), x 2h -a D +a I )) Increase: x + a I Decrease: x - a D Does not converge to fairness

45 MIMD User 1: x 1 User 2: x 2 fairness line efficiency line (x 1h,x 2h ) (b d x 1h,b d x 2h ) (b I b D x 1h, b I b D x 2h ) Increase: x*b I Decrease: x*b D Does not converge to fairness

46 (b D x 1h +a I, b D x 2h +a I ) AIMD User 1: x 1 User 2: x 2 fairness line efficiency line (x 1h,x 2h ) (b D x 1h,b D x 2h ) Increase: x+a D Decrease: x*b D Converges to fairness

47 Other Congestion Control Topics

Additional Congestion Control Topics TCP compatibility –Everyone has to use congestion control that shares fairly Equation-based congestion control [ r ~ 1/sqrt(d) ] Extending TCP to higher speeds Signaling congestion without packet drops (ECN) Router involvement with congestion control –Ensuring fairness (no need for single standard) –Better than AIMD Economic models (Kelly) 48

49 Summary Congestion is natural –Internet does not reserve resources in advance –TCP actively tries to grab capacity Congestion control critically important –AIMD: Additive Increase, Multiplicative Decrease –Congestion detected via packet loss (fail-safe) –Slow start to find initial sending rate & to restart after timeout Next class: –Igor: Networking Libraries –Scott: Overlays and P2P