TCP Congestion Control

Slides:



Advertisements
Similar presentations
Slide Set 14: TCP Congestion Control. In this set... We begin Chapter 6 but with 6.3. We will cover Sections 6.3 and 6.4. Mainly deals with congestion.
Advertisements

Principles of Congestion Control Chapter 3.6 Computer Networking: A top-down approach.
Congestion Control Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson.
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.
Introduction to Congestion Control
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 12.
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.
1 Congestion Control Outline Queuing Discipline Reacting to Congestion Avoiding Congestion.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
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 Lecture 9: TCP and Congestion Control Slides adapted from: Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis) Chapter 3.
Computer Networks : TCP Congestion Control1 TCP Congestion Control.
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.
Data Communication and Networks
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks : TCP Congestion Control1 TCP Congestion Control.
Networks : TCP Congestion Control1 TCP Congestion Control Presented by Bob Kinicki.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
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 Layer 4 2: Transport Layer 4.
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.
Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter3_3.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
Transport Layer1 Flow and Congestion Control Ram Dantu (compiled from various text books)
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
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.
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.
Advanced Computer Networking Internet Congestion Control
TCP Congestion Control Computer Networks TCP Congestion Control 1.
Spring 2009CSE Congestion Control Outline Resource Allocation Queuing TCP Congestion Control.
By N.Gopinath AP/CSE Unit: III Introduction to Transport layer.
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.
1 John Magee 20 February 2014 CS 280: Transport Layer: Congestion Control Concepts, TCP Congestion Control Most slides adapted from Kurose and Ross, Computer.
CS-1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
TCP Congestion Control
Advance Computer Networks Lecture#09 & 10 Instructor: Engr. Muhammad Mateen Yaqoob.
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.
CS 6401 Congestion Control in TCP Outline Overview of RENO TCP Reacting to Congestion SS/AIMD example.
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.
Spring Computer Networks1 Congestion Control II Outline Queuing Discipline Reacting to Congestion Avoiding Congestion DECbit Random Early Detection.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
@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.
@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.
9.6 TCP Congestion Control
Transport Layer CS 381 3/7/2017.
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
CS-1652 Jack Lange University of Pittsburgh
COMP 431 Internet Services & Protocols
Congestion Control.
Chapter 3 outline 3.1 Transport-layer services
So far, On the networking side, we looked at mechanisms to links hosts using direct linked networks and then forming a network of these networks. We introduced.
Congestion Control in TCP
Chapter 6 TCP Congestion Control
If both sources send full windows, we may get congestion collapse
TCP Congestion Control
TCP Overview.
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
Chapter 3 Transport Layer
Presentation transcript:

TCP Congestion Control Computer Networks TCP Congestion Control

Principles of Congestion Control informally: “too many sources sending too much data too fast for the network to handle” different from flow control! manifestations: lost packets (buffer overflow at routers) long delays (queueing in router buffers) a major problem in networking! Computer Networks TCP Congestion Control

Causes/Costs of Congestion Scenario 1 unlimited shared output link buffers Host A lin : original data Host B lout two senders, two receivers one router, infinite buffers no retransmission large delays when congested maximum achievable throughput Computer Networks TCP Congestion Control

Causes/Costs of Congestion Scenario 2 one router, finite buffers sender retransmits lost packets offered load Host A lout lin : original data l'in : original data, plus retransmitted data Host B finite shared output link buffers Computer Networks TCP Congestion Control

Causes/Costs of Congestion Scenario 2 l in out = always: (goodput) “perfect” retransmission only when loss: retransmission of delayed (not lost) packet makes larger (than perfect case) for same l in out > l in l out R/2 lin lout b. a. c. R/4 R/3 “costs” of congestion: more work (retransmissions) for a given “goodput” unneeded retransmissions: link carries multiple copies of packet Computer Networks TCP Congestion Control

Approaches towards Congestion Control Two broad approaches towards congestion control: end-end congestion control: no explicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP network-assisted congestion control: routers provide feedback to end systems single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) explicit rate sender should use for sending. Computer Networks TCP Congestion Control

TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson and Davie, Morgan Kaufmann, 2007. Computer Networks TCP Congestion Control

TCP Congestion Control Essential strategy :: The TCP host sends packets into the network without a reservation and then the host reacts to observable events. Originally TCP assumed FIFO queuing. Basic idea :: each source determines how much capacity is available to a given flow in the network. ACKs are used to ‘pace’ the transmission of packets such that TCP is “self-clocking”. Computer Networks TCP Congestion Control

TCP Congestion Control K & R Goal: TCP sender should transmit as fast as possible, but without congesting network. issue - how to find rate just below congestion level? Each TCP sender sets its window size, based on implicit feedback: ACK segment received  network is not congested, so increase sending rate. lost segment - assume loss due to congestion, so decrease sending rate. Computer Networks TCP Congestion Control

TCP Congestion Control K & R “probing for bandwidth”: increase transmission rate on receipt of ACK, until eventually loss occurs, then decrease transmission rate continue to increase on ACK, decrease on loss (since available bandwidth is changing, depending on other connections in network). ACKs being received, so increase rate X loss, so decrease rate X X X TCP’s “sawtooth” behavior sending rate X time Q: how fast to increase/decrease? Computer Networks TCP Congestion Control

AIMD (Additive Increase / Multiplicative Decrease) CongestionWindow (cwnd) is a variable held by the TCP source for each connection. cwnd is set based on the perceived level of congestion. The Host receives implicit (packet drop) or explicit (packet mark) as an indication of internal congestion. MaxWindow :: min (CongestionWindow , AdvertisedWindow) EffectiveWindow = MaxWindow – (LastByteSent -LastByteAcked) Computer Networks TCP Congestion Control

Additive Increase (AI) Additive Increase is a reaction to perceived available capacity (referred to as congestion avoidance stage). Frequently in the literature, additive increase is defined by parameter α (where the default is α = 1). Linear Increase :: For each “cwnd’s worth” of packets sent, increase cwnd by 1 packet. In practice, cwnd is incremented fractionally for each arriving ACK. increment = MSS x (MSS /cwnd) cwnd = cwnd + increment Computer Networks TCP Congestion Control

Figure 6.8 Additive Increase Source Destination Add one packet each RTT Figure 6.8 Additive Increase Computer Networks TCP Congestion Control

Multiplicative Decrease (MD) Key assumption :: a dropped packet and resultant timeout are due to congestion at a router. Frequently in the literature, multiplicative decrease is defined by parameter β (where the default is β = 0.5) Multiplicate Decrease:: TCP reacts to a timeout by halving cwnd. Although defined in bytes, the literature often discusses cwnd in terms of packets (or more formally in MSS == Maximum Segment Size). cwnd is not allowed below the size of a single packet. Computer Networks TCP Congestion Control

AIMD (Additive Increase / Multiplicative Decrease) It has been shown that AIMD is a necessary condition for TCP congestion control to be stable. Because the simple CC mechanism involves timeouts that cause retransmissions, it is important that hosts have an accurate timeout mechanism. Timeouts set as a function of average RTT and standard deviation of RTT. However, TCP hosts only sample round-trip time once per RTT using coarse-grained clock. Computer Networks TCP Congestion Control

Figure 6.9 Typical TCP Sawtooth Pattern Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Slow Start Linear additive increase takes too long to ramp up a new TCP connection from cold start. Beginning with TCP Tahoe, the slow start mechanism was added to provide an initial exponential increase in the size of cwnd. Remember mechanism by: slow start prevents a slow start. Moreover, slow start is slower than sending a full advertised window’s worth of packets all at once. Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Slow Start The source starts with cwnd = 1. Every time an ACK arrives, cwnd is incremented. cwnd is effectively doubled per RTT “epoch”. Two slow start situations: At the very beginning of a connection {cold start}. When the connection goes dead waiting for a timeout to occur (i.e, when the advertized window goes to zero!) Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Source Destination Slow Start Add one packet per ACK Figure 6.10 Slow Start Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Slow Start However, in the second case the source has more information. The current value of cwnd can be saved as a congestion threshold. This is also known as the “slow start threshold” ssthresh. Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control ssthresh Computer Networks TCP Congestion Control

Figure 6.11 Behavior of TCP Congestion Control Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Fast Retransmit Coarse timeouts remained a problem, and Fast retransmit was added with TCP Tahoe. Since the receiver responds every time a packet arrives, this implies the sender will see duplicate ACKs. Basic Idea:: use duplicate ACKs to signal lost packet. Fast Retransmit Upon receipt of three duplicate ACKs, the TCP Sender retransmits the lost packet. Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Fast Retransmit Generally, fast retransmit eliminates about half the coarse-grain timeouts. This yields roughly a 20% improvement in throughput. Note – fast retransmit does not eliminate all the timeouts due to small window sizes at the source. Computer Networks TCP Congestion Control

Figure 6.12 Fast Retransmit Based on three duplicate ACKs Figure 6.12 Fast Retransmit Computer Networks TCP Congestion Control

Figure 6.13 TCP Fast Retransmit Trace Computer Networks TCP Congestion Control

Fast Recovery Fast recovery was added with TCP Reno. Basic idea:: When fast retransmit detects three duplicate ACKs, start the recovery process from congestion avoidance region and use ACKs in the pipe to pace the sending of packets. Fast Recovery After Fast Retransmit, half cwnd and commence recovery from this point using linear additive increase ‘primed’ by left over ACKs in pipe. Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Modified Slow Start With fast recovery, slow start only occurs: At cold start After a coarse-grain timeout This is the difference between TCP Tahoe and TCP Reno!! Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Many TCP ‘flavors’ TCP New Reno TCP SACK requires sender and receiver both to support TCP SACK. possible state machine is complex. TCP Vegas adjusts window size based on difference between expected and actual RTT. TCP BIC  TCP Cubic {used by Linux} TCP Compound {used by Windows} Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control TCP New Reno Two problem scenarios with TCP Reno bursty losses, Reno cannot recover from bursts of 3+ losses. Packets arriving out-of-order can yield duplicate acks when in fact there is no loss. New Reno solution – try to determine the end of a burst loss. Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control TCP New Reno When duplicate ACKs trigger a retransmission for a lost packet, sender remembers the highest packet sent from window before entering Fast Recovery in recover. Upon receiving an ACK, if ACK < recover => partial ACK If ACK ≥ recover => new ACK Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control TCP New Reno Partial ACK implies another lost packet: retransmit next packet, inflate window and stay in fast recovery. New ACK implies fast recovery is over: starting from 0.5 x cwnd proceed with congestion avoidance (linear increase). New Reno recovers from n losses in n round trips. Computer Networks TCP Congestion Control

Figure 5.6 Three-way TCP Handshake Computer Networks TCP Congestion Control

Adaptive Retransmissions RTT:: Round Trip Time between a pair of hosts on the Internet. The initial TCP TimeOut value (RIO) is an operating system parameter that is set very conservatively! How to set the TimeOut value (RTO)? The timeout value is set as a function of the expected RTT. Consequences of a bad choice? Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Original Algorithm Keep a running average of RTT and compute TimeOut as a function of this RTT. Send packet and keep timestamp ts . When ACK arrives, record timestamp ta . SampleRTT = ta - ts Computer Networks TCP Congestion Control

Computer Networks TCP Congestion Control Original Algorithm Compute a weighted average: EstimatedRTT = α x EstimatedRTT + (1- α) x SampleRTT Original TCP spec: α in range (0.8,0.9) TimeOut = 2 x EstimatedRTT Computer Networks TCP Congestion Control

Karn/Partidge Algorithm An obvious flaw in the original algorithm: Whenever there is a retransmission it is impossible to know whether to associate the ACK with the original packet or the retransmitted packet. Computer Networks TCP Congestion Control

Figure 5.10 Associating the ACK? Computer Networks TCP Congestion Control

Karn/Partidge Algorithm Do not measure SampleRTT when sending packet more than once. For each retransmission, set TimeOut to double the last TimeOut. { Note – this is a form of exponential backoff based on the believe that the lost packet is due to congestion.} Computer Networks TCP Congestion Control

Jacobson/Karels Algorithm The problem with the original algorithm is that it did not take into account the variance of SampleRTT. Difference = SampleRTT – EstimatedRTT EstimatedRTT = EstimatedRTT + (δ x Difference) Deviation = δ (|Difference| - Deviation) where δ is a fraction between 0 and 1. Computer Networks TCP Congestion Control

Jacobson/Karels Algorithm TCP computes timeout using both the mean and variance of RTT TimeOut = µ x EstimatedRTT + Φ x Deviation where based on experience µ = 1 and Φ = 4. Computer Networks TCP Congestion Control

TCP Congestion Control Summary Congestion occurs due to a variety of circumstance. TCP interacts with routers in the subnet and reacts to implicit congestion notification (packet drop) by reducing the TCP sender’s congestion window (MD). TCP increases congestion window using slow start or congestion avoidance (AI). Computer Networks TCP Congestion Control

TCP Congestion Control Summary Important TCP Congestion Control ideas include: AIMD, Slow Start, Fast Retransmit and Fast Recovery. Know the differences between TCP Tahoe, TCP Reno and TCP New Reno. Currently, the two most common versions of TCP are Compound (Windows) and Cubic (Linux). TCP needs rules and an algorithm to determine RIO and RTO. Computer Networks TCP Congestion Control