CSE 461. TCP and network congestion

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

Bandwidth Allocation & TCP

Lecture 14: Congestion Control"

Flow and Congestion Control Marcos Vieira

CSE 123A Computer Networks

Flow and Congestion Control (Hosts)

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

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

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

Reliable Transport II: TCP and Congestion Control

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

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

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

TCP Congestion Control

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

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

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

8. TCP Congestion Control

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

Congestion Collapse in the 1980s

Congestion Control. Tom Anderson

image 3.8 KB Figure 1.6: Example Web Page

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

15-744: Computer Networking TCP

Lecture 14: Congestion Control"

Communication Networks

Lecture 4: Congestion Control

Transport Layer (Congestion Control)

CS321: Computer Networks Congestion Control in TCP

ADVANCED COMPUTER NETWORKS

End-to-End Protocols. Transport Protocols. User Datagram Protocol (UDP) Application Layer Expectations

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

Congestion Control 3/16/09

CSC 8560 Computer Networks: TCP

CS4700/CS5700 Fundamentals of Computer Networks

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

CS3600 SYSTEMS AND NETWORKS

Congestion Control in TCP

TCP congestion control:

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

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

Reliable Transport II: TCP and Congestion Control

Fall 2012: FCM 708 Bridge Foundation I

Computer Networking Introduction

Chapter 3 Transport Layer

Transport Protocols and TCP

Chapter III: Transport Layer

TCP Congestion Control 65KB W

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

Lecture 15: Transport Layer Congestion Control

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

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

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

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

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

COMP/ELEC 429/556 Introduction to Computer Networks

TCP Congestion Control

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

Introduc)on to Computer Networks

Chapter III. congestion situation in Highspeed Networks

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

Chapter 3 Transport Layer

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

CC451 Computer Networks

Lecture 8. TCP/IP Transport Layer (2)

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

Chapter 3 Transport Layer

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

TCP Congestion Control

Chapter 3- parte B outline

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

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

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

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

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

Congestion control in TCP

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

Lecture 11. Transport Layer (cont d) Transport Layer 1

Chapter 3 Review Questions

6.033 Computer System Engineering

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

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

Reliable Transport I: Concepts and TCP Protocol

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

CSC 4900 Computer Networks: TCP

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

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

ECE 333: Introduction to Communication Networks Fall 2001

Good Ideas So Far Computer Networking. Outline. Sequence Numbers (reminder) TCP flow control. Congestion sources and collapse

CSCD 330 Network Programming

EE122 MIDTERM EXAM: Scott Shenker, Ion Stoica

Congestion Control. Resource allocation and congestion control problem

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

In this lecture we cover a number of networking issues pertinent to the support of distributed computing. Much of the material is covered in more

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

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

CSCD 330 Network Programming Winter 2015

Contents. CIS 632 / EEC 687 Mobile Computing. TCP in Fixed Networks. Prof. Chansu Yu

Transcription:

CSE 461 TCP and network congestion

This Lecture Focus How should senders pace themselves to avoid stressing the network? Topics Application Presentation Session Transport Network congestion collapse Data Link congestion control Physical 2

Congestion from in the network Source 1 Source 2 1-Gbps Ethernet 100-Mbps Enet Router 1.5-Mbps T1 link Packets queued here Destination Buffers at routers used to absorb bursts when input rate > output Loss (drops) occur when sending rate is persistently > drain rate

Congestion Collapse In the limit, premature retransmissions lead to congestion collapse e.g., 1000x drop in effective bandwidth of network sending more packets into the network when it is overloaded exacerbates the problem (overflow router queues) network stays busy but very little useful work is being done This happened in real life ~1987 Led to Van Jacobson s TCP algorithms these form the basis of congestion control in the Internet today Researchers asked two questions: Was TCP misbehaving? Could TCP be trained to work better under abysmal network conditions? 4

A Scenario Receiver window size is 16KB. Bottleneck router buffer size is 15 KB. Data bandwidth is about 20KB/s 5

Behavior of Basic Sliding Window Slope is bandwidth. Steep smooth upward slope == means good bandwidth. Downward slope means retransmissions (bad). 6

Behavior of Basic Sliding Window ACK Pacing Flow Control Window Size Timeout Value RTT 7

Let's Fix It We want to avoid overflowing the bottleneck router's queue Idea 1: use something like flow-control, but with the router as the remote end point Idea 2: throttle the source send rate so that it's no more than the bottleneck router's available capacity We'd like to retransmit instantly when a packet is actually lost, and not at all if it isn't If we controlled what the routers did, approaches come to mind We don't (can't) control what the routers do 8

Modern TCP in previous scenario 9

Behavior of Basic Sliding Window Too late? Just right Too slow Too fast 10

Restriction on Approaches Can't ask routers to do anything they don't already do Can't radically change TCP (sliding window basis) There's no way to deploy a new TCP to every Internet endpoint at once (or maybe ever) You can deploy incrementally One side of a TCP connection can do something new, if It doesn't break the other, unmodified side The bottleneck router's capacity may change from time to time (Even which router is the bottleneck may change) 11

TCP's Solutions If we knew RTT and Current Router Queue Size, then we would send: MIN(Router Capacity Queue Size, Effective Window Size) and not retransmit a packet until it had been sent RTT ago. But we don t know these things so we have to estimate them They change over time because of other data sources so we have to continually adapt them 12

1988 Observations on Congestion Collapse Implementation, not the protocol, leads to collapse choices about when to retransmit, when to back off because of losses Obvious ways of doing things lead to non-obvious and undesirable results send effective-window-size # packets wait RTT try again Remedial algorithms achieve network stability by forcing the transport connection to obey a packet conservation principle. for connection in equilibrium (stable with full window in transit), packet flow is conservative a new packet not put in network until an old packet leaves 13

Ideal packet flow: stable equilibrium Pr = Interpacket spacing --> mirrors that of slowest link As = Inter-ACK spacing --> mirrors that of slowest downstream link 14

Modern TCP in previous scenario Notice: no retransmissions, (and thus no packet loss) achieved BW = bottleneck BW 15

Basic rules of TCP congestion control 1. The connection must reach equilibrium. hurry up and stabilize when things get wobbly, put on the brakes and reconsider 1. Sender must not inject a new packet before an old packet has left a packet leaves when the receiver picks it up, or if it gets lost. damaged in transit or dropped at congested point (far fewer than 1% of packets get damaged in practice) ACK or packet timeout signals that a packet has exited. ACK are easy to detect. appropriate timeouts are harder. all about estimating RTT. 3. Equilibrium is lost because of resource contention along the way. new competing stream appears, must re-stabilize 16

Resulting TCP/IP Improvements Slow-start Round-trip time variance estimation Exponential retransmit timer backoff More aggressive receiver ACK policy Dynamic window sizing on congestion Clamped retransmit backoff (Karn) Fast Retransmit Packet Conservation Principle Congestion control means: Finding places that violate the conservation of packets principle and then fixing them. 17

1. The connection must reach equilibrium. 18

1. Getting to Equilibrium: Slow Start Goal Quickly determine the appropriate congestion window size Strategy Basically, we re trying to sense the bottleneck bandwidth Introduce congestion_window (cwnd) When starting off, set cwnd to 1 For each ACK received, add 1 to cwnd When sending, send the minimum of receiver s advertised window and cwnd 19

Cwnd doubles every RTT; Opening a window of size W takes time (RTT)log 2 W. 20

Slow Start Note that the effect is to double transmission rate every RTT This is slow? Basically an effective way to probe for the bottleneck bandwidth, using packet losses as the feedback No change in protocol/header was required to implement Guaranteed to not transmit at more than twice the max BW, and for no more than one RTT. When do you need to do this kind of probing? 21

2. A sender must not inject a new packet before an old packet has exited. 22

2. Packet Injection: Estimating RTTs Do not inject a new packet until an old packet has left. 1. ACK tells us that an old packet has left. 2. Timeout expiration tells us as well. We must estimate RTT properly. Strategy 1: pick some constant RTT. simple, but probably wrong. (certainly not adaptive) Strategy 2: Estimate based on past behavior. Tactic 0: Mean Tactic 1: Mean with exponential decay Tactic 2: Tactic 1 + safety margin safety margin based on current estimate of error in Tactic 1 23

Tactic 0: Use the Mean Measure the RTT of each packet Time from sending packet until receiving the ACK for it EstimatedRTT = (Sum of SampleRTT s) / N Note: requires only constant storage Why not do this? 24

Tactic 1: Original TCP (RFC793) retransmission timeout algorithm Use EWMA to estimate RTT: EstimatedRTT = (1 g)(estimatedrtt) + g(samplertt) 0 g 1, usually g =.1 or.2 Conservatively set timeout to small multiple (2x) of the estimate Retransmission Timeout = 2 x EstimatedRTT (Expressed in manner oftactic 2) Retransmission Timeout = EstimatedRTT + EstimatedRTT 25

26

Tactic 2: Jacobson/Karels Algorithm 1. Explicitly estimate the deviation in the RTT DevRTT = (1-b) * DevRTT + b * SampledRTT - EstimatedRTT typically, b =.25 2. Retransmission timeout = 1 x EstimatedRTT + k * DevRTT k is generally set to 4 timeout =~ EstimatedRTT when variance is low (estimate is good) 27

28

3. Equilibrium is lost because of resource contention along the way. 29

Congestion from Multiple Sources Source 1 Source 2 1-Gbps Ethernet 100-Mbps FDDI Router 1.5-Mbps T1 link Packets queued here Packets Lost Here Destination

In Real Life 31

Four Simultaneous Streams 32

TCP is Self-Clocking Source 100 Mbps Ethernet Router 45 Mbps T3 link Sink ACKs pace transmissions at approximately the botteneck rate So just by sending packets we can discern the right sending rate (called the packet-pair technique) 33

Congestion Control Relies on Signals from the Network The network is not saturated: Send even more The network is saturated: Send less ACK signals that the network is not saturated. A lost packet (no ACK) signals that the network is saturated Leads to a simple strategy: On each ack, increase congestion window (additive increase) On each lost packet, decrease congestion window (multiplicative decrease) Why increase slowly and decrease quickly? Respond to good news conservatively, but bad news aggressively 34

AIMD (Additive Increase/Multiplicative Decrease) How to adjust probe rate? Source Destination Increase slowly while we believe there is bandwidth Additive increase per RTT Cwnd += 1 packet / RTT Decrease quickly when there is loss (went too far!) Multiplicative decrease Cwnd /= 2 35

With Additive Increase/Multiplicative Decrease 36

TCP Sawtooth Pattern Cwnd (KB) 70 60 50 40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 T ime (seconds) 37

Comparing to Slow Start Source Destination Q: What is the ideal value of cwnd? How long will AIMD take to get there? Use a different strategy to get close to ideal value Slow start: Double cwnd every RTT cwnd *= 2 per RTT i.e., cwnd += 1 per ACK AIMD: add one to cwnd per RTT cwnd +=1 per RTT i.e., cwnd += (1/cwnd) per ACK 38

Combining Slow Start and AIMD ssthresh Slow start is used whenever the connection is not running with packets outstanding There won't be any more ACKs until we send again initially, and after timeouts indicating that there s no data on the wire But we don t want to overshoot our ideal cwnd on next slow start, so remember the last cwnd that worked with no loss ssthresh = cwnd after cwnd /= 2 on loss switch to AIMD once cwnd passes ssthresh 39

Example (Slow Start +AIMD) KB 70 60 50 40 30 20 10 Timeout Timeout Timeout 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 Time (seconds) Slowstart Packets that will be lost AIMD 40

The Long Timeout Problem Would like to detect a lost packet earlier than timeout enable retransmit sooner Can we infer that a packet has been lost? Receiver receives an out of order packet Good indicator that the one(s) before have been misplaced Receiver generates a duplicate ack on receipt of a misordered packet Sender interprets sequence of duplicate acks as a signal that the as-yet-unacked packet has not arrived 41

Fast Retransmit TCP uses cumulative acks, so duplicate acks start arriving after a packet is lost. We can use this fact to infer which packet was lost, instead of waiting for a timeout. 3 duplicate acks are used in practice Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 Retransmit packet 3 Sender Receiver ACK 1 ACK 2 ACK 2 ACK 2 ACK 2 ACK 6 42

Example (with Fast Retransmit) KB 70 60 50 40 30 20 10 FT 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Timeout Timeout Timeout KB 70 60 50 40 30 20 10 NO FT Time (seconds) 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 43

Fast Recovery After Fast Retransmit, use further duplicate acks to grow cwnd and clock out new packets, since these acks represent packets that have left the network. End result: Can achieve AIMD when there are single packet losses. Only slow start the first time and on a real timeout. KB 70 60 50 40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 44

Example (with Fast Recovery) Cwnd (KB) 70 60 50 40 30 20 10 (Not the same trace as before) 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 T ime (seconds) The Familiar Saw Tooth Pattern 45

Fairness an informal argument Client B Bandwidth Bottleneck bandwidth Client A has an ongoing flow. Client B arrives. What happens? Client A Bandwidth 46

Fairness an informal argument Client B Bandwidth Bottleneck bandwidth Client A has an ongoing flow. Client B arrives. What happens? Client A Bandwidth 47

Key Concepts Packet conservation is a fundamental concept in TCP s congestion management Get to equilibrium Slow Start Do nothing to get out of equilibrium Good RTT Estimate Adapt when equilibrium has been lost due to other s attempts to get to/stay in equilibrium Additive Increase/Multiplicative Decrease The network reveals its own behavior 48

Key Concepts (next level down) TCP probes the network for bandwidth, assuming that loss signals congestion The congestion window is managed to be additive increase / multiplicative decrease It took fast retransmit and fast recovery to get there Slow start is used to avoid lengthy initial delays Ramp up to near target rate and then switch to AIMD 49