You are on page 1of 201

ECE 590

Spring 2017

Prof. Kishor S. Trivedi


Duke High Availability Assurance Lab (DHAAL)
Department of Electrical and Computer Engineering
Duke University, Durham, NC 27708-0291
E-mail: ktrivedi@duke.edu URL: www.ee.duke.edu/~ktrivedi

Copyright © 2017 by K.S. Trivedi 1


Petri Nets and
Stochastic Petri Nets

Copyright © 2017 by K.S. Trivedi 2


Outline

• Traditional approach: (continuous-time) Markov


chains
• Introduction to stochastic Petri nets (SPN)
• Example of Wireless cellular system
• Example of a Multiprocessor System
• SPNP: A Software Package
• Recent research on SPN

Copyright © 2017 by K.S. Trivedi 3


Traditional Approach
Study the system

Network Element: Router, Switch, etc.


Packet, Cell, etc.

Buffer

Copyright © 2017 by K.S. Trivedi 4


Traditional Approach

Step 1: Abstract the system

n m
l

M/D/1/n

Copyright © 2017 by K.S. Trivedi 5


Traditional Approach
Step 2: Construct Markov chain (CTMC)
(2-dimensional)

Note: m-stage
Erlang (Em) is used
to approximate
deterministic service
time (D).
Copyright © 2017 by K.S. Trivedi 6
Traditional Approach
Step 3-a: Build system of linear equations
(Steady-state solution)
pQ = 0
p1 = 1
where 1 = [1,1, .., 1] T

p: steady-state probability (row) vector


Q: infinitesimal generator matrix

Copyright © 2017 by K.S. Trivedi 7


Traditional Approach

Step 3-b: Or, build a system of linear, first-order,


ordinary differential equations
(transient solution)

dp(t)/dt = p (t) Q (given p (0) )


p(t): state probability (row) vector;
Q: infinitesimal generator matrix

Copyright © 2017 by K.S. Trivedi 8


Traditional Approach
Step 4a: If possible, find a closed form solution to the
equation [fully symbolic by hand or using Mathematica
or Matlab; semi-symbolic using SHARPE]
Step 4b: else numerically solve the equations
Step 5: Calculate measures of interest

Steps 1-3 , 4a and 5 are commonly handled


manually.
This is a rather tedious and error-prone
procedure, especially when the number of
states becomes very large.
Copyright © 2017 by K.S. Trivedi 9
Can we find a new approach to let
computer do the tedious work?

Copyright © 2017 by K.S. Trivedi 10


Stochastic Petri Net (SPN)
Petri Nets (PN) originated from the Phd thesis of
Carl Adam Petri in 1962.

Introduced in 1980s by Natkin, Florin, Molloy,


Ajmone Marsan, Balbo, Conte, Bobbio, Trivedi,
& others

A modeling formalism for the automated


generation and solution of Markovian stochastic
systems.
Copyright © 2017 by K.S. Trivedi 11
Petri Nets
Petri Net (PN) is a graphical paradigm for the formal
description of the logical interactions among parts or
of the flow of activities in complex systems.
PN are particularly suited to model:
 Concurrency and Conflict;
 Sequencing, conditional branching and looping
 Synchronization;
 Sharing of limited resources and
Mutual exclusion.
Copyright © 2017 by K.S. Trivedi 12
Petri Nets
Petri Nets (PN) originated from the PhD thesis of Carl
Adam Petri in 1962.
A web service on PN is managed by the University of
Aarhus in Denmark, where a bibliography with more
that 7,800 items can be found.
http://www.informatik.uni-hamburg.de/TGI/PetriNets/
There are two regular International Conferences on PN:
ATPN - Application and Theory of PN
PNPM – PN and Performance Models (now merged with
QEST)
Copyright © 2017 by K.S. Trivedi 13
Petri Nets
The original PN did not have the notion of time.
For performance and availability analysis it is
necessary to introduce duration of events associated
with PN transitions.

For this reason, PN were subsequently extended to


timed events following two main lines:
 Random durations : Stochastic PN (SPN)
 Deterministic or interval: Timed PN (TPN)

Copyright © 2017 by K.S. Trivedi 14


Introduction to
Petri Nets
&
Stochastic Petri Nets

Copyright © 2017 by K.S. Trivedi 15


Definitions
• A Petri net (PN) is a bipartite directed graph consisting of
two kinds of nodes: places and transitions

– Places typically represent conditions within the system


being modeled

– Transitions represent events occurring in the system


that may cause change in the condition of the system

– Arcs connect places to transitions and transitions to


places . But never an arc from a place to a place or
from a transition to a transition

Copyright © 2017 by K.S. Trivedi 16


Definition of PN

A PN is a 5-tuple (P,T,I,O,M)

P set of places
T set of transitions
I input arcs
O output arcs
M initial marking

Copyright © 2017 by K.S. Trivedi 17


Basic Components of PN

input place transition output place

token

input arc output arc

Copyright © 2017 by K.S. Trivedi 18


PN Definitions

• Input arcs are directed arcs drawn from places


to transitions, representing the conditions that
need to be satisfied for the event to be
activated

• Output arcs are directed arcs drawn from


transitions to places, representing the
conditions resulting from the occurrence of the
event
Copyright © 2017 by K.S. Trivedi 19
PN Definitions

• Input places of a transition are the set of places that


are connected to the transition through input arcs

• Output places of a transition are the set of places to


which output arcs exist from the transition

Copyright © 2017 by K.S. Trivedi 20


PN Definitions

• Tokens are dots (or integers) associated with places; A


place containing tokens indicates that the
corresponding condition holds
n
• Marking of a Petri net is a vector listing the number of
tokens in each place of the net

M = (n1 n2 … nP), P = # of Places

Copyright © 2017 by K.S. Trivedi 21


PN Definitions
• When input places of a transition have the required
number of tokens, the transition is enabled.

• An enabled transition may fire (event occurs) taking


a specified number of tokens from each input place
and depositing a specified number of tokens in each
of its output place.

Copyright © 2017 by K.S. Trivedi 22


Example of a PN

t1

p1 p2

p1 – resource idle
p2 – resource busy t2
t1 – task arrives
t2 – task completes

Copyright © 2017 by K.S. Trivedi 23


Example of a PN
p3 t1

p1 p2

t2
p1 – resource idle
p2 – resource busy p3 – user
t1 – task arrives
t2 – task completes
Copyright © 2017 by K.S. Trivedi 24
The firing rules of a PN
m  t k  m'

Copyright © 2017 by K.S. Trivedi 25


Enabling & Firing of Transitions
up up up
“t_fail” fires “t_fail” fires

t_repair t_fail t_repair t_fail t_repair t_fail

“t_repair” fires “t_repair” fires


down down down
A 2-processor failure/repair model

Copyright © 2017 by K.S. Trivedi 26


Reachability Analysis

t_fail t_fail

2,0 1,1 0,2

t_repair t_repair

Reachability graph (RG)

Copyright © 2017 by K.S. Trivedi 27


Concurrency (or Parallelism)

Copyright © 2017 by K.S. Trivedi 28


Example of PN

Copyright © 2017 by K.S. Trivedi 29


Synchronization

Copyright © 2017 by K.S. Trivedi 30


Limited Resources

Copyright © 2017 by K.S. Trivedi 31


Producer/consumer

Copyright © 2017 by K.S. Trivedi 32


Producer/consumer with buffer

Copyright © 2017 by K.S. Trivedi 33


Mutual exclusion

Copyright © 2017 by K.S. Trivedi 34


Reachability Analysis
• A marking is reachable from another marking if there
exists a sequence of transition firings starting from the
original marking that result in the new marking

• The reachability set of a PN is the set of all markings


that are reachable from its initial marking

Copyright © 2017 by K.S. Trivedi 35


Reachability Analysis
• A reachability graph is a directed graph whose
nodes are the markings in the reachability set, with
directed arcs between the markings representing
the marking-to-marking transitions

• The directed arcs are labeled with the


corresponding transition whose firing results in a
change of the marking from the original marking to
the new marking

Copyright © 2017 by K.S. Trivedi 36


Generation of the reachability graph

Copyright © 2017 by K.S. Trivedi 37


Generation of the
reachability graph

Copyright © 2017 by K.S. Trivedi 38


Generation of the reachability graph
By properly identifying the frontier nodes, the generation
of the reachability graph involves a finite number of
steps, even if the PN is unbounded.

Three type of frontier nodes:


 terminal (dead) nodes: no transition is enabled;
 duplicate nodes: already generated;
 infinitely reproducible nodes.

Copyright © 2017 by K.S. Trivedi 39


Extensions of PN models

 arc multiplicity
 inhibitor arcs
 priority levels
 enabling functions (guards)
 high level PN

Copyright © 2017 by K.S. Trivedi 40


Petri Net: Arc Multiplicity
• An arc cardinality (or multiplicity) may be associated with
input and output arcs, whereby the enabling and firing
rules are changed as follows:
– Each input place must contain at least as many tokens as the
cardinality of the corresponding input arc.

m k

– When the transition fires, it removes as many tokens from each


input place as the cardinality of the corresponding input arc, and
deposits as many tokens in each output places as the cardinality
of the corresponding output arc.

Copyright © 2017 by K.S. Trivedi 41


Petri Net : Inhibitor Arc
pi

tk

pj

Inhibitor arcs are represented with a circle-headed arc.

The transition can fire iff the inhibitor place does not
contain any tokens.
Copyright © 2017 by K.S. Trivedi 42
Petri Net : Inhibitor Arc

Copyright © 2017 by K.S. Trivedi 43


Petri Net : Multiple Inhibitor Arc
A multiple inhibitor arc drawn from a place to a
transition means that the transition cannot fire if the
corresponding inhibitor place contains at least as many
tokens as the cardinality of the corresponding inhibitor
arc n
m k

Inhibitor arcs are represented graphically as an arc


ending in a small circle at the transition instead of an
arrowhead

Copyright © 2017 by K.S. Trivedi 44


An Example: Before

or cardinality of an output arc

Copyright © 2017 by K.S. Trivedi 45


An Example: After

or cardinality of the output arc

Copyright © 2017 by K.S. Trivedi 46


Priority levels

A priority level can be attached to each PN transition.

The standard execution rules are modified in the sense


that, among all the transitions enabled in a given
marking, only those with associated highest priority
level are allowed to fire.

Copyright © 2017 by K.S. Trivedi 47


Enabling Functions
An enabling function (or guard) is a Boolean expression
composed from the PN primitives (places, trans, tokens).

The enabling rule is modified so that besides the standard


conditions, the enabling function must also evaluate to be
true.
pi
tk

e(tk) = #p1<2 & #p2=0


pj
Copyright © 2017 by K.S. Trivedi 48
High Level (colored) Petri Nets
In standard PN tokens are indistinguishable entities.
The semantics of the model does not allow to follow
the behavior of an individual token through the PN.

High Level PN overcome this limitation by assigning to


each individual token an attribute (color).
Places, arcs and transitions can have functions and
guards depending on the colors.

Copyright © 2017 by K.S. Trivedi 49


Colored Petri Nets
In standard PN tokens are indistinguishable entities.
The semantics of the model does not allow to follow
the behavior of an individual token through the PN.

High Level PN overcome this limitation by assigning to


each individual token an attribute (color).
Places, arcs and transition can have functions
depending on the colors.

Copyright © 2017 by K.S. Trivedi 50


Colored Petri Nets
t <x> p

xC <x> xC

C is a set of colors of cardinality |C| and x is an element


of the set.
Place p can contain tokens of any color x  C;
Transition t can fires tokens of any color x  C.
Copyright © 2017 by K.S. Trivedi 51
Stochastic Petri Nets (SPN)

• Petri nets are extended by associating time with the


firing of transitions, resulting in timed Petri nets.

• A special case of timed Petri nets is stochastic


Petri net (SPN) where the firing times are
considered to be random variables with exponential
distributions.

Copyright © 2017 by K.S. Trivedi 52


Stochastic Petri Nets (SPN)

The marking process is mapped into a


continuous time Markov chain (CTMC)

The state space of the CTMC is isomorphic


to the reachability graph of the PN.

Copyright © 2017 by K.S. Trivedi 53


SPN: A Simple Example
Server Failure/Repair
t1
λ t1 λ

.
p1 p2 p1
. p2

t2 m t2 m

Reachability CTMC
graph t1 λ
10 01 10 01

t2 m 54
Copyright © 2017 by K.S. Trivedi
From SPN to CTMC
A Simple Example

Copyright © 2017 by K.S. Trivedi 55


From SPN to CTMC
Mutual Exclusion Ex

Copyright © 2017 by K.S. Trivedi 56


A system with 10 components

The reachability graph has 2 n = 1024 states !

Copyright © 2017 by K.S. Trivedi 57


SPN: Poisson Process

λ
PP with rate λ

λ
SPN model

RG = CTMC λ λ λ
0 1 2 .......

Copyright © 2017 by K.S. Trivedi 58


SPN: M/M/1 Queue
m
M/M/1 λ

λ m
SPN model

RG = CTMC λ λ λ
0 1 2 .......
m m m
Copyright © 2017 by K.S. Trivedi 59
SPN: M/M/1/n Queue (1)
m
M/M/1/n λ
n

n
SPN model

λ m
RG = CTMCλ λ λ
0 1 2 ....... n
m m m
Copyright © 2017 by K.S. Trivedi 60
SPN: M/M/1/n Queue (2)
m
M/M/1/n λ
n
λ m
SPN model
n

RG = CTMC
λ λ λ
0 1 2 ....... n
m m m
Copyright © 2017 by K.S. Trivedi 61
61
Marking dependent firing rate
• A firing rate is associated with each
transition.
• Firing rate of a transition may be marking
dependent.

T
n # Actual firing rate
l of T = nl

Copyright © 2017 by K.S. Trivedi 62


SPN: M/M/n/n Queue
m
M/M/n/n λ
m
n
m
n
SPN model
#
λ m

The use of marking-dependent firing rate


Copyright © 2017 by K.S. Trivedi 63
Server Types
m
λ

λ m

Single server M/M/1

Copyright © 2017 by K.S. Trivedi 64


Server Types

Next consider:
Multiple server M/M/n
Infinite server M/M/

Copyright © 2017 by K.S. Trivedi 65


Marking dependent firing rate
• We have 3 typical situations

T
• Single server n Rate of T = µ
µ
rateval
T
• Multiple server n Rate of T  m µ
m µ
T ratefun
• Infinite server n
# Rate of T = n µ
µ
Copyright © 2017 by K.S. Trivedi
ratedep 66
SPN Availability Model
up

#
m λ

down

A 2-processor failure/repair model


Generate RG and hence CTMC

Copyright © 2017 by K.S. Trivedi 67


3 Equivalent SPN Reliability Models

up up up

2
# # #
m λ m λ m λ
e(m): #up>=1
2

down down down


A 2-processor failure/repair model
Copyright © 2017 by K.S. Trivedi 68
Mutual exclusion

Copyright © 2017 by K.S. Trivedi 69


Marking dependent firing rate
The mutual exclusion SPN can be folded

l(t1) = #p1 * l

Copyright © 2017 by K.S. Trivedi 70


Generalized SPN
• Sometimes when some events take extremely
small time to occur, it is useful to model them
as instantaneous activities

• SPN models were, hence, extended by


allowing some transitions, called immediate
transitions, to have zero firing times

• The remaining transitions, called timed


transitions, have exponentially distributed
firing times
Copyright © 2017 by K.S. Trivedi 71
Generalized SPN
• The enabling rules are now modified: if both an
immediate and a timed transition are enabled in a
marking, immediate transition has higher priority.
T
Immediate transition t is
enabled
t
• If more than one immediate transition is enabled in a
marking, then the conflict is resolved by assigning firing
probabilities to the immediate transitions.
p1
t1
Transition t1 & t2 will fire
p2 t2 with p1 and p2.

Copyright © 2017 by K.S. Trivedi 72


GSPN Properties
Markings (states) enabling immediate transitions are
passed through in 0 time and hence called vanishing.

Markings (states) enabling timed transitions only, are


called tangible.

Since the process spends zero time in vanishing


markings they do not contribute to the timing behavior
of the system and can be removed.

Copyright © 2017 by K.S. Trivedi 73


GSPN Properties
The resulting reachability graph, referred to as the
Extended Reachability Graph (ERG), contains
vanishing marking, and is not a CTMC or a
DTMC!
ERG can be treated as an SMP and solved as such
(spnp calls this Preservation)

Or can eliminate the vanishing markings to obtain


the CTMC (spnp calls this Elimination).
Copyright © 2017 by K.S. Trivedi 74
No vanishing markings
Situation 1
Only timed transitions are enabled (competition leads to min{})

Copyright © 2017 by K.S. Trivedi 75


Preservation of vanishing markings?
Situation 2
One immediate and several timed transitions are enabled.

ERG CTMC

t2

Copyright © 2017 by K.S. Trivedi 76


Elimination of vanishing markings
Situation 2
One immediate and several timed transitions are enabled.

ERG CTMC

t2

Copyright © 2017 by K.S. Trivedi 77


Elimination of vanishing markings
Situation 3
Several immediate transitions are enabled.

ERG CTMC

u 1-u

Copyright © 2017 by K.S. Trivedi 78


Elimination of vanishing markings

Copyright © 2017 by K.S. Trivedi 79


SPN: M/M/m/n+m Queue (1)

m
m(t3) = #P4 m

n m
l(t1) = l

t1  arrival
t3  service
Copyright © 2017 by K.S. Trivedi 80
immediate trans.
GSPN Example: M/M/i/n Queue

Pserver
i
n-i
Tservice
Tarrival tquick

#
λ Pqueue Pservice m

We assume that n > i

Copyright © 2017 by K.S. Trivedi 81


ERG for M/M/i/n Queue
i=0:
l l l l
0,0,0 1,0,0 2,0,0 ....... n,0,0

i>0
(ERG):Tarrival tquick Tarrival tquick
0,0,i 1,0,i 0,1,i-1 ... 1,i-1,1 0,i,0
Tservice Tservice tquick
Tarrival
n-i,i,0 n-i,i-1,1 ....... 1,i,0 1,i-1,1
Tservice tquick tquick
Tservice
i>0
(CTMC):l l l l l l
0,0,i 0,1,i-1 ... 0,i,0 1,i,0 ... n-i,i,0
m 2m im im im im
Copyright © 2017 by K.S. Trivedi 82
Measures of Reliability &
Performance
Solving the model means computing the (steady
state/transient/cumulative transient) vector over the state
space (markings). The vector size being equal to the
number of (tangible) markings.

However, the modeler wants to interact only at the SPN


level: the numerical procedure must be completely
transparent to the modeler.

There is a need to define the output measures at the SPN


level, in terms of the PN primitives.
Copyright © 2017 by K.S. Trivedi 83
Measures of Reliability &
Performance
Output measures commonly defined at the SPN level.

 pmf of number of tokens in a place;


 Expected number of firings of a PN trans
(throughput).
All these measures can be reformulated in terms of
reward functions (so that the underlying model is an
MRM)

Copyright © 2017 by K.S. Trivedi 84


Solving models with (G)SPN
The use of SPN requires only the topology of the PN,
the firing rates (or of the CDF in the general case) of the
transitions and the specification of the output measures.
All the subsequent steps, which consist of:
 generation of the (extended) reachability graph
 generation of the associated Markov chain (or SMP);
 steady-state, transient or cumulative transient solution
of the Markov chain (or SMP);
 computation of the relevant measures.
are completely automated by a computer program, thus
making the associated numerical mathematics
transparent to the user.
Copyright © 2017 by K.S. Trivedi 85
Example:
Multiprocessor with failure
• Number of processors: n
• Single repair facility is shared by all
processors
• A reconfiguration is needed after a covered
fault
• A reboot is required after an not-covered
fault
Copyright © 2017 by K.S. Trivedi 86

Assumptions
• The failure rate of each processor is 
• The repair times are exponentially
distributed with mean 1/
• A processor fault is covered with
probability c
• The reconfiguration times and the reboot
times are exponentially distributed with
mean 1/ and 1/, respectively

Copyright © 2017 by K.S. Trivedi 87


Multiprocessor Availability
Model
(n  1) c

n c Dn  Dn-1  
n  n-1  n-2 ............... 1

0
 
n (1  c) Bn Bn-1
(n  1) (1  c)

1,2,…,n are up states; all others are down states


Copyright © 2017 by K.S. Trivedi 88
Multiprocessor Availability
Model (Contd.)
• Compute the steady state probability pj
for each state j
• System unavailability =
n n
1   j 1p j  p 0   p D j   p B j
n

j 2 j 2

• Downtime = 8760*60* unavailability


Copyright © 2017 by K.S. Trivedi 89
Downtime vs. no. of Processors with
Mean Delay 1/ as parameter.

Copyright © 2017 by K.S. Trivedi 90


Downtime vs. no. of Processors with coverage c as parameter.

Copyright © 2017 by K.S. Trivedi 91


GSPN Multiprocessor Availability Model

Copyright © 2017 by K.S. Trivedi 92


ERG for Multiprocessor Model (n=2)
Tfail tcov
2,0,0,0,0 1,1,0,0,0 1,0,1,0,0 Trep 0,0,0,0,2
Tuncov Treboot tquick
Trecon
1,0,0,1,0 1,0,0,0,1 0,1,0,0,1
Trep Tfail

Extended Reachability Graph for Multiprocessor model


2c
2,0,0,0,0 1,0,1,0,0
2(1-c)   
1,0,0,1,0  1,0,0,0,1 0,0,0,0,2

Reduced ERG for Multiprocessor model
Copyright © 2017 by K.S. Trivedi 93
How do we get output measures

• GSPN does not provide reward feature


• So how do we get the steady state
availability from the GSPN
multiprocessor model? (none of the
GSPN out measure primitive can be
used here)

Copyright © 2017 by K.S. Trivedi 94


Stochastic Reward Net (SRN)
• Introduced by Ciardo, Muppala and Trivedi
[1989]
• Structural characteristics
– Extensive Marking dependency allowed for firing rates
and firing probabilities
– Transition Priorities
– Guards (Enabling functions) for Transitions
– Variable cardinality arcs

Copyright © 2017 by K.S. Trivedi 95


Stochastic Reward Net (SRN)

• Stochastic characteristics
– Allow definition of reward rates in terms of net level entities
– Automatically generate the reward rates for the markings
– Enables computation of required measures of interest

Copyright © 2017 by K.S. Trivedi 96


Example: Reward Rates for
Multiprocessor Availability
• Reward rate at the net level for (steady –
state/transient/interval) availability
1, # Pup  1 and (# Pcov  # Pun cov )  0
ri  
0, otherwise
• Reward rate at the CTMC level for (steady-
state/transient/interval) availability (n=2)
1, i  (2,0,0,0,0), (1,0,0,0,1)
ri  
0, otherwise
Copyright © 2017 by K.S. Trivedi 97
Example: Reward Rates for
Multiprocessor Availability (contd.)
• Reward rate at the net level for unavailability
0, # Pup  1 and (# Pcov  # Pun cov )  0
ri  
1, otherwise
• Reward rate at the net level for downtime (in minutes/year)
0, # Pup  1 and (# Pcov  # Pun cov )  0
ri  
8760  60, otherwise
• Reward rate at the net level for capacity-oriented availability
# Pup , # Pup  1 and (# Pcov  # Pun cov )  0
ri  
0, otherwise

• Reward rates for Performability?


Copyright © 2017 by K.S. Trivedi 98
Analysis Procedure of SRN

Stochastic Reward Nets


Reachability Analysis

Extended Reachability Graphs

Eliminates vanishing markings

Markov Reward Model


Solve MRM (transient or steady-state)

Measures of Interest
Copyright © 2017 by K.S. Trivedi 99
SRN Summary
Place

Timed Transition

Immediate Transition

Input Arc with Multiplicity

An SRN Output Arc with Multiplicity

Inhibit Arc

Copyright © 2017 by K.S. Trivedi 100


SRN Notation Summary

guard(“t3”, g_t3); t3(g_t3)


harc(“t1”, “P2”)
1-p
t4(0) vf1 viarc(“t3”, “P3”, vf1)
r p
3 P2 P3 3 t2
P1 t1 T(10)
place(“P1”); imm(“t2”);
ratedep(“T”, “P2”, r);
init(“P1”,1); probval(“t2”, p);
priority(“T”,10);

moarc(“t1”,“P2”, 3); Auxiliary Functions


int g_t3(){...}
int vf1(){…}
Copyright © 2017 by K.S. Trivedi 101
SRN Analysis: Step-1
Abstract the system -> SRN Model
Finite Buffer Specify in SRN Tools

m m
l mm

Single Server m-stage


Poisson Arrival
Erlang Service time

SRN of M/E
Copyright by/1/n
© 2017 m Queue
K.S. Trivedi 102
SRN Analysis: Step-2
Reachability Analysis: Automatically Generate ERG

SRN
Specification

Extended
Reachabilty
Graph

Vanishing Marking
Copyright Tangible Marking
© 2017 by K.S. Trivedi 103
SRN Analysis: Step-3
Reachability Analysis: Automatically Generate RG
Extended
Reachabilty
Graph
Eliminate
Vanishing
Marking

CTMC = RG

Copyright © 2017 by K.S. Trivedi 104


SRN Analysis: Step-4
Solve SMP (preservation) or CTMC (elimination)
Steady-state Analysis: A System of Linear Equations
Gauss-Seidel, SOR (Successive over-relaxation)
Power method

Transient Analysis: A coupled system of ODE


Classical ODE Methods
Randomization (or Uniformization or Jensen’s method)
Copyright © 2017 by K.S. Trivedi 105
SRN Analysis: Step-5

Compute measures of interest


Measures of interests: Blocking/Dropping Probability,
Throughput, Utilization, Delay etc.
Measures can be defined as reward functions which
specify reward rates on net-level entities.

Steps 1-5: The SPNP Tool does it all!

Copyright © 2017 by K.S. Trivedi 106


Example:
Wireless Cellular System
Channels pool (C)

New Calls Call completion

Handoff Calls Handoff out


From neighboring cells
Guard channels (g)
for Handoff Calls

Traffic in a cell
Copyright © 2017 by K.S. Trivedi 107
Performance Measures: Loss
formulas or probabilities
• When a new call (NC) is attempted in an cell covered by a
base station (BS), the NC is connected if an idle channel is
available in the cell. Otherwise, the call is blocked
• If an idle channel exists in the target cell, the handoff call
(HC) continues nearly transparently to the user. Otherwise,
the HC is dropped
• Loss Formulas
– New call blocking probability, Pb : Percentage of new calls rejected
– Handoff call dropping probability, Pd : Percentage of calls forcefully
terminated while crossing cells

Copyright © 2017 by K.S. Trivedi 108


Guard Channel Scheme

Handoff dropping less desirable than new call blocking!

Handoff call has Higher Priority: Guard Channel Scheme


GCS: g channels are reserved for handoff calls.

g trade-off between Pb & Pd

Copyright © 2017 by K.S. Trivedi 109


Assumptions:
• ln : The arrival rate of new calls
• lh : The arrival rate of hand-off calls into the
cell
• mc : Service completion rate of on going calls
(new or hand-off)
• mo : Service rate of hand-off outgoing calls from
the cell
• C : Total number of channels
• g : Number of guard channels
Copyright © 2017 by K.S. Trivedi 110
Description of the problem:
• A hand-off call is accepted if at least one idle
channel is available, otherwise it is dropped.
• A new call is accepted, if at least g+1 idle channels
are available, otherwise it is blocked.
• Given our assumptions, the underlying traffic
(performance) model is a homogeneous
continuous time Markov chain of the birth-death
type. We start with an SPN Model.

Copyright © 2017 by K.S. Trivedi 111


Modeling for cellular network
with hard handoff Haring, Marie,
Idle-channels Puigjaner and Trivedi,
Loss formulae and
Write a guard instead their optimization for
C cellular networks,
g+1 IEEE Trans. on
g mc Vehicular Technology,
ln # May 2001
Talking-channels
New calls Call-completion

#
lh mo
Handoff-in
Handoff-out

Stochastic Petri Net Model of wireless hard handoff

Copyright © 2017 by K.S. Trivedi 112


Modeling for cellular network
Guard function:
g_new_calls
with hard handoff
if(mark(“Idle_channels”) >= g+1) Idle-channels Haring, Marie,
return(1) Puigjaner and Trivedi,
else Loss formulae and
return(0)
C their optimization for
cellular networks,
mc IEEE Trans. on
Vehicular Technology,
ln Talking-channels
#
May 2001
New calls Call-completion

#
lh mo
Handoff-in
Handoff-out

Stochastic Petri Net Model of wireless hard handoff

Copyright © 2017 by K.S. Trivedi 113


Reward Rates for the cellular
network model
• Reward rate for handoff call dropping probability
1, # Idle  channels  0
ri  
0, otherwise
• Reward rate for new call blocking probability
1, # Talking-channels  C  g
ri  
0, otherwise

Copyright © 2017 by K.S. Trivedi 114


Reward Rates for the cellular
network model
• Reward rate for mean number in steady–state

• Reward rate for steady-state throughput of call completion

Copyright © 2017 by K.S. Trivedi 115


Pure Performance model
• Markov Model
– State index indicates the number of channels in use
– Steady-state call blocking probability (Pb)
– Steady-state call dropping probability (Pd)

ln + lh ln + lh lh lh
0 1 ... C-g-1 C-g C-g+1 ... C-1 C
mc +mo (C-g)(mc+mo) (C+1-g)(mc+mo) C(mc +mo)

Pd  p C
Pb  p C  g  ...  p C Call blocking probability
Copyright © 2017 by K.S. Trivedi 116
Reward Rates for the CTMC model

• Reward rate for steady–state handoff call dropping probability

• Reward rate for steady-state new call blocking probability

• For goodput (of completed calls),


• Rate of accepted calls,

• Rate of handoff-out,
• mean number of calls in the system,
Copyright © 2017 by K.S. Trivedi 117
Loss formulas for wireless
network with hard handoff
Dropping probability
for handoff:

Blocking probability
of new calls:

Note: if g=0 (no guard channel), the above expressions reduce


to the classical Erlang-B loss formula

Copyright © 2017 by K.S. Trivedi 118


RF Channel Failure/Recovery

A talking channel may fail!


First we discuss a pure availability model
Then we discuss a composite
performance/availability model
Then we discuss call recovery

Copyright © 2017 by K.S. Trivedi 119


Pure Availability model:
• Markov Model: (C channels total)
– Each channel has MTTF and MTTR
– Steady-state system Unavailability : U
– Steady-state system Availability : A
– Instantaneous system Availability : At
– Downtime : downtime (in minutes)

C/MTTF (C-1)/MTTF 1/MTTF


C C-1 C-2 ... 1 0
1/MTTR 1/MTTR 1/MTTR
Copyright © 2017 by K.S. Trivedi 120
SPN Availability model

# 1/MTTF
Repair
C idle_channels

1/MTTR

Copyright © 2017 by K.S. Trivedi 121


Composite SPN Model
Handoff_in_call
New_call
lh ln
Completion_of_call
In_use # g g+1

mc
# 1/MTTF
# mo Repair
C idle_channels
Handoff_out_call
1/MTTR
#
1/MTTF
Copyright © 2017 by K.S. Trivedi 122
WFS Example Revisited as SPNs

Copyright © 2017 by K.S. Trivedi 123


WFS example first SPN

2 1
Pwsup Pfsup

mw # Tfsfail Tfsrep

lw lf mf
Twsfail
Twsrep

Pwsdn Pfsdn
Copyright © 2017 by K.S. Trivedi 124
WFS example first SPN

2 1
Pwsup Pfsup

mw # Tfsfail Tfsrep

lw lf mf
Twsfail
Twsrep

Pwsdn Pfsdn
Replace the inhibitor arc by an enabling function (or guard)
Copyright © 2017 by K.S. Trivedi 125
Reachability Graph of the SRN

Pwsup Pfsup Pwsdn Pfsdn

2100 2001

1110 1011

0120 0021

Copyright © 2017 by K.S. Trivedi 126


GSPN Model for WFS Example

• Assume that when a workstation fails, with


probability c the failure is properly detected

• With the probability (1 – c) the failure is not


detected, leading to the corruption and the
failure of the file-server

Copyright © 2017 by K.S. Trivedi 127


GSPN Model for WFS Example
with imperfect coverage
Pwsup Pfsup

Pwsfl #
Tfsfl Tfsrp
Pwst

Twsrp

twscv
twsuc

Pwsdn Pfsdn
Copyright © 2017 by K.S. Trivedi 128
Copyright © 2017 by K.S. Trivedi 129
Reachability Graph of the GSPN

wsrp wsrp

21000 wsfl 11100 wscv 11010 wsfl 01110 wscv 01020

fsfl fsrp wsuc fsfl fsrp wsuc fsfl fsrp

20001 wsfl 10101 wscv 10011 wsfl 00111 wscv 00021

Copyright © 2017 by K.S. Trivedi 130


The CTMC for the example

mw mw

2lwc lwc
21000 11010 01020
2lw(1-c) lw(1-c)
lf mf lf mf lf mf

20001 2lw 10011 lw 00021

Copyright © 2017 by K.S. Trivedi 131


System Availability for the Example

Copyright © 2017 by K.S. Trivedi 132


WFS Availability Model
• Change so as to have non-preemptive repair
priority

Copyright © 2017 by K.S. Trivedi 133


GSPN Model for WFS Example
with non preemptive repair priority
Use of immediate transitions for logic (as opposed to random switch)
Pwsup Pfsup

#λwsfl λfsfl
Tfsfl Tfsrp
Twsrp Twsfl
μfsrp
μwsrp
Pwsdn Pfsdn

Pwsrp Pfsrp

t1 t0
Immediate Prob.
Transition value

t0 1
t1 1
Prepair
Copyright © 2017 by K.S. Trivedi 134
ERG for the example
Tfsrp

2100001 2000101
Tfsfl t0
2000010
Twsrp Twsfl
Twsfl
1101001
Tfsrp
t1 Twsrp 1001010
1110000 1010100 Twsfl
Tfsfl
Twsrp Twsfl
Twsfl 0002010
0111000 t1 Tfsrp
Tfsfl 0102001

0011100 1001101
Twsrp t0

Marking= <#Pwsup, #Pfsup, #Pwsrp, #Pwsdn, #Pfsdn, #Pfsrp, #Prepair>


Copyright © 2017 by K.S. Trivedi 135
Reduced ERG for the example
μfsrp

2100001 2000101
λfsfl 1
2000010
μwsrp 2λwsfl
2λwsfl
1101001
λfsrp
1 μwsrp 1001010
1110000 1010100 λwsfl
λfsfl
μwsrp λwsfl
λwsfl 0002010
0111000 1 μfsrp
λfsfl 0102001

0011100 1001101
μwsrp 1

Marking= <#Pwsup, #Pfsup, #Pwsrp, #Pwsdn, #Pfsdn, #Pfsrp, #Prepair>


Copyright © 2017 by K.S. Trivedi 136
ERG to CTMC mapping
Marking in ERG State in CTMC
2100001 1
1110000 2
0111000 4
0011100 5
1010100 3
2000010 6
1001010 7
0002010 8

Copyright © 2017 by K.S. Trivedi 137


CTMC for the WFS example with
non preemptive repair priority
lf
1 mf 6

mf 2lw
2lw mw mw
2
lf 3 7

lw mw lw mw lw
4 lf
lf 5 8

mf
Copyright © 2017 by K.S. Trivedi 138
GSPN Example: M/M/m/b Queue

Pserver
m
b-m
Tservice
Tarrival tquick

#
l Pqueue Pservice m

We assume b > m

Copyright © 2017 by K.S. Trivedi 139


M/M/m/b Queue SRN (compare
with GSPN on slide 139)

ratefun
Copyright © 2017 by K.S. Trivedi 140
Multiprocessor Reliability
Model

Copyright © 2017 by K.S. Trivedi 141


C.mmp SRN Model using variable
cardinality flushing arcs

Copyright © 2017 by K.S. Trivedi 142


SRN Model Of C.mmp using hold
condition – to be done
• Formulate the model and discuss what are
the differences if any between the two
approaches

Copyright © 2017 by K.S. Trivedi 143


GSPN Model of C.mmp?
• No variable cardinality arcs and no reward rates
• Need to have a “system failure” place
• Need to have a set of places and immediate
transitions that determine under what
conditions system fails and that then deposits a
token in the system failure place
• SRN avoids all that
• See the paper by Malhotra and Trivedi in IEEE-
TR , 1995 for more details

Copyright © 2017 by K.S. Trivedi 144


SPN Software Packages

SPNP v6 (Duke, USA)


SHARPE (Duke, USA)
GreatSPN (Torino, Italy)
UltraSAN (U.Mich., Uof I)
DSPNexpress (Dortmund, Germany)
TimeNet (Erlangen, Germany)
PIPE2 (Imperial College)
etc.
Copyright © 2017 by K.S. Trivedi 145
SPNP Software Package

Copyright © 2017 by K.S. Trivedi 146


SPNP
• Installed at over 700 Sites; companies & universities
• Ported to Most Architectures and Operating Systems
• Used For Performance, Dependability and Performability
• Steady-State, Transient Analysis, cumulative transient
and sensitivity analysis
• Analytic-numeric methods for Markovian models.
• Simulation for non-Markovian and fluid models
– Three kinds of fast simulation methods
• Written in C Language
• GUI written in Java

Copyright © 2017 by K.S. Trivedi 147


Outline
• CSPL Language Specification
• Analytic-numeric solution Techniques
– Only implemented for Markovian nets
– MRSPN and FSPN analytic numeric solution
possible but not implemented in SPNP
• Simulative solution Techniques

Copyright © 2017 by K.S. Trivedi 148


Simulation
• Can be used for:
– Markovian SRN
– non-Markovian SRN
– Fluid SPN
• Used as a model for:
– Systems involving fluid variables
– Approximation of models with a large number of
tokens
• No need to generate the reachability graph
• Possibility to give the number of replications or the desired
relative error

Copyright © 2017 by K.S. Trivedi 149


SPN Models in SPNP
• The SPN models specified to SPNP are
SRNs, which are based on the “Markov
Reward Models” (MRM) paradigm.

Copyright © 2017 by K.S. Trivedi 150


Stochastic Reward Nets

• Features of SRN:
– Bipartite graph with two kinds of nodes: places
and transitions
– Timed and immediate transitions
– Inhibitor arc, variable cardinality, guard function,
and priority
– Reward rate based measures
– Fluid stochastic Petri net: fluid places and fluid
arcs

Copyright © 2017 by K.S. Trivedi 151


CSPL
• Languange for describing, handling and
solving Stochastic Reward Nets (SRNs).
• The syntax and the semantics of CSPL are
based on the ANSI C language.
• CSPL has a set of predefined functions for
specification and solving of SRNs.

Copyright © 2017 by K.S. Trivedi 152


CSPL Basic Functions
#include “user.h” Setup and Initialization
void options( )
void net( )
int assert( ) SRN definition
void ac_init( )
void ac_reach( )
Perform analysis
void ac_final( ) and get measures

Copyright © 2017 by K.S. Trivedi


153
Specification of SRN Model

#include “user.h” Setup and Initialization


void options( )
void net( ) SRN definition
int assert( )
void ac_init( )
void ac_reach( )
Perform Analysis
void ac_final( ) and
Get Measurement
SPNP model definition file
Copyright © 2017 by K.S. Trivedi 154
SRN Notation Summary

guard(“t3”, g_t3); t3(g_t3)


harc(“t1”, “P2”)
1-p
t4(0) vf1 viarc(“t3”, “P3”, vf1)
r p
3 P2 P3 3 t2
P1 t1 T(10)
place(“P1”); imm(“t2”);
ratedep(“T”, “P2”, r);
init(“P1”,1); probval(“t2”, p);
priority(“T”,10);

moarc(“t1”,“P2”, 3); Auxiliary Functions


int g_t3(){...}
int vf1(){…}
Copyright © 2017 by K.S. Trivedi 155
Example 1

Plots can be combined


to be compared

Copyright © 2017 by K.S. Trivedi 156


SOME INDUSTRIAL USES
• HP
– Cluster Availability Modeling
– Server Availability
– Mass Storage Arrays Availability Modeling

• MOTOROLA
– Recovery strategies in wireless handoff:
– Proposed and modeled several strategies
– Fixed-point iteration used
– Software rejuvenation in CMTS
• IBM
– Software rejuvenation for a cluster system
• Boeing, EMC, NEC, NTT, … …
Copyright © 2017 by K.S. Trivedi 157
SRN CHARACTERISTICS
• Structural characteristics:
– Marking dependency
– Priorities
– Guards
– Resampling policies, for general distributions
– Variable cardinality arcs
• Stochastic characteristics:
– Allow definition of reward rates in terms of net level
entities
– Automatically generate the reward rates for the
markings
Copyright © 2017 by K.S. Trivedi 158
STEPS IN ANALYTIC NUMERIC SOLUTION
OF MARKOVIAN SRN
Stochastic Reward Net
Generates all markings of the SRN by
considering all the enabled transitions in
each marking. Classify the markings as
Tangible and Vanishing markings.
Extended Reachability Graph

Eliminates the vanishing markings

Markov Reward Model


Solve MRM for Steady-State
Transient behavior using
known methods
Copyright © 2017 by K.S. Trivedi 159
SRN Models Solved In 3 Steps
SRN
Model

Reachabilit
y Graph

Markov
Reward
Model

Numerical
Solution 1 client, 1 server token ring system
Copyright © 2017 by K.S. Trivedi 160
Analytic-Numeric Methods
Extended Reachability Graph (ERG)

Markov Reward Model (MRM)

sensitivity
steady-state Fast MTTA transient
analysis
solver
IOP_SSMETHOD

Gauss-Seidel standard Fox-Glynn


SOR (slow) uniformization uniformization
(fastest) VAL_GASEI VAL_TSUNIF VAL_FOXUNIF
VAL_SSSOR

Power Method Stiff Uniformization


(guaranteed convergence)
VAL_POWER Copyright © 2017 by K.S. Trivedi 161
Options for Analytic-Numeric
Methods
• Steady-State Analysis
– IOP_SSMETHOD: VAL_SSSOR, VAL_GASEI, VAL_POWER
• Transient Analysis
– IOP_TSMETHOD
• VAL_TSUNIF, VAL_FOXUNIF
– IOP_CUMULATIVE: enable cumulative measures
– IOP_SSDETECT: use steady-state detection
– FOP_SSPRES: required precision for steady-state detection
• Common Options
– IOP_ITERATIONS (2000)
– FOP_PRECISION (1E-6)

Copyright © 2017 by K.S. Trivedi 162


Debug of Model
RES_NOERR

• Assert(): check for error at every state RES_ERROR

• IOP_DEBUG: print markings while generate them


• .rg file: Reachability graph (IOP_pr_RGRAPH)
– IOP_USENAME: use names to indicate the places and transitions
– IOP_PR_RSET: VAL_TAN — only print tangible markings
– IOP_PR_FULL_MARK: print places with zero tokens
• .Mc file: CTMC description (IOP_mc) – fromto and tofrom
• .prb file: prob. Of all tangible marking (IOP_PR_PROB)
• .Dot file: dot graph language (IOP_pr_dot)
– View with dotty (http://www.Research.att.Com/sw/tools/graphviz)
Copyright © 2017 by K.S. Trivedi 163
set by

File Formats IOP_PR_MC_ORD


ER
{VAL_FROMTO}
.rg file .mc file .prb file
_nplace = _firstindex =
_firstindex = _nstates =
_ntrans =
_nstates = _method =
_places =
_nentries = _precision =
. . . . . . .
_order = _iterations =
_transitions =
{_FROMTO|_TOFROM} _time =
. . . . . . .
_matrix = _probabilities =
_ntanmark =
<st> <st>:<rate>. . <state>:<prob> . .
_nabsmark =
. . . . . . . . . . . . . . . . . . . .
_nvanmark =
[_initstate = [
_nentries =
<st>:<prob> . . .] _derprobabilities =
_reachset =
_iterations = . . . . . . . . . .
. . . . . . . .
_precision = _cumprobabilities =
_reachgraph = . . . . . . . . . .
_method =
<mk> <mk>:<tr>:<v> _dercumprobabilities =
_time =
. . . . . . . . . . . . . . . . . . . ]

Copyright © 2017 by K.S. Trivedi 164


Options Setup
• Set options in options() of SPNP file.
• Set Options
– iopt(option, int_val)
– fopt(option, double_val)
• Get Options
– IOptionValue(option)
– FOptionValue(option)

Copyright © 2017 by K.S. Trivedi 165


Reward-based Measures
• Function to obtain measures
– Expected(), cum_expected(), accumulated()
– mtta(), mtta_fun(), newmtta()
• Output functions A new algorithm for
fast MTTA
– Pr_message(), pr_value() computation
– Pr_std_average(), pr_std_cum_average()
– Pr_time_avg_expected(), pr_cum_expected()
– Pr_expected(), pr_cum_expected()
– Pr_mtta(), pr_mtta_fun(), pr_newmtta()
– Pr_cum_abs(), pr_accumulated()
• Set_prob_init(), set_prob0()
• Hold_cond(), pr_hold_cond()

Copyright © 2017 by K.S. Trivedi 166


Sensitivity Analysis
Rate of T was r*(#P2),
• Parameter definition: after using parm,
Now rate of T is
– parm(“rate”); r*(#P2)*rate
– useparm(“T”, “rate”) ;
– Bind(“rate”, 20.0);
• Related options:
– IOP_sensitivity ® VAL_yes
• Start analysis:
– sens(all,0);
Copyright © 2017 by K.S. Trivedi 167
Recent Research on SPN
Efficient Solution Techniques
Largeness (Decomposition, state truncation)
Stiffness (B-T method, stiffly stable ODE)
Extension to non-Markovian SPNs
Markov Regenerative Stochastic Petri nets
(MRSPN); solution methods
Fluid stochastic Petri nets (FSPN); solution
methods for first order & second order
including boundary conditions

Copyright © 2017 by K.S. Trivedi 168


Stiffness
Problem:
Parameters on different time scales
Failure rates vs. rates in recovery model
Performance model events vs. reliability/availability model events
Ill-conditioned matrices
Solution:
Decomposition & Hierarchy or Fixed-point iteration
HARP, SHARPE, Ghosh et al
B-T method (Bobbio and Trivedi, IEEE TC Sept. 1986)
Stiffly stable numerical methods (e.g., stiff Uniformization,
implicit ODE methods) – Malhotra, Muppala, Trivedi,
Microelectronics and Reliability, 1994

Copyright © 2017 by K.S. Trivedi 169


Largeness
Model complexity  State space explosion
Solution
State Truncation
Muppala, Sathaye, Howe and Trivedi, “Dependability Modeling of a
Heterogeneous Multiprocessor System Using Stochastic Reward Nets”, in:
Hardware and Software Fault Tolerance in Parallel Computing Systems,
Avresky (ed.), Ellis Horwood Ltd., 1992
Hierarchical composition
Vaidyanathan, Trivedi, A Comprehensive Model for Software Rejuvenation,
IEEE-TDSC, 2005.
Wang, Xie, Trivedi, Performability Analysis of Clustered Systems with
Rejuvenation under Varying Workload". Performance Evaluation, 2007.
Kronecker algebra (Longo, Dayar, Buchholz)
Fixed-point iteration
Ghosh, Longo, Frattini, Russo, Trivedi, “Scalable Analytics for IaaS Cloud
Analytics”, IEEE Trans. on Cloud Computing, 2014.
Ghosh, Longo, Naik, Trivedi, “Modeling and Performance Analysis of Large
Scale IaaS Clouds”, Future Generation Computing Systems, 2013.
Copyright © 2017 by K.S. Trivedi 170
SHARPE
• SHARPE supports multi-level models that
communicate
• Can program fixed-point iteration in
SHARPE
• SPNP does not explicitly support multiple
models. This can be achieved via a shell file

Copyright © 2017 by K.S. Trivedi 171


Fixed Point Iteration in spnp
• Set the input parameters with parm()
• Use bind() to set the initial value
• Call solve() to get a solution
• Compute desired inputs from reward-
base measures
• Bind the parameters with the
calculated inputs
• Repeat above action until values
meet
Copyright © 2017 by K.S. Trivedi 172
State-Space model taxonomy
Can relax the assumption of exponential distributions
discrete-time Markov chains (DTMC)
Markov models
continuous-time Markov chains (CTMC)

Markov reward models (MRM)


(discrete) State space
models non-Markov models Semi-Markov process (SMP)

Markov regenerative process

Phase-Type Expansion

Non-Homogeneous Markov

Copyright © 2017 by K.S. Trivedi


SPN model taxonomy
Can relax the assumption of exponential distributions
TPN (DTMC)
Markov models
SPN, GSPN (CTMC)

SRN (MRM)
(discrete) State space
models non-Markov models ESPN (SMP)

DSPN, MRSPN (MRGP)

ESP (Phase-Type Expansion)

Non-Homogeneous Markov

Copyright © 2017 by K.S. Trivedi


Non-Markovian SPN
Transition Firing Times: not necessarily exponentially
distributed
• Choi, Kulkarni, Trivedi, Markov regenerative stochastic Petri
net (MRSPN), Performance Evaluation, 1994 ( At most one
general transition is enabled in any marking)
• Bobbio, Puliafito, Telek, Trivedi, Recent developments in non-
Markovian stochastic Petri nets, J. of Sys. Circuits and
Computers, 1998.
• Puliafito, Scarpa, Trivedi, Petri nets with k simultaneously
enabled generally distributed timed transitions, Perf. Eval., 1998

Copyright © 2017 by K.S. Trivedi 175


SRN Definition (Cont.)

• Transitions with non-exponentially distributed


firing times (sim) Three policies
PRI, PRD, PRS
– Policy(“t”, PRD)
– Affected(“t1”, “T”, PRS)
– xxxval(), xxxdep(), xxxfun()
• Halting_condition(): absorbing
• Functions to retrieve PN states
– Rate(“t”)
– Mark(“p1”)
– Enabled(“t3”)

Copyright © 2017 by K.S. Trivedi 176


DISTRIBUTIONS AVAILABLE FOR
SIMULATION
– Geometric
– Exponential
– Constant (including – Erlang
Immediate) – Pareto
– Uniform – Cauchy
– Truncated normal – Beta
– Weibull
– Gamma
– Lognormal
– Poisson

Copyright © 2017 by K.S. Trivedi 177


Transition Type Definition
Transition Type Definition Parameters
Exponential rateval(t,val), ratedep() val = firing rate
ratefun()
Deterministic detval(t, val) val = firing rate
(Constant)
(1/time)
Uniform(a,b) unifval(t, lower, upper) lower=a, upper=b

Geometric(p) geomval(t, val1, val2) val1=p


val2=time step
Weibull(a,b) weibval(t, val1, val2) val1=a, val2=b

Truncated Normal normval(t, val1, val2) val1=m, val2=

Lognormal lognval(t, val1, val2) val1=m, val2=

Copyright © 2017 by K.S. Trivedi 178


Transition Type Definition (cont.)
T r a n s i t io n T y p e D e f in i t io n P a ra m e te rs

G am m a g a m v a l( t, v a l1 , v a l2 ) v a l1 =  , v a l2 = l

B e ta b e tv a l( t, v a l1 , v a l2 ) v a l1 = a , v a l2 = b

P o is s o n p o is v a l( t, v a l1 , v a l2 ) v a l1 = p , v a l2 = s te p

B in o m in a l b in o v a l( t, v a l1 , v a l2 , v a l3 ) v a l1 = p , v a l2 = q
v a l3 = s te p
N e g a tiv e B in o m in a l n e g b v a l( t, v a l1 , v a l2 , v a l1 =  , v a l2 = p ,
v a l3 ) v a l3 = s te p
2 - s ta g e h y p e r v a l( t, v a l1 , v a l2 , v a l1 = l   v a l2 = l  
H y p e r e x p o n e n tia l v a l3 ) v a l3 = p
3 - s ta g e h y p o v a l( t, v a l1 , v a l2 , v a l3 , v a l1 = n u m s ta g e s
H y p o e x p o n e n tia l v a l4 ) v a l2 ~ 4 = l   l  
E r la n g e r lv a l( t, v a l1 , v a l2 ) v a l1 = l , v a l= p h a s e

P a r e to p a r v a l( t, k , a lp h a ) f P a r ( x ) =  k  /( x + k )  + 1

C auchy c a u v a l( t, a lp h a , b e ta )  
Copyright © 2017 by K.S. Trivedi 179
Copyright © 2010 by K.S. Trivedi
Fluid Petri Net
Fluid stochastic Petri net (FSPN)
Introduced by K. Trivedi and V. Kulkarni (1993)
Allow both discrete and continuous places
Useful in fluid approximation of discrete queuing system
Powerful formalism of stochastic fluid queueing networks
Boundary conditions complicated. Solution techniques
under investigation.

Copyright © 2017 by K.S. Trivedi 180


The Fluid Petri Net Model
FPN is an extension of PN that is able to model the
coexistence of discrete and continuous variables.
The primitives of FPN (places, transitions and arcs) are
partitioned in two groups:
 discrete primitives that handle discrete tokens (as in
standard PN);
 continuous (or fluid) primitives that handle
continuous (fluid) quantities.
 fluid arcs are assigned instantaneous flow rates.

Copyright © 2017 by K.S. Trivedi 181


Fluid Petri Nets

Copyright © 2017 by K.S. Trivedi 182


FSPN Specification
P3
fiarc(“T1”, “FP1”, 1.2);
B(45) T2
FP1 T1 FP2 I(0.0)
B(7.5)
I(2.5) 1.2 2.0
Br(3.0)

fplace(“FP1”); inf(“T1”);
fbound(“FP1”, 7.5);
finit(“FP1”, 2.5); diarc(“T2”, “FP2”);
fbreak(“FP1”, 3.0);

Indicate a state
change at x = 3.0 state functions for FSPN:

(a) fmark(“FP1”);
(b) Trivedi
Copyright © 2017 by K.S. fcondition(“FP2”, F_LQ, 3.0);
183
DISCRETE EVENT SIMULATION
• Can be used for:
– Markovian SRN
– non-Markovian SRN (limited extent analytic-numerical
methods exist but not implemented in SPNP)
– Fluid SPN (limited extent analytic-numerical methods
exist but not implemented in SPNP)
• FSPN (Fluid Stochastic Petri net)
Used as a model for:
– Systems involving fluid variables
– Approx. of models with a large number of tokens
• No need to generate the reachability graph
• Possibility to give the number of replications or the desired
relative error. Copyright © 2017 by K.S. Trivedi 184
Execution of SPNP
options()

ReadModel()
6
net() No
Rebuild?

Yes Yes
Simulation? Discrete Event
Simulation BuildReachabilityGraph()
No

ac_init() solve() ac_reach()

bind()
Steady State Accumulative
ac_final()
Rebuild() sensi()
Transient MTTA
Copyright © 2017 by K.S. Trivedi 185
Solution Techniques
SRN Model

Markovian Nets Non-Markovian Nets FSPNs

Generate All Markings Discrete make correspondance list


(tangible + vanishing) Event
Simulation
schedule transition events
Generate Reward Rates (DES) schedule fluid events
for Tangible Markings
modify
change states
clock

Extended Reachability Graph Compute statistics


(ERG) and confidence interval
Copyright © 2017 by K.S. Trivedi 186
Solution Technique in SPNP

Copyright © 2017 by K.S. Trivedi 187


Research on Simulation
Methods

• Simulation methods
– Implementation of other general distributions
– Importance sampling (for rare events)
– Sensitivity analysis
– Non-linear FSPNs
– 2nd order FSPNs

Copyright © 2017 by K.S. Trivedi 188


Simulation Methods
Discrete Event Simulation (DES) IOP_SIMULATION

Steady-state analysis transient analysis

IOP_SIM_RUNMETHOD
Regenerative Batch
Independent
Simulation means
Replications
(VAL_REG) (VAL_BATCH)

Regenerative Importance
Regular DES Restart Splitting
Importance Sampling Sampling
(VAL_REPL) (VAL_RESTART) (VAL_SPLIT)
(VAL_ISREG) (VAL_IS)
Copyright © 2017 by K.S. Trivedi 189
Simulation Options Setup
• IOP_SIMULATION=VAL_YES
• IOP_SIM_RUNMETHOD
• IOP_SIM_RUNS
• FOR_SIM_ERROR (when IOP_SIM_RUNS=0)
– run until the error precision is reached
• FOP_SIM_LENGTH: End time of simulation
• FOP_SIM_CONFIDENCE (0.90, 0.95, or 0.99)
• IOP_SIM_CUMULATIVE: for cumulative measures
• FOP_FLUID_EPSILON: precision for fluid place
• FOP_TIME_EPSILON: the smallest time step
Copyright © 2017 by K.S. Trivedi 190
Other Useful Options
• IOP_ELIMINATION
– VAL_REDNEVER: no reduction
– VAL_REDAFTERRG: reduction after RG generation
– VAL_REDONTHEFLY: reduction during RG generation
• IOP_MC
– VAL_DTMC: solve embedded DTMC
• FOP_ABS_RET_M0
– Prob. of ABSORBING STATE  INIT STATE
• IOP_SIM_SEED
– Used to replicate simulation results
• IOP_SIM_STD_REPORT: as pr_std_average()

Copyright © 2017 by K.S. Trivedi 191


Replication V.S. Batch
• Replication (VAL_REPL)
– Start from initial marking, run simulations until
T=FOP_SIM_LENGTH. The simulation is
repeated for IOP_SIM_RUNS times.
– Mainly for transient analysis.
• Batch(VAL_BATCH)
– Only one run is performed
– (L=FOP_SIM_LENGTH x IOP_SIM_RUNS)
– Simulation restart from the current state in
FOP_SIM_LENGTH is reached.
– For steady state analysis only.
Copyright © 2017 by K.S. Trivedi 192
Transition Sampling Policy
• Policy() for re-enabled transition.
• Affected() for effect of firing to transition still enabled.
– PRI (preemptive repeat identical).
– PRD(preemptive repeat different).
– PRS(preemptive resume).

T1

A
T1 C T3
t

B T2
T2
D
T4 Copyright © 2017 by K.S. Trivedi 193
t
Importance Splitting

• Basic idea: A rear event can be split into many events


that are not rear.
P( A)  P( A | Bk ) P( Bk | Bk 1 )  P( B2 | B1 ) P( B1 )

B3 Note:
Every state
will eventually
B2
return to 0
B1
0
Copyright © 2017 by K.S. Trivedi 194
RESTART Technique

• Can be used to compute the probability


P(A) of every kind of rear event in
steady state.
• Method: restart to initial state after
simulate to T long enough.
N
P( A)  
T

i 1
1
T 0   i (t )1 A (ti )dti

Copyright © 2017 by K.S. Trivedi 195


Importance Splitting in SPNP
• IOP_SIM_RUNMETHOD: VAL_SPLIT | VAL_RESTART
• IOP_SPLIT_LEVEL_DOWN: levels to go down for a path to be stopped. (d)
• IOP_SPLIT_RESTART_FINISH: (RESTART only)
– Whether retrial is continued when they go under the threshold. (Y/N)
• IOP_SPLIT_PRESIM:
– Select to run a pre-simulation (Y/N).
– Pre-simulation can select the thresholds automatically.
• IOP_SPLIT_PRESIM_RUNS: the number of runs in pre-simulation.(n)
• IOP_SPLIT_NUMBER: number of splitting thresholds.
• Table FOP_SPLIT_THRESHOLD:
– The indexes is [1..IOP_SPLIT_NUMBER]
– Maximum number is 7.

Copyright © 2017 by K.S. Trivedi 196


Further Topics
• Importance sampling
• Thinning
• Regenerative simulation

Copyright © 2017 by K.S. Trivedi 197


SPNP GUI
• iSPN
– cd /opt/ftss/share/tool/ispn6
– source script
– run ispn

• Java SPNP GUI


– contact Christophe (chirel@ee.duke.edu)

Copyright © 2017 by K.S. Trivedi 198


References
• http://www.ee.duke.edu/~kst
then click on Stochastic Petri Nets
• K. Trivedi, Probability and Statistics with Reliability, Queuing,
and Computer Science Applications, 2nd Ed., John Wiley and
Sons, New York, 2001
• G. Ciardo and K. Trivedi, A Decomposition Approach for
Stochastic Reward Net Models, Performance Eval., July 1993.
• G. Ciardo et al. Automated generation and analysis of Markov
reward models using stochastic reward nets. In Linear Algebra,
Markov Chains, and Queueing Models, Springer 1993.
• Malhotra and Trivedi, Dependability Modeling Using Petri-Nets,
IEEE-TR, 1995
• Ibe & Trivedi, “Stochastic Petri-net Models of Polling Systems”,
IEEE JSAC, 1990
• Ibe, Choi & Trivedi, “Performance Evaluation of Client-Server
Systems”, IEEE TPDS, 1993

Copyright © 2017 by K.S. Trivedi 199


References
• Muppala, Ciardo and Trivedi, Stochastic Reward Nets for Reliability
Prediction, Communications in Reliability, Maintainability and
Serviceability: An International Journal published by SAE
International, July 1994
• Muppala, Sathaye, Howe and Trivedi, “Dependability Modeling of a
Heterogeneous Multiprocessor System Using Stochastic Reward
Nets”, PN 93 Tutorial, also in: Hardware and Software Fault
Tolerance in Parallel Computing Systems, D. Avresky (ed.), Ellis
Horwood Ltd., 1992
• Balakrishnan and Trivedi, Stochastic Petri Nets for the Reliability
Analysis of Communication Network Applications with Alternate-
Routing, Reliability Engineering and System Safety, 1996
• B. Tuffin and Trivedi, Importance Sampling for the Simulation of
Stochastic Petri Nets and Fluid Stochastic Petri Nets, Proc. High
Performance Computing, Seattle, WA, April 2001.
• R. Ghosh, F. Longo, F. Frattini, S. Russo, and K. Trivedi, Scalable
Analytics for IaaS Cloud Availability, IEEE TCC, 2014

Copyright © 2017 by K.S. Trivedi 200


References
• G. Ciardo, J. K. Muppala, and K. S. Trivedi. On the solution of GSPN
reward models. Performance Evaluation, July, 1991.
• B. Tuffin and K.S. Trivedi. Implementation of importance splitting
techniques in stochastic petri net package. Technical report, Duke
University, Durham, NC, 1999.
• H. Sun, X. Zang, K. Trivedi. “A stochastic reward net model for
performance analysis of prioritized DQDB MAN”, Computer
Communications, June 1999.
• L. Tomek, J. K. Muppala and K. S. Trivedi. “Modeling correlation in
software recovery blocks.” IEEE Transactions on Software
Engineering, Special Issue on Software Reliability, November 1993.
• L. Tomek, V. Mainkar, R. Geist and K. Trivedi. “Reliability analysis of
life-critical real-time systems.” Proceedings of the IEEE, Jan. 1994.
• C. Wang, D. Logothetis, I. Viniotis, K. Trivedi, “Transient Behavior of
ATM Networks under Overloads,” Proc. of IEEE INFOCOM 1996.
• J. Muppala, V. Mainkar, V. Kulkarni and K. Trivedi. Numerical
computation of response time distributions using stochastic reward
nets. Annals of Operations Research, 1994.
Copyright © 2017 by K.S. Trivedi 201

You might also like