Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Palm Calculus Made Easy The Importance of the Viewpoint JY Le Boudec 1."— Presentation transcript:

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

2 Contents 1.Informal Introduction 2.Palm Calculus 3.Other Palm Calculus Formulae 4.Application to RWP 5.Other Examples 6.Perfect Simulation 2

3 1. Event versus Time Averages Consider a simulation, state S t Assume simulation has a stationary regime Consider an Event Clock: times T n at which some specific changes of state occur Ex: arrival of job; Ex. queue becomes empty Event average statistic Time average statistic 3

4 Example: Gatekeeper 4 090100190200290300 5000 1000 t (ms) job arrival 5000 1000 5000 1000

5 Sampling Bias W s and W c 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 5

6 Large Time Heuristic Explained on an Example 6

7 7

8 8

9 The Large Time Heuristic We will show later that this is formally correct if the simulation is stationary It is a robust method, i.e. independent of assumptions on distributions (and on independence) 9

10 Impact of Cross-Correlation S n = 90, 10, 90, 10, 90 X n = 5000, 1000, 5000, 1000, 5000 Correlation is >0 W c > W s When do the two viewpoints coincide ? 10 090100190200290300 5000 1000 t (ms) job arrival 5000 1000 5000 1000

11 Two Event Clocks Stop and Go protocol Clock 0: new packets; Clock a: all transmissions Obtain throughput as a function of t 0, t 1 and loss rate 11 t (ms) timeout t0t0 t1t1 t0t0 0,a a

12 12 t (ms) timeout t0t0 t1t1 t0t0 0,a a

13 13 t (ms) timeout t0t0 t1t1 t0t0 0,a a

14 Throughput of Stop and Go Again a robust formula 14

15 Other Samplings 15

16 16 Load Sensitive Routing of Long-Lived IP Flows Anees Shaikh, Jennifer Rexford and Kang G. Shin Proceedings of Sigcomm'99 ECDF, per flow viewpoint ECDF, per packet viewpoint

17 17

18 18

19 19 2. Palm Calculus : Framework A stationary process (simulation) with state S t. Some quantity X t measured at time t. Assume that (S t ;X t ) is jointly stationary I.e., S t is in a stationary regime and X t depends on the past, present and future state of the simulation in a way that is invariant by shift of time origin. Examples S t = current position of mobile, speed, and next waypoint Jointly stationary with S t : X t = current speed at time t; X t = time to be run until next waypoint Not jointly stationary with S t : X t = time at which last waypoint occurred

20 Stationary Point Process Consider some selected transitions of the simulation, occurring at times T n. Example: T n = time of n th trip end T n is a called a stationary point process associated to S t Stationary because S t is stationary Jointly stationary with S t Time 0 is the arbitrary point in time 20

21 21 Palm Expectation Assume: X t, S t are jointly stationary, T n is a stationary point process associated with S t Definition : the Palm Expectation is E t (X t ) = E (X t | a selected transition occurred at time t) By stationarity: E t (X t ) = E 0 (X 0 ) Example: T n = time of n th trip end, X t = instant speed at time t E t (X t ) = E 0 (X 0 ) = average speed observed at a waypoint

22 22 E ( X t ) = E (X 0 ) expresses the time average viewpoint. E t (X t ) = E 0 (X 0 ) expresses the event average viewpoint. Example for random waypoint: T n = time of n th trip end, X t = instant speed at time t E t (X t ) = E 0 (X 0 ) = average speed observed at trip end E ( X t )= E (X 0 ) = average speed observed at an arbitrary point in time XnXn X n+1

23 23 Formal Definition In discrete time, we have an elementary conditional probability In continuous time, the definition is a little more sophisticated uses Radon Nikodym derivative– see lecture note for details Also see [BaccelliBremaud87] for a formal treatment Palm probability is defined similarly

24 24 Ergodic Interpretation Assume simulation is stationary + ergodic, i.e. sample path averages converge to expectations; then we can estimate time and event averages by: In terms of probabilities:

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

26 26 Two Palm Calculus Formulae Intensity Formula: where by convention T 0 ≤ 0 < T 1 Inversion Formula The proofs are simple in discrete time – see lecture notes

27 27

28 3. Other Palm Calculus Formulae 28

29 29 Feller’s Paradox

30 30

31 Rate Conservation Law 31

32 32

33 33

34 Campbell’s Formula Shot noise model: customer n adds a load h(t-T n,Z n ) where Z n is some attribute and T n is arrival time Example: TCP flow: L = λV with L = bits per second, V = total bits per flow and λ= flows per sec 34 t Total load T1T1 T2T2 T3T3

35 Little’s Formula 35 t Total load T1T1 T2T2 T3T3

36 Two Event Clocks Two event clocks, A and B, intensities λ(A) and λ(B) We can measure the intensity of process B with A’s clock λ A (B) = number of B-points per tick of A clock Same as inversion formula but with A replacing the standard clock 36

37 Stop and Go 37 AAA BBB B

38 4. RWP and Freezing Simulations Modulator Model: 38

39 Is the previous simulation stationary ? Seems like a superfluous question, however there is a difference in viewpoint between the epoch n and time Let S n be the length of the n th epoch If there is a stationary regime, then by the inversion formula so the mean of S n must be finite This is in fact sufficient (and necessary) 39

40 40 Application to RWP

41 41 Time Average Speed, Averaged over n independent mobiles Blue line is one sample Red line is estimate of E(V(t))

42 42 A Random waypoint model that has no stationary regime ! Assume that at trip transitions, node speed is sampled uniformly on [v min,v max ] Take v min = 0 and v max > 0 Mean trip duration = (mean trip distance) Mean trip duration is infinite ! Was often used in practice Speed decay: “considered harmful” [YLN03]

43 What happens when the model does not have a stationary regime ? The simulation becomes old

44 Stationary Distribution of Speed (For model with stationary regime)

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

46 46 Removing Transient Matters A. In the mobile case, the nodes are more often towards the center, distance between nodes is shorter, performance is better The 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 case Finds that static is better Q. Find the bug !

47 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

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

49 49 5. PASTA There 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

50 50

51 51

52 Exercise 52

53 Exercise 53

54 6. Perfect Simulation An alternative to removing transients Possible when inversion formula is tractable Example : random waypoint Same applies to a large class of mobility models 54

55 55 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/s bounding area = 1km x 1km

56 56 Perfect simulation is highly desirable (2) Distribution of path: Time = 100s Time = 50s Time = 300s Time = 500s Time = 1000s Time = 2000s

57 Solution: Perfect Simulation Def: a simulation that starts with stationary distribution Usually difficult except for specific models Possible if we know the stationary distribution Sample Prev and Next waypoints from their joint stationary distribution Sample M uniformly on segment [Prev,Next] Sample speed V from stationary distribution

58 Stationary Distrib of Prev and Next

59 59 Stationary Distribution of Location Is also Obtained By Inversion Formula

60 60

61 No Speed Decay

62 62 Perfect Simulation Algorithm Sample a speed V(t) from the time stationary distribution How ? A: inversion of cdf Sample Prev(t), Next(t) How ? Sample M(t)

63 Questions Q1: A node receives messages from 2 sensors S1 and S2. Each of the sources sends messages independently of each other. The sequence of time intervals between messages sent by source S1 is iid, with a Gaussian distribution with mean m1 and variance v1 and similarly for S2. The node works as follows. It waits for the next message from S1. When it has received one message from S1, it waits for the next message from S2, and sends a message of its own. How much time does, in average, the node spends waiting for the second message after the first is received ? Q2: A sensor detects the occurrence of an event and sends a message when it occurs. However, the sensing system needs some relaxation time and cannot sense during T milliseconds after an event was sensed. There are l events per millisecond. Can you find the probability that an event is not sensed, as a function of T? 63

64 Questions Q3: Consider the random waypoint model, where the distribution of the speed drawn at a random waypoint has a density f(v) over the interval [0, vmax]. Is it possible to find f() such that (1) the model has a stationary regime and (2) the time stationary distribution of speed is uniform over [0, vmax] ? Q4: A distributed protocol establishes consensus by periodically having one host send a message to n other hosts and wait for an acknowledgement. Assume the times to send and receive an acknowledgement are iid, with distribution F(t). What is the number of consensus per time unit achieved by the protocol ? Give an approximation when the distribution is Pareto, using the fact that the mean of the kth order statistic in a sample of n is approximated by F −1 ( k/ n+1). Q5: We measure the distribution of flows transferred from a web server. We find that the distribution of the size in packets of an arbitrary flow is Pareto. What is the probability that, for an arbitrary packet, it belongs to a flow of length x ? Q6: A node receives messages from 2 sensors S1 and S2. Each of the sources sends messages independently of each other. The sequence of time intervals between messages sent by source S1 is iid, with a Gaussian distribution with mean m 1 and variance s 1 2 and similarly for S2. The node works as follows. It waits for the next message from S1. When it has received one message from S1, it waits for the next message from S2, and sends a message of its own. How do you implement a simulator for this system ? How much time does, in average, the node spends waiting for the second message after the first is received ? 64

65 Conclusions A metric should specify the sampling method Different sampling methods may give very different values Palm calculus contains a few important formulas Which ones ? Freezing simulations are a pattern to be aware of


Download ppt "Palm Calculus Made Easy The Importance of the Viewpoint JY Le Boudec 1."

Similar presentations


Ads by Google