Modeling TCP Congestion Control Don Towsley UMass Amherst [email protected] collaborators: T. Bu,...

41
Modeling TCP Congestion Control Don Towsley UMass Amherst [email protected] ollaborators: T. Bu, W. Gong, C. Hollot, V. Misra

Transcript of Modeling TCP Congestion Control Don Towsley UMass Amherst [email protected] collaborators: T. Bu,...

Page 1: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Modeling TCP Congestion Control

Don Towsley UMass Amherst

[email protected]

collaborators: T. Bu, W. Gong, C. Hollot, V. Misra

Page 2: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Outline

• motivation• TCP primer • bottleneck invariance principle

– instability of RED active queue management– fixed point approximations of TCP networks

• transient analysis of TCP networks– stochastic differential equations

• summary

Page 3: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Properties of TCP• 90% of Internet traffic• conservative end-end congestion control

(CC)– equal bandwidth share– additive increase multiplicative decrease CC

• only end-end protocol with congestion control

20Mbs B1=5MbsB2=5Mbs

B3=5Mbs

B4=5Mbs

12

3

4

TCP

20Mbs B1= 2MbsB2= 2MbsB3= 2MbsB4= 2Mbs

1234

UDP-12Mbs

TCP{12Mbs

TCP can be pushed around

Page 4: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Properties of TCP• 90% of Internet traffic• conservative end-end congestion control

(CC)– equal bandwidth share– additive increase multiplicative decrease CC

• only end-end protocol with congestion control

Need to understand TCP in network setting

Page 5: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Additive-Increase Multiplicative-Decrease (AIMD) Congestion Control

ri - rate after i-th feedback

ri+1 = ri + c if i-th feedback is no congestion

ri+1 = a x ri if i-th feedback indicates congestion, a<1

• similar algorithms for window-based CC• basic building block of most congestion

control algorithms (e.g., TCP)

Page 6: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

ri 1

r i2

C

C

(r1,r2)

• two sources, rates ri1,ri

2

. ..

(Chiu,Jain 89)

• initial rates r1 and r2

• bandwidth C

AIMD and Fair Share

• as time goes on, i increases, source rates converge to a fair share

Page 7: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Generic TCP Behavior

• window algorithm (window W )– up to W packets can be in network– return of ACK allows sender to send another

packet– ACKS cumulative

• increase window by one per RTT W W +1/W per ACK

W W +1 per RTT• seeks available network bandwidth

Page 8: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

sender

receiver

W

Page 9: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Generic TCP Behavior

• window algorithm (window W)• increase window by one per RTT

W W +1/W per ACK• loss indication of congestion • decrease window by half on detection of

loss (triple duplicate ACK), W W/2

Page 10: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

sender

receiver

TD

Page 11: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Generic TCP Behavior

• window algorithm (window W)• increase window by one per RTT

W W +1/W per ACK• halve window on detection of loss, W

W/2• timeouts due to lack of ACKs window

reduced to one, W 1

Page 12: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

sender

receiver

TO

Page 13: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Generic TCP Behavior

• window algorithm (window W)• increase window by one per RTT (or one over

window per ACK, W W +1/W)• halve window on detection of loss, W W/2• timeouts due to lack of ACKs, W 1• successive timeout intervals grow

exponentially long• slow start mechanism• provides fair share, full use of bandwidth

Page 14: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Early Models

• B(p,R) - TCP session throughput– p - loss probability– R - avg round trip time

• equilibrium analysis of AIMD

B (p,R ) 1/R (1/p )1/2

• equilibrium analysis incl. timeouts (PFTK98)

B (p,R ) [R (4p/3)1/2 +

T0 3(3p/4)1/2p (1+32p 2)]-1

– T0 - timeout length

Page 15: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

ValidationExperiments:

– 38 traces from 18 hosts– unidirectional bulk transfers– 100sec measurements

Observations:– many timeout loss

events

Conclusions:– good validation– other studies support model– insensitive to TCP version

F

F

FF

F

F

F

FF

FF

F

FFFF

F

FFFFFFFF

FFFFF

1

10

100

1000

10000

0.001 0.01 0.1 1

Loss probability (p)

F Measured

Full Model

Floyd/Ott Model

UMass - UMaryland

Pac

kets

/s

MeasuredPFTKp1/2 model

FF

F

FF

FFFFFF

FFFFFFFF

FFFFFFFFFFFFFFFFFFF

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

0.01

0.1

1

10

100

0.001 0.01 0.1 1

Loss probability (p)

F Measured

Full Model

Floyd/Ott Model

UMass - INRIA

Pac

kets

/s

Measured

PFTK p1/2 model

Page 16: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Lessons

• TCP exhibits well defined bandwidth curve– decreasing function of R and p

• timeouts important• little difference between TCP versions

– AIMD, timeouts– Vegas an exception

Page 17: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Bottleneck invariance principle

• bottleneck router– loss, high load, util. 1

• bottleneck invariance principle (BIP)

i Bi (Ri ,p) = C C - router bandwidth

Bi - throughput of flow i

Page 18: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Applications of BIP

• provides simple checks of protocol design– active queue management, RED– new improved congestion control algorithms

• accurate models of networks supporting infinite/finite duration TCP flows– thruput, loss rate, avg. queue length, …

Page 19: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Active queue management

• drop tail - drop pkt when buffer fills• active queue management (AQM)

– proactively drop/mark packets before buffer overflow

– example: drop pkt with probability p(x) x - avg. queue length

Page 20: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

RED (Random Early Detect)

RED: marking/dropping based on average queue length x (t )

tmin tmax

pmax

1

2tmax

mark

ing p

rob p

avg queue length x

t

- q (t )- x (t )x (t) : smoothed, time averaged q (t)

x (ti +1) = q (ti +) + (1-) x (ti)

Page 21: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

RED discard function

• RED queue

N

N1 < N2

N2

• N identical TCP sourcesB(R,p) = C/N

C

• p increases with N

pmax

tmax

N1

N1

N3

N2 < N3

?N4

N3 < N4

Page 22: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

RED discard function

• RED queue

N• N identical TCP sourcesB(R,p) = C/N

C

• p increases with N

pmax

tmax

N4tmax

queue length

Page 23: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

RED discard function

• RED queue

N

(Firoiu, Borden, 00)

• N identical TCP sourcesB(R,p) = C/N

C

• p increases with N

• once p > pmax, queue oscillates around tmax

RED unstable!pmax

tmax

Page 24: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Improved RED

tmin tmax

pmax

1

discontinuity removed in gentle_ variant

2tmax

Mark

ing p

rob.

p

Avg queue length x

Page 25: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Stationary Behavior: single bottleneck

1

N

• N infinite sourceTCP sessions

• one bottleneck link– AQM; avg. queue length q, discard prob.

p(q)– bandwidth C

• R (q) = R0 + q /C (round trip time)

B (p(q ), R (q )) = C /N

Page 26: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Single bottleneck

• solve a fixed point problem for q• unique solution provided B is monotonic

and continuous

• resulting q can be used to obtain Ri and p

• preliminary evaluation results good

Page 27: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Results: single Bottleneck

• N TCP flows • two-way prop. delay 18+2i ms, i = 1,…,N • link bandwidth N • RED: scaled by N

PFKT Modelp1/2 ModelSimulation+

RT Model p 1/2 Model

similar results for short-lived flows

Page 28: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Network Setting

• N TCP flows– throughputs {Bi }

• V congested RED routers– capacities {Cv }

– avg. queue lengths x = {xv }

– discard prob. p = {pv (xv )}

• TCP model: Bi (R , p)

• congested router model

i Bi (x ) = Cv , v =1,…,V

• V equations, V unknowns

TCP flow Bi

AQMrouter

Cv, pv(xv)

Page 29: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Results: Tandem Networks

• 8 networks, 5 -10 routers

• 2-way propagation delay 20-120 ms

• bandwidth, 2-6 Mbps• error

• throughput < 10%• loss rate < 10%• avg. queue length < 15%

• similar results for cyclic networks

RT Modelp1/2 Model

+

Est

imate

d e

nd

to e

nd

lo

ss

Measured end2end loss

Page 30: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Transient Analysis: single router

• one congested router– capacity {C (packets/sec) }

– queue length q (t )– discard prob. p(t )

• N TCP flows– window sizes Wi (t )

– round trip time

Ri(t ) = Ai +q (t )/C– throughputs

Bi (t ) = Wi (t )/Ri (t )

1

N

Page 31: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

System of Stochastic Differential Equations

Window Size: dWi

Timeouts ignored

=

Additiveincrease

dt Ri (q (t))

-

Mult. decrease

Wi dNi (t-)2

{Ni (t)}: time varying, rate Wi (t ) p (x (t )) / Ri (q (t))

: feedback delay (round trip time)

Assumption: Poisson loss process {Ni (t)}:

Page 32: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

System of SDEs

Queue length: =

Outgoingtraffic

- 1{q (t) > 0}C dtdq

Window Size: dWi = dt Ri (q (t))

- Wi dNi (t-)2

Incomingtraffic

+ Ri (q (t ))

Wi (t ) dt

Page 33: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

System of Differential Equations

Window Size:dEWi

dt 1

Ri(Eq(t))

EWi

2

-EWi(t-)

Ri (Eq(t-))Ep(t-)

-1{Eq(t) > 0}C + Ri(Eq(t))

EWi(t)Queue length: dEqdt

Conjecture: exact as no. flows ->

Page 34: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

System of Differential Equations (cont.)

Estimatedaverage queue length:

Eq(t)dExdt

=ln (1-)

ln (1-)

-Ex(t)

= averaging parameter of RED= sampling interval ~ 1/C

Loss probability:dEpdt

= dpdx

dExdt

dp/dx is obtained from the marking profile

p

x

Page 35: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Result: N +2 coupled equations

Numerical solution using MATLAB

dEWi

dt=f1(Ep,Ri, EWi) i = 1..N

dEqdt

= f2(EWi)dEpdt

= f3(Eq)

Page 36: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Extension to Network

Networked case: V congested AQM routers

Other extensions to modelTimeouts: leveraged work done in [PFTK Sigcomm98] to model timeoutsFlow aggregation: represent flows sharing same route by single equation

loss probability - cumulative loss probability

p(t) = 1-V (1-pV(t ))

Queuing delay - aggregate delay

q(t ) = V qV(t )

Page 37: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Validation scenario

• two RED routers • one way ftp flows traffic

sources• comparison to ns• transient queuing

performance obtained

Flow set 1

Flow set 2

Flow set 3

Flow set 4

Flow set 5

RED router 1RED router 2

Topology

5 sets of flows2 RED routersSet 2 flows through both routers

Page 38: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Performance of DE method

• link rates 5 Mb/s• load variation at t=75

and t=150 seconds• 200 flows simulated• drops to 120 between

t = 75, 120 • fluid model captures

transient performance

Fluid model ns simulation

Inst

. Q

ueue len

gth

Time

Page 39: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Observations on RED• “Tuning” of RED is difficult - sensitive to packet sizes, load levels, round trip time, etc.

• oscillations due to – exponential smoothing of queue length– use of variable sampling interval – feedback delay– queue fill delay

Further WorkDetailed Control Theoretic Analysis of TCP/RED available

at http://gaia.cs.umass.edu/papers/papers.html

Page 40: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Improving congestion control

Working with linearized model• developed rules for setting

RED parameters• compared Proportional

Integral (PI) controller with properly adjusted RED

• ns simulation with time varying http,ftp flows

• PI controller: faster response, decouples queue size and load level

Queue length vs. Time

- PI Controller- RED Controller

queue length

time

Page 41: Modeling TCP Congestion Control Don Towsley UMass Amherst towsley@cs.umass.edu collaborators: T. Bu, W. Gong, C. Hollot, V. Misra.

Conclusions

• fixed point approach promising for stationary behavior of TCP

• DE approach promising for more detailed transient behavior

• computation cost of methods a fraction of the discrete event simulation cost

• formal representation and analysis yields better understanding of RED/AQM