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
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
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
Stochastic Process Algebra
PEPA syntax:
P ::= (a, λ).P P + P P ��L
P P/L A
JTB [18/07/2005] – p. 4/21
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
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
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
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
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
PEPA: Example
Sysdef= (AA ��
{run}A1) ��
{alert}(BB ��
{run}B1)
JTB [18/07/2005] – p. 5/21
PEPA: Example
Sysdef= (AA ��
{run}A1) ��
{alert}(BB ��
{run}B1)
AAdef= (run,⊤).(alert, r5 ).AA
JTB [18/07/2005] – p. 5/21
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
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
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
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
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
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
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
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
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
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
Rate Equation Translation
Action: delay
JTB [18/07/2005] – p. 9/21
Rate Equation Translation
Action: delay
Client1
n(Client1)µ
−−−−−−−→ Client
JTB [18/07/2005] – p. 9/21
Rate Equation Translation
Action: delay
Client1
n(Client1)µ
−−−−−−−→ Client
Action: recover
Server1
n(Server1)ν
−−−−−−−→ Server
JTB [18/07/2005] – p. 9/21
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
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
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
Dizzy setup
JTB [18/07/2005] – p. 11/21
Dizzy simulation
JTB [18/07/2005] – p. 12/21
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
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
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
High-level voter description
Voter0def= (choose, c1) . . . (sendV ,⊤).Voter1
JTB [18/07/2005] – p. 16/21
High-level voter description
Voter0def= (choose, c1) . . . (sendV ,⊤).Voter1
Voter1def= (unblind ,u1) . . . (sendC , s6).Voter2
JTB [18/07/2005] – p. 16/21
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
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
High-level Election description
Election_Preparation
def= (sendV ,⊤).Election_Preparation + · · ·
+ (publishA, er).Election_Voting
JTB [18/07/2005] – p. 18/21
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
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
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
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
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