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

Similar documents
Introduc)on to Computer Networks

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

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

Congestion Control. Queuing Discipline Reacting to Congestion Avoiding Congestion. Issues

Flow and Congestion Control Marcos Vieira

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

CS CS COMPUTER NETWORKS CS CS CHAPTER 6. CHAPTER 6 Congestion Control

Internet Protocols Fall Lecture 16 TCP Flavors, RED, ECN Andreas Terzis

CSCI-1680 Link Layer I Rodrigo Fonseca

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

CSE 123A Computer Networks

Congestion Control 3/16/09

Bandwidth Allocation & TCP

TCP Congestion Control. Housekeeping. Additive Increase/Multiplicative Decrease. AIMD (cont) Pick up folders for exam study Exam next Friday, Nov.

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

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

15-744: Computer Networking TCP

Lecture 14: Congestion Control"

CSCI-1680 Link Layer Reliability John Jannotti

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

CS4700/CS5700 Fundamentals of Computer Networks

Lecture 4: Congestion Control

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

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

Chapter III: Transport Layer

Congestion Control In the Network

EE 122: Router Support for Congestion Control: RED and Fair Queueing. Ion Stoica Oct. 30 Nov. 4, 2002

Reliable Transport II: TCP and Congestion Control

Computer Networking

CS4700/CS5700 Fundamentals of Computer Networks

CS3600 SYSTEMS AND NETWORKS

COMP/ELEC 429/556 Introduction to Computer Networks

CS321: Computer Networks Congestion Control in TCP

CS 356: Computer Network Architectures Lecture 19: Congestion Avoidance Chap. 6.4 and related papers. Xiaowei Yang

Computer Networking Introduction

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

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

CSE 461. TCP and network congestion

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

Lec 19 - Error and Loss Control

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

ADVANCED COMPUTER NETWORKS

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

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

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

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

Chapter 3 Transport Layer

CSCI Topics: Internet Programming Fall 2008

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

Congestion Control. Resource allocation and congestion control problem

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

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

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

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

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

CS268: Beyond TCP Congestion Control

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

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

TCP Congestion Control

CSC 4900 Computer Networks: TCP

Chapter 3 Transport Layer

TCP congestion control:

Lecture 9 Congestion Control: Part II. EECS 122 University of California Berkeley

Congestion Control. Tom Anderson

Lecture 15: Transport Layer Congestion Control

Congestion Control in TCP

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

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

Mid Term Exam Results

CS 344/444 Computer Network Fundamentals Final Exam Solutions Spring 2007

Wireless TCP Performance Issues

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

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

Fair Queueing. Presented by Brighten Godfrey. Slides thanks to Ion Stoica (UC Berkeley) with slight adaptation by Brighten Godfrey

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

Introduc)on to Computer Networks

CSC 8560 Computer Networks: TCP

Chapter 3 Transport Layer

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

Chapter III. congestion situation in Highspeed Networks

Chapter 6 Congestion Avoidance. Networking CS 3470, Section 1

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

CSCI Topics: Internet Programming Fall 2008

UNIT IV -- TRANSPORT LAYER

EE122 MIDTERM EXAM: Scott Shenker, Ion Stoica

Congestion Collapse in the 1980s

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

CNT 6885 Network Review on Transport Layer

TCP Congestion Control. Lecture 16. Outline. TCP Congestion Control. Additive Increase / Multiplicative Decrease (AIMD)

The Transport Layer Congestion control in TCP

Congestion Avoidance

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

8. TCP Congestion Control

Flow and Congestion Control (Hosts)

Overview. Administrivia. Congestion Control Revisited. Congestion at Router. Example: FIFO tail drop. Router design issues

TCP Congestion Control

TCP Congestion Control

TCP Congestion Control 65KB W

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

Transcription:

CSCI-1680 Transport Layer III Congestion Control Strikes Back Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti, Ion Stoica

Last Time Flow Control Congestion Control

Today More TCP Fun! Congestion Control Continued Quick Review RTT Estimation TCP Friendliness Equation Based Rate Control TCP on Lossy Links Congestion Control versus Avoidance Getting help from the network Cheating TCP

Quick Review Flow Control: Receiver sets Advertised Window Congestion Control Two states: Slow Start (SS) and Congestion Avoidance (CA) A window size threshold governs the state transition Window <= ssthresh: SS Window > ssthresh: Congestion Avoidance States differ in how they respond to ACKs Slow start: +1 w per RTT (Exponential increase) Congestion Avoidance: +1 MSS per RTT (Additive increase) On loss event: set ssthresh = w/2, w = 1, slow start

AIMD AIMD Fair: A = B Flow Rate B Efficient: A+B = C Flow Rate A

States differ in how they respond to acks Slow start: double w in one RTT There are w/mss segments (and acks) per RTT Increase w per RTT à how much to increase per ack? w / (w/mss) = MSS AIMD: Add 1 MSS per RTT MSS/(w/MSS) = MSS 2 /w per received ACK

Putting it all together cwnd Timeout AIMD Timeout AIMD ssthresh Slow Start Slow Start Slow Start Time

Fast Recovery and Fast Retransmit cwnd AI/MD Slow Start Fast retransmit Time

Throughput(Mbps) TCP Friendliness Can other protocols co-exist with TCP? E.g., if you want to write a video streaming app using UDP, how to do congestion control? 10 9 8 7 6 5 4 3 2 1 0 RED 1 4 7 10 13 16 19 22 25 28 31 Flow Number 1 UDP Flow at 10MBps 31 TCP Flows Sharing a 10MBps link

TCP Friendliness Can other protocols co-exist with TCP? E.g., if you want to write a video streaming app using UDP, how to do congestion control? Equation-based Congestion Control Instead of implementing TCP s CC, estimate the rate at which TCP would send. Function of what? RTT, MSS, Loss Measure RTT, Loss, send at that rate!

TCP Throughput Assume a TCP congestion of window W (segments), round-trip time of RTT, segment size MSS Sending Rate S = W x MSS / RTT (1) Drop: W = W/2 grows by MSS for W/2 RTTs, until another drop at W W Average window then 0.75xS From (1), S = 0.75 W MSS / RTT (2) Loss rate is 1 in number of packets between losses: Loss = 1 / ( 1 + (W/2 + W/2+1 + W/2 + 2 + + W) = 1 / (3/8 W 2 ) (3)

TCP Throughput (cont) Loss = 8/(3W 2 ) (4) W = 8 3 Loss Substituting (4) in (2), S = 0.75 W MSS / RTT, Throughput 1.22 RTT MSS Loss Equation-based rate control can be TCP friendly and have better properties, e.g., small jitter, fast ramp-up

What Happens When Link is Lossy? Throughput 1 / sqrt(loss) p = 0 60 50 40 30 20 p = 1% p = 10% 10 0 1 26 51 76 101 126 151 176 201 226 251 276 301 326 351 376 401 426 451 476

What can we do about it? Two types of losses: congestion and corruption One option: mask corruption losses from TCP Retransmissions at the link layer E.g. Snoop TCP: intercept duplicate acknowledgments, retransmit locally, filter them from the sender Another option: Tell the sender about the cause for the drop Requires modification to the TCP endpoints

Congestion Avoidance TCP creates congestion to then back off Queues at bottleneck link are often full: increased delay Sawtooth pattern: jitter Alternative strategy Predict when congestion is about to happen Reduce rate early Other approaches Delay Based: TCP Vegas (not covered) Better model of congestion: BBR Router-centric: RED, ECN, DECBit, DCTCP

Another view of Congestion Control Round Trip Time Bytes in Flight Throughput Bytes in Flight Tput = InFlight/ RTT prop Diagrams based on Cardwell et al., BBR: Congestion Based Congestion Control, Communications of the ACM, Vol. 60 No. 2, Pages 58-66.

Another view of Congestion Control Round Trip Time Throughput RTT prop Slope = 1/RTT prop BDP Bytes in Flight Bottleneck BW Bytes in Flight

Another view of Congestion Control Round Trip Time Throughput RTT prop Slope = 1/RTT prop BDP Slope = 1/BW Bytes in Flight Bottleneck BW Bytes in Flight BDP+Bottleneck Queue

Round Trip Time Another view of Congestion Control Ideal Operating Point RTT prop Bytes in Flight Slope = 1/BW Loss-based CC Throughput Slope = 1/RTT prop BDP Bottleneck BW Bytes in Flight BDP+Bottleneck Queue

BBR Problem: can t measure both RTT prop and Bottleneck BW at the same time BBR: Slow start Measure throughput when RTT starts to increase Measure RTT when throughput is still increasing Pace packets at the BDP Probe by sending faster for 1RTT, then slower to compensate

BBR From: https://labs.ripe.net/members/gih/bbr-tcp

Help from the network What if routers could tell TCP that congestion is happening? Congestion causes queues to grow: rate mismatch TCP responds to drops Idea: Random Early Drop (RED) Rather than wait for queue to become full, drop packet with some probability that increases with queue length TCP will react by reducing cwnd Could also mark instead of dropping: ECN

RED Details Compute average queue length (EWMA) Don t want to react to very quick fluctuations Queue length Instantaneous Average Time

RED Drop Probability Define two thresholds: MinThresh, MaxThresh Drop probability: P(drop) 1.0 MaxP AvgLen MinThresh MaxThresh Improvements to spread drops (see book)

RED Advantages Probability of dropping a packet of a particular flow is roughly proportional to the share of the bandwidth that flow is currently getting Higher network utilization with low delays Average queue length small, but can absorb bursts ECN Similar to RED, but router sets bit in the packet Must be supported by both ends Avoids retransmissions optionally dropped packets

What happens if not everyone cooperates? TCP works extremely well when its assumptions are valid All flows correctly implement congestion control Losses are due to congestion

Cheating TCP Possible ways to cheat Increasing cwnd faster Large initial cwnd Opening many connections Ack Division Attack

Increasing cwnd Faster C y x increases by 2 per RTT y increases by 1 per RTT Limit rates: x = 2y x Figure from Walrand, Berkeley EECS 122, 2003

A D Larger Initial Window x y B E x starts SS with cwnd = 4 y starts SS with cwnd = 1 Figure from Walrand, Berkeley EECS 122, 2003

Assume: Open Many Connections Web Browser: has to download k objects for a page Open many connections or download sequentially? A D x y A opens 10 connections to B B opens 1 connection to E TCP is fair among connections A gets 10 times more bandwidth than B B E Figure from Walrand, Berkeley EECS 122, 2003

Exploiting Implicit Assumptions Savage, et al., CCR 1999: TCP Congestion Control with a Misbehaving Receiver Exploits ambiguity in meaning of ACK ACKs can specify any byte range for error control Congestion control assumes ACKs cover entire sent segments What if you send multiple ACKs per segment?

ACK Division Attack Receiver: upon receiving a segment with N bytes, divide the bytes in M groups and acknowledge each group separately Sender will grow window M times faster Could cause growth to 4GB in 4 RTTs! M = N = 1460 RTT Sender Receiver Data 1:1461 ACK 487 ACK 973 ACK 1461 Data 1461:2921 Data 2921:4381 Data 4381:5841 Data 5841:7301

TCP Daytona! 60000 Sequence number (Bytes) 50000 40000 30000 20000 10000 0 Data Segments ACKs Data Segments (normal) ACKs (normal) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time (sec)

Defense Appropriate Byte Counting [RFC3465 (2003), RFC 5681 (2009)] In slow start, cwnd += min (N, MSS) where N is the number of newly acknowledged bytes in the received ACK

Cheating TCP and Game Theory A D x y B E A Increases by 1 D à Increases by 1 Increases by 5 22, 22 10, 35 (x, y) Increases by 5 35, 10 15, 15 Individual incentives: cheating pays Social incentives: better off without cheating Too aggressive àlosses àthroughput falls Classic PD: resolution depends on accountability 38

An alternative for reliability Erasure coding Assume you can detect errors Code is designed to tolerate entire missing packets Collisions, noise, drops because of bit errors Forward error correction Examples: Reed-Solomon codes, LT Codes, Raptor Codes Property: From K source frames, produce B > K encoded frames Receiver can reconstruct source with any K frames, with K slightly larger than K Some codes can make B as large as needed, on the fly

LT Codes Luby Transform Codes Michael Luby, circa 1998 Encoder: repeat B times 1. Pick a degree d (*) 2. Randomly select d source blocks. Encoded block t n = XOR or selected blocks * The degree is picked from a distribution, robust soliton distribution, that guarantees that the decoding process will succeed with high probability

LT Decoder Find an encoded block t n with d=1 Set s n = t n For all other blocks t n that include s n, set t n =t n XOR s n Delete s n from all encoding lists Finish if 1. You decode all source blocks, or 2. You run out out blocks of degree 1

Next Time Move into the application layer DNS, Web, Security, and more

Backup slides We didn t cover these in lecture: won t be in the exam, but you might be interested J

More help from the network Problem: still vulnerable to malicious flows! RED will drop packets from large flows preferentially, but they don t have to respond appropriately Idea: Multiple Queues (one per flow) Serve queues in Round-Robin Nagle (1987) Good: protects against misbehaving flows Disadvantage? Flows with larger packets get higher bandwidth

Solution Bit-by-bit round robing Can we do this? No, packets cannot be preempted! We can only approximate it

Fair Queueing Define a fluid flow system as one where flows are served bit-by-bit Simulate ff, and serve packets in the order in which they would finish in the ff system Each flow will receive exactly its fair share

Example Flow 1 (arrival traffic) 1 2 3 4 5 6 time Flow 2 (arrival traffic) 1 2 3 4 5 time Service in fluid flow system 1 2 1 2 3 3 4 4 5 6 5 time Packet system 1 2 1 3 2 3 4 4 5 5 6 time

Implementing FQ Suppose clock ticks with each bit transmitted (RR, among all active flows) P i is the length of the packet S i is packet i s start of transmission time F i is packet i s end of transmission time F i = S i + P i When does router start transmitting packet i? If arrived before F i-1, S i = F i-1 If no current packet for this flow, start when packet arrives (call this A i ): S i = A i Thus, F i = max(f i-1,a i ) + P i

Fair Queueing Across all flows Calculate F i for each packet that arrives on each flow Next packet to transmit is that with the lowest F i Clock rate depends on the number of flows Advantages Achieves max-min fairness, independent of sources Work conserving Disadvantages Requires non-trivial support from routers Requires reliable identification of flows Not perfect: can t preempt packets

Throughput(Mbps) Throughput(Mbps) Fair Queueing Example 10Mbps link, 1 10Mbps UDP, 31 TCPs 10 2 9 8 7 6 5 4 3 2 1 0 RED 1 4 7 10 13 16 19 22 25 28 31 Flow Number 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 FQ 1 4 7 10 13 16 19 22 25 28 31 Flow Number

Big Picture Fair Queuing doesn t eliminate congestion: just manages it You need both, ideally: End-host congestion control to adapt Router congestion control to provide isolation