Transcript
Page 1: CS144 An Introduction to Computer Networks

1

CS144An Introduction to Computer Networks

Flow Control, Congestion Control and the size of Router Buffers

Section

Nick McKeownProfessor of Electrical Engineering and Computer Science, Stanford University

Page 2: CS144 An Introduction to Computer Networks

2

Outline

Flow ControlCongestion ControlThe size of Router Buffers

CS144, Stanford University

Page 3: CS144 An Introduction to Computer Networks

3

Sliding WindowWindow Size

Outstanding Datasent, but un-ack’d

Data OK to send

Data not OK to send yet

Data ACK’d

Page 4: CS144 An Introduction to Computer Networks

4

Flow Control

CS144, Stanford University

userOS

Resequence, ACK, etc

RcvBuffer

Inside Destination

Arriving packets

Page 5: CS144 An Introduction to Computer Networks

5

Dynamics of flow control

CS144, Stanford University

Animation at:http://media.pearsoncmg.com/aw/aw_kurose_network_4/applets/flow/FlowControl.htm

Page 6: CS144 An Introduction to Computer Networks

6

Outline

Flow ControlCongestion ControlThe size of Router Buffers

CS144, Stanford University

Page 7: CS144 An Introduction to Computer Networks

7

TCP Sliding Window

ACK

Window Size

Round-trip time

(1) R x RTT > Window size

ACK

Window Size

Round-trip time

(2) R x RTT = Window size

ACK

Window Size

ACK ACK

A

B

Page 8: CS144 An Introduction to Computer Networks

8

“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

Page 9: CS144 An Introduction to Computer Networks

9

TCP Congestion ControlTCP varies the number of outstanding packets in the

network by varying the window size:

Window size = min{Advertised window, Congestion Window}

Receiver Transmitter (“cwnd”)

Page 10: CS144 An Introduction to Computer Networks

10

AIMDAdditive Increase, Multiplicative Decrease

CS144, Stanford University

Page 11: CS144 An Introduction to Computer Networks

11

Leads to the AIMD “sawtooth”

t

cwnd

halved

“Drops”

Page 12: CS144 An Introduction to Computer Networks

12

Dynamics of an AIMD flow

CS144, Stanford University

Animation at:http://guido.appenzeller.net/anims/

Page 13: CS144 An Introduction to Computer Networks

13

Outline

Flow ControlCongestion ControlThe size of Router Buffers

CS144, Stanford University

Page 14: CS144 An Introduction to Computer Networks

14

The size of a router buffer

CB

Page 15: CS144 An Introduction to Computer Networks

15

Rule-of-Thumb

Buffer size = 2T x C, where:2T = RTTmin = 2(propagation delay + packetization delay)

C = capacity of outgoing line.

Example: 10Gb/s interface, with 2T = 250ms300Mbytes of buffering.Read and write new packet every 32ns.

Page 16: CS144 An Introduction to Computer Networks

16

The Story

)(logO2

2 )2()1( Wn

CTCT

)(logO

22 )2()1( W

n

CTCT

10,000 20# packetsat 10Gb/s 1,000,000

(1) Assume: Large number of desynchronized flows; 100% utilization(2) Assume: Large number of desynchronized flows; <100% utilization

Page 17: CS144 An Introduction to Computer Networks

17

Time evolution of a single TCP flow through a router. Buffer is < 2T*C

Time Evolution of a Single TCP FlowTime evolution of a single TCP flow through a router. Buffer is 2T*C

Page 18: CS144 An Introduction to Computer Networks

18

Buffer size = 2T x C

Interval magnifiedon next slide

Page 19: CS144 An Introduction to Computer Networks

19

When sender pauses, buffer drains

one RTTDrop

Page 20: CS144 An Introduction to Computer Networks

20

Origin of rule-of-thumbBefore and after reducing window size, the sending rate of the

TCP 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.

newold RR

new

new

old

old

RTT

W

RTT

W

T

W

CBT

W oldold

2

2/

/2

BCT 2

Page 21: CS144 An Introduction to Computer Networks

21

Rule-of-thumb

Rule-of-thumb makes sense for one flowTypical backbone link has > 20,000 flowsDoes the rule-of-thumb still hold?

Answer: - If flows are perfectly synchronized, then Yes.- If flows are desynchronized then No.

Page 22: CS144 An Introduction to Computer Networks

22

The Story

)(logO2

2 )2()1( Wn

CTCT

)(logO

22 )2()1( W

n

CTCT

10,000 20# packetsat 10Gb/s 1,000,000

(1) Assume: Large number of desynchronized flows; 100% utilization(2) Assume: Large number of desynchronized flows; <100% utilization

Page 23: CS144 An Introduction to Computer Networks

23

Synchronized Flows

Aggregate window has same dynamicsTherefore buffer occupancy has same dynamicsRule-of-thumb still holds.

2maxW

t

max

2

W

maxW

maxW

Page 24: CS144 An Introduction to Computer Networks

24

ProbabilityDistribution

Buffer Size

W

Many TCP Flows

Page 25: CS144 An Introduction to Computer Networks

25

2T C

n

Simulation

Required Buffer Size - Simulations

Page 26: CS144 An Introduction to Computer Networks

26

Level3 WAN Experiment

High link utilization for two weeksBuffer 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.

Page 27: CS144 An Introduction to Computer Networks

27

Drop vs. LoadBuffer = 190ms, 10ms

0

0.04

0.08

0.12

0.16

0.2

0 20 40 60 80 100

Load (%)

Pa

ck

et

Dro

p R

ate

(%

)

Page 28: CS144 An Introduction to Computer Networks

28

Drop vs. LoadBuffer = 1ms

0

0.04

0.08

0.12

0.16

0.2

0 20 40 60 80 100

Load (%)

Pa

ck

et

Dro

p R

ate

(%

)

Page 29: CS144 An Introduction to Computer Networks

29

The Story

)(logO2

2 )2()1( Wn

CTCT

)(logO

22 )2()1( W

n

CTCT

10,000 20# packetsat 10Gb/s 1,000,000

(1) Assume: Large number of desynchronized flows; 100% utilization(2) Assume: Large number of desynchronized flows; <100% utilization

Page 30: CS144 An Introduction to Computer Networks

30

Buffer SizeT

hro

ug

hpu

t

10,000

100%

1,000,00010Gb/s WAN

Number of packets

On-chip buffersSmaller designLower power

tW

indo

w S

ize

Buffer

Page 31: CS144 An Introduction to Computer Networks

31

Buffer SizeT

hro

ug

hpu

t

log(W)

10,000~50

~ 90%100%

1,000,00010Gb/s WAN

Number of packets

20 pkts

Integrated all-optical buffer [UCSB 2008]

On-chip buffersSmaller designLower power

Page 32: CS144 An Introduction to Computer Networks

3232

Consequences?

10-50 packets on a chip


Top Related