TCP Congestion Control - WPI

TCP Congestion Control - WPI

TCP Congestion Control Computer Networks TCP Congestion Control 1 Principles of Congestion Control Congestion:: 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

2 Causes/Costs of Congestion Scenario 1 two senders, two receivers one router, infinite buffers no retransmission Host A Host B lout lin : original data unlimited shared

output link buffers large delays when congested maximum achievable throughput Computer Networks TCP Congestion Control 3 Causes/Costs of Congestion Scenario 2 one router, finite buffers sender retransmits lost packets offered load Host A lin : original data

lout l'in : original data, plus retransmitted data Host B finite shared output link buffers Computer Networks TCP Congestion Control 4 Causes/Costs of Congestion always: Scenario 2 = l (goodput)

out in perfect retransmission only when loss: l l > lout in retransmission of delayed (not lost) packet makes perfect case) for same lout R/2 R/2 l in larger (than

R/2 lin a. R/2 lout lout lout R/3 lin R/4

R/2 b. lin R/2 c. costs of congestion: more work (retransmissions) for a given goodput unneeded retransmissions: link carries multiple copies of packet Computer Networks TCP Congestion Control 5 Approaches towards Congestion Control

Two broad approaches towards congestion control: end-end congestion control: network-assisted congestion control: no explicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP 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 6 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 7 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 8 TCP Congestion ControlK & 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 9 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 Xloss, so decrease rate sending rate X X X TCPs sawtooth behavior X time

Q: how fast to increase/decrease? Computer Networks TCP Congestion Control 10 AIMD (Additive Increase / Multiplicative Decrease) CongestionWindow (cwnd) is a variable held by the TCP source for each connection. MaxWindow :: min (CongestionWindow , AdvertisedWindow) EffectiveWindow = MaxWindow (LastByteSent -LastByteAcked) 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. Computer Networks TCP Congestion Control

11 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 cwnds 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 12 Source Destination

Add one packet each RTT Figure 6.8 Additive Increase Computer Networks TCP Congestion Control 13 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 14 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

15 70 60 50 40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0

7.0 8.0 9.0 10.0 Time (seconds) Figure 6.9 Typical TCP Sawtooth Pattern Computer Networks TCP Congestion Control 16 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 windows worth of packets all at once. Computer Networks TCP Congestion Control 17 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 18 Source Destination Slow Start Add one packet per ACK Figure 6.10 Slow Start Computer Networks TCP Congestion Control 19

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 20 ssthresh Computer Networks TCP Congestion Control 21 70 60

50 40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0

9.0 Time (seconds) Figure 6.11 Behavior of TCP Congestion Control Computer Networks TCP Congestion Control 22 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 23 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 24

Sender Receiver Packet 1 Packet 2 Packet 3 ACK 1 Packet 4 ACK 2 Packet 5 ACK 2 Packet 6

Fast Retransmit ACK 2 ACK 2 Retransmit packet 3 Based on three duplicate ACKs ACK 6 Figure 6.12 Fast Retransmit Computer Networks TCP Congestion Control 25 70 60 50

40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Time (seconds)

Figure 6.13 TCP Fast Retransmit Trace Computer Networks TCP Congestion Control 26 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 27

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 28 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 29 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 30 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 31 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 32 Figure 5.6 Three-way TCP Handshake Computer Networks TCP Congestion Control 33 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 34 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 35 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 36 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 37 Figure 5.10 Associating the ACK? Sender Receiver O r ig in a l Re tr a

tr a n ns m AC K (a) Sender O r ig smi is s io s s io n n

Receiver in a l tr a n AC K Re tr smi a ns s s io m is n s io n

(b) Computer Networks TCP Congestion Control 38 Karn/Partidge Algorithm 1. Do not measure SampleRTT when sending packet more than once. 2. 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 39

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)Difference|Difference| - Deviation) - Deviation) where is a fraction between 0 and 1. Computer Networks TCP Congestion Control 40 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 41 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 senders congestion window (MD). TCP increases congestion window using

slow start or congestion avoidance (AI). Computer Networks TCP Congestion Control 42 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 43

Computer Congestion Control determine RIONetworks andTCP RTO.

Recently Viewed Presentations

  • Pipeline Principle A non-pipelined system of combination circuits

    Pipeline Principle A non-pipelined system of combination circuits

    A pipelined version by adding register at each output of the combination circuits. Additional 20 picoseconds to save result in register. Begin new operation every 120 ps. Overall latency increases. Time. OP1. OP2. OP3. Cannot start new operation until previous...
  • The Role of Research in Teacher Education The BERA-RSA Inquiry

    The Role of Research in Teacher Education The BERA-RSA Inquiry

    Special advisers -Graham Donaldson, Carmel Gallagher, Sir Alasdair Macdonald, Lord David Puttnam and Sir Alan Steer; Feedback from public events - including BERA and UCET conferences 2013. This Interim Report.
  • Non-Arc Welding Processes - CCCTC Home

    Non-Arc Welding Processes - CCCTC Home

    Non-Arc Welding Processes Resistive heating, chemical reactions, focused light and electrons, sound waves, and friction can also be used to join materials Resistance welding Oxy-Fuel Welding Friction welding (&Solid State) Laser and electron beam welding Brazing and soldering Plastics joining...
  • La mémoire - emyspot

    La mémoire - emyspot

    Animation pédagogique Mions - 2010 Attention Concentration Mémoire et Apprentissage Pendant des siècles… objectif de l 'école : développer la mémoire distinction mémoire naturelle et mémoire artificielle importance des procédés mnémotechniques Francès YATES, l 'art de la mémoire, 1966 Mémoire...
  • Monopoly (Ch.10)

    Monopoly (Ch.10)

    Price Ceiling (e.g. rent control) P* Q* P. S. D. rent ceiling. Economic Effects of Price C eiling. Work in Pairs. A. Using the graph shown, analyze the effect a $300 price ceiling would have on the market for ten-speed...
  • Srsd - Davenport&#x27;S Dynamic Dimensions

    Srsd - Davenport'S Dynamic Dimensions

    POW - TIDE + P - Pull apart prompt. O - Organize my notes. W - Write and say more. P=PULL apart the prompt. What am I being asked to do? What should I write about? Circle. key words and...
  • Balancing Redox Equations Reduction/Oxidation = Redox A new

    Balancing Redox Equations Reduction/Oxidation = Redox A new

    lose 2 e's, LEO. gain 5 e's, GER. 4. Multiply both ½-reactions by the appropriate coefficient so that both reactions involve the same number of e's. Find the lowest common multiple (LCM) of the e's transferred (10 e's is the...
  • AP Literature Exam Review

    AP Literature Exam Review

    What are literary terms? This is a generic term for all vocabulary surrounding prose and poetry. Just as a biology exam would expect you to know specific vocabulary, the Literature exam expects you to know most of these terms.