Network Transport Layer: Congestion Control

Slides:



Advertisements
Similar presentations
CSCI-1680 Transport Layer II Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Advertisements

1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 12.
1 Ch. 7 : Internet Transport Protocols. 3-2 TCP reliable data transfer r TCP creates reliable service on top of IP’s unreliable service r pipelined segments.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
1 Flow Control 2 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of free buffer space  RcvWindow field in TCP.
Announcement Project 2 out –Much harder than project 1, start early! Homework 2 due next Tu.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Lecture 17 Congestion Control; AIMD; TCP Reno 10/31/2013
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
CS540/TE630 Computer Network Architecture Spring 2009 Tu/Th 10:30am-Noon Sue Moon.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
EE 122: Congestion Control and Avoidance Kevin Lai October 23, 2002.
1 End-to-End Protocols (UDP, TCP, Connection Management)
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
TCP. TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already.
Peer-to-Peer Networks 13 Internet – The Underlay Network
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
1 Network Transport Layer: TCP Analysis and BW Allocation Framework Y. Richard Yang 3/30/2016.
Chapter 3 Transport Layer
Chapter 3 outline 3.1 Transport-layer services
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
CS450 – Introduction to Networking Lecture 19 – Congestion Control (2)
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Approaches towards congestion control
Transport Layer CS 381 3/7/2017.
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
COMP 431 Internet Services & Protocols
Introduction to Congestion Control
EECS 122: Introduction to Computer Networks Congestion Control
Chapter 3 outline 3.1 Transport-layer services
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Chapter 5 TCP Transmission Control
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
TCP.
Lecture 19 – TCP Performance
CS4470 Computer Networking Protocols
CS 268: Lecture 4 (TCP Congestion Control)
Chapter 6 TCP Congestion Control
COMP/ELEC 429/556 Introduction to Computer Networks
CS640: Introduction to Computer Networks
Congestion Control.
EE 122: Lecture 10 (Congestion Control)
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
Network Transport Layer: TCP Reliability; Transport Congestion Control; TCP/Reno CC Y. Richard Yang 11/8/2018.
TCP flow and congestion control
Chapter 3 Transport Layer
Network Transport Layer: TCP/Reno Analysis, TCP Cubic, TCP/Vegas
Flow Control.
Presentation transcript:

Network Transport Layer: Congestion Control Y. Richard Yang http://zoo.cs.yale.edu/classes/cs433/ 11/2/2017

Admin. Programming assignment 4 Part 1 discussion slots: Nov. 3: 11:15-12:15 pm Nov. 6: 11-12; 2:30-5:30 pm Nov. 7: 2:30-3:00; 4-6 pm

Recap: Protocol Analysis sender receiver General technique: write down joint state and analyze correctness.

Recap: Reliable Transport Basic structure: sliding window protocols Realization: GBN or SR General technique: pipelining.

Recap: Connection Management Host A Host B Host A Host B close SYN(seq=x) FIN ACK close ACK(seq=x), SYN(seq=y) FIN ACK ACK(seq=y) timed wait closed DATA(seq=x+1) Distributed synchronization/agreement is a basic, hard problem.

TCP: reliable data transfer 00 sendbase = initial_sequence number agreed by TWH 01 nextseqnum = initial_sequence number by TWH 02 loop (forever) { 03 switch(event) 04 event: data received from application above 05 if (window size W allows send) 06 create TCP segment with sequence number nextseqnum 06 if (no timer) start timer T 07 pass segment to IP 08 nextseqnum = nextseqnum + length(data) else put packet in buffer 09 event: timer timeout for sendbase 10 retransmit segment 11 compute new timeout interval 12 restart timer 13 event: ACK received, with ACK field value of y 14 if (y > sendbase) { /* cumulative ACK of all data up to y */ 15 cancel the timer for sendbase sendbase = y if (no timer and packet pending) start timer for new sendbase while (there are segments and window allow) sent a segment; 18 } 19 else { /* y==sendbase, duplicate ACK for already ACKed segment */ 20 increment number of duplicate ACKs received for y 21 if (number of duplicate ACKS received for y == 3) { 22 /* TCP fast retransmit */ 23 resend segment with sequence number y 24 restart timer for segment y 25 } 26 } /* end of loop forever */ TCP: reliable data transfer Hybrid GBN/SR Key Parameters?

Summary: Reliable Transport Basic structure: sliding window protocol Remaining issue: How to determine the “right” parameters? timeout value? sliding window size?

History Key parameters for TCP in mid-1980s fixed window size W timeout value = 2 RTT Network collapse in the mid-1980s UCB  LBL throughput dropped by 1000X ! The intuition was that the collapse was caused by wrong parameters…

Outline Admin and recap Setting timeout (RTO)

Timeout: Cost of Timeout Param too short premature timeout unnecessary retransmissions; many duplicates too long slow reaction to segment loss Q: Is it possible to set Timeout as a constant? Q: Any problem w/ the early approach: Timeout = 2 RTT

Timeout = EstRTT + 4 * DevRTT Setting Timeout Problem: Ideally, we set timeout = RTT, but RTT is not a fixed value => using the average of RTT will generate many timeouts due to network variations Solution: Set Timeout RTO = avg + “safety margin” based on variation RTT freq. Timeout = EstRTT + 4 * DevRTT Current approach:

Compute EstRTT and DevRTT Exponential weighted moving average influence of past sample decreases exponentially fast EstRTT = (1-alpha)*EstRTT + alpha*SampleRTT - SampleRTT: measured time from segment transmission until ACK receipt - typical value: alpha = 0.125 DevRTT = (1-beta)*DevRTT + beta|SampleRTT-EstRTT| (typically, beta = 0.25)

An Example TCP Session

A Summary of Questions Basic structure: sliding window protocols How to determine the “right” parameters? timeout: mean + variation sliding window size?

Sliding Window Size Function: Rate Control Transmission rate determined by congestion window size, cwnd, over segments: cwnd cwnd segments, each with MSS bytes sent in one RTT: Rate = cwnd * MSS RTT Bytes/sec Assume W is small enough. Ignore small details. MSS: Minimum Segment Size

Some General Questions Big picture question: How to determine a flow’s sending rate? For better understanding, we need to look at a few basic questions: What is congestion (cost of congestion)? Why are desired properties of congestion control?

Roadmap What is congestion The basic CC alg TCP/reno CC TCP/Vegas A unifying view of TCP/Reno and TCP/Vegas Network wide resource allocation Framework Axiom derivation of network-wide objective function Derive distributed algorithm

Outline Admin and recap Setting timeout Transport congestion control what is congestion (cost of congestion)

Cause/Cost of Congestion: Single Bottleneck flow 1 5 Mbps 20 Mbps 10 Mbps 20 Mbps flow 2 (5 Mbps) 20 Mbps router 1 router 2 - Flow 2 has a fixed sending rate of 5 Mbps - We vary the sending rate of flow 1 from 0 to 20 Mbps - Assume no retransmission; link from router 1 to router 2 has infinite buffer throughput: e2e packets delivered in unit time Delay? sending rate by flow 1 (Mbps) delay at central link 5 delay due to randomness sending rate by flow 1 (Mbps) throughput of flow 1 & 2 (Mbps) 5 10

Cause/Cost of Congestion: Single Bottleneck router 3 router 5 flow 1 5 Mbps 20 Mbps 10 Mbps 20 Mbps flow 2 (5 Mbps) 20 Mbps router 1 router 2 router 4 router 6 Assume no retransmission the link from router 1 to router 2 has finite buffer throughput: e2e packets delivered in unit time Zombie packet: a packet dropped at the link from router 2 to router 5; the upstream transmission from router 1 to router 2 used for that packet was wasted! sending rate by flow 1 (Mbps) throughput of flow 1 & 2 (Mbps) 5 10 x

Summary: The Cost of Congestion Throughput knee cliff congestion collapse packet loss When sources sending rate too high for the network to handle”: Packet loss => wasted upstream bandwidth when a pkt is discarded at downstream wasted bandwidth due to retransmission (a pkt goes through a link multiple times) High delay Load Delay

Outline Admin and recap Setting timeout Transport congestion control what is congestion (cost of congestion) basic congestion control alg.

The Desired Properties of a Congestion Control Scheme Efficiency: close to full utilization but low delay fast convergence after disturbance Fairness (resource sharing) Distributedness (no central knowledge for scalability)

Derive CC: A Simple Model User 1 x1 d = sum xi > Xgoal? sum xi User 2 x2 xn User n Flows observe congestion signal d, and locally take actions to adjust rates.

Discussion: values of the parameters? Linear Control Proposed by Chiu and Jain (1988) The simplest control strategy Discussion: values of the parameters?

State Space of Two Flows fairness line: x1=x2 x2 efficiency line: x1+x2=C x(0) overload underload x1

efficiency: distributed linear rule congestion efficiency: distributed linear rule x0 x0 efficiency fairness x0 intersection x0

Implication: Congestion (overload) Case In order to get closer to efficiency and fairness after each update, decreasing of rate must be multiplicative decrease (MD) aD = 0 bD < 1

efficiency: distributed linear rule no-congestion efficiency: distributed linear rule x0 x0 efficiency fairness x0 convergence x0

Implication: No Congestion Case In order to get closer to efficiency and fairness after each update, additive and multiplicative increasing (AMI), i.e., aI > 0, bI > 1 Simply additive increase gives better improvement in fairness (i.e., getting closer to the fairness line) Multiplicative increase may grow faster

Intuition: State Trace Analysis of Four Special Cases Additive Decrease Multiplicative Decrease Additive Increase AIAD (bI=bD=1) AIMD (bI=1, aD=0) Multiplicative Increase MIAD (aI=0, bI>1, bD=1) MIMD (aI=aD=0) Discussion: state transition trace.

AIMD: State Transition Trace x2 fairness line: x1=x2 efficiency line: x1+x2=C overload underload x0 x1

Intuition: Another Look Consider the difference or ratio of the rates of two flows AIAD MIMD MIAD AIMD AIAD: difference does not change MIMD: ratio does not change MIAD: difference becomes bigger AIMD: difference does not change

Mapping A(M)I-MD to Protocol Question to look at: How do we apply the A(M)I-MD algorithm? Implement d(t): loss/delay Adjust window size b_D: exponential backoff timeout after window size is 1

Rate-based vs. Window-based Congestion control by explicitly controlling the sending rate of a flow, e.g., set sending rate to 128Kbps Example: ATM Window-based: Congestion control by controlling the window size of a transport scheme, e.g., set window size to 64KBytes Example: TCP Discussion: rate-based vs. window-based

Window-based Congestion Control Window-based congestion control is self-clocking: considers flow conservation, and adjusts to RTT variation automatically. Hence, for better safety, more designs use window-based design.

Mapping A(M)I-MD to Protocol Question to look at: How do we apply the A(M)I-MD algorithm? Implement d(t): loss/delay Adjust window size b_D: exponential backoff timeout after window size is 1

Outline Admin and recap Setting timeout Transport congestion control what is congestion (cost of congestion) basic congestion control alg. TCP/reno congestion control

TCP Congestion Control Closed-loop, end-to-end, window-based congestion control Designed by Van Jacobson in late 1980s, based on the AIMD alg. of Dah-Ming Chu and Raj Jain Worked in a large range of bandwidth values: the bandwidth of the Internet has increased by more than 200,000 times Many versions TCP/Tahoe: this is a less optimized version TCP/Reno: many OSs today implement Reno type congestion control TCP/Vegas: not currently used For more details: see TCP/IP illustrated; or read http://lxr.linux.no/source/net/ipv4/tcp_input.c for linux implementation

Basic Structure Two “phases” Important variables: MI: slow-start AIMD: congestion avoidance Important variables: cwnd: congestion window size ssthresh: threshold between the slow-start phase and the congestion avoidance phase

Visualization of the Two Phases

MI: Slow Start Algorithm: MI double cwnd every RTT until network congested Goal: getting to equilibrium gradually but quickly, to get a rough estimate of the optimal of cwnd

MI: Slow-start Initially: cwnd = 1; ssthresh = infinite (e.g., 64K); For each newly ACKed segment: if (cwnd < ssthresh) /* MI: slow start*/ cwnd = cwnd + 1; segment 1 cwnd = 1 ACK for segment 1 cwnd = 2 segment 2 segment 3 ACK for segments 2 + 3 cwnd = 4 segment 4 segment 5 segment 6 segment 7 cwnd = 6 cwnd = 8

Startup Behavior with Slow-start See [Jac89]

AIMD: Congestion Avoidance Algorithm: AIMD increases window by 1 per round-trip time (how?) cuts window size to half when detecting congestion by 3DUP to 1 if timeout if already timeout, doubles timeout Goal: Maintains equilibrium and reacts around equilibrium

TCP/Reno Full Alg Initially: cwnd = 1; ssthresh = infinite (e.g., 64K); For each newly ACKed segment: if (cwnd < ssthresh) // slow start: MI cwnd = cwnd + 1; else // congestion avoidance; AI cwnd += 1/cwnd; Triple-duplicate ACKs: // MD cwnd = ssthresh = cwnd/2; Timeout: ssthresh = cwnd/2; // reset (if already timed out, double timeout value; this is called exponential backoff)