Congestion Control. Brighten Godfrey CS 538 January Based in part on slides by Ion Stoica

Similar documents
Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

Internet Networking recitation #10 TCP New Reno Vs. Reno

Reliable Transport II: TCP and Congestion Control

Reliable Transport II: TCP and Congestion Control

CS3600 SYSTEMS AND NETWORKS

CS4700/CS5700 Fundamentals of Computer Networks

Overview. TCP congestion control Computer Networking. TCP modern loss recovery. TCP modeling. TCP Congestion Control AIMD

Congestion Control End Hosts. CSE 561 Lecture 7, Spring David Wetherall. How fast should the sender transmit data?

CS Networks and Distributed Systems. Lecture 10: Congestion Control

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

Lecture 4: Congestion Control

Communication Networks

cs/ee 143 Communication Networks

COMP/ELEC 429/556 Introduction to Computer Networks

TCP over Wireless PROF. MICHAEL TSAI 2016/6/3

Congestion / Flow Control in TCP

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

Goals of Today s Lecture! Congestion Control! Course So Far.! Congestion Control Overview! It s Not Just The Sender & Receiver! Congestion is Natural!

image 3.8 KB Figure 1.6: Example Web Page

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

Computer Networking Introduction

Midterm Review. EECS 489 Computer Networks Z. Morley Mao Monday Feb 19, 2007

Flow and Congestion Control Marcos Vieira

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

TCP congestion control:

CSE 123A Computer Networks

TCP Congestion Control

TCP Congestion Control

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Transport Layer Congestion Control

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Lecture 21: Congestion Control" CSE 123: Computer Networks Alex C. Snoeren

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Lecture 15: Transport Layer Congestion Control

TCP Congestion Control

CSE 461. TCP and network congestion

Networked Systems and Services, Fall 2018 Chapter 3

ECE 435 Network Engineering Lecture 10

Lecture 14: Congestion Control"

Congestion Control. Daniel Zappala. CS 460 Computer Networking Brigham Young University

CS321: Computer Networks Congestion Control in TCP

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

Performance Analysis of TCP Variants

Networked Systems and Services, Fall 2017 Reliability with TCP

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

TCP Congestion Control 65KB W

TCP so far Computer Networking Outline. How Was TCP Able to Evolve

Congestion control in TCP

Bandwidth Allocation & TCP

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

Congestion Control In the Network

Lecture 7: Flow Control"

15-744: Computer Networking TCP

TCP Performance. EE 122: Intro to Communication Networks. Fall 2006 (MW 4-5:30 in Donner 155) Vern Paxson TAs: Dilip Antony Joseph and Sukun Kim

UNIT IV -- TRANSPORT LAYER

Overview. TCP & router queuing Computer Networking. TCP details. Workloads. TCP Performance. TCP Performance. Lecture 10 TCP & Routers

Department of Informatics Networks and Distributed Systems (ND) group TCP "TEB" (Timer-based Exponential Backoff): Code and Rationale

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

Flow and Congestion Control (Hosts)

Congestion Collapse in the 1980s

Wireless TCP Performance Issues

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

Fall 2012: FCM 708 Bridge Foundation I

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

ADVANCED COMPUTER NETWORKS

CSE/EE 461. TCP congestion control. Last Lecture. This Lecture. Focus How should senders pace themselves to avoid stressing the network?

ECE4110, Internetwork Programming, QUIZ 2 - PRACTICE Spring 2006

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Outline. Internet. Router. Network Model. Internet Protocol (IP) Design Principles

Network Protocols. Transmission Control Protocol (TCP) TDC375 Autumn 2009/10 John Kristoff DePaul University 1

EE122 MIDTERM EXAM: Scott Shenker, Ion Stoica

The Transport Layer Reliability

Congestion Avoidance and Control. Rohan Tabish and Zane Ma

ECE 461 Internetworking. Problem Sheet 6

8. TCP Congestion Control

Chapter III. congestion situation in Highspeed Networks

Chapter 24. Transport-Layer Protocols

Chapter 3 Transport Layer

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

Advanced Computer Networks

CNT 6885 Network Review on Transport Layer

Computer Networking

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Congestion Control in the Network

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Transport Protocols and TCP

TCP Congestion Control

CPSC 3600 HW #4 Fall 2017 Last update: 11/9/2017 Please work together with your project group (3 members)

Chapter III: Transport Layer

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

TCP Congestion Control

Transport Layer (Congestion Control)

Transcription:

Congestion Control Brighten Godfrey CS 538 January 31 2018 Based in part on slides by Ion Stoica

Announcements

A starting point: the sliding window protocol

TCP flow control Make sure receiving end can handle data Negotiated end-to-end, with no regard to network Ends must ensure that no more than W packets are in flight if buffer has size W Receiver ACKs packets When sender gets an ACK, it knows packet has arrived

Sliding window-based flow control At the sender... Sent and all ACKs received Window: Sent but leftmost not yet ack d Not yet sent...... no ack ack d no ack ack d ack d

Sliding window-based flow control At the receiver... Received Window: ready to receive but leftmost missing Not ready to receive...... not rec d not rec d rec d rec d not rec d

Sliding window 3 1 2 7 6 5 4 7 5 6 Last ACKed (without gap) Last received (without gap)

Observations What is the throughput in terms of RTT and window size, in theory? Throughput is ~ (w/rtt)

On to Jacobson 88 Getting to equilibrium: Slow Start Initial rate is slow: very conservative starting point But acceleration is high or is it? Maybe too conservative now - http://research.google.com/pubs/pub36640.html 1 0.8 0.6 Google Web search Top 500 sites 0.4 All sites Gmail 0.2 Google maps Photos blogger Top 100 sites 0 100 1000 10000 100000 Response size (Bytes) TCP latency (ms) 500 495 490 485 480 475 470 465 3 6 10 16 26 42 init_cwnd Google Web search Figure 1: CDF of HTTP response sizes for top 100 sites, top 500 sites, all the Web, and for a few popular Google services. Vertical lines highlight response sizes of 3 and 10 segments. Figure 2: TCP latency for Google search with different init cwnd values. [Figures from Dukkipati et al, CCR July 2010]

On to Jacobson 88 Getting to equilibrium: Slow Start Initial rate is slow: very conservative starting point But acceleration is high or is it? Maybe too conservative now - http://research.google.com/pubs/pub36640.html Conservation: Round-Trip Timing Congestion Avoidance

Round-trip timing

Error recovery Must retransmit packets that were dropped To do this efficiently Keep transmitting whenever possible Detect dropped packets and retransmit quickly Requires: Timeouts (with good timers) Other hints that packet were dropped

A bad timer algorithm T(n) = measured RTT of this packet mean: A(n) = b*a(n-1) + (1 b)*t(n) Timeout(n) = 2*A(n) Is twice the mean what we really want? No: want outliers 2A(n) a poor estimate of outliers Idea: measure deviation from mean

Better timer [Jacobson] T(n) = measured RTT of this packet mean: deviation: A(n) = b*a(n-1) + (1 b)*t(n) D(n) = b*d(n-1) + (1 b)*(t(n) A(n)) Timeout(n) = A(n) + 4D(n) Questions: Measure T(n) only for original transmissions. Why? Double Timeout after a timeout happens. Why? Is deviation what we really want? Really?

Better timer [Jacobson] Is deviation what we REALLY want? Really? [SNL]

Better still... What do we REALLY want? Estimate whether Pr[packet lost] is high Is timing the only way? Another way: Duplicate ACKs Receiver sends an ACK whenever a packet arrives ACK has seq. # of last consecutively received packet Duplicate ACKs suggest missing packet (assumptions?) Modern TCPs: Fast Retransmit after 3 dup-acks Does this eliminate need for timers? No: What if we get no packets from receiver? But, makes them less important

What should the receiver ACK? ACK every packet, giving its sequence number Use negative ACKs (NACKs), indicating which packet did not arrive Use cumulative ACK, where an ACK for number n implies ACKS for all k < n Use selective ACKs (SACKs), indicating those that did and did not arrive, even if not in order

Congestion

TCP congestion control Can the network handle the rate of data? Determined end-to-end, but TCP is making guesses about the state of the network Two papers: Good science vs great engineering

Dangers of increasing load Knee point after which Throughput increases very slowly Delay increases quickly Throughput knee cliff packet loss congestion collapse Cliff point after which Load Throughput starts to decrease very fast to zero Delay (congestion collapse) Delay approaches infinity In an M/M/1 queue Load Delay = 1/(1 utilization)

Cong. control vs. cong. avoidance Congestion control goal Stay left of cliff Congestion avoidance goal Stay left of knee Throughput knee cliff congestion collapse Load

Control system model [CJ89] User 1 x 1 User 2 x 2 Σ Σx i >X goal x n User n y Simple, yet powerful model Explicit binary signal of congestion

Possible choices! Multiplicative increase, additive decrease - a I =0, b I >1, a D <0, b D =1! Additive increase, additive decrease - a I >0, b I =1, a D <0, b D =1! Multiplicative increase, multiplicative decrease Which should we pick? - a I =0, b I >1, a D =0, 0<b D <1! Additive increase, multiplicative decrease - a I >0, b I =1, a D =0, 0<b D <1

Mult. increase, additive decrease! Does not (b I (x 1h +a D ), b I (x 2h +a D )) fairness line converge to fairness (x 1h,x 2h )! (Additive decrease User 2: x 2 (x 1h +a D,x 2h +a D ) worsens fairness) efficiency line User 1: x 1

Additive increase, add. decrease! Reaches (x 1h +a D +a I ), x 2h +a D +a I )) fairness line stable cycle, but does not (x 1h,x 2h ) converge to fairness User 2: x 2 (x 1h +a D,x 2h +a D ) efficiency line User 1: x 1

Mult. increase, mult. decrease! Converges (x 1h,x 2h ) fairness line to stable cycle, but is (b I b D x 1h, b I b D x 2h ) not fair User 2: x 2 (b d x 1h,b d x 2h ) efficiency line User 1: x 1

Additive increase, mult. decrease! Converges to stable and (x 1h,x 2h ) (b D x 1h +a I, b D x 2h +a I ) fairness line fair cycle User 2: x 2 (b D x 1h,b D x 2h ) efficiency line User 1: x 1

Modeling Critical to understanding complex systems [CJ89] model relevant after nearly 30 years, 10 6 increase in bandwidth, 1000x increase in number of users Criteria for good models Two conflicting goals: reality and simplicity Realistic, complex model too hard to understand, too limited in applicability Unrealistic, simple model can be misleading Where does this model fit?

Putting the pieces together

TCP congestion control [CJ89] provides theoretical basis for basic congestion avoidance mechanism Must turn this into real protocol

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: reach knee quickly Upon starting (or restarting): Set cwnd =1 Each time a segment is acknowledged, increment cwnd by one (cwnd++). Starts slow but accelerates quickly cwnd increases exponentially

Slow start example The congestion window size grows very rapidly TCP slows down the increase of cwnd when cwnd ssthresh cwnd = 1 cwnd = 2 cwnd = 4 cwnd = 8 segment 1 ACK 2 segment 2 segment 3 ACK 4 segment 4 segment 5 segment 6 segment 7 ACK8

Congestion avoidance Slow down Slow Start ssthresh variable is lower-bound guess about location of knee If cwnd > ssthresh then each time a segment is acknowledged, increment cwnd by 1/cwnd (cwnd += 1/cwnd). Result: cwnd is increased by one after a full window of segments have been acknowledged

Slow start/cong. avoidance example 12! Assume that ssthresh = 8 Cwnd (in segments) 9 6 3 0 ssthresh t=0 t=1 t=2 Roundtrip times t=3 t=4 t=5 t=6 t=7

All together: TCP pseudocode Initially: cwnd = 1; ssthresh = infinite; New ack received: if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1; else /* Additive increase */ cwnd = cwnd + 1/cwnd; Timeout: /* Multiplicative decrease */ ssthresh = cwnd/2; cwnd = 1; seq # while (next < unack + win) transmit next packet; where win = min(cwnd, flow_win); unack win next

The big picture (so far) cwnd Timeout Slow Start Congestion Avoidance Time

Fast retransmit Resend a segment after 3 cwnd = 1 segment 1 duplicate ACKs cwnd = 2 ACK 2 ACK 3 segment 2 segment 3 Avoids waiting for timeout to discover loss 3 duplicate ACKs cwnd = 4 ACK 4 ACK 4 ACK 4 ACK 4 segment 4 segment 5 segment 6 segment 7

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 & other variants Lesson: avoid RTOs at all costs!

Picture with fast retransmit & recov. cwnd Slow Start Congestion Avoidance Retransmit after 3 duplicated acks prevent expensive timeouts No need to slow start again Time At steady state, cwnd oscillates around the optimal window size

Discussion

Engineering vs. Science in CC Great engineering by Jacobson and others built useful protocol TCP Reno, etc. Good science by Chiu, Jain and others Basis for understanding why it works so well

Limitations of TCP CC In what ways is TCP congestion control broken or suboptimal?

A partial list... Efficiency Tends to fill queues creates latency and loss Slow to converge for short flows or links with high bandwidth delay product Loss congestion Often does not fully utilize bandwidth

A partial list... Fairness Unfair to large-rtt flows (less throughput) Unfair to short flows if ssthresh starts small Equal rates isn t necessarily fair or best Vulnerable to selfish & malicious behavior TCP assumes everyone is running TCP!

Announcements Assignment 1 was due today Mon: Congestion control in the network (2 papers) Wed: Project proposals due