Conges'on Control Reading: Sec'ons

Similar documents
Flow and Congestion Control

Conges'on. Last Week: Discovery and Rou'ng. Today: Conges'on Control. Distributed Resource Sharing. Conges'on Collapse. Conges'on

Multiple unconnected networks

Goals for Today s Lecture

CS457 Transport Protocols. CS 457 Fall 2014

TCP conges+on control

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Context. TCP is the dominant transport protocol in today s Internet. Embodies some of Internet design principles

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Network Performance: Queuing

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Opera&ng Systems and Networks. Network Lecture 10: Conges&on Control. Adrian Perrig Network Security Group ETH Zürich

Network Performance: Queuing

Introduc)on to Computer Networks

Lecture 8. TCP/IP Transport Layer (2)

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

Lecture 14: Congestion Control"

CNT 6885 Network Review on Transport Layer

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

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

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

CS321: Computer Networks Congestion Control in TCP

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

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

Introduc)on to Computer Networks

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

Announcements. Network Performance: Queuing. Goals of Today s Lecture. Window Scaling. Window Scaling, con t. Window Scaling, con t

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

User Datagram Protocol (UDP):

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

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

UNIT IV -- TRANSPORT LAYER

Introduc)on to Computer Networks

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

Flow and Congestion Control (Hosts)

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

05 Transmission Control Protocol (TCP)

CSE 123A Computer Networks

Congestion / Flow Control in TCP

Introduc)on to Transport Protocols

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

Where we are in the Course

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

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

CSCD 330 Network Programming Winter 2015

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

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

ADVANCED COMPUTER NETWORKS

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

Introduc)on to Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks

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

User Datagram Protocol

ECE 650 Systems Programming & Engineering. Spring 2018

Computer Networking Introduction

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

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

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

Communication Networks

ECE 333: Introduction to Communication Networks Fall 2001

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

Sequence Number. Acknowledgment Number. Data

Fall 2012: FCM 708 Bridge Foundation I

image 3.8 KB Figure 1.6: Example Web Page

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

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

Reliable Transport II: TCP and Congestion Control

Chapter 3- parte B outline

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Chapter 24 Congestion Control and Quality of Service 24.1

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

Queue Management. Last Wed: CongesDon Control. Today: Queue Management. Packet Queues

Lecture 3: The Transport Layer: UDP and TCP

CSCD 330 Network Programming

Transport protocols. Transport Layer 3-1

Lecture 5. Transport Layer. Transport Layer 1-1

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Chapter 24. Transport-Layer Protocols

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

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

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

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

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

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

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

CC451 Computer Networks

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

Computer Communication Networks Midterm Review

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

Chapter III: Transport Layer

TSIN02 - Internetworking

15-744: Computer Networking TCP

Transport Protocols and TCP

Reliable Transport II: TCP and Congestion Control

Advanced Computer Networks

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

TSIN02 - Internetworking

7. TCP 최양희서울대학교컴퓨터공학부

PRACTICE QUESTIONS ON RESOURCE ALLOCATION

Transcription:

Conges'on Control Reading: Sec'ons 6.1 6.4 COS 461: Computer Networks Spring 2009 (MW 1:30 2:50 in CS 105) Mike Freedman Teaching Assistants: WyaM Lloyd and Jeff Terrace hmp://www.cs.princeton.edu/courses/archive/spring09/cos461/ 1

Course Announcements Second programming assignment is posted Web proxy server Due Sunday March 8 at 11:59pm More challenging than the first assignment Good to get started on the next assignment To go to office hours early if you encounter problems 2

Goals of Today s Lecture Conges'on in IP networks Unavoidable due to best effort service model IP philosophy: decentralized control at end hosts Conges'on control by the TCP senders Infers conges'on is occurring (e.g., from packet losses) Slows down to alleviate conges'on, for the greater good TCP conges'on control algorithm Addi've increase, mul'plica've decrease Slow start and slow start restart Ac've Queue Management (AQM) Random Early Detec'on (RED) Explicit Conges'on No'fica'on (ECN) 3

No Problem Under Circuit Switching Source establishes connec'on to des'na'on Nodes reserve resources for the connec'on Circuit rejected if the resources aren t available Cannot have more than the network can handle 4

IP Best Effort Design Philosophy Best effort delivery Let everybody send Network tries to deliver what it can and just drop the rest source destination IP network 5

Conges'on is Unavoidable Two packets arrive at the same 'me The node can only transmit one and either buffer or drop the other If many packets arrive in short period of 'me The node cannot keep up with the arriving traffic and the buffer may eventually overflow 6

The Problem of Conges'on What is conges'on? Load is higher than capacity What do IP routers do? Drop the excess packets Why is this bad? Wasted bandwidth for retransmissions Goodput congestion collapse Increase in load that results in a decrease in useful work done. Load 7

Ways to Deal With Conges'on Ignore the problem Many dropped (and retransmimed) packets Can cause conges'on collapse Reserva'ons, like in circuit switching Pre arrange bandwidth alloca'ons Requires nego'a'on before sending packets Pricing Don t drop packets for the high bidders Requires a payment model Dynamic adjustment (TCP) Every sender infers the level of conges'on Each adapts its sending rate for the greater good 8

Many Important Ques'ons How does the sender know there is conges'on? Explicit feedback from the network? Inference based on network performance? How should the sender adapt? Explicit sending rate computed by the network? End host coordinates with other hosts? End host thinks globally but acts locally? What is the performance objec've? Maximizing goodput, even if some users suffer more? Fairness? (Whatever the heck that means!) How fast should new TCP senders send? 9

Inferring From Implicit Feedback? What does the end host see? What can the end host change? 10

Where Conges'on Happens: Links Simple resource alloca'on: FIFO queue & drop tail Access to the bandwidth: first in first out queue Packets transmimed in the order they arrive Access to the buffer space: drop tail queuing If the queue is full, drop the incoming packet 11

How it Looks to the End Host Packet delay Packet experiences high delay Packet loss Packet gets dropped along the way How does TCP sender learn this? Delay Round trip 'me es'mate Loss Timeout Duplicate acknowledgments 12

What Can the End Host Do? Upon detec'ng conges'on (well, packet loss) Decrease the sending rate End host does its part to alleviate the conges'on But, what if condi'ons change? Suppose there is more bandwidth available Would be a shame to stay at a low sending rate Upon not detec'ng conges'on Increase the sending rate, a limle at a 'me And see if the packets are successfully delivered 13

TCP Conges'on Window Each TCP sender maintains a conges'on window Maximum number of bytes to have in transit I.e., number of bytes s'll awai'ng acknowledgments Adap'ng the conges'on window Decrease upon losing a packet: backing off Increase upon success: op'mis'cally exploring Always struggling to find the right transfer rate Both good and bad Pro: avoids having explicit feedback from network Con: under shoo'ng and over shoo'ng the rate 14

Addi've Increase, Mul'plica've Decrease (AIMD) How much to increase and decrease? Increase linearly, decrease mul'plica'vely A necessary condi'on for stability of TCP Consequences of over sized window are much worse than having an under sized window Over sized window: packets dropped and retransmimed Under sized window: somewhat lower throughput Mul'plica've decrease On loss of packet, divide conges'on window in half Addi've increase On success for last window of data, increase linearly 15

Leads to the TCP Sawtooth Window Loss halved t 16

Prac'cal Details Conges'on window Represented in bytes, not in packets (Why?) Packets have MSS (Maximum Segment Size) bytes Increasing the conges'on window Increase by MSS on success for last window of data Decreasing the conges'on window Never drop conges'on window below 1 MSS 17

Receiver Window vs. Conges'on Window Flow control Keep a fast sender from overwhelming a slow receiver Conges'on control Keep a set of senders from overloading the network Different concepts, but similar mechanisms TCP flow control: receiver window TCP conges'on control: conges'on window TCP window: min { conges'on window, receiver window } 18

How Should a New Flow Start Need to start with a small CWND to avoid overloading the network. Window But, could take a long time to get started! t 19

Slow Start Phase Start with a small conges'on window Ini'ally, CWND is 1 Max Segment Size (MSS) So, ini'al sending rate is MSS/RTT That could be premy wasteful Might be much less than the actual bandwidth Linear increase takes a long 'me to accelerate Slow start phase (really fast start ) Sender starts at a slow rate (hence the name) but increases the rate exponen'ally un'l the first loss event 20

Slow Start in Ac'on Double CWND per round-trip time Src 1 2 4 8 D A D D A A D D D D A A A A Dest 21

Slow Start and the TCP Sawtooth Window Loss Exponential slow start Why is it called slow-start? Because TCP originally had no congestion control mechanism. The source would just start by sending a whole receiver window s worth of data. t 22

Two Kinds of Loss in TCP Timeout Packet n is lost and detected via a 'meout E.g., because all packets in flight were lost Aqer the 'meout, blas'ng away for the en're CWND would trigger a very large burst in traffic So, bemer to start over with a low CWND Triple duplicate ACK Packet n is lost, but packets n+1, n+2, etc. arrive Receiver sends duplicate acknowledgments and the sender retransmits packet n quickly Do a mul'plica've decrease and keep going 23

Repea'ng Slow Start Aqer Timeout Window timeout Slow start in operation until it reaches half of previous cwnd. t Slow-start restart: Go back to CWND of 1, but take advantage of knowing the previous value of CWND. 24

Repea'ng Slow Start Aqer Idle Period Suppose a TCP connec'on goes idle for a while E.g., Telnet session where you don t type for an hour Eventually, the network condi'ons change Maybe many more flows are traversing the link E.g., maybe everybody has come back from lunch! Dangerous to start transmisng at the old rate Previously idle TCP sender might blast the network causing excessive conges'on and packet loss So, some TCP implementa'ons repeat slow start Slow start restart aqer an idle period 25

TCP Achieves Some No'on of Fairness Effec've u'liza'on is not the only goal We also want to be fair to the various flows but what the heck does that mean? Simple defini'on: equal shares of the bandwidth N flows that each get 1/N of the bandwidth? But, what if the flows traverse different paths? E.g., bandwidth shared in propor'on to the RTT 26

What About Chea'ng? Some folks are more fair than others Running mul'ple TCP connec'ons in parallel Modifying the TCP implementa'on in the OS Use the User Datagram Protocol What is the impact Good guys slow down to make room for you You get an unfair share of the bandwidth Possible solu'ons? Routers detect chea'ng and drop excess packets? Peer pressure???? 27

Queuing Mechanisms Random Early Detec'on (RED) Explicit Conges'on No'fica'on (ECN) 28

Bursty Loss From Drop Tail Queuing TCP depends on packet loss Packet loss is the indica'on of conges'on In fact, TCP drives the network into packet loss by con'nuing to increase the sending rate Drop tail queuing leads to bursty loss When a link becomes congested many arriving packets encounter a full queue And, as a result, many flows divide sending rate in half and, many individual flows lose mul'ple packets 29

Slow Feedback from Drop Tail Feedback comes when buffer is completely full even though the buffer has been filling for a while Plus, the filling buffer is increasing RTT and the variance in the RTT Might be bemer to give early feedback Get 1 2 connec'ons to slow down, not all of them Get these connec'ons to slow down before it is too late 30

Random Early Detec'on (RED) Basic idea of RED Router no'ces that the queue is gesng backlogged and randomly drops packets to signal conges'on Packet drop probability Drop probability increases as queue length increases If buffer is below some level, don t drop anything otherwise, set drop probability as func'on of queue Probability Average Queue Length 31

Proper'es of RED Drops packets before queue is full In the hope of reducing the rates of some flows Drops packet in propor'on to each flow s rate High rate flows have more packets and, hence, a higher chance of being selected Drops are spaced out in 'me Which should help desynchronize the TCP senders Tolerant of burs'ness in the traffic By basing the decisions on average queue length 32

Problems With RED Hard to get the tunable parameters just right How early to start dropping packets? What slope for the increase in drop probability? What 'me scale for averaging the queue length? Some'mes RED helps but some'mes not If the parameters aren t set right, RED doesn t help And it is hard to know how to set the parameters RED is implemented in prac'ce But, oqen not used due to the challenges of tuning right Many varia'ons in the research community With cute names like Blue and FRED 33

Explicit Conges'on No'fica'on Early dropping of packets Good: gives early feedback Bad: has to drop the packet to give the feedback Explicit Conges'on No'fica'on Router marks the packet with an ECN bit and sending host interprets as a sign of conges'on Surmoun'ng the challenges Must be supported by the end hosts and the routers Requires 2 bits in the IP header for detec'on (forward dir) One for ECN mark; one to indicate ECN capability Solu'on: borrow 2 of Type Of Service bits in IPv4 header Also 2 bits in TCP header for signaling sender (reverse dir) 34

Other TCP Mechanisms Nagle s Algorithm and Delayed ACK 35

Mo'va'on for Nagle s Algorithm Interac've applica'ons Telnet and rlogin Generate many small packets (e.g., keystrokes) Small packets are wasteful Mostly header (e.g., 40 bytes of header, 1 of data) Appealing to reduce the number of packets Could force every packet to have some minimum size but, what if the person doesn t type more characters? Need to balance compe'ng trade offs Send larger packets but don t introduce much delay by wai'ng 36

Nagle s Algorithm Wait if the amount of data is small Smaller than Maximum Segment Size (MSS) And some other packet is already in flight I.e., s'll awai'ng the ACKs for previous packets That is, send at most one small packet per RTT by wai'ng un'l all outstanding ACKs have arrived vs. ACK Influence on performance Interac've applica'ons: enables batching of bytes Bulk transfer: transmits in MSS sized packets anyway 37

Nagle s Algorithm Wait if the amount of data is small Smaller than Maximum Segment Size (MSS) And some other packet is already in flight I.e., s'll awai'ng the ACKs for previous packets Turning Nagle Off That is, send at most one small packet per RTT void tcp_nodelay by wai'ng (int un'l s) all outstanding ACKs have arrived { ACK int n = 1; vs. if Influence (setsockopt on performance (s, IPPROTO_TCP, TCP_NODELAY, (char *) &n, sizeof (n)) < 0) Interac've applica'ons: enables batching of bytes warn ("TCP_NODELAY: %m\n"); Bulk transfer: transmits in MSS sized packets anyway } 38

Mo'va'on for Delayed ACK TCP traffic is oqen bidirec'onal Data traveling in both direc'ons ACKs traveling in both direc'ons ACK packets have high overhead 40 bytes for the IP header and TCP header and zero data traffic Piggybacking is appealing Host B can send an ACK to host A as part of a data packet from B to A 39

TCP Header Allows Piggybacking Source port Destination port Flags: SYN FIN RST PSH URG ACK Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options (variable) Data 40

Example of Piggybacking A Data B Data+ACK B has data to send A has data to send Data ACK Data Data + ACK B doesn t have data to send 41

Increasing Likelihood of Piggybacking Example: rlogin or telnet Host A types characters at prompt Host B receives the character and executes a command and then data are generated Would be nice if B could send the ACK with the new data Increase piggybacking TCP allows the receiver to wait to send the ACK in the hope that the host will A Data Data+ACK Data ACK Data Data + ACK B have data to send 42

Delayed ACK Delay sending an ACK Upon receiving a packet, the host B sets a 'mer Typically, 200 msec or 500 msec If B s applica'on generates data, go ahead and send And piggyback the ACK bit If the 'mer expires, send a (non piggybacked) ACK Limi'ng the wait Timer of 200 msec or 500 msec ACK every other full sized packet 43

Conclusions Conges'on is inevitable Internet does not reserve resources in advance TCP ac'vely tries to push the envelope Conges'on can be handled Addi've increase, mul'plica've decrease Slow start, and slow start restart Ac've Queue Management can help Random Early Detec'on (RED) Explicit Conges'on No'fica'on (ECN) Fundamental tensions Feedback from the network? Enforcement of TCP friendly behavior? 44