CS 268: Lecture 4 (TCP Congestion Control)

Slides:



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

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.
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.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP Congestion Control: AIMD and Binomial Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
CS 268: Congestion Control and Avoidance Kevin Lai Feb 4, 2002.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
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 Internet Networking Spring 2002 Tutorial 10 TCP NewReno.
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.
TCP in Heterogeneous Network Md. Ehtesamul Haque # P.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
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,
Network Technologies essentials Week 8: TCP congestion control Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University.
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.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
TCP CS 168 Discussion Week 6 Many thanks to past EE 122 GSIs.
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.
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
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.
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.
Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks TCP.
The Macroscopic behavior of the TCP Congestion Avoidance Algorithm.
TCP continued. Discussion – TCP Throughput TCP will most likely generate the saw tooth type of traffic. – A rough estimate is that the congestion window.
CS 268: Lecture 5 (TCP Congestion Control) Ion Stoica February 4, 2004.
CS 268: Transport and Congestion Control Lecture 5 February 2, 2005.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
@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.
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.
Chapter 3 outline 3.1 transport-layer services
Introduction to Networks
COMP 431 Internet Services & Protocols
Congestion Control.
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.
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.
Congestion Control (from Chapter 05)
CS640: Introduction to Computer Networks
CS 268: Lecture 5 (TCP Congestion Control)
If both sources send full windows, we may get congestion collapse
Congestion control and TCP 2007
Congestion Control (from Chapter 05)
Administrivia Review 1 Office hours moving to Thursday 10—12
TCP Congestion Control
EE 122: Lecture 10 (Congestion Control)
Congestion Control (from Chapter 05)
Transport Layer: Congestion Control
Congestion Control (from Chapter 05)
Congestion Control (from Chapter 05)
TCP flow and congestion control
Presentation transcript:

CS 268: Lecture 4 (TCP Congestion Control) Ion Stoica January 30, 2003

Problem How much traffic do you send? Two components Flow control – make sure that the receiver can receive as fast as you send Congestion control – make sure that the network delivers the packets to the receiver

Flow control: Window Size and Throughput wnd = 3 RTT (Round Trip Time) Sliding-window based flow control: Higher window  higher throughput Throughput = wnd/RTT Need to worry about sequence number wrapping Remember: window size control throughput segment 1 segment 2 segment 3 ACK 2 ACK 3 ACK 4 segment 4 segment 5 segment 6

Why do You Care About Congestion Control? Otherwise you get to congestion collapse How might this happen? Assume network is congested (a router drops packets) You learn the receiver didn’t get the packet either by ACK, NACK, or Timeout What do you do? retransmit packet Still receiver didn’t get the packet Retransmit again …. and so on … And now assume that everyone is doing the same! Network will become more and more congested And this with duplicate packets rather than new packets!

Solutions? Increase buffer size. Why not? Slow down Questions: If you know that your packets are not delivered because network congestion, slow down Questions: How do you detect network congestion? By how much do you slow down?

What’s Really Happening? 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

Congestion Control vs. Congestion Avoidance Congestion control goal Stay left of cliff Congestion avoidance goal Stay left of knee knee cliff Throughput congestion collapse Load

Goals Operate near the knee point Remain in equilibrium How to maintain equilibrium? Don’t put a packet into network until another packet leaves. How do you do it? Use ACK: send a new packet only after you receive and ACK. Why? Maintain number of packets in network “constant”

How Do You Do It? Detect when network approaches/reaches knee point Stay there Questions How do you get there? What if you overshoot (i.e., go over knee point) ? Possible solution: Increase window size until you notice congestion Decrease window size if network congested

Detecting Congestion Explicit network signal Implicit network signal Send packet back to source (e.g. ICMP Source Quench) Control traffic congestion collapse Set bit in header (e.g. DEC DNA/OSI Layer 4[CJ89], ECN) Can be subverted by selfish receiver [SEW01] Unless on every router, still need end-to-end signal Could be be robust, if deployed Implicit network signal Loss (e.g. TCP Tahoe, Reno, New Reno, SACK) +relatively robust, -no avoidance Delay (e.g. TCP Vegas) +avoidance, -difficult to make robust Easily deployable Robust enough? Wireless?

Efficient Allocation xi=Xgoal Too slow 2 user example Too fast 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

Fair Allocation Maxmin fairness Assumes no knowledge of priorities Flows which share the same bottleneck get the same amount of bandwidth Assumes no knowledge of priorities Fairness = 1 - distance from fairness line 2 user example 2 getting too much fairness line User 2: x2 1 getting too much User 1: x1

Control System Model [CJ89] User 1 x1 x2 xi>Xgoal  User 2 xn User n y Simple, yet powerful model Explicit binary signal of congestion Why explicit (TCP uses implicit)? Implicit allocation of bandwidth

Possible Choices Multiplicative increase, additive decrease aI=0, bI>1, aD<0, bD=1 Additive increase, additive decrease aI>0, bI=1, aD<0, bD=1 Multiplicative increase, multiplicative decrease aI=0, bI>1, aD=0, 0<bD<1 Additive increase, multiplicative decrease aI>0, bI=1, aD=0, 0<bD<1 Which one?

Multiplicative Increase, Additive Decrease fairness line Does not converge to fairness Not stable at all Does not converges to efficiency Stable iff (bI(x1h+aD), bI(x2h+aD)) (x1h,x2h) (x1h+aD,x2h+aD) User 2: x2 efficiency line User 1: x1

Additive Increase, Additive Decrease fairness line (x1h+aD+aI), x2h+aD+aI)) Does not converge to fairness Stable Does not converge to efficiency Stable iff (x1h,x2h) (x1h+aD,x2h+aD) User 2: x2 efficiency line User 1: x1

Multiplicative Increase, Multiplicative Decrease fairness line Does not converge to fairness Stable Converges to efficiency iff (x1h,x2h) (bIbDx1h, bIbDx2h) (bdx1h,bdx2h) User 2: x2 efficiency line User 1: x1

Additive Increase, Multiplicative Decrease (bDx1h+aI, bDx2h+aI) fairness line Converges to fairness Converges to efficiency Increments smaller as fairness increases effect on metrics? (x1h,x2h) (bDx1h,bDx2h) User 2: x2 efficiency line User 1: x1

Significance Characteristics Converges to efficiency, fairness Easily deployable Fully distributed No need to know full state of system (e.g. number of users, bandwidth of links) (why good?) Theory that enabled the Internet to grow beyond 1989 Key milestone in Internet development Fully distributed network architecture requires fully distributed congestion control Basis for TCP

Modeling Critical to understanding complex systems [CJ89] model relevant for 13 years, 106 increase of bandwidth, 1000x increase in number of users Criteria for good models Realistic Simple Easy to work with Easy for others to understand Realistic, complex model  useless Unrealistic, simple model  can teach something about best case, worst case, etc.

TCP Congestion Contol [CJ89] provides theoretical basis How to start? Still many issues to be resolved How to start? Implicit congestion signal Loss Need to send packets to detect congestion Must reconcile with AIMD How to maintain equilibrium? Use ACK: send a new packet only after you receive and ACK. Why? Maintain number of packets in network “constant”

TCP Congestion Control Maintains three variables: cwnd – congestion window flow_win – flow window; receiver advertised window ssthresh – threshold size (used to update cwnd) For sending use: win = min(flow_win, cwnd)

TCP: Slow Start Goal: discover congestion quickly How? Quickly increase cwnd until network congested  get a rough estimate of the optimal of cwnd Whenever starting traffic on a new connection, or whenever increasing traffic after congestion was experienced: Set cwnd =1 Each time a segment is acknowledged increment cwnd by one (cwnd++). Slow Start is not actually slow cwnd increases exponentially

Slow Start Example The congestion window size grows very rapidly TCP slows down the increase of cwnd when cwnd >= ssthresh segment 1 cwnd = 1 ACK 2 cwnd = 2 segment 2 segment 3 ACK 4 cwnd = 4 segment 4 segment 5 segment 6 segment 7 ACK6-8 cwnd = 8

Congestion Avoidance Slow down “Slow Start” If cwnd > ssthresh then each time a segment is acknowledged increment cwnd by 1/cwnd (cwnd += 1/cwnd). So cwnd is increased by one only if all segments have been acknowlegded. (more about ssthresh latter)

Slow Start/Congestion Avoidance Example Assume that ssthresh = 8 Cwnd (in segments) ssthresh Roundtrip times

Putting Everything Together: TCP 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; while (next < unack + win) transmit next packet; where win = min(cwnd, flow_win); unack next seq # win

The big picture cwnd Timeout Congestion Avoidance Slow Start Time

Fast Retransmit Don’t wait for window to drain Resend a segment after 3 duplicate ACKs remember a duplicate ACK means that an out-of sequence segment was received Notes: duplicate ACKs due to packet reordering why reordering? iwindow may be too small to get 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 ACK 4 segment 7 ACK 4 3 duplicate ACKs ACK 4

Fast Recovery After a fast-retransmit set cwnd to ssthresh/2 i.e., don’t reset cwnd to 1 But when RTO expires still do cwnd = 1 Fast Retransmit and Fast Recovery  implemented by TCP Reno; most widely used version of TCP today

Fast Retransmit and Fast Recovery cwnd Congestion Avoidance Slow Start Time Retransmit after 3 duplicated acks prevent expensive timeouts No need to slow start again At steady state, cwnd oscillates around the optimal window size.

Reflections on TCP Assumes that all sources cooperate Assumes that congestion occurs on time scales greater than 1 RTT Only useful for reliable, in order delivery, non-real time applications Vulnerable to non-congestion related loss (e.g. wireless) Can be unfair to long RTT flows