350 likes | 746 Views
CS144 An Introduction to Computer Networks. Flow Control, Congestion Control and the size of Router Buffers Section. Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University. Outline. Flow Control Congestion Control The size of Router Buffers.
E N D
CS144An Introduction to Computer Networks Flow Control, Congestion Control and the size of Router Buffers Section Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University
Outline • Flow Control • Congestion Control • The size of Router Buffers CS144, Stanford University
Sliding Window Window Size Data ACK’d Outstanding Data sent, but un-ack’d Data OK to send Data not OK to send yet
Flow Control Inside Destination RcvBuffer Arriving packets Resequence, ACK, etc OS user CS144, Stanford University
Dynamics of flow control Animation at: http://media.pearsoncmg.com/aw/aw_kurose_network_4/applets/flow/FlowControl.htm CS144, Stanford University
Outline • Flow Control • Congestion Control • The size of Router Buffers CS144, Stanford University
Round-trip time Window Size Window Size ACK (2) R x RTT = Window size TCP Sliding Window Round-trip time A B Window Size ACK ACK ACK ACK (1) R x RTT > Window size
“Bag of packets” • If there is a single flow, TCP is probing to find out how big the “bag” is so it can fill it. • In general, a TCP flow is trying to figure out how much room there is in the “bag” for its flow. CS144, Stanford University
TCP Congestion Control TCP varies the number of outstanding packets in the network by varying the window size: Window size = min{Advertised window, Congestion Window} Receiver Transmitter (“cwnd”)
AIMDAdditive Increase, Multiplicative Decrease CS144, Stanford University
Leads to the AIMD “sawtooth” cwnd “Drops” halved t
Dynamics of an AIMD flow • Animation at: http://guido.appenzeller.net/anims/ CS144, Stanford University
Outline • Flow Control • Congestion Control • The size of Router Buffers CS144, Stanford University
Rule-of-Thumb Buffer size = 2TxC, where: 2T = RTTmin = 2(propagation delay + packetization delay) C = capacity of outgoing line. Example: 10Gb/s interface, with 2T = 250ms 300Mbytes of buffering. Read and write new packet every 32ns.
# packets at 10Gb/s 1,000,000 20 10,000 The Story • Assume: Large number of desynchronized flows; 100% utilization • Assume: Large number of desynchronized flows; <100% utilization
Time evolution of a single TCP flow through a router. Buffer is 2T*C Time evolution of a single TCP flow through a router. Buffer is < 2T*C Time Evolution of a Single TCP Flow
Buffer size = 2TxC Interval magnified on next slide
When sender pauses, buffer drains one RTT Drop
Origin of rule-of-thumb • Before and after reducing window size, the sending rate of theTCP sender is the same • Inserting the rate equation we get • The RTT is part transmission delay T and part queueing delay B/C . We know that after reducing the window, the queueing delay is zero.
Rule-of-thumb • Rule-of-thumb makes sense for one flow • Typical backbone link has > 20,000 flows • Does the rule-of-thumb still hold? • Answer: • If flows are perfectly synchronized, then Yes. • If flows are desynchronized then No.
# packets at 10Gb/s 1,000,000 20 10,000 The Story • Assume: Large number of desynchronized flows; 100% utilization • Assume: Large number of desynchronized flows; <100% utilization
Synchronized Flows • Aggregate window has same dynamics • Therefore buffer occupancy has same dynamics • Rule-of-thumb still holds. t
Probability Distribution Buffer Size Many TCP Flows
Required Buffer Size - Simulations Simulation
Level3 WAN Experiment • High link utilization for two weeks • Buffer sizes on three parallel links: • 190ms (190K packets) • 10ms (10K packets) • 1ms (1k packets) Note: This slide had a typo that caused some confusion (for me!) during class.
# packets at 10Gb/s 1,000,000 20 10,000 The Story • Assume: Large number of desynchronized flows; 100% utilization • Assume: Large number of desynchronized flows; <100% utilization
Buffer Size 100% On-chip buffers Smaller design Lower power Buffer Throughput Window Size t Number of packets 10,000 10Gb/s WAN 1,000,000
Buffer Size 100% ~ 90% On-chip buffers Smaller design Lower power Integrated all-optical buffer [UCSB 2008] Throughput 20 pkts log(W) Number of packets ~50 10,000 10Gb/s WAN 1,000,000
Consequences? 10-50 packets on a chip