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

Similar documents
CSE 123A Computer Networks

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

Lecture 14: Congestion Control"

CS321: Computer Networks Congestion Control in TCP

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

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

CSE 461. TCP and network congestion

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

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

Transport Layer (Congestion Control)

15-744: Computer Networking TCP

Computer Networking

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

Congestion Collapse in the 1980s

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

Operating Systems and Networks. Network Lecture 10: Congestion Control. Adrian Perrig Network Security Group ETH Zürich

Where we are in the Course. Topic. Nature of Congestion. Nature of Congestion (3) Nature of Congestion (2) Operating Systems and Networks

Reliable Transport II: TCP and Congestion Control

Communication Networks

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

Bandwidth Allocation & TCP

ADVANCED COMPUTER NETWORKS

Reliable Transport II: TCP and Congestion Control

TCP Congestion Control

TCP Congestion Control

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

cs/ee 143 Communication Networks

CS Networks and Distributed Systems. Lecture 10: Congestion Control

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

Computer Networking Introduction

image 3.8 KB Figure 1.6: Example Web Page

CSCI-1680 Transport Layer III Congestion Control Strikes Back Rodrigo Fonseca

Lecture 14: Congestion Control"

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

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

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

Lecture 22: TCP & NAT. CSE 123: Computer Networks Alex C. Snoeren

Internet Networking recitation #10 TCP New Reno Vs. Reno

TCP Congestion Control

COMP/ELEC 429/556 Introduction to Computer Networks

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

Flow and Congestion Control (Hosts)

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

Flow Control. Flow control problem. Other considerations. Where?

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

Chapter III: Transport Layer

8. TCP Congestion Control

Congestion Control. Tom Anderson

Flow and Congestion Control Marcos Vieira

TCP Congestion Control : Computer Networking. Introduction to TCP. Key Things You Should Know Already. Congestion Control RED

Congestion. Can t sustain input rate > output rate Issues: - Avoid congestion - Control congestion - Prioritize who gets limited resources

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

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

Wireless TCP Performance Issues

Lecture 4: Congestion Control

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

CS4700/CS5700 Fundamentals of Computer Networks

6.033 Spring 2015 Lecture #11: Transport Layer Congestion Control Hari Balakrishnan Scribed by Qian Long

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

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

Lecture 15: Transport Layer Congestion Control

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

CS3600 SYSTEMS AND NETWORKS

Detecting half-open connections. Observed TCP problems

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

TCP congestion control:

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

Principles of congestion control

6.033 Computer System Engineering

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

Computer Networks. Course Reference Model. Topic. Congestion What s the hold up? Nature of Congestion. Nature of Congestion 1/5/2015.

ECE 435 Network Engineering Lecture 10

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 10

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Congestion Control. Principles of Congestion Control. Network-assisted Congestion Control: ATM. Congestion Control. Computer Networks 10/21/2009

Congestion Control 3/16/09

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

Chapter 3 Transport Layer

CSE/EE 461 Lecture 16 TCP Congestion Control. TCP Congestion Control

Congestion Avoidance and Control. Rohan Tabish and Zane Ma

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

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

UNIT IV -- TRANSPORT LAYER

Mid Term Exam Results

TCP Congestion Control

Chapter 3 Transport Layer

CSC 4900 Computer Networks: TCP

Congestion Control. Principles of Congestion Control. Network assisted congestion. Asynchronous Transfer Mode. Computer Networks 10/23/2013

Recap. More TCP. Congestion avoidance. TCP timers. TCP lifeline. Application Presentation Session Transport Network Data Link Physical

CSCI Topics: Internet Programming Fall 2008

Performance Analysis of TCP Variants

CS244 Advanced Topics in Computer Networks Midterm Exam Monday, May 2, 2016 OPEN BOOK, OPEN NOTES, INTERNET OFF

TCP Congestion Control 65KB W

Chapter III. congestion situation in Highspeed Networks

Flow and Congestion Control

This Lecture: Congestion Control : Computer Networking. Introduction to TCP. Key Things You Should Know Already. Congestion Control

What is Congestion? Congestion: Moral of the Story. TCP Approach. Transport Layer: TCP Congestion Control & Buffer Management

TCP based Receiver Assistant Congestion Control

Transcription:

Congestion Control End Hosts CSE 51 Lecture 7, Spring. David Wetherall Today s question How fast should the sender transmit data? Not tooslow Not toofast Just right Should not be faster than the receiver can process Flow control (last week) Should not be faster than the network can process Congestion control djw // CSE 51, Spring, with credit to savage L7. 1

Quick review: How routers/switches work (1) interfaces () interconnect (3) () interfaces (5) 1. Packet arrives at input interface and is queued. Lookup address in forwarding table and find output interface 3. Switch packet to output interface. Packet is queued for transmission 5. Packet sent djw // CSE 51, Spring, with credit to savage L7.3 Quick review: How Queuing works Queues absorb short-term traffic bursts Long term overload will cause packets to be dropped Two components to a queuing mechanism Scheduling: which packets are sent from queue? Buffer management: what happens when queue is full? Most of the Internet is FIFO/Drop Tail First-In-First-Out: Packets leave in same order they arrive Drop tail: When queue is full, newly arriving packets dropped There are other policies and we ll talk about some of them later djw // CSE 51, Spring, with credit to savage L7.

Impact of load on FIFO/Drop-Tail Queues Congestive packet loss Throughput Latency Congestion collapse Network Load djw // CSE 51, Spring, with credit to savage L7.5 Congestion collapse Rough definition: When an increase in network load produces a decrease in useful work Why does it happen? Sender sends faster than bottleneck link speed Packets queue until dropped In response to packets being dropped, sender retransmits Repeat in steady state Everyone does the same thing djw // CSE 51, Spring, with credit to savage L7. 3

What can be done? Increase network resources More buffers for queuing Increase link speed Pros/Cons of these approaches? Reduce network load Send datamore slowly How much more slowly? When to slow down? djw // CSE 51, Spring, with credit to savage L7.7 Congestion management goals Efficiency Utilize available bandwidth as much as possible Fairness All hosts get equal access to bandwidth Distributed implementation Only require state at endpoints Convergence For constant load, arrive at single solution for using/sharing bandwidth djw // CSE 51, Spring, with credit to savage L7.8

Proactive vs reactive approaches! Congestion avoidance: try to stay to the left of the knee! Congestion control: try to stay to the left of the cliff Knee Cliff Congestive packet loss Throughput Latency Congestion collapse Network Load djw // CSE 51, Spring, with credit to savage L7.9 Key questions How to detect congestion? How to limit sending data rate? How fast to send? How to achieve stability? djw // CSE 51, Spring, with credit to savage L7.1 5

How to detect congestion? Implicit congestion signaling Packet loss (Today) Assume congestion is primary source of packet loss Lost packets (timeout, NAK) indicate congestion Packet delay Round-trip time increases as packets queue Packet inter-arrival time is a function of bottleneck link Pros/Cons? Explicit congestion signaling Source Quench: ICMP message from router to sender Explicit Congestion Notification (ECN) (Next time) Router marks packet based on queue occupancy Receiver tells sender if queue is getting too full Hop-by-hop backpressure djw // CSE 51, Spring, with credit to savage L7.11 How to limit the sending rate? Window-based (TCP) Artificially constrain number of outstanding packets allowed in network Increase window to send faster; decrease to send slower Pro: Cheap to implement; good failure properties Con: creates bursty traffic Rate-based (Many streaming media protocols) Two parameters (period, packets) Allow sending of x packets in period y Pro: smooth traffic Con: per-connection timers; what if receiver fails djw // CSE 51, Spring, with credit to savage L7.1

How fast to send? Ideally: Keep equilibrium at knee of power curve Find knee somehow Keep number of packets in flight the same Don t send a new packet into the network until you know one has left (I.e. by receiving an ACK) What if you guess wrong, or if bandwidth availability changes? Compromise: adaptive approximation If congestion signaled, reduce sending rate by x If data delivered successfully, increase sending rate by y How to relate x and y? Most choices don t converge djw // CSE 51, Spring, with credit to savage L7.13 How to achieve stability? Additive Increase, Multiplicative Decrease (AIMD) Increase sending rate by a constant (e.g. by 15 bytes) Decrease sending rate by a linear factor (e.g. divide by ) Rough intuition for why this works (from JK88) Let L i be queue length at time i In steady state: L i = N, where N is a constant During congestion: L i = N + y L i-1, where y > If y islarge(closeto1),queuesizeincreasesexponentially Must reduce sending rate exponentially as well (multiplicative decrease) djw // CSE 51, Spring, with credit to savage L7.1 7

Jacobson&Karels88 Seminal paper in computer networking 5 th most cited paper in all computer science Context: 198 brings huge congestion collapse LBL<->Berkeley link throughput decreases by 1x Motivation for paper: Why? and how to fix it? Key principle: packet conservation Once equilibrium is reached, only send new packet once old packet has been received or dropped (constant load) Why is TCP not obeying this principle? Hmmm. djw // CSE 51, Spring, with credit to savage L7.15 Ways to violate packet conservation Connection never reaches equilibrium Slow start (still a big problem) Premature sending of new packets Adaptive timeouts Equilibrium can t be reached because of resource limits along path Congestion avoidance (misnamed) djw // CSE 51, Spring, with credit to savage L7.1 8

Some TCP details Congestion control, not avoidance Implicit congestion detection Packet losses Window-based Makes sense make congestion control and flow control using same rate-limiting mechanism rwin: advertised flow control window from receiver cwnd: congestion control window Estimate of network limit on # of outstanding packets Sender can only send MIN(rwin,cwnd) atanytime AIMD-based algorithm Increase window by 1/cwnd, decrease by djw // CSE 51, Spring, with credit to savage L7.17 Congestion avoidance If packet is ACKd then increase cwnd by MSS*MSS/cwnd (fraction of cwnd) Approximates 1/cwnd per window If timeout then divide cwnd by cwnd 1 8 3 Additive Increase/Multiplicative Decrease 9 1 15 18 1 7 3 33 3 round-trip times djw // CSE 51, Spring, with credit to savage L7.18 9

Adaptive timing How long to wait for a packet s acknowledgement? Too short: spurious timeouts and retransmissions Too long: wasted time Old TCP Maintain weighted average of RTT samples: R Timeoutsetto R*B, whereb = Under high load, B doesn t reflect variation and spurious retransmissions occur Jacobson s contributions Estimate variation, B based on same samples After loss, increase timeout exponentially (by ) djw // CSE 51, Spring, with credit to savage L7.19 Slow start Goal: find the equilibrium sending rate Quickly increase sending rate until congestion detected Algorithm: On new connection, or after timeout, set cwnd=1 For each segment acknowledged, increment cwnd by 1 If timeout then divide cwnd by, and set ssthresh = cwnd Ifcwnd>=ssthreshthenexitslowstart Why called slow? Its exponential after all djw // CSE 51, Spring, with credit to savage L7. 1

Slow start growth example cwnd=1 cwnd= cwnd= cwnd=8 Sender Ack Ack 3 Ack Ack 5 Ack Ack 7 1 Ack 1 3 5 7 Receiver cwnd 3 5 15 1 5 1 3 5 7 8 round-trip times djw // CSE 51, Spring, with credit to savage L7.1 Fast retransmit & recovery Fast retransmit Timeouts are slow (1 second is fastest timeout on most TCPs) When packet is lost, receiver still ACKs last in-order packet Use 3 duplicate ACKs to indicate a loss Why 3? When wouldn t this work? Fast recovery If there are still ACKs coming in, then no need for slow start Divide cwnd by after fast retransmit Increment cwnd by 1/cwnd for each additional duplicate ACK djw // CSE 51, Spring, with credit to savage L7. 11

Fast retransmit&recovery 3 Dup Acks Sender Ack Ack 3 Ack 3 Ack 3 Ack 3 Ack 3 1 Ack 1 3 5 7 Receiver Fast recovery (increase cwnd by 1) Fast retransmit djw // CSE 51, Spring, with credit to savage L7.3 Putting it together 18 1 Slow Start + Congestion Avoidance Timeout cwnd 1 1 1 8 Congestion avoidance ssthresh Slow start 8 1 1 1 1 18 8 3 3 3 3 38 round-trip times djw // CSE 51, Spring, with credit to savage L7. 1

Fast retransmit in action 18 Slow Start + Congestion Avoidance + Fast Retransmit cwnd 1 1 1 1 8 8 1 1 1 1 Fast retransmit round-trip times 18 8 3 3 3 3 38 djw // CSE 51, Spring, with credit to savage L7.5 Fast recovery in action 18 Slow Start + Congestion Avoidance + Fast Retransmit + Fast Recovery cwnd 1 1 1 1 8 8 1 1 1 1 Fast recovery round-trip times 18 8 3 3 3 3 38 djw // CSE 51, Spring, with credit to savage L7. 13

Delayed ACKs In request/response programs, want to combine an ACKtoarequestwitharesponseinsamepacket Wait ms before ACKing Must ACK every other packet (or packet burst) Impact onslow start? Must not delay duplicate ACKs Why? What is the interaction with the congestion control algorithms? djw // CSE 51, Spring, with credit to savage L7.7 Partial ACKs A partial ACK acknowledges only some of the packets outstandingatthestartoffastrecovery Suggests that a second packet may have been lost Should you exit Fast Recovery and go into congestion avoidance, or continue in FR? Hoe: Stay in Fast Recovery, retransmit packet after ACK When all packets in window when FR was initiated have been ACKed, go into congestion avoidance djw // CSE 51, Spring, with credit to savage L7.8 1

A TCP Taxonomy TCP Tahoe (1988) Slow-Start, Fast Retransmit, Congestion Avoidance TCP Reno (199) Tahoe + Fast Recovery TCP New-Reno (199) Reno + Hoe s partial ACK change that keeps TCP in Fast Recovery SACK TCP (199) Selective acknowledgements TCP Vegas (1993) Contraversial attempts at real congestion avoidance djw // CSE 51, Spring, with credit to savage L7.9 Discussion: Short Connections How do short connections and Slow-Start interact? What happens when there is a drop in Slow-Start? What happens when the SYN is dropped? Bottom line: Which packet gets dropped matters a lot Syn Slow-Start Congestion avoidance Do you think most flows are short or long? What s the current most popular application? What were the most popular applications when Slow-Start was developed? djw // CSE 51, Spring, with credit to savage L7.3 15

Stuff to think about TCP is designed around the premise of cooperation What happens to TCP if it competes with a UDP flow? What if divide cwnd by 3 instead of after a loss? What happens if receiver lies about receiving packets? There are a number of assumptions Losses mean congestion, re-ordering is rare, etc There are a bunch of magic numbers Decrease by x, increase by 1/cwnd, 3 duplicate acks, g=1/8, initial timeout = 3 seconds, etc djw // CSE 51, Spring, with credit to savage L7.31 What s hot now? Equation-based congestion control Based on TCP behavior (TCP-friendliness) BW MSS RTT.7 p Goal: tailored congestion control response that is still fair wrt current implementations E.g. multimedia wants smoother response after loss, but can afford slower ramp up djw // CSE 51, Spring, with credit to savage L7.3 1

Summary Congestion avoidance Slow down before congestion occurs Congestion control Slow down when congestion occurs Can be implemented entirely end-to-end without network support using AIMD algorithms Benefit of router involvement? djw // CSE 51, Spring, with credit to savage L7.33 17