an empirical model of tcp performance

28
An Empirical Model of TCP Performance Allen B. Downey Olin College of Engineering 1

Upload: q-z

Post on 18-Jul-2016

228 views

Category:

Documents


2 download

DESCRIPTION

Model of TCP Performance

TRANSCRIPT

Page 1: An Empirical Model of TCP Performance

An Empirical Model of TCP Performance

Allen B. Downey

Olin College of Engineering

1

Page 2: An Empirical Model of TCP Performance

TCP Performance

Goal: model and predict transfer times.

� Understand TCP performance

• Improve TCP?• Improve the network?

� Interactive applications.

• Predict duration of downloads.• Select mirror site.

� Distributed applications.

• Resource selection.• Scheduling.

2

Page 3: An Empirical Model of TCP Performance

Goals

Complementary questions:

� What do we need toknow about anetwork path?

� What can wemeasure about anetwork path?

Complementary goals:

� Maximize accuracy. � Minimizemeasurement.

3

Page 4: An Empirical Model of TCP Performance

Two approaches

� History-based.

• Pro: Good statistical description.• Con: Availability of data?

• Passive: Might not have seen what you need.• Active: Obtrusive?

� Model-based.

• Pro: small measurements ⇒ parameters ⇒

model ⇒ predictions• Con: single-value predictions.• Con: incomplete models, so far.

4

Page 5: An Empirical Model of TCP Performance

TCP Models

� Several models for mice (never leave slow start).

� Several models for elephants (ignore slow start).

� For medium size (bdp < size < 10bdp), performancedepends on slow start and steady state.

� bdp commonly 4 KB – 128 KB.

� Maybe 40% of TCP transfers are in this range.

5

Page 6: An Empirical Model of TCP Performance

Hybrid model

� Explicit model of slow start.

� History-based prediction of steady state throughput.

ss0 ss1 ss2 ssn

ca

6

Page 7: An Empirical Model of TCP Performance

Model parameters

So what do we need to know?

� State transition probabilities.

� Distribution of rtt.

� cw1, cw2, cw3 ...

� Distribution of steady-state throughput.

Can we measure these parameters?

7

Page 8: An Empirical Model of TCP Performance

Measurement

� Application-level HTTP timing (instrumented wget).

• Pro: easy to implement.• Con: some timing inaccuracy, lost information.

8

Page 9: An Empirical Model of TCP Performance

Timing chart

0 100 200 300 400time (ms)

0

20

40

60

80

100

siz

e (

10

00

B)

server 7 timing chart� Plot bytes read

vs. time.

� Immediately, wecan estimate rtt,cw, bw and bdp.

� And we can inferTCP state.

9

Page 10: An Empirical Model of TCP Performance

Estimating parameters

� Divide timing chart into rounds.

� Measure window size for each round.

� Pattern match on window sizes:

• 2, 4, 8, 16, 32 ...• 2, 4, 6, 4, 5, 6 ...• 2, 4, 6, (long pause) 11, 6 ...• 3, 6, 12, 15, 15, 15 ...• 3, 6, 12, 51, 17, 63 ...

10

Page 11: An Empirical Model of TCP Performance

Measurement

� Measurements:

• 100,000 byte transfers.• 100 transfers, with 100s between.

� HTTP downloads:

• 2 URLs provided by collaborators.• 11 URLs culled from proxy cache logs.

� Diverse network paths:

• rtt from 7 to 270 ms.• bw from 0.350 to 100 Mbps.

11

Page 12: An Empirical Model of TCP Performance

Window sizes

0 20 40 60 80measurement

0

10

20

30

40

observ

ed w

indow

(packets

)

server 7 window sizes

4321

� This is the sortof thing Iexpected.

� Too bad it’s theexception.

12

Page 13: An Empirical Model of TCP Performance

Window sizes

0 20 40 60 80measurement

0

5

10

15

observ

ed w

indow

(packets

)

server 3 window sizes

4321

� cw2 issometimes 3,sometimes 4.

� cwn+1 is2 · cwn − m,where m is0, 1, 2, ...

� 10 out of 13 aresimilar.

13

Page 14: An Empirical Model of TCP Performance

Non-deterministic slow start

� Partial explanation in the paper.

� Putting the “empirical” in “empirical model”.

� Models that omit this behavior can’t work forshort–medium transfers (2–5 rounds of slow start).

14

Page 15: An Empirical Model of TCP Performance

Estimating Parameters

� R: Distribution of rtt.

� W : Distribution of window size.

� T : Distribution of throughput.

� State transition probabilities.

ss0 ss1 ss2 ssn

ca

15

Page 16: An Empirical Model of TCP Performance

Generating predictions

Monte Carlo simulation of finite state model:

1. Start at ss0.

2. Choose a state transition at random.

3. If in slow start, choose rtt from R and cw from W.

4. If in congestion avoidance, choose throughput from T.

5. Update total time and total data transmitted.

6. If total data > size, return total time.

7. Otherwise go to step 2.

16

Page 17: An Empirical Model of TCP Performance

Validation

� Randomly partition 2 datasets of 50 measurements.

� Estimate parameters and generate distributions fromone subset.

� Compare to actual times from other subset.

� Agreement indicates that the model is sufficientlydetailed, and that the estimated parameters areconsistent.

17

Page 18: An Empirical Model of TCP Performance

Example #1

62 119 231 447 866x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 7 tts (cdf)

100050002000050000100000

� Deterministicslow start.

� Bandwidthlimited.

18

Page 19: An Empirical Model of TCP Performance

Example #2

563 1119 2227 4431 8815x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 1 tts (cdf)

100050002000050000100000

� Nondeterministicslow start ⇒multimodaldistributions.

� Modes atmultiples of rtt.

19

Page 20: An Empirical Model of TCP Performance

Example #3

18 29 46 74 119x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 2 tts (cdf)

100050002000050000100000

� Buffer-limited.

20

Page 21: An Empirical Model of TCP Performance

Example #4

121 419 1450 5011 17317x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 9 tts (cdf)

100050002000050000100000

� Congestionlimited.

� Underestimatingvariability?

21

Page 22: An Empirical Model of TCP Performance

Evil case #1

101 190 355 665 1244x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 3 tts (cdf)

100050002000050000100000

� Up to 50,000bytes, not bad.

� Anything over60,000, way off!

22

Page 23: An Empirical Model of TCP Performance

Server performance

� Server imposes 50 ms delay after 40 packets.

� Model includes processing time in round one, but notafterwards.

� Reminder: real world resists modeling.

23

Page 24: An Empirical Model of TCP Performance

Evil case #2

19 41 91 201 443x (ms)

0.0

0.2

0.4

0.6

0.8

1.0

Pr

(tra

nsfe

r tim

e <

x)

server 6 tts (cdf)

100050002000050000100000

� Actual times aresharplymultimodal.

� Model smoothesthe modes.

24

Page 25: An Empirical Model of TCP Performance

Multiple paths

0 100 200 300 400time (ms)

0

20

40

60

80

100

siz

e (

10

00

B)

server 6 timing chart� Akamai-style

content delivery⇒ multimodalrtt.

25

Page 26: An Empirical Model of TCP Performance

Headlines

� Hybrid model captures transition from slow start tosteady state.

• Lots of parameters, but easy to estimate.

� Non-deterministic slow start sighted.

• TCP characteristic or Linux bug?

26

Page 27: An Empirical Model of TCP Performance

Ongoing work

� Followup paper:“TCP Self-Clocking and Bandwidth Sharing”.

� Network monitoring/predicting tool.

• Collect active and passive measurements.• Maintain database.• Generate vizualizations.• Answer queries.

27

Page 28: An Empirical Model of TCP Performance

Had enough?

� Followup paper and additional data available from

http://allendowney.com

� Contact me at

[email protected]

28