performance analysis of stochastic process algebra · pdf fileperformance analysis of...

42
Performance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel Thomas Email: [email protected] [email protected] [email protected] Department of Computing, Imperial College London LFCS, University of Edinburgh School of Computing Science, Univerity of Newcastle Produced with prosper and L A T E X JTB [18/07/2005] – p. 1/21

Upload: dohanh

Post on 04-Mar-2018

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Performance analysis of StochasticProcess Algebra models using

Stochastic Simulation

Jeremy Bradley Stephen Gilmore Nigel Thomas

Email: [email protected] [email protected] [email protected]

Department of Computing,

Imperial College London

LFCS,

University of Edinburgh

School of Computing Science,

Univerity of Newcastle

Produced with prosper and LATEX

JTB [18/07/2005] – p. 1/21

Page 2: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

The story used to be...

- -��

��1

PP

PPq

PEPAipc

HYDRA

hydra Passage-time PDF

Passage-time CDF

Transient

For state spaces of less than O(109)

Very precise probabilistic results

JTB [18/07/2005] – p. 2/21

Page 3: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Now the story is...

- ��

��1

PP

PPq

PEPAipc/pwb

Rate equations

Dizzy Stochastic simulation

Numerical ODE solution

For very large state spaces, e.g. 101000+ states

Aggregate deterministic results

JTB [18/07/2005] – p. 3/21

Page 4: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

JTB [18/07/2005] – p. 4/21

Page 5: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

Action prefix: (a, λ).P

JTB [18/07/2005] – p. 4/21

Page 6: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

Action prefix: (a, λ).P

Competitive choice: P1 + P2

JTB [18/07/2005] – p. 4/21

Page 7: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

Action prefix: (a, λ).P

Competitive choice: P1 + P2

Cooperation: P1 ��L

P2

JTB [18/07/2005] – p. 4/21

Page 8: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

Action prefix: (a, λ).P

Competitive choice: P1 + P2

Cooperation: P1 ��L

P2

Action hiding: P/L

JTB [18/07/2005] – p. 4/21

Page 9: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Stochastic Process Algebra

PEPA syntax:

P ::= (a, λ).P P + P P ��L

P P/L A

Action prefix: (a, λ).P

Competitive choice: P1 + P2

Cooperation: P1 ��L

P2

Action hiding: P/L

Constant label: A

JTB [18/07/2005] – p. 4/21

Page 10: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

PEPA: Example

Sysdef= (AA ��

{run}A1) ��

{alert}(BB ��

{run}B1)

JTB [18/07/2005] – p. 5/21

Page 11: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

PEPA: Example

Sysdef= (AA ��

{run}A1) ��

{alert}(BB ��

{run}B1)

AAdef= (run,⊤).(alert, r5 ).AA

JTB [18/07/2005] – p. 5/21

Page 12: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

PEPA: Example

Sysdef= (AA ��

{run}A1) ��

{alert}(BB ��

{run}B1)

AAdef= (run,⊤).(alert, r5 ).AA

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

JTB [18/07/2005] – p. 5/21

Page 13: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

PEPA: Example

Sysdef= (AA ��

{run}A1) ��

{alert}(BB ��

{run}B1)

AAdef= (run,⊤).(alert, r5 ).AA

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

BBdef= (run,⊤).(alert, r5 ).BB

JTB [18/07/2005] – p. 5/21

Page 14: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

PEPA: Example

Sysdef= (AA ��

{run}A1) ��

{alert}(BB ��

{run}B1)

AAdef= (run,⊤).(alert, r5 ).AA

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

BBdef= (run,⊤).(alert, r5 ).BB

B1def= (start, r1 ).B2 + (pause, r2 ).B1

B2def= (run, r3 ).B1

JTB [18/07/2005] – p. 5/21

Page 15: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Types of Analysis

Steady-state and transient analysis in PEPA:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 5 10 15 20 25 30

Pro

babi

lity

Time, t

Steady state: X_1

JTB [18/07/2005] – p. 6/21

Page 16: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Types of Analysis

Steady-state and transient analysis in PEPA:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 5 10 15 20 25 30

Pro

babi

lity

Time, t

PEPA model: transient X_1 -> X_1Steady state: X_1

JTB [18/07/2005] – p. 6/21

Page 17: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Types of Analysis

Steady-state and transient analysis in PEPA:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 5 10 15 20 25 30

Pro

babi

lity

Time, t

PEPA model: transient X_1 -> X_1Steady state: X_1

JTB [18/07/2005] – p. 6/21

Page 18: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Types of Analysis

Steady-state and transient analysis in PEPA:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 5 10 15 20 25 30

Pro

babi

lity

Time, t

PEPA model: transient X_1 -> X_1Steady state: X_1

JTB [18/07/2005] – p. 6/21

Page 19: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Types of Analysis

Steady-state and transient analysis in PEPA:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 5 10 15 20 25 30

Pro

babi

lity

Time, t

PEPA model: transient X_1 -> X_1Steady state: X_1

JTB [18/07/2005] – p. 6/21

Page 20: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Passage-time Quantiles

Extract a passage-time density from a PEPA model:

A1def= (start, r1 ).A2 + (pause, r2 ).A3

A2def= (run, r3 ).A1 + (fail, r4 ).A3

A3def= (recover, r1 ).A1

AAdef= (run,⊤).(alert, r5 ).AA

Sysdef= AA ��

{run}A1

JTB [18/07/2005] – p. 7/21

Page 21: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Example of aggregate states

Clientdef= (compute,⊤).Client1

Client1

def= (delay , µ).Client

Serverdef= (compute, λ).Server1

Server1

def= (recover , ν).Server

Sys = (Client ‖ · · · ‖ Client︸ ︷︷ ︸

N

) ��{compute}

(Server ‖ · · · ‖ Server︸ ︷︷ ︸

M

)

Cooperating clusters can be represented as tuples

JTB [18/07/2005] – p. 8/21

Page 22: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Rate Equation Translation

Action: delay

JTB [18/07/2005] – p. 9/21

Page 23: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Rate Equation Translation

Action: delay

Client1

n(Client1)µ

−−−−−−−→ Client

JTB [18/07/2005] – p. 9/21

Page 24: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Rate Equation Translation

Action: delay

Client1

n(Client1)µ

−−−−−−−→ Client

Action: recover

Server1

n(Server1)ν

−−−−−−−→ Server

JTB [18/07/2005] – p. 9/21

Page 25: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Rate Equation Translation

Action: delay

Client1

n(Client1)µ

−−−−−−−→ Client

Action: recover

Server1

n(Server1)ν

−−−−−−−→ Server

Action: compute

Client + Serverθ(n(Client))n(Server)λ

−−−−−−−→ Client1 + Server1

where θ(x) = 1 if x > 0, else 0.

JTB [18/07/2005] – p. 9/21

Page 26: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Why the θ function?

There are N client cpts enabling a compute action

There are M server cpts enabling a compute action

Overall compute rate is:

rcompute(Sys) = min(N⊤,Mλ)

JTB [18/07/2005] – p. 10/21

Page 27: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Why the θ function?

There are N client cpts enabling a compute action

There are M server cpts enabling a compute action

Overall compute rate is:

rcompute(Sys) = min(N⊤,Mλ)

If N = 0 then overall rate is 0, hence:

rcompute(Sys) = θ(N) Mλ

JTB [18/07/2005] – p. 10/21

Page 28: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Dizzy setup

JTB [18/07/2005] – p. 11/21

Page 29: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Dizzy simulation

JTB [18/07/2005] – p. 12/21

Page 30: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Voter example

Election_Preparation ��L

Electoral_Personae

Electoral_Personaedef= Voter0[N ] ��

MElectoral_App

Electoral_Appdef= Collector_0[N ] ‖ Counter_1[N ]

‖ Administrator [N ]

JTB [18/07/2005] – p. 13/21

Page 31: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Early voter description

Voter0def= (choose, c1).Voter0_1

Voter0_1def= (bitcommit , b1).Voter0_2

Voter0_2def= (blind1, b2).Voter0_3

Voter0_3def= (blind2, b3).Voter0_4

Voter0_4def= (voter_sign, s1).Voter0_5

Voter0_5def= (sendA, s2).Voter0_5b

Voter0_5bdef= (sendV ,⊤).Voter1

Voter1def= (unblind1, u1).Voter1_1

JTB [18/07/2005] – p. 14/21

Page 32: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Voter: early stage

0

2000

4000

6000

8000

10000

0 5 10 15 20 25 30

Num

ber

Time, t

Number of Voter components in derivative states

Voter0Voter0_4

Voter0_5bVoter1

JTB [18/07/2005] – p. 15/21

Page 33: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level voter description

Voter0def= (choose, c1) . . . (sendV ,⊤).Voter1

JTB [18/07/2005] – p. 16/21

Page 34: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level voter description

Voter0def= (choose, c1) . . . (sendV ,⊤).Voter1

Voter1def= (unblind ,u1) . . . (sendC , s6).Voter2

JTB [18/07/2005] – p. 16/21

Page 35: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level voter description

Voter0def= (choose, c1) . . . (sendV ,⊤).Voter1

Voter1def= (unblind ,u1) . . . (sendC , s6).Voter2

Voter2def= (check , p × c4) . . . (sendCo, s7).Voter_Finished

JTB [18/07/2005] – p. 16/21

Page 36: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Voter: lifecycle

0

2000

4000

6000

8000

10000

12000

0 10 20 30 40 50 60

Num

ber

Time, t

Number of Voter components in derivative states

Voter0Voter1Voter2

Voter_Finished

JTB [18/07/2005] – p. 17/21

Page 37: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level Election description

Election_Preparation

def= (sendV ,⊤).Election_Preparation + · · ·

+ (publishA, er).Election_Voting

JTB [18/07/2005] – p. 18/21

Page 38: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level Election description

Election_Preparation

def= (sendV ,⊤).Election_Preparation + · · ·

+ (publishA, er).Election_Voting

Election_Voting

def= (sendC ,⊤).Election_Voting + · · ·

+ (publishC , er).Election_Counting

JTB [18/07/2005] – p. 18/21

Page 39: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

High-level Election description

Election_Preparation

def= (sendV ,⊤).Election_Preparation + · · ·

+ (publishA, er).Election_Voting

Election_Voting

def= (sendC ,⊤).Election_Voting + · · ·

+ (publishC , er).Election_Counting

Election_Counting

def= (sendCo,⊤).Election_Counting + · · ·

+ (final_publish, er).Election_Finished

JTB [18/07/2005] – p. 18/21

Page 40: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Election: population of 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

0 5 10 15 20 25 30

Num

ber

Time, t

Election component in derivative states

Election_PreparationElection_Voting

Election_CountingElection_Finished

JTB [18/07/2005] – p. 19/21

Page 41: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Election + Voter: interaction

0

2000

4000

6000

8000

10000

0 10 20 30 40 50 60

Num

ber

Time, t

Number of Voter derivatives against Election state

Election_PreparationElection_Voting

Election_CountingElection_Finished

Voter0Voter1Voter2

Voter_Finished

JTB [18/07/2005] – p. 20/21

Page 42: Performance analysis of Stochastic Process Algebra · PDF filePerformance analysis of Stochastic Process Algebra models using Stochastic Simulation Jeremy Bradley Stephen Gilmore Nigel

Conlcusion

Novel simulation techniques based on chemical rateequations

Orders of magnitude larger state spaces can beanalysed

Complexity of simulation method (Gibson-Bruck) isO(log n) where n is number of rate equations

JTB [18/07/2005] – p. 21/21