Reliable Transport II: TCP and Congestion Control

Similar documents
Reliable Transport II: TCP and Congestion Control

Lecture 4: Congestion Control

Communication Networks

Flow and Congestion Control Marcos Vieira

Reliable Transport I: Concepts and TCP Protocol

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

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

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

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

15-744: Computer Networking TCP

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Bandwidth Allocation & TCP

Lecture 14: Congestion Control"

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

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

Congestion Avoidance and Control. Rohan Tabish and Zane Ma

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

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

CS3600 SYSTEMS AND NETWORKS

ECE 610: Homework 4 Problems are taken from Kurose and Ross.

Reliable Transport I: Concepts and TCP Protocol

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

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

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

TCP Congestion Control 65KB W

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

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

CS4700/CS5700 Fundamentals of Computer Networks

Answers to Sample Questions on Transport Layer

Lecture 14: Congestion Control"

cs/ee 143 Communication Networks

CS321: Computer Networks Congestion Control in TCP

Congestion Control in TCP

CSE 461. TCP and network congestion

CSE 123A Computer Networks

Principles of congestion control

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

Computer Networking Introduction

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

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

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

TCP 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

8. TCP Congestion Control

CS644 Advanced Networks

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

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

Transport Layer Congestion Control

Flow and Congestion Control (Hosts)

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

Chapter 3- parte B outline

23-3 TCP. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control 23.22

Internet Networking recitation #10 TCP New Reno Vs. Reno

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

Detecting half-open connections. Observed TCP problems

Congestion Control 3/16/09

Mid Term Exam Results

Lecture 8. TCP/IP Transport Layer (2)

Lecture 15: Transport Layer Congestion Control

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

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

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

Transport Protocols and 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

ADVANCED COMPUTER NETWORKS

CSC 8560 Computer Networks: TCP

Chapter III. congestion situation in Highspeed Networks

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

COMP/ELEC 429/556 Introduction to Computer Networks

Q23-5 In a network, the size of the receive window is 1 packet. Which of the follow-ing protocols is being used by the network?

CS Transport. Outline. Window Flow Control. Window Flow Control

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

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

Congestion Avoidance

TCP Congestion Control

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

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

TCP Congestion Control

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

Congestion control in TCP

CS268: Beyond TCP Congestion Control

ECE 333: Introduction to Communication Networks Fall 2001

Equation-based Congestion Control

TCP Review. CS144 Review Session 4 April 25, 2008 Ben Nham

Advanced Computer Networks

6.033 Computer System Engineering

Outline. User Datagram Protocol (UDP) Transmission Control Protocol (TCP) Transport layer (cont.) Transport layer. Background UDP.

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

Congestion Control. Lecture 12: TCP Friendliness, DCCP, NATs, and STUN. Chiu Jain Phase Plots. Fair A=B. Responding to Loss. Flow B rate (bps) t 1 t 3

image 3.8 KB Figure 1.6: Example Web Page

Lecture 12: TCP Friendliness, DCCP, NATs, and STUN

Lecture 10: TCP Friendliness, DCCP, NATs, and STUN

CS Networks and Distributed Systems. Lecture 10: Congestion Control

Chapter 3 Transport Layer

CNT 6885 Network Review on Transport Layer

Transcription:

Reliable Transport II: TCP and Congestion Control Brad Karp UCL Computer Science CS 3035/GZ01 31 st October 2013

Outline Slow Start AIMD Congestion control Throughput, loss, and RTT equation Connection teardown Protocol state machine 2

Retransmit Behavior Original TCP (pre-aimd design), before [Jacobson 88]: at start of connection, send full window of packets retransmit each packet immediately after its timer expires Result: window-sized bursts of packets sent into network 3

Pre-Jacobson TCP (Obsolete!) Time-sequence plot taken at sender Bursts of packets: vertical lines Spurious retransmits: repeats at same y value Dashed line: available 20 Kbps capacity 4

Self-Clocking: Conservation of Packets Goal: self-clocking transmission each ACK returns, one data packet sent spacing of returning ACKs: matches spacing of packets in time at slowest link on path 5

Reaching Equilibrium: Slow Start At connection start, sender sets congestion window size, cwnd, to pktsize (one packet s worth of bytes), not whole window Sender sends up to minimum of receiver s advertised window size W and cwnd Upon return of each ACK until receiver s advertised window size reached, increase cwnd by pktsize bytes Slow means exponential window increase! Takes log 2 (W/pktSize) RTTs to reach receiver s advertised window size W 6

Post-Jacobson TCP: Slow Start and Mean+Variance RTT Estimator Time-sequence plot at sender Slower start No spurious retransmits 7

Outline Slow Start AIMD Congestion control Throughput, loss, and RTT equation Connection teardown Protocol state machine 8

Goals in Congestion Control Achieve high utilization on links; don t waste capacity! Divide bottleneck link capacity fairly among users Be stable: converge to a steady allocation among users Avoid congestion collapse 9

Congestion Collapse Knee Throughput (bps) Congestion collapse! Offered load (bps) Cliff behavior observed in [Jacobson 88] 10

Congestion Requires Slowing Senders Recall: bigger buffers cannot prevent congestion Senders must slow to alleviate congestion Absence of ACKs implicitly indicates congestion TCP sender s window size determines sending rate Recall: correct window size is bottleneck bandwidth-delay product How can sender learn this value? Search for it, by adapting window size Feedback from network: ACKs return (window OK) or do not return (window too big) 11

Avoiding Congestion: Multiplicative Decrease Recall that sender uses sending window of size min(cwnd, rwnd), where rwnd is receiver s advertised window Upon timeout for sent packet, sender presumes packet lost to congestion, and: sets ssthresh = cwnd / 2 sets cwnd = pktsize uses slow start to grow cwnd up to ssthresh End result: cwnd = cwnd / 2, via slow start Sender sends one window per RTT; halving cwnd halves transmit rate 12

Avoiding Congestion: Additive Increase Drops indicate TCP sending more than its fair share of bottleneck No feedback to indicate TCP using less than its fair share of bottleneck Solution: speculatively increase window size as ACKs return Additive increase: for each returning ACK, cwnd = cwnd + (pktsize pktsize)/cwnd Increases cwnd by ~pktsize bytes per RTT 13

Avoiding Congestion: Additive Increase Drops indicate TCP sending more than its fair share of bottleneck No feedback to indicate TCP using less than its fair share of bottleneck Combined Solution: algorithm: speculatively increase window Additive size as ACKs Increase, return Multiplicative Decrease (AIMD) Additive increase: for each returning ACK, cwnd = cwnd + (pktsize pktsize)/cwnd Increases cwnd by ~pktsize bytes per RTT 14

Refinement: Fast Retransmit (I) Sender must wait well over RTT for timer to expire before loss detected TCP s minimum retransmit timeout: 1 second Another loss indication: duplicate ACKs Suppose sender sends 1, 2, 3, 4, 5, but 2 lost Receiver receives 1, 3, 4, 5 Receiver sends cumulative ACKs 2, 2, 2, 2 Loss causes duplicate ACKs! 15

Fast Retransmit (II) Upon arrival of 3 duplicate ACKs, sender: sets cwnd = cwnd/2 retransmits missing packet no slow start Not only loss causes dup ACKs Reordering, too A data, seqno = 1 data, seqno = 513 data, seqno = 1025 data, seqno = 1537 data, seqno = 2049 ACK = 513 ACK = 513 ACK = 513 ACK = 513 data, seqno = 513 B time 16

AIMD in Action Sender searches for correct window size 17

Why AIMD? Other control rules possible E.g., MIMD, AIAD, Recall goals: Links fully utilized (efficient) Users share resources fairly TCP adapts all flows window sizes independently Must choose a control that will always converge to an efficient and fair allocation of windows 18

Chiu-Jain Phase Plots Consider two users sharing a bottleneck link Plot bandwidths allocated to each Efficiency: sum of two users rates fixed Fairness: two users rates equal Equi-Fairness: ratio of two users rates fixed User 2 (bps) Equi-Fairness Line (MI) Fairness Line (AI) Overload Optimum Efficiency Line Underload User 1 (bps) 19

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 20

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 21

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 22

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 23

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 24

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 25

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 26

Chiu Jain: AIMD Fairness Line Efficiency Line AIMD converges to optimum efficiency and fairness 27

Chiu Jain: AIAD Fairness Line Efficiency Line AIAD doesn t converge to optimum point! Similar oscillations for MIMD 28

Outline Packet header format Connection establishment Data transmission Retransmit timeouts RTT estimator AIMD Congestion control Throughput, loss, and RTT equation Connection teardown Protocol state machine 29

Modeling Throughput, Loss, and RTT How do packet loss rate and RTT affect throughput TCP achieves? Assume: only fast retransmits no timeouts (so no slow starts in steadystate) 30

Evolution of Window Over Time W W/2 time Average window size: 3W/4 One window sent per RTT Bandwidth: 3W/4 packets per RTT (3W/4 x packet size) / RTT bytes per second W depends on loss rate 31

Loss and Window Size Assume no delayed ACKs, fixed RTT cwnd grows by one packet per RTT So it takes W/2 RTTs to go from window size W/2 to window size W; this period is one cycle How many packets sent in total? ((3W/4) / RTT) x (W/2 x RTT) = 3W 2 /8 One loss per cycle (as window reaches W) loss rate: p = 8/3W 2 W = sqrt(8/3p) 32

Throughput, Loss, and RTT Model W = sqrt(8/3p) = (4/3) x sqrt(3/2p) Recall: Bandwidth: B = (3W/4 x packet size) / RTT B = packet size / (RTT x sqrt(2p/3)) Consequences: Increased loss quickly reduces throughput At same bottleneck, flow with longer RTT achieves less throughput than flow with shorter RTT! 33

Outline Packet header format Connection establishment Data transmission Retransmit timeouts RTT estimator AIMD Congestion control Throughput, loss, and RTT equation Connection teardown Protocol state machine 34

TCP: Connection Teardown Data may flow bidirectionally Each side independently decides when to close connection In each direction, FIN answered by ACK Must reliably terminate connection for both sides During TIME_WAIT state at first side to send FIN, ACK valid FINs that arrive Must avoid mixing data from old connection with new one During TIME_WAIT state, disallow all new connections for 2 x max segment lifetime A FIN, seqno = i ACK = j+1 enter TIME_WAIT state ACK = i+1 FIN, seqno = j B time 35

TCP: Protocol State Machine 36

Summary: TCP and Congestion Control Connection establishment and teardown Robustness against delayed packets crucial Round-trip time estimation EWMAs estimate both RTT mean and deviation Congestion detection at sender Timeout: retransmit timer expires, half window, slow start from one packet Fast Retransmit: three duplicate ACKs, half window, no slow start Search for optimal sending window size Additive increase, multiplicative decrease (AIMD) AIMD converges to high utilization, fair sharing 37