Flow and Congestion Control (Hosts)

Similar documents
Lecture 8. TCP/IP Transport Layer (2)

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

CC451 Computer Networks

Chapter 3- parte B outline

CSCI Topics: Internet Programming Fall 2008

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

CNT 6885 Network Review on Transport Layer

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

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

CSCD 330 Network Programming Winter 2015

Fall 2012: FCM 708 Bridge Foundation I

CS Lecture 1 Review of Basic Protocols

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

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

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

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Transport Protocols and TCP

Mid Term Exam Results

Flow and Congestion Control Marcos Vieira

Chapter 3 Transport Layer

Transport Layer: outline

Computer Networking Introduction

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

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

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

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

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter III: Transport Layer

Chapter III: Transport Layer

TCP Congestion Control

CSCI Topics: Internet Programming Fall 2008

CS321: Computer Networks Congestion Control in TCP

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

10 minutes survey (anonymous)

Transport Layer: Outline

CSC 8560 Computer Networks: TCP

CSCD 330 Network Programming Spring 2018 Lecture 11a Transport Layer

CSE 4213: Computer Networks II

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

CSE 461. TCP and network congestion

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

Congestion Control. Principles of Congestion Control. Network assisted congestion. Asynchronous Transfer Mode. Computer Networks 10/23/2013

Go-Back-N. Pipelining: increased utilization. Pipelined protocols. GBN: sender extended FSM

Transmission Control Protocol

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

Advanced Congestion Control (Hosts)

The Transport Layer Congestion control in TCP

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

Master Course Computer Networks IN2097

ADVANCED COMPUTER NETWORKS

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

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

Chapter 3 Transport Layer

CS450 Introduc0on to Networking Lecture 14 TCP. Phu Phung Feb 13, 2015

Principles of congestion control

CSCD 330 Network Programming

Review Questions for Midterm Exam-2 Fall 2016

CSCE 463/612 Networks and Distributed Processing Spring 2017

Chapter 3 Transport Layer

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

Chapter 3 Transport Layer

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

TCP. TCP: Overview. TCP Segment Structure. Maximum Segment Size (MSS) Computer Networks 10/19/2009. CSC 257/457 - Fall

image 3.8 KB Figure 1.6: Example Web Page

Computer Communication Networks Midterm Review

TCP congestion control:

Foundations of Telematics

TCP : Fundamentals of Computer Networks Bill Nace

Chapter 3 Transport Layer

Chapter 3 Transport Layer

CSC 401 Data and Computer Communications Networks

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

Lecture 4: Congestion Control

Congestion Collapse in the 1980s

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

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

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

Chapter III: Transport Layer

COMP/ELEC 429/556 Introduction to Computer Networks

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

Lecture 15: Transport Layer Congestion Control

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

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

CSC 4900 Computer Networks: TCP

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Computer Networking Introduction

CSCI Topics: Internet Programming Fall 2008

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Master Course Computer Networks IN2097

Chapter 3 Transport Layer

Congestion Control. Tom Anderson

CS4700/CS5700 Fundamentals of Computer Networks

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

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

CS3600 SYSTEMS AND NETWORKS

Transcription:

Flow and Congestion Control (Hosts) 14-740: Fundamentals of Computer Networks Bill Nace Material from Computer Networking: A Top Down Approach, 6 th edition. J.F. Kurose and K.W. Ross

traceroute Flow Control Principles of Congestion Control TCP Congestion Control 2

Flow Control In RDT lecture, we discovered windows for managing pipelined transfer But, didn't discuss windows (much) in TCP lecture TCP has 2 windows Flow Control Window Congestion Control Window Sender limited by smallest window Flow Control!= Congestion Control 3

application writes data application reads data socket socket TCP send buffer TCP receive buffer segment segment Both sides have buffers Lots of Producer-Consumer coordination problems to overcome

Flow Control Receive side of TCP connection has a receive buffer of size RcvBuffer Application process may be slow at reading from the buffer RcvWindow data from IP Spare Room TCP data in buffer data to app process RcvBuffer 5

Flow Control (2) Flow Control: Sender won t overflow the receiver s buffer by transmitting too much, too fast Speed-matching service: matching the send rate to the receiving app s drain rate RcvWindow data from IP Spare Room TCP data in buffer data to app process RcvBuffer 6

Mechanism Spare room in buffer = RcvWindow Yes, this assumes receiver discards out-of-order segments. Easy enough to program around simplification = RcvBuffer - [LastByteRcvd - LastByteRead] RcvWindow data from IP Spare Room TCP data in buffer data to app process RcvBuffer 7

Mechanism (2) Receiver advertises spare room by including value of RcvWindow in ACKs Gives sender permission to send this much Sender limits unacked data to RcvWindow bytes 32 bits source port # destination port # sequence # acknowledgement # RcvWindow hdr len not used flags receive window checksum urgent data pointer data from IP Spare Room TCP data in buffer data to app process options (variable length) application data (variable length) RcvBuffer 8

traceroute Flow Control Principles of Congestion Control TCP Congestion Control 9

Router View Source #1 Source #2 10-Mbps Ethernet Router 100-Mbps FDDI 1.5-Mbps T1 link Destination Router buffer absorbs temporary bursts when input rate > output rate When buffer is full, router cannot accept more packets and must drop them 10

Costs of Congestion 11

Congestion Too many sources sending too much data too fast for network to handle Different than flow control! Flow control concerns the receiving end-host As network load increases, some router has many packets queued in its buffer, resulting in: Long delays as packets wait for processing Lost packets as buffer space overflows, cannot handle any more incoming packets! 12

Congestion Collapse Commonly happened in late 1980s! End-hosts would send their packets into the Internet as fast as the receiver advertised window would allow Congestion would happen at some router, causing packets to be dropped End-hosts would retransmit their packets Network would become more and more congested Vicious cycle: retransmission of old packets, not new ones! 13

Congestion Control Goal: large throughput and small delay To increase throughput, send more packets More packets increases queue length at routers -- delay increases Large throughput!= small delay 14

Congestion Control (2) Apply some control theory Region 1: Low throughput Region 2: High delay Throughput increases slowly Delay increases quickly Region 3: Collapse Throughput 0, Delay At what load would we like to operate? 15

How do we control? Need feedback mechanism! Detect when network approaches knee point, so countermeasures can be taken Slow down sending rate Conservation of Packets Law When network running in steady state at peak efficiency, don t put a packet into the network until one leaves 16

Feedback Approaches Network-assisted congestion control (detection): routers provide feedback to sender, or Set single bit in header as it goes by, or... TCP/IP ECN, ATM, SNA, DECnet tell explicit send rate End-end control: no explicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP

Feedback Mechanism Network Assisted: Signals from routers End-to-end: Messages from receiver 18

traceroute Principles of Congestion Control TCP Congestion Control 19

TCP CC: Overview End-to-End CC: sender limits transmission based on perceived congestion Uses CongWin variable -- how much data allowed in-flight at any time LastByteSent-LastByteAcked CongWin Roughly, rate = CongWin / RTT 20

Congestion Detection How does sender perceive congestion? timeout 3 duplicate ACKs TCP sender reduces rate (CongWin) after loss event 21

TCP CC: Components Slow start Getting to equilibrium Additive-increase, multiplicativedecrease (AIMD) Adapting to path (avoiding congestion) RTT estimation Conservation at equilibrium Reaction to timeout events 22

TCP CC (2) TCP is self-clocking Uses ACK to trigger (or clock) its increase in congestion window size A number of algorithmic varieties: TCP Tahoe TCP Reno (most widely used) TCP Vegas, TCP SACK, etc 23

Getting Started Uncontrolled rush to send segments is UGLY Some segments got sent 5 times! Nothing in this trace resembles desirable behavior 24

Slow Start Getting to Equilibrium When connection begins, CongWin = 1 MSS Available bandwidth may be >> MSS/RTT desire a quick ramp-up to respectable rate Therefore, at start, increase rate exponentially fast... until first loss event... or CongWin > ssthresh (a pre-set threshold) 25

Slow Start When connection begins, increase rate exponentially: double CongWin every RTT done by increasing CongWin by 1MSS for every ACK received Summary: initial rate is slow but ramps up exponentially fast RTT one segment two segments four segments

Behavior of Slow Start With Slow Start, no bandwidth wasted on retransmission 27

Control at Equilibrium Slow start s exponential increase will eventually saturate the network What happens to keep it in control? Additive Increase, Multiplicative Decrease (AIMD) algorithm Backoff quickly when loss occurs Continue probing for usable bandwidth This phase is also called congestion avoidance 28

AIMD Mechanics Additive Increase: Increase CongWin by 1 MSS every RTT until loss is detected Multiplicative Decrease: cut CongWin in half after a loss event Congestion Window Size 24 Kbytes 16 Kbytes 8 Kbytes Sawtooth behavior: Probing for bandwidth time 29

Refinements Under TCP Tahoe, CongWin set to 1 after a loss, then slow start to ssthresh, which is set to half of CongWin s value at loss Under TCP Reno, CongWin is set to ssthresh and then linear increase

Fast Recovery TCP Tahoe After both loss events CongWin set to 1 MSS Enters Slow Start Reno s Philosophy 3 dup ACKs indicates network capable of delivering some segments timeout indicates a more alarming congestion scenario back off! TCP Reno After 3 dup ACKs: Cancel Slow Start CongWin is cut in half window grows linearly But after timeout event: CongWin set to 1 MSS window grows exponentially to a threshold, then grows linearly

CongWin size plot when is slow start operating? 32

CongWin size plot when is congestion avoidance operating?

CongWin size plot Is this segment loss detected by 3x duplicate ACK or timeout?

CongWin size plot What is the value of Threshold?

CongWin size plot If a segment loss is detected here by 3x duplicate ACK,... What will CongWin and Threshold values be?

RTT and Timeout How should the timeout value be set? Must be longer than RTT (which varies) Too short: premature timeout unnecessary retransmissions Too long: slow reaction to segment loss Strategy: Measure actual RTTs for baseline 37

Estimating RTT Grab some samples: SampleRTT Measured time from segment transmission to ACK receipt ignore retransmissions Sampled values vary, so smooth average several recent measurements 38

Why ignore retransmissions? Seq=92, 8 bytes of data TCP does not measure SampleRTT for retransmitted segments. Why not? timeout ACK=100 Seq=92, 8 bytes of data

Smoothing the Samples To smooth samples, use exponential weighted moving average (EWMA) EstimatedRTT <= (1-α)*EstimatedRTT + α*samplertt Influence of past samples decreases exponentially fast Typical value for α is 0.125 40

Setting the Timeout Timeout should be EstimatedRTT + safety margin Large variation in EstimatedRTT larger margin Use EWMA of deviation in SampleRTT from EstimatedRTT DevRTT <= (1-β)*DevRTT + β* SampleRTT-EstimatedRTT β typically set to 0.25 Then set timeout interval TimeoutInterval = EstimatedRTT + 4 * DevRTT 41

Why worry about Variance? Why not just estimate RTT (use EWMA), then multiply by a constant safety margin? Older version of TCP did just that: TimeoutInterval = EstimatedRTT*2 Not adaptive enough -- Need a larger safety margin when network load is higher, smaller for lower loads Otherwise, timeout interval is too short what happens? Retransmit segments that are not lost Adds more segments to an already congested network! 42

TCP CC Summary When CongWin is below Threshold, window grows exponentially (slow-start phase) When CongWin is above Threshold, window grows linearly (congestion-avoidance phase) When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold. Window grows linearly When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS. Enters slow-start phase 43

Lesson Objectives Now, you should be able to: describe the mission, operation and mechanisms for flow control in TCP list causes, costs and consequences of network congestion describe the operations of, as well as advantages and disadvantages of, different feedback mechanisms 44

You should be able to: describe the overall congestion control mechanisms used in TCP, including the congwin variable, self-clocking nature, and interaction of various phases describe the slow start component of TCP congestion control; including starting conditions, reactions to ACKs and ending conditions

You should also be able to: describe the congestion avoidance component of TCP congestion control; including starting conditions, ending conditions, reactions to loss, reactions to ACKs and differences between Reno and Tahoe versions describe how TCP sets timeout values calculate EstimatedRTT, DevRTT and TimeoutInterval