cs 356 computer network architectures lecture 19
play

CS 356: Computer Network Architectures Lecture 19: Congestion - PowerPoint PPT Presentation

CS 356: Computer Network Architectures Lecture 19: Congestion Avoidance Chap. 6.4 and related papers Xiaowei Yang xwy@cs.duke.edu Overview More on TCP congestion control Theory Macroscopic behavior TCP Cubic Queuing


  1. CS 356: Computer Network Architectures Lecture 19: Congestion Avoidance Chap. 6.4 and related papers Xiaowei Yang xwy@cs.duke.edu

  2. Overview • More on TCP congestion control – Theory – Macroscopic behavior – TCP Cubic • Queuing mechanisms – DropTail – Weighted fair queuing – Deficit round robin • Congestion Avoidance – Random Early Detection (RED) – Explicit Congestion Notification 2

  3. Administrivia • Midterm summary – Will discussion solutions in next lecture – Return exams

  4. Two Modes of Congestion Control 1. Probing for the available bandwidth – slow start (cwnd < ssthresh) 2. Avoid overloading the network – congestion avoidance (cwnd >= ssthresh)

  5. Slow Start • Initial value: Set cwnd = 1 MSS • Modern TCP implementation may set initial cwnd to 2 • When receiving an ACK, cwnd+= 1 MSS • If an ACK acknowledges two segments, cwnd is still increased by only 1 segment. • Even if ACK acknowledges a segment that is smaller than MSS bytes long, cwnd is increased by 1. • Question: how can you accelerate your TCP download?

  6. Congestion Avoidance • If cwnd >= ssthresh then each time an ACK is received, increment cwnd as follows: • cwnd += MSS * (MSS / cwnd) (cwnd measured in bytes) • So cwnd is increased by one MSS only if all cwnd /MSS segments have been acknowledged.

  7. The Sawtooth behavior of TCP Cwnd RTT • For every ACK received – Cwnd += 1/cwnd *MSS • For every packet lost – Cwnd /= 2 7

  8. Why does it work? [Chiu-Jain] – A feedback control system – The network uses feedback y to adjust users’ load å x_i 8

  9. Goals of Congestion Avoidance – Efficiency: the closeness of the total load on the resource ot its knee – Fairness: • When all x_i’s are equal, F(x) = 1 • When all x_i’s are zero but x_j = 1, F(x) = 1/n – Distributedness • A centralized scheme requires complete knowledge of the state of the system – Convergence • The system approach the goal state from any starting state 9

  10. Metrics to measure convergence • Responsiveness • Smoothness 10

  11. Model the system as a linear control system • Four sample types of controls • AIAD, AIMD, MIAD, MIMD 11

  12. Phase plot x 2 12 x 1

  13. TCP congestion control is AIMD Cwnd RTT • Problems: – Each source has to probe for its bandwidth – Congestion occurs first before TCP backs off – Unfair: long RTT flows obtain smaller bandwidth shares 13

  14. Macroscopic behavior of TCP • Throughput is inversely proportional to RTT: • 1 . 5 MSS • RTT p • In a steady state, total packets sent in one sawtooth cycle: – S = w + (w+1) + … (w+w) = 3/2 w 2 • the maximum window size is determined by the loss rate – 1/S = p 1 – w = 1.5 p • The length of one cycle: w * RTT • Average throughput: 3/2 w * MSS / RTT 14

  15. TCP Cubic • CUBIC: a new TCP-friendly high-speed TCP variant by S. HaNorth, I. Rhee, and L. Xu • Implemented in Linux kernel and Windows 10

  16. Overview • More on TCP congestion control – Theory – Macroscopic behavior – TCP Cubic • Queuing mechanisms – DropTail – Weighted fair queuing – Deficit round robin • Congestion Avoidance – Random Early Detection (RED) – Explicit Congestion Notification 16

  17. Design Space for resource allocation • Router-based vs. Host-based • Reservation-based vs. Feedback-based • Window-based vs. Rate-based

  18. Overview • More on TCP congestion control – Theory – Macroscopic behavior – TCP Cubic • Queuing mechanisms – DropTail – Weighted fair queuing – Deficit round robin • Congestion Avoidance – Random Early Detection (RED) – Explicit Congestion Notification 18

  19. Queuing mechanisms • Router-enforced resource allocation • Default – First come first serve (FIFO)

  20. Properties of Fair Queuing • Work conserving – Link busy if there is traffic to send • Max-min fair – Cannot increase without decreasing any flow with a no-greater share

  21. Weighted Fair Queuing w=1 w=2 • Different queues get different weights – Take w i amount of bits from a queue in each round – F i = S i + P i / w i

  22. Deficit Round Robin (DRR) • WFQ: extracting min is O(log Q) • DRR: O(1) rather than O(log Q) – Each queue is allowed to send Q bytes per round – If Q bytes are not sent (because packet is too large) deficit counter of queue keeps track of unused portion – If queue is empty, deficit counter is reset to 0 – Similar behavior as FQ but computationally simpler

  23. • Unused quantum saved for the next round • How to set quantum size? – Too small – Too large

  24. Congestion Avoidance Slow down before packet loss happens

  25. Design goals • Predict when congestion is going to happen • Reduce sending rate before buffer overflows • Not widely deployed – Reducing queuing delay and packet loss are not essential

  26. Mechanisms • Router+host joint control – Router: Early signaling of congestion – Host: react to congestion signals – Case studies: DECbit, Random Early Detection • Host: Source-based congestion avoidance – Host detects early congestion – Case study: TCP Vegas

  27. DECbit • Add a congestion bit to a packet header • A router sets the bit if its average queue length is non-zero – Queue length is measured over a busy+idle interval • If less than 50% of packets in one window do not have the bit set – A host increases its congest window by 1 packet • Otherwise – Decreases by 0.875 • AIMD

  28. Random Early Detection • Random early detection (Floyd93) – Goal: operate at the “knee” – Problem: very hard to tune (why) • RED is generalized by Active Queue Managment (AQM) • A router measures average queue length using exponential weighted averaging algorithm: – AvgLen = (1-Weight) * AvgLen + Weight * SampleQueueLen

  29. RED algorithm p 1 avg_qlen min_thresh max_thresh • If AvgLen ≤ MinThreshold – Enqueue packet • If MinThreshold < AvgLen < MaxThreshold – Calculate dropping probability P – Drop the arriving packet with probability P • If MaxThreshold ≤ AvgLen – Drop the arriving packet

  30. Even out packet drops TempP 1 avg_qlen min_thresh max_thresh • TempP = MaxP x (AvgLen – Min)/(Max-Min) • P = TempP / (1 – count * TempP) • Count – keeps track of how many newly arriving packets have been queued when min < Avglen < max • It keeps drop evenly distributed over time, even if packets arrive in burst

  31. An example • MaxP = 0.02 • AvgLen is half way between min and max thresholds • TempP = 0.01 • A burst of 1000 packets arrive • With TempP, 10 packets may be discarded uniformly randomly among the 1000 packets • With P, they are likely to be more evently spaced out, as P gradually increases if previous packets are not discarded

  32. Explicit Congestion Notification • A new IETF standard • Two bits in IP header – 00: No ECN support – 01/10: ECN enabled transport – 11: Congestion CE=1 experienced X ECE=1 • Two TCP flags – ECE: congestion CWR=1 experienced – CWR: cwnd reduced

  33. Source-based congestion avoidance • TCP Vegas – Detect increases in queuing delay – Reduces sending rate • Details – Record baseRTT (minimum seen) – Compute ExpectedRate = cwnd/BaseRTT – Diff = ExpectedRate - ActualRate – When Diff < α , incr cwnd linearly, when Diff > β , decr cwnd linearly • α < β

  34. cwnd

  35. Summary • The problem of network resource allocation – Case studies • TCP congestion control • Fair queuing • Congestion avoidance – Active queue management – Source-based congestion avoidance

Recommend


More recommend