EECS 122: Introduction to Computer Networks Congestion Control

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

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.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
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.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP Congestion Control: AIMD and Binomial Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
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.
15-744: Computer Networking L-10 Congestion Control.
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #7 TCP New Reno Vs. Reno.
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,
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.
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
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
What is TCP? Connection-oriented reliable transfer Stream paradigm
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.
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,
© 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.
TCP over Wireless PROF. MICHAEL TSAI 2016/6/3. TCP Congestion Control (TCP Tahoe) Only ACK correctly received packets Congestion Window Size: Maximum.
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)
Transport Layer CS 381 3/7/2017.
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
Congestion Control.
Introduction to Congestion Control
Project 2 is out! Goal: implement reliable transport protocol
Chapter 3 outline 3.1 Transport-layer services
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.
Flow and Congestion Control
Lecture 19 – TCP Performance
ECE 4450:427/527 - Computer Networks Spring 2017
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)
TCP Tutorial - Part III -
Chapter 6 TCP Congestion Control
COMP/ELEC 429/556 Introduction to Computer Networks
CS640: Introduction to Computer Networks
State Transition Diagram
If both sources send full windows, we may get congestion collapse
CS4470 Computer Networking Protocols
TCP Congestion Control
EE 122: Lecture 10 (Congestion Control)
Computer Science Division
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
TCP flow and congestion control
Presentation transcript:

EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA 94720-1776

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 "As we know, there are known knowns. There are things we know we know. We also know there are known unknowns. That is to say, we know there are some things we do not know. But there are also unknown unknowns, the ones we don't know we don't know." The Zen of Donald Rumsfeld.

Implications Send too slow: link is not fully utilized Wastes time Send too fast: link is fully utilized but.... Queue builds up in router buffer (delay) Overflow buffers in routers Overflow buffers in receiving host (ignore) Why are buffer overflows a problem? Packet drops (mine and others) Interesting history....(Van Jacobson rides to the rescue)

Abstract View Ignore internal structure of router and model it as having a single queue for a particular input-output pair A B Sending Host Buffer in Router Receiving Host

Three Congestion Control Problems Adjusting to bottleneck bandwidth Adjusting to variations in bandwidth Sharing bandwidth between flows

Single Flow, Fixed Bandwidth Adjust rate to match bottleneck bandwidth Without any a priori knowledge Could be gigabit link, could be a modem A B 100 Mbps

Single Flow, Varying Bandwidth Adjust rate to match instantaneous bandwidth Assuming you have rough idea of bandwidth A B BW(t)

Multiple Flows A2 B2 A1 A3 B3 B1 Two Issues: Adjust total sending rate to match bandwidth Allocation of bandwidth between flows A2 B2 100 Mbps A1 A3 B3 B1

Reality Congestion control is a resource allocation problem involving many flows, many links, and complicated global dynamics

What’s Really Happening? View from a Single Flow packet loss knee cliff Knee – point after which Throughput increases very slow Delay increases fast Cliff – point after which Throughput starts to decrease very fast to zero (congestion collapse) Delay approaches infinity Note (in an M/M/1 queue) Delay = 1/(1 – utilization) Throughput congestion collapse Load Delay Load

General Approaches Send without care Reservations Pricing Many packet drops Not as stupid as it seems Reservations Pre-arrange bandwidth allocations Requires negotiation before sending packets Low utilization Pricing Don’t drop packets for the high-bidders Requires payment model

General Approaches (cont’d) 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

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

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

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

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)

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

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

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 cwnd = 1 segment 1 cwnd = 2 segment 2 segment 3 cwnd = 3 cwnd = 4 segment 4 segment 5 segment 6 segment 7 cwnd = 8

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

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!

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

AIMD Sharing Dynamics A B D E x y Rates equalize  fair share No congestion  rate increases by one packet/RTT every RTT Congestion  decrease rate by factor 2 Rates equalize  fair share

AIAD Sharing Dynamics A B D E x y No congestion  x increases by one packet/RTT every RTT Congestion  decrease x by 1

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: xi=Xgoal Efficiency = 1 - distance from efficiency line 2 user example overload User 2: x2 Efficiency line underload User 1: x1

AIMD A B x C D E y Limit rates: x = y

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

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;

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

Congestion Detection Revisited Wait for Retransmission Time Out (RTO) RTO kills throughput In BSD TCP implementations, RTO is usually more than 500ms The granularity of RTT estimate is 500 ms Retransmission timeout is RTT + 4 * mean_deviation Solution: Don’t wait for RTO to expire

Fast Retransmits Resend a segment after 3 duplicate ACKs Notes: Duplicate ACK means that an out-of sequence segment was received Notes: ACKs are for next expected packet Packet reordering can cause duplicate ACKs Window may be too small to get enough duplicate ACKs segment 1 cwnd = 1 ACK 2 cwnd = 2 segment 2 segment 3 ACK 3 ACK 4 cwnd = 4 segment 4 segment 5 segment 6 segment 7 ACK 4 3 duplicate ACKs ACK 4 ACK 4

Fast Recovery: After a Fast Retransmit ssthresh = cwnd / 2 cwnd = ssthresh instead of setting cwnd to 1, cut cwnd in half (multiplicative decrease) For each dup ack arrival dupack++ MaxWindow = min(cwnd + dupack, AdvWin) indicates packet left network, so we may be able to send more Receive ack for new data (beyond initial dup ack) dupack = 0 exit fast recovery But when RTO expires still do cwnd = 1

Fast Retransmit and Fast Recovery cwnd AI/MD Slow Start Fast retransmit Time Retransmit after 3 duplicated acks Prevent expensive timeouts Reduce slow starts At steady state, cwnd oscillates around the optimal window size

TCP Congestion Control Summary Measure available bandwidth Slow start: fast, hard on network AIMD: slow, gentle on network Detecting congestion Timeout based on RTT robust, causes low throughput Fast Retransmit: avoids timeouts when few packets lost can be fooled, maintains high throughput Recovering from loss Fast recovery: don’t set cwnd=1 with fast retransmits