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

Slides:



Advertisements
Similar presentations
Congestion Control and Fairness Models Nick Feamster CS 4251 Computer Networking II Spring 2008.
Advertisements

TCP and Congestion Control
TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from Computer Networks A Systems Approach, Fourth Ed.,Peterson and Davie,
CSCI-1680 Transport Layer II Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
1 EE 122: Networks Performance & Modeling Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks.
Congestion Control Jennifer Rexford Advanced Computer Networks Tuesdays/Thursdays 1:30pm-2:50pm.
ECE 4450:427/527 - Computer Networks Spring 2015
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.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer.
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.
Lecture 8 Congestion Control EECS 122 University of California Berkeley.
1 Congestion Control EE122 Fall 2011 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson.
15-744: Computer Networking L-10 Congestion Control.
1 Lecture 9: TCP and Congestion Control Slides adapted from: Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis) Chapter 3.
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.
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.
CS540/TE630 Computer Network Architecture Spring 2009 Tu/Th 10:30am-Noon Sue Moon.
Transport Layer1 Flow and Congestion Control Ram Dantu (compiled from various text books)
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.
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
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
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.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Principles of Congestion Control Some slides.
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,
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.
CS450 – Introduction to Networking Lecture 19 – Congestion Control (2)
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
COMP 431 Internet Services & Protocols
Introduction to Congestion Control
EECS 122: Introduction to Computer Networks Congestion Control
Project 2 is out! Goal: implement reliable transport protocol
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Flow and Congestion Control
Lecture 19 – TCP Performance
So far, On the networking side, we looked at mechanisms to links hosts using direct linked networks and then forming a network of these networks. We introduced.
CS 268: Lecture 4 (TCP Congestion Control)
Chapter 6 TCP Congestion Control
COMP/ELEC 429/556 Introduction to Computer Networks
CS640: Introduction to Computer Networks
If both sources send full windows, we may get congestion collapse
TCP Congestion Control
EE 122: Lecture 10 (Congestion Control)
Transport Layer: Congestion Control
TCP flow and congestion control
Presentation transcript:

1 EE 122:TCP Congestion Control Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson, Jennifer Rexford, and colleagues at UC Berkeley)

2 Goals of Today’s Lecture Principles of congestion control Learning that congestion is occurring Adapting to alleviate the congestion TCP congestion control Additive-increase, multiplicative-decrease (AIMD) How to begin transmitting: Slow Start

3 What We Know We know: How to process packets in a switch How to route packets in the network How to send packets reliably We don’t know: How fast to send

4 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 Three congestion control problems: Adjusting to bottleneck bandwidth Without any a priori knowledge Could be a Gbps link; could be a modem Adjusting to variations in bandwidth Sharing bandwidth between flows

5 Congestion is Unavoidable 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 … and the buffer may eventually overflow

6 Congestion Collapse Definition: Increase in network load results in a decrease of useful work done Due to: Undelivered packets Packets consume resources and are dropped later in network Spurious retransmissions of packets still in flight Unnecessary retransmissions lead to more load! Pouring gasoline on a fire Mid-1980s: Internet grinds to a halt Until Jacobson/Karels (Berkeley!) devise TCP congestion control

7 View from a Single Flow Knee – point after which Throughput increases very slowly Delay increases quickly Cliff – point after which Throughput starts to decrease very fast to zero (congestion collapse) Delay approaches infinity Load Throughput Delay kneecliff congestion collapse packet loss

8 General Approaches Send without care Many packet drops (1) Reservations Pre-arrange bandwidth allocations Requires negotiation before sending packets Low utilization (2) Pricing Don’t drop packets for the high-bidders Requires payment model

9 General Approaches (cont’d) (3) Dynamic Adjustment Probe network to test level of congestion Speed up when no congestion Slow down when congestion Suboptimal, messy dynamics, simple to implement All three techniques have their place But for generic Internet usage, dynamic adjustment is the most appropriate Due to pricing structure, traffic characteristics, and good citizenship

10 TCP Congestion Control TCP connection has window Controls number of unacknowledged packets Sending rate: ~Window/RTT Vary window size to control sending rate

11 Sizing the Windows cwnd (Congestion Windows) How many bytes can be sent without overflowing routers Computed by congestion control algorithm AdvertisedWindow How many bytes can be sent without overflowing the sender Determined by the receiver

12 EffectiveWindow Limits how much data can be in transit Implemented as # of bytes Described as # packets (segments) in this lecture EffectiveWindow = MaxWindow – (LastByteSent – LastByteAcked) MaxWindow = min(cwnd, AdvertisedWindow) LastByteAcked LastByteSent sequence number increases MaxWindow EffectiveWindow

13 Two Basic Components Detecting congestion Rate adjustment algorithm Depends on congestion or not Three subproblems within adjustment problem Finding fixed bandwidth Adjusting to bandwidth variations Sharing bandwidth

14 Detecting Congestion Packet dropping is best sign of congestion Delay-based methods are hard and risky How do you detect packet drops? ACKs TCP uses ACKs to signal receipt of data ACK denotes last contiguous byte received Actually, ACKs indicate next segment expected Two signs of packet drops No ACK after certain time interval: time-out Several duplicate ACKs (ignore for now)

15 Rate Adjustment Basic structure: Upon receipt of ACK (of new data): increase rate Upon detection of loss: decrease rate But what increase/decrease functions should we use? Depends on what problem we are solving

16 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 cwnd++ upon receipt of ACK

17 Slow-Start cwnd increases exponentially: cwnd doubles every time a full cwnd of packets has been sent Each ACK releases two packets Slow-start is called “slow” because of starting point segment 1 cwnd = 1 cwnd = 2 segment 2 segment 3 cwnd = 4 segment 4 segment 5 segment 6 segment 7 cwnd = 8 cwnd = 3

18 5 Minute Break Questions Before We Proceed?

19 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

20 Problem #2: Single Flow, Varying BW Want to be able to track available bandwidth, oscillating around its current value Possible variations: (in terms of RTTs) Multiplicative increase or decrease: cwnd  a*cwnd Additive increase or decrease: cwnd  cwnd + b Four alternatives: AIAD: gentle increase, gentle decrease AIMD: gentle increase, drastic decrease MIAD: drastic increase, gentle decrease (too many losses) MIMD: drastic increase and decrease

21 Problem #3: Multiple Flows Want steady state to be “fair” Many notions of fairness, but here all we require is that two identical flows end up with the same bandwidth This eliminates MIMD and AIAD AIMD is the only remaining solution!

22 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

23 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

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

25 Efficient Allocation: Challenges of Congestion Control Too slow Fail to take advantage of available bandwidth  underload Too fast Overshoot knee  overload, high delay, loss Everyone’s doing it May all under/over shoot  large oscillations Optimal:  x i =X goal Efficiency = 1 - distance from efficiency line User 1: x 1 User 2: x 2 Efficiency line 2 user example overload underload

26 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)

27 MIAD User 1: x 1 User 2: x 2 fairness line efficiency line (x 1h,x 2h ) (x 1h -a D,x 2h -a D ) (b I (x 1h -a D ), b I (x 2h -a D )) Increase: x*b I Decrease: x - a D Does not converge to fairness Does not converges to efficiency

28 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 Does not converge to efficiency

29 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 Converges to efficiency iff

30 (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 Converges to efficiency Increments smaller as fairness increases

31 Implementing AIMD After each ACK Increment cwnd by 1/cwnd (cwnd += 1/cwnd) As a result, cwnd is increased by one only if all segments in a cwnd have been acknowledged But need to decide when to leave slow-start and enter AIMD  Use ssthresh variable

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

33 The big picture (with timeouts) Time cwnd Timeout Slow Start AIMD ssthresh Timeout Slow Start AIMD

34 Summary Congestion is inevitable Internet does not reserve resources in advance TCP actively tries to grab capacity Congestion control critical for avoiding collapse 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 Advanced congestion control