7/28/2019 SMS - Stochastic Petri Nets
1/44
Stochastic ModelingStochastic Modeling
Stochastic Petri Net Models
Prof. Dr. P. Mitrevski
1
7/28/2019 SMS - Stochastic Petri Nets
2/44
Assessment of performance, reliability and
availability is a key step in the design,analysis and tuning of computer systems Example:
We have a multiprocessor system and we want to
be sure it provides enough processing power If we add a processor, how much better willperformance get?
Could additional overhead make the performance
IntroductionIntroduction
Could we get a performance improvement just bychanging the scheduling of jobs?
How would adding a processor affect the reliabilityof the system(?) Would this make the system godown more often?
If so, would an increase in performance outweighthe decrease in reliability?
2
7/28/2019 SMS - Stochastic Petri Nets
3/44
Reliability
Ability of a component or system to function correctly overa specified period of time
Availability Probability that system is working at the instant t,
regardless of the number of times it may have failed and
been repaired in the interval (0, t) Performance
Ability of the system to carry out the work it is subject to,assuming that the system (or its components) does not fail
IntroductionIntroduction
r r y A new modeling paradigm that can give combinedreliability and performance measures Systems may be able to survive the failure of one or more
of their active components and continue to provide serviceat a reduced level (gracefully degrading systems). Suchsystems cannot adequately be modeled through separatereliability/availability or performance models
3
7/28/2019 SMS - Stochastic Petri Nets
4/44
Applicable to a wide range of modeling problems Provide interesting reliability, availability,
performance and performability models Difficulties:
State space can grow much faster than the number of
components in the system being modeled, making itdifficult to specify a model correctly Far removed in shape and general feel from the system
being modeled S stem desi ners ma find it hard to translate their
Markov ModelsMarkov Models
problems into Markov models These difficulties can be overcome by using a
model with a form that is more concise andcloser to a designers intuition about what amodel should look like One such model which is quite popular is the stochastic
Petri net(!)
4
7/28/2019 SMS - Stochastic Petri Nets
5/44
A Petri net consists ofplaces, transitions,arcs and tokens
Tokens reside in places and move from oneplace to another along the arcs through the
transitions A marking is the number of tokens in each
place
Introduction to Petri net modelsIntroduction to Petri net models
untimed the interest is in studyingsequences of transition firings
A very common extension is the stochastic
Petri net (SPN), in which the transitions aretimed
5
7/28/2019 SMS - Stochastic Petri Nets
6/44
SPN model for M/M/1/k queueSPN model for M/M/1/k queue
6
7/28/2019 SMS - Stochastic Petri Nets
7/44
Ifm
is the steady-state probability for state (marking) m ofthe underlying Markov chain and n
mis the number of tokens
in queue for marking m, the average number of tokens inqueue is: mm n
ReachabilityReachability graph for SPN modelgraph for SPN modelof M/M/1/k queueof M/M/1/k queue
The steady-state probability that the queue is full is thesteady-state probability that the placejobsource is empty.We can find this by adding together the steady-stateprobabilities for all of the markings that have no tokens injobsource. There is just one such marking, (0,5).
m
7
7/28/2019 SMS - Stochastic Petri Nets
8/44
7/28/2019 SMS - Stochastic Petri Nets
9/44
Bag (multiset) a set where members are
allowed to appear multiple times Petri net marking a bag whose elements are
place names Petri net 5-tuple (P,T,I(),O(),m0) where:
P is a set ofplaces () T is a set oftransitions () I() is the input function maps transitions to bags of
places
Petri net model definitions (1)Petri net model definitions (1)
places m0 is the initial marking of the net
A transition tis enabled by a marking m if andonly if I(t) is a subbag ofm Any transition tenabled by marking m can fire When it fires, I(t) is subtracted from the marking m and
O(t) is added to m, resulting in a new marking
9
7/28/2019 SMS - Stochastic Petri Nets
10/44
Petri net examplePetri net example10
7/28/2019 SMS - Stochastic Petri Nets
11/44
ReachabilityReachability graph for Petri netgraph for Petri netexampleexample
11
7/28/2019 SMS - Stochastic Petri Nets
12/44
To associate time with transitions, weconsider that a transition is enabled as soonas all required tokens are present in therequired places, but the transition does notfire right away
A transitions firing time, which is specified bya distribution function, is measured from theinstant the transition is enabled to the instant
Petri net model definitions (2)Petri net model definitions (2)
A stochastic Petri net (SPN) is a Petri net
with timed transitions, where the firing timedistributions are assumed to be exponential
Conflicting timed transitions are viewed as
competing processes (race policy)
12
7/28/2019 SMS - Stochastic Petri Nets
13/44
A generalized stochastic Petri net(GSPN) is a PN where both immediate() and timed ()transitions are allowed
A graphical representation of a GSPN
(generally) shows immediate transitions aslines and timed transitions as thick bars orrectangular boxes
Petri net model definitions (3)Petri net model definitions (3)
are enabled in a marking, only the immediatetransitions can fire
Conflicting immediate transitions areassigned relative firing probability values
(preselection policy)
13
7/28/2019 SMS - Stochastic Petri Nets
14/44
GSPN model for simultaneousGSPN model for simultaneous possesionpossesion of a resource:of a resource:I/O subsystem with two disks but only one I/O channelI/O subsystem with two disks but only one I/O channel
14
7/28/2019 SMS - Stochastic Petri Nets
15/44
Some of the extensions are a matterof convenience, especially regardinggraphical representation, and some
are true extensions that addmodeling power: Arc Multi licit
Petri net extensionsPetri net extensions
Inhibitor Arcs Priorities
Guards
Marking-dependent arc multiplicity Marking-dependent firing rates
15
7/28/2019 SMS - Stochastic Petri Nets
16/44
Example ofExample ofarc multiplicitiesarc multiplicities16
7/28/2019 SMS - Stochastic Petri Nets
17/44
An inhibitor arc from placep to transition tdisables t in any marking wherep is not empty
SPN model withSPN model with inhibitor arcsinhibitor arcs forforM/M/1/k queueM/M/1/k queue
17
7/28/2019 SMS - Stochastic Petri Nets
18/44
GSPN model for queue with twoGSPN model for queue with twojob classesjob classes
18
7/28/2019 SMS - Stochastic Petri Nets
19/44
GSPN model withGSPN model with prioritiespriorities forforqueue with four job classesqueue with four job classes
19
7/28/2019 SMS - Stochastic Petri Nets
20/44
A guard is a marking-dependent predicate that provides anadditional enabling criterion for each transition: the transition is
enabled only if the guard is satisfied
SU=server up; SD=server down; BU=buffer up; BD=buffer down
nm(Q) = number of jobs in the system
A GSPN usingA GSPN using guardsguards20
7/28/2019 SMS - Stochastic Petri Nets
21/44
EXAMPLE: a PN model of a communication protocol where
the arrival of a certain kind of packet causes all outgoingpackets to be flushed
MarkingMarking--dependent arc multiplicity:dependent arc multiplicity:Flushing a placeFlushing a place
21
7/28/2019 SMS - Stochastic Petri Nets
22/44
The system is operational if k-out-of-n components are working
If the failure rate for each component is , then when there arejfunctional components, the rate of occurrence of a componentfailure isj, depicted by appending the character # to the rate
MarkingMarking--dependent firing rates:dependent firing rates:GSPN model for kGSPN model for k--outout--ofof--n systemn system
22
7/28/2019 SMS - Stochastic Petri Nets
23/44
Most commonly used methods: Generation and analysis of a stochastic process
associated with the PN Let M(t) be the SPN marking at time t M(t) is a continuous time stochastic process called the
marking process or stochastic process underlyingthe SPN
The state space of the marking process is thereachability set of the SPN
The analysis of the SPN for transient or steady-state
SPN andSPN and GSPN analysis (1)GSPN analysis (1)
Continuous Time Markov Chain (CTMC) Discrete-event simulation of the PN
Avoids the generation of the reachability graph and canhelp with very large PNs
In addition, it becomes possible to handle non-Markovian nets
23
7/28/2019 SMS - Stochastic Petri Nets
24/44
Analyzing GSPNs is a bit morecomplicated because of the presence ofimmediate transitions
A marking in which at least one
immediate transition is enabled is called avanishing (, )marking; otherwise it is a tangible
SPN and GSPN analysis (2)SPN and GSPN analysis (2)
mar ng The resulting graph is called an extended
reachability graph (ERG) and can betransformed into a reduced reachability
graph that corresponds to a CTMC
24
7/28/2019 SMS - Stochastic Petri Nets
25/44
A GSPNA GSPN
25
7/28/2019 SMS - Stochastic Petri Nets
26/44
ERG and CTMC of the GSPNERG and CTMC of the GSPN
26
7/28/2019 SMS - Stochastic Petri Nets
27/44
A GSPNA GSPN
27
7/28/2019 SMS - Stochastic Petri Nets
28/44
ERGERG
28
7/28/2019 SMS - Stochastic Petri Nets
29/44
Pvv, Pvt = matrices of transition probabilities
( )
Ptt, Ptv = matrices of transition rates( )
(t=tangible; v=vanishing)
Constructing the generator matrixConstructing the generator matrixfor the underlying CTMC (1)for the underlying CTMC (1)
29
7/28/2019 SMS - Stochastic Petri Nets
30/44
The matrix describing the rates of transition from each tangible
marking to other tangible markings is: U = Ptt + Ptv (I Pvv)-1 Pvt
Constructing the generator matrixConstructing the generator matrixfor the underlying CTMC (2)for the underlying CTMC (2)
The entries in the generator matrix () for the underlying CTMC are:
30
7/28/2019 SMS - Stochastic Petri Nets
31/44
A system with two processors and three memory modules
Processors and memory modules are subject to failure and can be repaired There is only one repair facility
The system is unavailable ifppup is empty orpmup is empty
A GSPN availability modelA GSPN availability model
31
7/28/2019 SMS - Stochastic Petri Nets
32/44
A single server handles
more than one sourceof jobs (e.g. two) The system contains
stations which theserver polls one at atime
If the server finds a jobwaiting for a service ata station, the job isserved
A GSPN model for a single serviceA GSPN model for a single servicepolling systempolling system
I t ere are no jo s
waiting at a station,the server goes on topoll the next station
Mi= maximum numberof jobs for Station i
32
7/28/2019 SMS - Stochastic Petri Nets
33/44
PE = processingelement
P = processor
LM = localmemory
CM = common(shared) memory
LB = local bus GB = global bus
A singleA single--bus multiprocessorbus multiprocessorsystemsystem
33
7/28/2019 SMS - Stochastic Petri Nets
34/44
Three stages of a hypo-exponentially distributed service time
Processing efficiency = average fraction of active processors inthe system
A processor is active if it is executing instructions in its private memory
GSPN for singleGSPN for single--busbusmultiprocessor systemmultiprocessor system
34
7/28/2019 SMS - Stochastic Petri Nets
35/44
A failed node is successfully bypassedwith some probability 1-F
The network as a whole fails if any one ofthe nodes or links fails
A ring networkA ring network
35
7/28/2019 SMS - Stochastic Petri Nets
36/44
GSPN model of ring networkGSPN model of ring network
36
7/28/2019 SMS - Stochastic Petri Nets
37/44
GSPN model for queue with serverGSPN model for queue with serverfailure and repairfailure and repair
37
7/28/2019 SMS - Stochastic Petri Nets
38/44
Voice and packets arriveaccording to a Poissonprocess
The transmitter contains a
buffer to store a maximumofkdata packets A voice packet can enter
the channel only if there
ISDN channel with Poisson arrivalISDN channel with Poisson arrivalprocessprocess
be transmitted
If a voice transmission is inprogress, data packetscannot be serviced, but arebuffered
38
7/28/2019 SMS - Stochastic Petri Nets
39/44
Queuing network withQueuing network withsimultaneous resource possessionsimultaneous resource possession
39
7/28/2019 SMS - Stochastic Petri Nets
40/44
GSPN model of queuing networkGSPN model of queuing networkwith resource constraintswith resource constraints
40
7/28/2019 SMS - Stochastic Petri Nets
41/44
In a great number of real situations,
deterministic or generally (non-exponentially)distributed event times occur Timeouts in a protocol
Service times in a manufacturing systemperforming the same task on each part
Memory access or instruction execution in a low-
NonNon--MarkovianMarkovian SPN modelSPN modelextensions (1)extensions (1)
NOTE: they all have durations which areconstant or have a very low variance(!)
41
7/28/2019 SMS - Stochastic Petri Nets
42/44
Extended Stochastic Petri nets (ESPN)
General firing time distributions are allowed Under suitable hypotheses, the underlying
stochastic process is a semi-Markov process andanalytical solution methods exist
Deterministic and Stochastic Petri nets(DSPN) Allow the definition of immediate, exponential and
deterministic transitions
NonNon--MarkovianMarkovian SPN modelSPN modelextensions (2)extensions (2)
e s oc as c process un er y ng a s a
Markov Regenerative Process (MRGP) With the restriction that at most one deterministic
transition is enabled together with zero or moreexponentially distributed timed transitions, asteady-state and a transient solution method exist
42
7/28/2019 SMS - Stochastic Petri Nets
43/44
Markov Regenerative Stochastic Petri nets(MRSPN) A generalization of DSPNs that allows immediate,
exponential and generally distributed transitions The underlying stochastic process is still an MRGP There exist equations for the steady-state and transient
behavior for the case where every marking has at mostone generally distributed timed transition
Concurrent Generalized Petri nets (CGPN) Allow simultaneous enabling of any number of
NonNon--MarkovianMarkovian SPN modelSPN modelextensions (2)extensions (2)
distributed timed transitions, provided that the latter areall enabled at the same instant
The stochastic process underlying a CGPN is shown to bean MGRP
Equations for the steady-state as well transient analysisare provided
43
7/28/2019 SMS - Stochastic Petri Nets
44/44
Fluid Stochastic Petri nets (FSPN)
One or more places can hold fluid rather thandiscrete tokens
The discrete and continuous portions mayaffect each other
Able to both control the fluid flow, and have thediscrete control decisions be affected by observedfluid flow
NonNon--MarkovianMarkovian SPN modelSPN modelextensions (3)extensions (3)
The transient and the steady-state behavior ofFSPNs is described by a coupled system ofpartial differential equations
44