Cyclic server polling system

(Ibe and Trivedi)

Contents

Introduction:

This case study is based on a cyclic server polling system, taken from [IT90]. The model is represented as a CTMC. We use N to denote the number of stations handled by the polling server. By way of example, the PRISM source code for the case where N=5 is given below.

// polling example [IT90]
// gxn/dxp 26/01/00

ctmc

const int N=5;

const double mu= 1;
const double gamma= 200;
const double lambda= mu/N;

module server

	s : [1..5]; // station
	a : [0..1]; // action: 0=polling, 1=serving
	
	[loop1a] (s=1)&(a=0) -> gamma	: (s'=s+1);
	[loop1b] (s=1)&(a=0) -> gamma	: (a'=1);
	[serve1] (s=1)&(a=1) -> mu	: (s'=s+1)&(a'=0);
	
	[loop2a] (s=2)&(a=0) -> gamma	: (s'=s+1);
	[loop2b] (s=2)&(a=0) -> gamma	: (a'=1);
	[serve2] (s=2)&(a=1) -> mu	: (s'=s+1)&(a'=0);
	
	[loop3a] (s=3)&(a=0) -> gamma	: (s'=s+1);
	[loop3b] (s=3)&(a=0) -> gamma	: (a'=1);
	[serve3] (s=3)&(a=1) -> mu	: (s'=s+1)&(a'=0);
	
	[loop4a] (s=4)&(a=0) -> gamma	: (s'=s+1);
	[loop4b] (s=4)&(a=0) -> gamma	: (a'=1);
	[serve4] (s=4)&(a=1) -> mu	: (s'=s+1)&(a'=0);
	
	[loop5a] (s=5)&(a=0) -> gamma	: (s'=1);
	[loop5b] (s=5)&(a=0) -> gamma	: (a'=1);
	[serve5] (s=5)&(a=1) -> mu	: (s'=1)&(a'=0);
	
endmodule

module station1

	s1 : [0..1];
	
	[loop1a] (s1=0) -> 1 : (s1'=0);
	[]       (s1=0) -> lambda : (s1'=1);
	[loop1b] (s1=1) -> 1 : (s1'=1);
	[serve1] (s1=1) -> 1 : (s1'=0);
	
endmodule

// construct further stations through renaming
module station2 = station1 [s1=s2, loop1a=loop2a, loop1b=loop2b, serve1=serve2] endmodule
module station3 = station1 [s1=s3, loop1a=loop3a, loop1b=loop3b, serve1=serve3] endmodule
module station4 = station1 [s1=s4, loop1a=loop4a, loop1b=loop4b, serve1=serve4] endmodule
module station5 = station1 [s1=s5, loop1a=loop5a, loop1b=loop5b, serve1=serve5] endmodule

// cumulative rewards

rewards "waiting" // expected time the station 1 is waiting to be served
	s1=1 & !(s=1 & a=1) : 1;
endrewards

rewards "served" // expected number of times station1 is served
	[serve1] true : 1;
endrewards
Download: polling5.sm

Model Statistics:

The table below shows statistics for each model we have built. The first section gives information about the CTMC representing the model: the number of states and the number of non-zeros (transitions). The second part refers to the MTBDD which represents this CTMC: the total number of nodes, the number of leaves (terminal nodes), and the amount of memory needed to store it. The last column gives the amount of memory a sparse matrix would need to represent the same CTMC.

N: Model: MTBDD: Sparse:
States: NNZ: Nodes: Leaves: Kb: Kb:
4 96 272 178 4 3.48 4.3
5 240 800 271 4 5.29 12.2
6 576 2,208 367 4 7.17 32.6
7 1,344 5,824 482 4 14.9 84
8 3,072 14,848 608 4 11.9 210
9 6,912 36,864 765 4 14.9 513
10 15,360 89,600 921 4 18.0 1,230
11 33,792 214,016 1,096 4 21.4 2,904
12 73,728 503,808 1,282 4 25.0 6,768
13 159,744 1,171,456 1,491 4 33.3 15,600
14 344,064 2,695,168 1,707 4 33.3 35,616
15 737,280 6,144,000 1,942 4 37.9 80,640
16 1,572,864 13,893,632 2,188 4 42.7 371,712
17 3,342,336 31,195,136 2,469 4 48.2 378,624
18 7,077,888 69,599,232 2,745 4 53.6 843,264
19 14,942,208 154,402,816 3,040 4 59.4 1,867,776
20 31,457,280 340,787,200 3,346 4 65.4 4,116,362

Model Construction Times

The table below gives the times taken to construct the models. This process involves first building a CTMC (represented as an MTBDD) from the system description (in our module based language), and then computing the reachable states using a BDD based fixpoint algorithm. The total time required and the number of fixpoint iterations are given below.

N: Construction:
Time (s): Iter.s:
4 0.039 9
5 0.043 11
6 0.059 13
7 0.063 15
8 0.069 17
9 0.09 19
10 0.107 21
11 0.115 23
12 0.126 25
13 0.144 27
14 0.156 29
15 0.19 31
16 0.202 33
17 0.239 35
18 0.271 37
19 0.302 39
20 0.346 41

Model Checking

We now report on the model checking results obtained using PRISM when checking the following CSL specifications.

// Time bound
const double T;

// Probability that in the long run station 1 is awaiting service 
S=? [ s1=1 & !(s=1 & a=1) ]

// Probability that in the long run station 1 is idle 
S=? [ s1=0 ] 

// Once a station becomes full, the minimum probability it will eventually be polled
P=? [ true U (s=1 & a=0) {s1=1}{min} ]

// Probability, from the inital state, that station 1 is served before station 2
P=? [ !(s=2 & a=1) U (s=1 & a=1) ]

// Probability that station 1 will be polled within T time units
P=?[ true U<=T (s=1 & a=0) ]

// Expected time that station 1 is waiting to be served
R{"waiting"}=?[C<=T]

// Expected number of times station1 is served
R{"served"}=?[C<=T] // number of times station1 is served
Download: polling.csl

All experiments were carried out on a 2.80GHz PC with 1 Gb memory running Linux and in all iterative methods we stop iterating when the relative error between subsequent iteration vectors is less than 1e-6, that is:

max⁡i(∣πi(k)−πi(k−1)∣∣πi(k)∣)<10−6\max_i \left( \frac{|\pi_i^{(k)} - \pi_i^{(k-1)}|}{|\pi_i^{(k)}|} \right) < 10^{-6}
plots probability that in the long run station 1 is awaiting service
Probability that in the long run station 1 is awaiting service
plots probability that in the long run station 1 is idle
Probability that in the long run station 1 is idle
plots expected number of times station 1 is served by time T
Expected number of times station 1 is served by time T