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

Similar documents
15-744: Computer Networking TCP

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

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

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

15-744: Computer Networking. Overview. Queuing Disciplines. TCP & Routers. L-6 TCP & Routers

CS 268: Computer Networking

Computer Networking

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

CS 268: Computer Networking. This Lecture: Congestion Control

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

Computer Networking. Queue Management and Quality of Service (QOS)

Lecture 22: Buffering & Scheduling. CSE 123: Computer Networks Alex C. Snoeren

Lecture 14: Congestion Control"

Reliable Transport II: TCP and Congestion Control

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

Lecture 14: Congestion Control"

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

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

Principles of congestion control

Reliable Transport II: TCP and Congestion Control

TCP Congestion Control

Bandwidth Allocation & TCP

ADVANCED COMPUTER NETWORKS

CSE 461. TCP and network congestion

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

Congestion Control & Transport protocols

Congestion Control. Tom Anderson

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

CSE 123A Computer Networks

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

CS644 Advanced Networks

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Project Computer Networking. Resource Management Approaches. Start EARLY Tomorrow s recitation. Lecture 20 Queue Management and QoS

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

TCP Overview Revisited Computer Networking. Queuing Disciplines. Packet Drop Dimensions. Typical Internet Queuing. FIFO + Drop-tail Problems

Equation-Based Congestion Control for Unicast Applications. Outline. Introduction. But don t we need TCP? TFRC Goals

TCP congestion control:

CS4700/CS5700 Fundamentals of Computer Networks

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

CS3600 SYSTEMS AND NETWORKS

Priority Traffic CSCD 433/533. Advanced Networks Spring Lecture 21 Congestion Control and Queuing Strategies

Overview. Lecture 22 Queue Management and Quality of Service (QoS) Queuing Disciplines. Typical Internet Queuing. FIFO + Drop tail Problems

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

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

CS321: Computer Networks Congestion Control in TCP

Flow and Congestion Control

Chapter III. congestion situation in Highspeed Networks

Communication Networks

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

Detecting half-open connections. Observed TCP problems

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

Congestion Control. Resource allocation and congestion control problem

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

Flow and Congestion Control Marcos Vieira

Computer Networking Introduction

Chapter III: Transport Layer

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

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

CS519: Computer Networks. Lecture 5, Part 5: Mar 31, 2004 Queuing and QoS

6.033 Computer System Engineering

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

Flow and Congestion Control (Hosts)

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

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

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

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

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

UNIT IV -- TRANSPORT LAYER

Congestion Control 3/16/09

Lecture 15: Transport Layer Congestion Control

The Transport Layer Congestion control in TCP

CSCD 330 Network Programming Winter 2015

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

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

CS4700/CS5700 Fundamentals of Computer Networks

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

Random Early Detection (RED) gateways. Sally Floyd CS 268: Computer Networks

Chapter II. Protocols for High Speed Networks. 2.1 Need for alternative Protocols

CS557: Queue Management

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

Congestion Control in TCP

COMP/ELEC 429/556 Introduction to Computer Networks

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

Random Early Detection Gateways for Congestion Avoidance

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

image 3.8 KB Figure 1.6: Example Web Page

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Lecture 4: Congestion Control

Sally Floyd, Mark Handley, and Jitendra Padhye. Sept. 4-6, 2000

Random Early Detection Gateways for Congestion Avoidance

ADVANCED TOPICS FOR CONGESTION CONTROL

Congestion / Flow Control in TCP

Multiple unconnected networks

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

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

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

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!

Transcription:

TCP Congestion Control 15-744: Computer Networking L-4 TCP Congestion Control RED Assigned Reading [FJ93] Random Early Detection Gateways for Congestion Avoidance [TFRC] Equation-Based Congestion Control for Unicast Applications (2 sections) 2 Introduction to TCP Communication abstraction: Reliable Ordered Point-to-point Byte-stream Full duplex Flow and congestion controlled Protocol implemented entirely at the ends Fate sharing Sliding window with cumulative acks Ack field contains last in-order packet received Duplicate acks sent when out-of-order packet received Key Things You Should Know Already Port numbers TCP/UDP checksum Sliding window flow control Sequence numbers TCP connection setup TCP reliability Timeout Data-driven Chiu&Jain analysis of linear congestion control 3 4 1

Overview TCP congestion control TFRC TCP and queues Queuing disciplines RED TCP Congestion Control Changes to TCP motivated by ARPANET congestion collapse Basic principles AIMD Packet conservation Reaching steady state quickly ACK clocking 5 6 AIMD Distributed, fair and efficient Packet loss is seen as sign of congestion and results in a multiplicative rate decrease Factor of 2 TCP periodically probes for available bandwidth by increasing its rate Rate Implementation Issue Operating system timers are very coarse how to pace packets out smoothly? Implemented using a congestion window that limits how much data can be in the network. TCP also keeps track of how much data is in transit Data can only be sent when the amount of outstanding data is less than the congestion window. The amount of outstanding data is increased on a send and decreased on ack (last sent last acked) < congestion window Window limited by both congestion and buffering Sender s maximum window = Min (advertised window, cwnd) Time 7 8 2

Congestion Avoidance Congestion Avoidance Sequence Plot If loss occurs when cwnd = W Network can handle 0.5W ~ W segments Set cwnd to 0.5W (multiplicative decrease) Upon receiving ACK Increase cwnd by (1 packet)/cwnd What is 1 packet? 1 MSS worth of bytes After cwnd packets have passed by approximately increase of 1 MSS Implements AIMD Sequence No Packets Acks Time 9 10 Congestion Avoidance Behavior Packet Conservation Congestion Window Packet loss + Timeout Cut Congestion Window and Rate Grabbing back Bandwidth Time At equilibrium, inject packet into network only when one is removed Sliding window and not rate controlled But still need to avoid sending burst of packets would overflow links Need to carefully pace out packets Helps provide stability Need to eliminate spurious retransmissions Accurate RTO estimation Better loss recovery techniques (e.g. fast retransmit) 11 12 3

TCP Packet Pacing Congestion window helps to pace the transmission of data packets In steady state, a packet is sent when an ack is received Data transmission remains smooth, once it is smooth Self-clocking behavior Sender A s P b A b P r A r Receiver Reaching Steady State Doing AIMD is fine in steady state but slow How does TCP know what is a good initial rate to start with? Should work both for a CDPD (10s of Kbps or less) and for supercomputer links (10 Gbps and growing) Quick initial phase to help get up to speed (called slow start) 13 14 Slow Start Packet Pacing Slow Start Example How do we get this clocking behavior to start? Initialize cwnd = 1 Upon receipt of every ack, cwnd = cwnd + 1 Implications Window actually increases to W in RTT * log 2 (W) Can overshoot window and cause packet loss 0R 1R 2R 3R 1 One pkt time 1 2 3 2 3 4 6 5 7 4 5 6 7 8 9 10 11 12 13 14 15 One RTT 15 16 4

Slow Start Sequence Plot Return to Slow Start Sequence No... If packet is lost we lose our self clocking as well Need to implement slow-start and congestion avoidance together When timeout occurs set ssthresh to 0.5w If cwnd < ssthresh, use slow start Else use congestion avoidance Packets Acks Time 17 18 TCP Saw Tooth Behavior Questions Congestion Window Timeouts may still occur Current loss rates 10% in paper Uniform reaction to congestion can different nodes do different things? TCP friendliness, GAIMD, etc. Can we use queuing delay as an indicator? TCP Vegas Initial Slowstart Slowstart to pace packets Fast Retransmit and Recovery Time What about non-linear controls? Binomial congestion control 19 20 5

Overview TCP congestion control TFRC See Hugo Pinto s slides (slides here are optional) TCP and queues Queuing disciplines RED Changing Workloads New applications are changing the way TCP is used 1980 s Internet Telnet & FTP long lived flows Well behaved end hosts Homogenous end host capabilities Simple symmetric routing 2000 s Internet Web & more Web large number of short xfers Wild west everyone is playing games to get bandwidth Cell phones and toasters on the Internet Policy routing How to accommodate new applications? 21 22 TCP Friendliness What does it mean to be TCP friendly? TCP is not going away Any new congestion control must compete with TCP flows Should not clobber TCP flows and grab bulk of link Should also be able to hold its own, i.e. grab its fair share, or it will never become popular How is this quantified/shown? Has evolved into evaluating loss/throughput behavior If it shows 1/sqrt(p) behavior it is ok But is this really true? TCP Friendly Rate Control (TFRC) Equation 1 real TCP response 1 st term corresponds to simple derivation 2 nd term corresponds to more complicated timeout behavior Is critical in situations with > 5% loss rates where timeouts occur frequently Key parameters RTO RTT Loss rate 23 24 6

RTO/RTT Estimation RTO not used to perform retransmissions Used to model TCP s extremely slow transmission rate in this mode Only important when loss rate is high Accuracy is not as critical Different TCP s have different RTO calculation Clock granularity critical 500ms typical, 100ms, 200ms, 1s also common RTO = 4 * RTT is close enough for reasonable operation EWMA RTT RTT n+1 = (1- )RTT n + RTTSAMP Loss Estimation Loss event rate vs. loss rate Characteristics Should work well in steady loss rate Should weight recent samples more Should increase only with a new loss Should decrease only with long period without loss Possible choices Dynamic window loss rate over last X packets EWMA of interval between losses Weighted average of last n intervals Last n/2 have equal weight 25 26 Loss Estimation Dynamic windows has many flaws Difficult to chose weight for EWMA Solution WMA Choose simple linear decrease in weight for last n/2 samples in weighted average What about the last interval? Include it when it actually increases WMA value What if there is a long period of no losses? Special case (history discounting) when current interval > 2 * avg Slow Start Used in TCP to get rough estimate of network and establish ack clock Don t need it for ack clock TCP ensures that overshoot is not > 2x Rate based protocols have no such limitation why? TFRC slow start New rate set to min(2 * sent, 2 * recvd) Ends with first loss report rate set to ½ current rate 27 28 7

Congestion Avoidance Loss interval increases in order to increase rate Primarily due to the transmission of new packets in current interval History discounting increases interval by removing old intervals.14 packets per RTT without history discounting.22 packets per RTT with discounting Much slower increase than TCP Decrease is also slower 4 8 RTTs to halve speed Overview TCP congestion control TFRC TCP and queues Queuing disciplines RED 29 30 TCP Performance Can TCP saturate a link? Congestion control Increase utilization until link becomes congested React by decreasing window by 50% Window is proportional to rate * RTT Doesn t this mean that the network oscillates between 50 and 100% utilization? Average utilization = 75%?? No this is *not* right! TCP Congestion Control Only W packets may be outstanding Source W max W max 2 Rule for adjusting W If an ACK is received: W W+1/W If a packet is lost: W W/2 Window size Dest t 31 32 8

Summary Unbuffered Link W The router can t fully utilize the link If the window is too small, link is not full If the link is full, next window increase causes drop With no buffer it still achieves 75% utilization t Minimum window for full utilization TCP Performance In the real world, router queues play important role Window is proportional to rate * RTT But, RTT changes as well the window Window to fill links = propagation RTT * bottleneck bandwidth If window is larger, packets sit in queue on bottleneck link 34 35 TCP Performance If we have a large router queue can get 100% utilization But, router queues can cause large delays How big does the queue need to be? Windows vary from W W/2 Must make sure that link is always full W/2 > RTT * BW W = RTT * BW + Qsize Therefore, Qsize > RTT * BW Ensures 100% utilization Delay? Varies between RTT and 2 * RTT Summary Buffered Link W Buffer t Minimum window for full utilization With sufficient buffering we achieve full link utilization The window is always above the critical threshold Buffer absorbs changes in window size Buffer Size = Height of TCP Sawtooth Minimum buffer size needed is 2T*C This is the origin of the rule-of-thumb 36 38 9

Overview TCP congestion control TFRC TCP and queues Queuing disciplines RED Queuing Disciplines Each router must implement some queuing discipline Queuing allocates both bandwidth and buffer space: Bandwidth: which packet to serve (transmit) next Buffer space: which packet to drop next (when required) Queuing also affects latency 39 40 Packet Drop Dimensions Aggregation Per-connection state Class-based queuing Drop position Head Random location Early drop Single class Tail Overflow drop Typical Internet Queuing FIFO + drop-tail Simplest choice Used widely in the Internet FIFO (first-in-first-out) Implies single class of traffic Drop-tail Arriving packets get dropped when queue is full regardless of flow or importance Important distinction: FIFO: scheduling discipline Drop-tail: drop policy 41 42 10

FIFO + Drop-tail Problems Leaves responsibility of congestion control to edges (e.g., TCP) Does not separate between different flows No policing: send more packets get more service Synchronization: end hosts react to same events Active Queue Management Design active router queue management to aid congestion control Why? Routers can distinguish between propagation and persistent queuing delays Routers can decide on transient congestion, based on workload 43 44 Active Queue Designs Modify both router and hosts DECbit congestion bit in packet header Modify router, hosts use TCP Fair queuing Per-connection buffer allocation RED (Random Early Detection) Drop packet or set bit in packet header as soon as congestion is starting Overview TCP congestion control TFRC TCP and queues Queuing disciplines RED 45 46 11

Internet Problems Full queues Routers are forced to have have large queues to maintain high utilizations TCP detects congestion from loss Forces network to have long standing queues in steady-state Lock-out problem Drop-tail routers treat bursty traffic poorly Traffic gets synchronized easily allows a few flows to monopolize the queue space Design Objectives Keep throughput high and delay low Accommodate bursts Queue size should reflect ability to accept bursts rather than steady-state queuing Improve TCP performance with minimal hardware changes 47 48 Lock-out Problem Random drop Packet arriving when queue is full causes some random packet to be dropped Drop front On full queue, drop packet at head of queue Random drop and drop front solve the lockout problem but not the full-queues problem Full Queues Problem Drop packets before queue becomes full (early drop) Intuition: notify senders of incipient congestion Example: early random drop (ERD): If qlen > drop level, drop each new packet with fixed probability p Does not control misbehaving users 49 50 12

Random Early Detection (RED) Detect incipient congestion, allow bursts Keep power (throughput/delay) high Keep average queue size low Assume hosts respond to lost packets Avoid window synchronization Randomly mark packets Avoid bias against bursty traffic Some protection against ill-behaved users RED Algorithm Maintain running average of queue length If avgq < min th do nothing Low queuing, send packets through If avgq > max th, drop packet Protection from misbehaving sources Else mark packet in a manner proportional to queue length Notify sources of incipient congestion 51 52 RED Operation RED Algorithm Max thresh P(drop) 1.0 max P Min thresh Average Queue Length min th max th Avg queue length Maintain running average of queue length Byte mode vs. packet mode why? For each packet arrival Calculate average queue size (avg) If min th avgq < max th Calculate probability P a With probability P a Mark the arriving packet Else if max th avg Mark the arriving packet 53 54 13

Queue Estimation Standard EWMA: avgq = (1-w q ) avgq + w q qlen Special fix for idle periods why? Upper bound on w q depends on min th Want to ignore transient congestion Can calculate the queue average if a burst arrives Set w q such that certain burst size does not exceed min th Lower bound on w q to detect congestion relatively quickly Typical w q = 0.002 Thresholds min th determined by the utilization requirement Tradeoff between queuing delay and utilization Relationship between max th and min th Want to ensure that feedback has enough time to make difference in load Depends on average queue increase in one RTT Paper suggest ratio of 2 Current rule of thumb is factor of 3 55 56 Packet Marking max p is reflective of typical loss rates Paper uses 0.02 0.1 is more realistic value If network needs marking of 20-30% then need to buy a better link! Gentle variant of RED (recommended) Vary drop rate from max p to 1 as the avgq varies from max th to 2* max th More robust to setting of max th and max p Coming Up Friday lecture: Fair Queuing Read WFQ paper First two sections of XCP paper Next week: taking a look at routers Will fix readings 57 58 14