Katz, Stoica F04 EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer.

Slides:



Advertisements
Similar presentations
TCP Variants.
Advertisements

1 EE 122:TCP Congestion Control Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,
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.
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.
Congestion Control Tanenbaum 5.3, /12/2015Congestion Control (A Loss Based Technique: TCP)2 What? Why? Congestion occurs when –there is no reservation.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
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.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
EE 122: Switching and Forwarding Kevin Lai September 23, 2002.
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.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Switch and Router Architectures Computer Science Division Department of Electrical Engineering.
Introduction 1 Lecture 14 Transport Layer (Congestion Control) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
1 EE 122: Advanced TCP Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,
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.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter3_3.
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!
1 Lecture 14 High-speed TCP connections Wraparound Keeping the pipeline full Estimating RTT Fairness of TCP congestion control Internet resource allocation.
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.
Project 2 – Implement Reliable Transport
Networking Fundamentals. Basics Network – collection of nodes and links that cooperate for communication Nodes – computer systems –Internal (routers,
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.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Principles of Congestion Control Some slides.
TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.
© 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.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
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.
TCP over Wireless PROF. MICHAEL TSAI 2016/6/3. TCP Congestion Control (TCP Tahoe) Only ACK correctly received packets Congestion Window Size: Maximum.
Transport Layer CS 381 3/7/2017.
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
Introduction to Congestion Control
EECS 122: Introduction to Computer Networks Congestion Control
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.
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.
Chapter 6 TCP Congestion Control
COMP/ELEC 429/556 Introduction to Computer Networks
CS640: Introduction to Computer Networks
EE 122: Lecture 7 Ion Stoica September 18, 2001.
CS4470 Computer Networking Protocols
TCP Congestion Control
EE 122: Lecture 10 (Congestion Control)
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
TCP flow and congestion control
Presentation transcript:

Katz, Stoica F04 EECS 122: Introduction to Computer Networks Congestion Control Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA

Katz, Stoica F04 2 Today’s Lecture: 10 Network (IP) Application Transport Link Physical 2 7, 8, 9 10, 11 17, 18, 19 14, 15, 16 21, 22,

Katz, Stoica F04 Finishing Last Lecture

Katz, Stoica F04 4  Where do IP routers belong? Big Picture Communication Network Switched Communication Network Broadcast Communication Network Circuit-Switched Communication Network Packet-Switched Communication Network Datagram Network Virtual Circuit Network

Katz, Stoica F04 5 Packet (Datagram) Switching Properties  Expensive forwarding -Forwarding table size depends on number of different destinations -Must lookup in forwarding table for every packet  Robust -Link and router failure may be transparent for end-hosts  High bandwidth utilization -Statistical multiplexing  No service guarantees -Network allows hosts to send more packets than available bandwidth  congestion  dropped packets

Katz, Stoica F04 6 Virtual Circuit (VC) Switching  Packets not switched independently -Establish virtual circuit before sending data  Forwarding table entry -(input port, input VCI, output port, output VCI) -VCI – Virtual Circuit Identifier  Each packet carries a VCI in its header  Upon a packet arrival at interface i -Input port uses i and the packet’s VCI v to find the routing entry (i, v, i’, v’) -Replaces v with v’ in the packet header -Forwards packet to output port i’

Katz, Stoica F04 7 VC Forwarding: Example …… 114 …… … 3 … in out in-VCI 11 out-VCI … … 5 …… 73 …… … 2 … in out in-VCIout-VCI … … 11 7 …… 14 …… … 1 … in out in-VCIout-VCI … … 7 1 source destination

Katz, Stoica F04 8 VC Forwarding (cont’d)  A signaling protocol is required to set up the state for each VC in the routing table -A source needs to wait for one RTT (round trip time) before sending the first data packet  Can provide per-VC QoS -When we set the VC, we can also reserve bandwidth and buffer resources along the path

Katz, Stoica F04 9 VC Switching Properties  Less expensive forwarding -Forwarding table size depends on number of different circuits -Must lookup in forwarding table for every packet  Much higher delay for short flows -1 RTT delay for connection setup  Less Robust -End host must spend 1 RTT to establish new connection after link and router failure  Flexible service guarantees -Either statistical multiplexing or resource reservations

Katz, Stoica F04 10 Circuit Switching  Packets not switched independently -Establish circuit before sending data  Circuit is a dedicated path from source to destination -E.g., old style telephone switchboard, where establishing circuit means connecting wires in all the switches along path -E.g., modern dense wave division multiplexing (DWDM) form of optical networking, where establishing circuit means reserving an optical wavelength in all switches along path  No forwarding table

Katz, Stoica F04 11 Circuit Switching Properties  Cheap forwarding -No table lookup  Much higher delay for short flows -1 RTT delay for connection setup  Less robust -End host must spend 1 RTT to establish new connection after link and router failure  Must use resource reservations

Katz, Stoica F04 12 Forwarding Comparison pure packet switching virtual circuit switching circuit switching forwarding cost highlownone bandwidth utilization highflexiblelow resource reservations noneflexibleyes robustnesshighlow

Katz, Stoica F04 13 Summary  Routers -Key building blocks of today a network in general, and Internet in particular  Main functionalities implemented by a router -Packet forwarding -Buffer management -Packet scheduling -Packet classification  Forwarding techniques -Datagram (packet) switching -Virtual circuit switching -Circuit switching

Katz, Stoica F04 Starting New Lecture Congestion Control

Katz, Stoica F04 15 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

Katz, Stoica F04 16 What’s at Stake?  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)

Katz, Stoica F04 17 Abstract View  We ignore internal structure of router and model it as having a single queue for a particular input- output pair Sending HostBuffer in Router Receiving Host AB

Katz, Stoica F04 18 Three Congestion Control Problems  Adjusting to bottleneck bandwidth  Adjusting to variations in bandwidth  Sharing bandwidth between flows

Katz, Stoica F04 19 Single Flow, Fixed Bandwidth  Adjust rate to match bottleneck bandwidth -without any a priori knowledge -could be gigabit link, could be a modem AB 100 Mbps

Katz, Stoica F04 20 Single Flow, Varying Bandwidth  Adjust rate to match instantaneous bandwidth -assuming you have rough idea of bandwidth AB BW(t)

Katz, Stoica F04 21 Multiple Flows Two Issues:  Adjust total sending rate to match bandwidth  Allocation of bandwidth between flows A2B2 100 Mbps A1 A3 B3 B1

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

Katz, Stoica F04 23 General Approaches  Send without care -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

Katz, Stoica F04 24 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

Katz, Stoica F04 25 TCP Congestion Control  TCP connection has window -controls number of unacknowledged packets  Sending rate: ~Window/RTT  Vary window size to control sending rate

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

Katz, Stoica F04 27 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

Katz, Stoica F04 28 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)

Katz, Stoica F04 29 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

Katz, Stoica F04 30 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

Katz, Stoica F04 31 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

Katz, Stoica F04 32 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!  Therefore, need a more gentle adjustment algorithm once have rough estimate of bandwidth

Katz, Stoica F04 33 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

Katz, Stoica F04 34 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!

Katz, Stoica F04 35 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

Katz, Stoica F04 36 AIMD Sharing Dynamics AB x DE  No congestion  rate increases by one packet/RTT every RTT  Congestion  decrease rate by factor 2 Rates equalize  fair share y

Katz, Stoica F04 37 AIAD Sharing Dynamics AB x DE  No congestion  x increases by one packet/RTT every RTT  Congestion  decrease x by 1 y

Katz, Stoica F04 38 AIMD AB x C DE y Limit rates: x = y

Katz, Stoica F04 39 AIAD AB x C DE y Limit rates: x and y depend on initial values

Katz, Stoica F04 40 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

Katz, Stoica F04 41 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;

Katz, Stoica F04 42 The big picture (with timeouts) Time cwnd Timeout Slow Start AIMD ssthresh Timeout Slow Start AIMD

Katz, Stoica F04 43 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

Katz, Stoica F04 44 Fast Retransmits  Resend a segment after 3 duplicate ACKs -a 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 ACK 2 segment 1 cwnd = 1 cwnd = 2 segment 2 segment 3 ACK 4 cwnd = 4 segment 4 segment 5 segment 6 segment 7 ACK 3 3 duplicate ACKs ACK 4

Katz, Stoica F04 45 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

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

Katz, Stoica F04 47 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

Katz, Stoica F04 48 Issues to Think About  What about short flows? (setting initial cwnd) -most flows are short -most bytes are in long flows  How does this work over wireless links? -packet reordering fools fast retransmit -loss not always congestion related  High speeds? -to reach 10gbps, packet losses occur every 90 minutes!  Why are losses bad? -Tornado codes: can reconstruct data proportional to packets that get through. Why not send at maximal rate?  Fairness: how do flows with different RTTs share link?

Katz, Stoica F04 49 Bonus Question  Why is TCP like Blanche Dubois?  Because it “relies on the kindness of strangers...”  What happens if not everyone cooperates?