stochastic Petri net (SPN)

5 downloads 0 Views 4MB Size Report
chains. • Introduction to stochastic Petri nets (SPN). • Example of Wireless cellular system. • Example of a Multiprocessor System. • SPNP: A Software Package.
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: [email protected] 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 Packet, Cell, etc.

Network Element: Router, Switch, etc.

Buffer

Copyright © 2017 by K.S. Trivedi

4

Traditional Approach Step 1: Abstract the system l

n

m

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: Copyright © 2017 by K.S. Trivedi

Timed PN (TPN) 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 T I O M

set of places set of transitions input arcs output arcs 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 p2

p1

p1 – resource idle p2 – resource busy t1 – task arrives t2 – task completes Copyright © 2017 by K.S. Trivedi

t2

23

Example of a PN p3

t1

p1

p2

t2

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

p3 – user

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

t_repair

down

“t_fail” fires

up

“t_fail” fires

t_fail t_repair

t_fail t_repair

“t_repair” fires

“t_repair” fires down

up

t_fail

down

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

26

Reachability Analysis t_fail 2,0

t_fail 1,1

t_repair

0,2 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

pj

e(tk) = #p1=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 t

Immediate transition t is enabled

• 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 p2

t1 t2

Transition t1 & t2 will fire 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 u

CTMC 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)

n

m

m(t3) = #P4 m

n

m

l(t1) = l t1  arrival t3  service Copyright © 2017 by K.S. Trivedi

immediate trans.

80

GSPN Example: M/M/i/n Queue Pserver i

n-i Tarrival

Tservice

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:

0,0,0

l

l

1,0,0

2,0,0

i>0 (ERG):Tarrival tquick 0,0,i 1,0,i 0,1,i-1 Tservice

n-i,i,0

n-i,i-1,1

Tservice

tquick

.......

l

.......

Tarrival

...

Tservice Tarrival

l

n,0,0

tquick

1,i-1,1

0,i,0

1,i,0

1,i-1,1

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

Copyright © 2017 by K.S. Trivedi

im

im

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

n





Dn-1



n-1

n (1  c) Bn





Bn-1

n-2

...............



 1



(n  1) (1  c)

1,2,…,n are up states; all others are down states Copyright © 2017 by K.S. Trivedi

88

0

Multiprocessor Availability Model (Contd.) • Compute the steady state probability pj for each state j • System unavailability = n

n

j 2

j 2

1   j 1p j  p 0   p D j   p B j n

• 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) 2,0,0,0,0

Tfail

tcov

1,1,0,0,0

Tuncov

1,0,0,1,0

Trecon

1,0,1,0,0 Trep 0,0,0,0,2

tquick

Treboot 1,0,0,0,1

Trep

Tfail

0,1,0,0,1

Extended Reachability Graph for Multiprocessor model 2,0,0,0,0 2(1-c)

1,0,0,1,0

2c





1,0,1,0,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, ri   0,

# Pup  1 and (# Pcov  # Pun cov )  0 otherwise

• Reward rate at the CTMC level for (steadystate/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 # Pup  1 and (# Pcov  # Pun cov )  0 0, ri   1, otherwise • Reward rate at the net level for downtime (in minutes/year) # Pup  1 and (# Pcov  # Pun cov )  0 0, ri   8760  60, otherwise • Reward rate at the net level for capacity-oriented availability # Pup  1 and (# Pcov  # Pun cov )  0 # Pup , 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 t3(g_t3) 1-p

guard(“t3”, g_t3);

harc(“t1”, “P2”)

t4(0)

vf1

viarc(“t3”, “P3”, vf1)

p

r P1 place(“P1”); init(“P1”,1);

t1

3

P2

P3

T(10)

ratedep(“T”, “P2”, r); priority(“T”,10); moarc(“t1”,“P2”, 3);

3

t2

imm(“t2”); probval(“t2”, p);

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

n

m

m mm

l Poisson Arrival

Single Server m-stage Erlang Service time

SRN of M/E Queue Copyright © 2017 m by/1/n K.S. Trivedi

102

SRN Analysis: Step-2 Reachability Analysis: Automatically Generate ERG SRN Specification

Extended Reachabilty Graph

Vanishing Marking Tangible Marking Copyright © 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

Copyright © 2017 by K.S. Trivedi

& Pd

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

Write a guard instead

C g+1

mc

g

ln New calls

Talking-channels

#

Puigjaner and Trivedi, Loss formulae and their optimization for cellular networks, IEEE Trans. on Vehicular Technology, May 2001

Call-completion

#

lh Handoff-in

mo Handoff-out

Stochastic Petri Net Model of wireless hard handoff Copyright © 2017 by K.S. Trivedi

112

Guard function: g_new_calls

Modeling for cellular network with hard handoff

if(mark(“Idle_channels”) >= g+1) return(1) else return(0)

ln New calls

Idle-channels

C

mc Talking-channels

#

Call-completion

Haring, Marie, Puigjaner and Trivedi, Loss formulae and their optimization for cellular networks, IEEE Trans. on Vehicular Technology, May 2001

#

lh Handoff-in

mo 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, ri   0,

# Idle  channels  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 0

ln + lh

1

mc +mo

... C-g-1

C-g

(C-g)(mc+mo)

Pd  p C Pb  p C  g  ...  p C

lh

C-g+1 ... C-1

(C+1-g)(mc+mo)

lh C C(mc +mo)

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

C-1 1/MTTR

1/MTTF

(C-1)/MTTF C-2

...

1/MTTR Copyright © 2017 by K.S. Trivedi

1

0

1/MTTR 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+1

g

mc #

mo

#

1/MTTF 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

# lw

Tfsrep

Tfsfail

Twsfail

lf

mf

Twsrep

Pfsdn

Pwsdn Copyright © 2017 by K.S. Trivedi

124

WFS example first SPN 2

1

Pwsup

Pfsup

mw

# lw

Tfsrep

Tfsfail

Twsfail

lf

mf

Twsrep

Pfsdn Pwsdn 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

Pwsfl

Pfsup

# Tfsfl

Pwst

Tfsrp

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 21000

fsfl

wsfl

11100

fsrp

20001

wsfl

wsrp wscv

wsuc fsfl 10101

wscv

11010

wsfl

fsrp 10011 wsfl

Copyright © 2017 by K.S. Trivedi

01110

wscv

wsuc fsfl 00111 wscv

01020

fsrp 00021

130

The CTMC for the example

21000 lf

mf

20001

mw

mw

2lwc

lwc

11010

2lw(1-c)

2lw

lf

mf

10011

Copyright © 2017 by K.S. Trivedi

lw(1-c)

lw

01020 lf

mf

00021

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

λfsfl

#λwsfl Twsfl

Twsrp

Tfsfl

Tfsrp

μfsrp

μwsrp Pwsdn

Pfsdn

Pwsrp

Pfsrp t1

t0

Prepair

Copyright © 2017 by K.S. Trivedi

Immediate Transition

Prob. value

t0

1

t1

1 134

ERG for the example Tfsrp 2100001

Twsrp

Twsfl

Tfsfl

2000101

1101001

1110000

Twsrp

Twsfl

Tfsrp

Twsrp

t1

Tfsfl

t0

Twsfl

1001010

0002010

Tfsrp

Tfsfl 0011100

Twsfl

Twsfl

1010100

t1

0111000

2000010

0102001

Twsrp

1001101

t0

Marking= Copyright © 2017 by K.S. Trivedi

135

Reduced ERG for the example μfsrp 2100001

μwsrp

2λwsfl

λfsfl

2000101

1101001

1110000

μwsrp

λfsrp

μwsrp

1

λwsfl

λfsfl

2000010

1

λwsfl

0002010

μfsrp

λfsfl 0011100

1001010

λwsfl

1010100

1

0111000

2λwsfl

0102001

μwsrp

1001101

1

Marking= 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

mf

1

mf

2lw mw 2

lf

3

7

lw lf

2lw

mw

lw mw 4 lf

6

lw

mw

5

8

mf Copyright © 2017 by K.S. Trivedi

138

GSPN Example: M/M/m/b Queue Pserver m

b-m Tarrival

Tservice

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 IEEETR , 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( ) void ac_init( ) void ac_reach( )

void ac_final( ) Copyright © 2017 by K.S. Trivedi

SRN definition

Perform analysis and get measures

153

Specification of SRN Model Setup and Initialization

#include “user.h” void options( )

SRN definition

void net( ) int assert( ) void ac_init( ) void ac_reach( )

Perform Analysis and Get Measurement

void ac_final( ) SPNP model definition file

Copyright © 2017 by K.S. Trivedi

154

SRN Notation Summary t3(g_t3) 1-p

guard(“t3”, g_t3);

harc(“t1”, “P2”)

t4(0)

vf1

viarc(“t3”, “P3”, vf1)

p

r P1 place(“P1”); init(“P1”,1);

t1

3

P2

P3

T(10)

ratedep(“T”, “P2”, r); priority(“T”,10); moarc(“t1”,“P2”, 3);

3

t2

imm(“t2”); probval(“t2”, p);

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 analysis

steady-state

Fast MTTA solver

transient

IOP_SSMETHOD

SOR (fastest) VAL_SSSOR

Gauss-Seidel (slow) VAL_GASEI

Power Method (guaranteed convergence) VAL_POWER

standard uniformization VAL_TSUNIF

Fox-Glynn uniformization VAL_FOXUNIF

Stiff Uniformization 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 RES_ERROR



Assert(): check for error at every state



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

File Formats .rg file _nplace = _ntrans = _places = . . . . . . . _transitions = . . . . . . . _ntanmark = _nabsmark = _nvanmark = _nentries = _reachset = . . . . . . . . _reachgraph = :: . . . . . . . . .

.mc file _firstindex = _nstates = _nentries = _order = {_FROMTO|_TOFROM} _matrix = :. . . . . . . . . . . . [_initstate = : . . .] _iterations = _precision = _method = _time = Copyright © 2017 by K.S. Trivedi

set by IOP_PR_MC_ORD ER {VAL_FROMTO}

.prb file _firstindex = _nstates = _method = _precision = _iterations = _time = _probabilities = : . . . . . . . . . . . . [ _derprobabilities = . . . . . . . . . . _cumprobabilities = . . . . . . . . . . _dercumprobabilities = . . . . . . . . . . ] 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 computation

Pr_message(), pr_value() 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 •

Parameter definition:

Rate of T was r*(#P2), after using parm, Now rate of T is r*(#P2)*rate

– parm(“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 rewardbase 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 nonMarkovian 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 Three policies firing times (sim) – Policy(“t”, PRD) – Affected(“t1”, “T”, PRS) – xxxval(), xxxdep(), xxxfun()

PRI, PRD, PRS

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 – Exponential – Constant (including Immediate) – Uniform – Truncated normal – Weibull – Lognormal

– – – – – – –

Geometric Erlang Pareto Cauchy Beta Gamma Poisson

Copyright © 2017 by K.S. Trivedi

177

Transition Type Definition Transition Type

Definition

Parameters

Exponential

rateval(t,val), ratedep() ratefun() detval(t, val)

val = firing rate

Deterministic (Constant)

val = firing rate (1/time) lower=a, upper=b

Uniform(a,b)

unifval(t, lower, upper)

Geometric(p)

geomval(t, val1, val2)

Weibull(a,b)

weibval(t, val1, val2)

val1=p val2=time step 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 2 - s ta g e H y p e r e x p o n e n tia l 3 - s ta g e H y p o e x p o n e n tia l E r la n g

n e g b v a l( t, v a l1 , v a l2 , v a l3 ) h y p e r v a l( t, v a l1 , v a l2 , v a l3 ) h y p o v a l( t, v a l1 , v a l2 , v a l3 , v a l4 ) e r lv a l( t, v a l1 , v a l2 )

v a l1 =  , v a l2 = p , v a l3 = s te p v a l1 = l   v a l2 = l   v a l3 = p v a l1 = n u m s ta g e s v a l2 ~ 4 = l   l   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 Copyright © 2010 by K.S. Trivedi

179

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(7.5) I(2.5) Br(3.0)

B(45) FP2 I(0.0)

T1

FP1 1.2

fplace(“FP1”); fbound(“FP1”, 7.5); finit(“FP1”, 2.5); fbreak(“FP1”, 3.0);

Indicate a state change at x = 3.0

T2

2.0

inf(“T1”); diarc(“T2”, “FP2”);

state functions for FSPN: (a) fmark(“FP1”); Copyright © 2017 by K.S. 183 (b) Trivedi fcondition(“FP2”, F_LQ, 3.0);

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 Copyright © 2017 by K.S. Trivedi 184 relative error.

Execution of SPNP options()

ReadModel()

6 net()

Yes Simulation?

No

Rebuild? Yes

Discrete Event Simulation

BuildReachabilityGraph()

No ac_init()

solve()

ac_reach()

bind() Steady State Accumulative ac_final() Rebuild()

sensi() Copyright © 2017 by K.S. Trivedi

Transient

MTTA 185

Solution Techniques SRN Model Markovian Nets

Generate All Markings (tangible + vanishing)

Generate Reward Rates for Tangible Markings

FSPNs

Non-Markovian Nets

Discrete make correspondance list Event Simulation schedule transition events (DES) schedule fluid events change states

Extended Reachability Graph (ERG)

modify clock

Compute statistics 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)

Steady-state analysis

IOP_SIMULATION

transient analysis

IOP_SIM_RUNMETHOD Regenerative Simulation (VAL_REG)

Batch means (VAL_BATCH)

Regenerative Importance Sampling (VAL_ISREG)

Independent Replications

Regular DES (VAL_REPL)

Importance Sampling (VAL_IS)

Restart (VAL_RESTART)

Copyright © 2017 by K.S. Trivedi

Splitting (VAL_SPLIT) 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 T2

B T2 T4

D 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 )

A

B3 B2 B1 0

Copyright © 2017 by K.S. Trivedi

Note: Every state will eventually return to 0 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)   i 1

T



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 ([email protected]) 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 AlternateRouting, 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