Palm Calculus Made Easy The Importance of the Viewpoint

67
Palm Calculus Made Easy The Importance of the Viewpoint JY Le Boudec 1

description

Palm Calculus Made Easy The Importance of the Viewpoint. JY Le Boudec. Contents. Informal Introduction Palm Calculus Other Palm Calculus Formulae Application to RWP Other Examples Perfect Simulation. 1. Event versus Time Averages. Consider a simulation, state S t - PowerPoint PPT Presentation

Transcript of Palm Calculus Made Easy The Importance of the Viewpoint

Page 1: Palm Calculus Made Easy The Importance of the Viewpoint

Palm CalculusMade Easy

The Importance of the ViewpointJY Le Boudec

1

Page 2: Palm Calculus Made Easy The Importance of the Viewpoint

Contents

1. Informal Introduction2. Palm Calculus

3. Other Palm Calculus Formulae4. Application to RWP

5. Other Examples6. Perfect Simulation

2

Page 3: Palm Calculus Made Easy The Importance of the Viewpoint

1. Event versus Time AveragesConsider a simulation, state St

Assume simulation has a stationary regime

Consider an Event Clock: times Tn at which some specific changes of state occur

Ex: arrival of job; Ex. queue becomes empty

Event average statistic

Time average statistic

3

Page 4: Palm Calculus Made Easy The Importance of the Viewpoint

Example: Gatekeeper; Average execution time

4

0 90 100 190 200 290 300

50001000

Real time t (ms)

job arrival

50001000

50001000

Execution time for a job that

arrives at t (ms)

Viewpoint 1: System Designer Viewpoint 2: Customer

Page 5: Palm Calculus Made Easy The Importance of the Viewpoint

Example: Gatekeeper; Average execution time

5

0 90 100 190 200 290 300

50001000

Real time t (ms)

job arrival

50001000

50001000

Execution time for a job that

arrives at t (ms)

Viewpoint 1: System Designer Viewpoint 2: Customer

Two processes, with execution times 5000 and 1000 Inspector arrives at a random time

red processor is used with proba

Page 6: Palm Calculus Made Easy The Importance of the Viewpoint

Sampling BiasWs and Wc are different

A metric definition should mention the sampling method (viewpoint)Different sampling methods may provide different values: this is the sampling bias

Palm Calculus is a set of formulas for relating different viewpoints

Can often be obtained by means of the Large Time Heuristic

6

Page 7: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

We want to relate and We apply the large time heuristic

1. How do we evaluate these metrics in a simulation ?

7

Page 8: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

We want to relate and We apply the large time heuristic

1. How do we evaluate these metrics in a simulation ?

where index of next green or red arrow at or after

8

Page 9: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

2. Break one integral into pieces that match the ’s:

9

Page 10: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

2. Break one integral into pieces that match the ’s:

10

Page 11: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

3. Compare

11

Page 12: Palm Calculus Made Easy The Importance of the Viewpoint

Large Time Heuristic Explained

on an Example

3. Compare

12

Page 13: Palm Calculus Made Easy The Importance of the Viewpoint

This is Palm Calculus !

13

𝑊 𝑐=𝜆cov (𝑆 ,𝑋 )+𝑊 𝑠

Page 14: Palm Calculus Made Easy The Importance of the Viewpoint

Sn = 90, 10, 90, 10, 90

Xn = 5000, 1000, 5000, 1000, 5000

Correlation is >0

Wc > Ws

When do the two viewpoints coincide ? 14

Page 15: Palm Calculus Made Easy The Importance of the Viewpoint

The Large Time Heuristic

Formally correct ifsimulation is stationary

It is a robust method, i.e. independent of assumptions on distributions (and on independence)

15

Page 16: Palm Calculus Made Easy The Importance of the Viewpoint

Other «Clocks»

16

Flow 1 Flow 2

Flow 3

Distribution of flow sizesfor an arbitrary flowfor an arbitrary packet

Page 17: Palm Calculus Made Easy The Importance of the Viewpoint

17

Load Sensitive Routing of Long-Lived IP FlowsAnees Shaikh, Jennifer Rexford and Kang G. Shin

Proceedings of Sigcomm'99

ECDF, per flow viewpoint

ECDF, per packet viewpoint

Page 18: Palm Calculus Made Easy The Importance of the Viewpoint

Mean flow size:per flow per packet

18

Flow 1 Flow 2

Flow 3

Distribution of flow sizesfor an arbitrary flowfor an arbitrary packet

Page 19: Palm Calculus Made Easy The Importance of the Viewpoint

Large «Time» Heuristic1. How do we evaluate these metrics in a simulation ?

2. Put the packets side by side, sorted by flow

19

Flow n=1 Flow n=2 Flow n=3

p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9

Page 20: Palm Calculus Made Easy The Importance of the Viewpoint

Large «Time» Heuristic1. How do we evaluate these metrics in a simulation ?

per flow per packet where when packet belongs to flow

2. Put the packets side by side, sorted by flow

20

Flow n=1 Flow n=2 Flow n=3

p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9

𝑆𝑃=1𝑃 (𝑆1+𝑆1+𝑆2+𝑆2+𝑆3+𝑆3+𝑆3+𝑆3+𝑆3+…)

Page 21: Palm Calculus Made Easy The Importance of the Viewpoint

Large «Time» Heuristic

3. Compare

21

Flow n=1 Flow n=2 Flow n=3

p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9

Page 22: Palm Calculus Made Easy The Importance of the Viewpoint

Large «Time» Heuristic

3. Compare

22

Flow n=1 Flow n=2 Flow n=3

p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9

Page 23: Palm Calculus Made Easy The Importance of the Viewpoint

Large «Time» Heuristic for PDFs of flow sizesPut the packets side by side, sorted by flow

1. How do we evaluate these metrics in a simulation ?

23

Flow n=1 Flow n=2 Flow n=3

Page 24: Palm Calculus Made Easy The Importance of the Viewpoint

24

Page 25: Palm Calculus Made Easy The Importance of the Viewpoint

Cyclist’s ParadoxOn a round trip tour, there is more uphills than downhills

25

Page 26: Palm Calculus Made Easy The Importance of the Viewpoint

The km clock vs the standard clock

speed for the kilometer

26

Page 27: Palm Calculus Made Easy The Importance of the Viewpoint

27

2. Palm Calculus : Framework

A stationary process (simulation) with state St.

Some quantity Xt measured at time t. Assume that

(St;Xt) is jointly stationary

I.e., St is in a stationary regime and Xt depends on the past, present and future state of the simulation in a way that is invariant by shift of time origin.Examples

St = current position of mobile, speed, and next waypoint

Jointly stationary with St: Xt = current speed at time t; Xt = time to be run until next waypointNot jointly stationary with St: Xt = time at which last waypoint occurred

Page 28: Palm Calculus Made Easy The Importance of the Viewpoint

Stationary Point Process

Consider some selected transitions of the simulation, occurring at times Tn.

Example: Tn = time of nth trip end

Tn is a called a stationary point process associated to St

Stationary because St is stationary

Jointly stationary with St

Time 0 is the arbitrary point in time

28

Page 29: Palm Calculus Made Easy The Importance of the Viewpoint

29

Palm ExpectationAssume: Xt, St are jointly stationary, Tn is a stationary point process associated with St

Definition : the Palm Expectation is

Et(Xt) = E(Xt | a selected transition occurred at time t)

By stationarity:

Et(Xt) = E0(X0)

Example: Tn = time of nth trip end, Xt = instant speed at time t

Et(Xt) = E0(X0) = average speed observed at a waypoint

Page 30: Palm Calculus Made Easy The Importance of the Viewpoint

30

E(Xt) = E(X0) expresses the time average viewpoint.

Et(Xt) = E0(X0) expresses the event average viewpoint.

Example for random waypoint: Tn = time of nth trip end, Xt = instant speed at time t

Et(Xt) = E0(X0) = average speed observed at trip end

E(Xt)=E(X0) = average speed observed at an arbitrary point in time

Xn

Xn+1

Page 31: Palm Calculus Made Easy The Importance of the Viewpoint

33

Intensity of a Stationary Point Process Intensity of selected transitions: := expected number of transitions per time unit

Page 32: Palm Calculus Made Easy The Importance of the Viewpoint

34

Two Palm Calculus Formulae Intensity Formula:

where by convention T0 ≤ 0 < T1

Inversion Formula

The proofs are simple in discrete time – see lecture notes

Page 33: Palm Calculus Made Easy The Importance of the Viewpoint

35

Page 34: Palm Calculus Made Easy The Importance of the Viewpoint

3. Other Palm Calculus Formulae

36

Page 35: Palm Calculus Made Easy The Importance of the Viewpoint

Joe’ sWaiting Time

mean waiting time

37

mean time between busessystem’s viewpoint

penalty due to variability

Page 36: Palm Calculus Made Easy The Importance of the Viewpoint

38

Feller’s Paradox

Page 37: Palm Calculus Made Easy The Importance of the Viewpoint

We encountered Feller’s Paradox Already

39

Page 38: Palm Calculus Made Easy The Importance of the Viewpoint

40

For a Poisson process, what is the mean length of an interval ?

Page 39: Palm Calculus Made Easy The Importance of the Viewpoint

Rate Conservation Law

41

Page 40: Palm Calculus Made Easy The Importance of the Viewpoint

42

Page 41: Palm Calculus Made Easy The Importance of the Viewpoint

43

Page 42: Palm Calculus Made Easy The Importance of the Viewpoint

Campbell’s Formula

Shot noise model: customer n adds a load h(t-Tn,Zn) where Zn is some attribute and Tn is arrival time

Example: TCP flow: L = λV with L = bits per second, V = total bits per flow and λ= flows per sec

44

t

Total load

T1 T2 T3

Page 43: Palm Calculus Made Easy The Importance of the Viewpoint

Little’s Formula

45

t

Total load

T1 T2 T3

Page 44: Palm Calculus Made Easy The Importance of the Viewpoint

4. RWP and Freezing SimulationsModulator Model:

46

Page 45: Palm Calculus Made Easy The Importance of the Viewpoint

Is the previous simulation stationary ?Seems like a superfluous question, however there is a difference in viewpoint between the epoch n and time

Let Sn be the length of the nth epoch

If there is a stationary regime, then by the inversion formula

so the mean of Sn must be finite

This is in fact sufficient (and necessary)

47

Page 46: Palm Calculus Made Easy The Importance of the Viewpoint

48

Application to RWP

Page 47: Palm Calculus Made Easy The Importance of the Viewpoint

49

Time Average Speed, Averaged over n independent mobiles

Blue line is one sampleRed line is estimate of E(V(t))

Page 48: Palm Calculus Made Easy The Importance of the Viewpoint

50

A Random waypoint model that has no stationary regime !

Assume that at trip transitions, node speed is sampled uniformly on [vmin,vmax]

Take vmin = 0 and vmax > 0

Mean trip duration = (mean trip distance)

Mean trip duration is infinite !

Was often used in practice

Speed decay: “considered harmful” [YLN03]

max

0max

1 v

vdv

v

Page 49: Palm Calculus Made Easy The Importance of the Viewpoint

What happens when the model does not have a stationary regime ?

The simulation becomes old

Page 50: Palm Calculus Made Easy The Importance of the Viewpoint

Stationary Distribution of Speed(For model with stationary regime)

Page 51: Palm Calculus Made Easy The Importance of the Viewpoint

Closed Form Assume a stationary regime exists and simulation is run long enoughApply inversion formula and obtain distribution of instantaneous speed V(t)

Page 52: Palm Calculus Made Easy The Importance of the Viewpoint

54

Removing Transient MattersA. In the mobile case, the nodes are more often towards the center, distance between nodes is shorter, performance is betterThe comparison is flawed. Should use for static case the same distribution of node location as random waypoint. Is there such a distribution to compare against ?

Random waypoint

Static

A (true) example: Compare impact of mobility on a protocol:

Experimenter places nodes uniformly for static case, according to random waypoint for mobile caseFinds that static is better

Q. Find the bug !

Page 53: Palm Calculus Made Easy The Importance of the Viewpoint

A Fair Comparison

We revisit the comparison by sampling the static case from the stationary regime of the random waypoint

Random waypoint

Static, from uniform

Static, same node location as RWP

Page 54: Palm Calculus Made Easy The Importance of the Viewpoint

56

Is it possible to have the time distribution of speed uniformly distributed in [0; vmax] ?

Page 55: Palm Calculus Made Easy The Importance of the Viewpoint

57

5. PASTAThere is an important case where Event average = Time average“Poisson Arrivals See Time Averages”

More exactly, should be: Poisson Arrivals independent of simulation state See Time Averages

Page 56: Palm Calculus Made Easy The Importance of the Viewpoint

58

Page 57: Palm Calculus Made Easy The Importance of the Viewpoint

59

Page 58: Palm Calculus Made Easy The Importance of the Viewpoint

6. Perfect SimulationAn alternative to removing transientsPossible when inversion formula is tractableExample : random waypoint

Same applies to a large class of mobility models

60

Page 59: Palm Calculus Made Easy The Importance of the Viewpoint

61

Removing Transients May Take Long

If model is stable and initial state is drawn from distribution other than time-stationary distribution

The distribution of node state converges to the time-stationary distribution

Naïve: so, let’s simply truncate an initial simulation duration

The problem is that initial transience can last very long

Example [space graph]: node speed = 1.25 m/sbounding area = 1km x 1km

Page 60: Palm Calculus Made Easy The Importance of the Viewpoint

62

Perfect simulation is highly desirable (2)

Distribution of path:

Time = 100s

Time = 50s

Time = 300s

Time = 500s

Time = 1000s

Time = 2000s

Page 61: Palm Calculus Made Easy The Importance of the Viewpoint

Solution: Perfect SimulationDef: a simulation that starts with stationary distributionUsually difficult except for specific modelsPossible if we know the stationary distribution

Sample Prev and Next waypoints from their joint stationary distributionSample M uniformly on segment [Prev,Next]Sample speed V from stationary distribution

Page 62: Palm Calculus Made Easy The Importance of the Viewpoint

Stationary Distrib of Prev and Next

Page 63: Palm Calculus Made Easy The Importance of the Viewpoint

65

Stationary Distribution of Location Is also Obtained By Inversion Formula

Page 64: Palm Calculus Made Easy The Importance of the Viewpoint

66

Page 65: Palm Calculus Made Easy The Importance of the Viewpoint

No Speed Decay

Page 66: Palm Calculus Made Easy The Importance of the Viewpoint

68

Perfect Simulation AlgorithmSample a speed V(t) from the time stationary distributionHow ?A: inversion of cdf

Sample Prev(t), Next(t)How ?

Sample M(t)

Page 67: Palm Calculus Made Easy The Importance of the Viewpoint

ConclusionsA metric should specify the sampling methodDifferent sampling methods may give very different valuesPalm calculus contains a few important formulas

Which ones ?

Freezing simulations are a pattern to be aware of