www.prismmodelchecker.org
HomeAboutDownloadsDocumentationManualPublicationsCase StudiesSupport

Bounded Retransmission Protocol

(D'Argenio, Jeannet, Jensen & Larsen)

Contents

Introduction

This case study is based on the bounded retransmission protocol (BRP) [HSV94], a variant of the alternating bit protocol. The BRP protocol sends a file in a number of chunks, but allows only a bounded number of retransmissions of each chunk. The model is represented as an MDP. We let N denote the number of chunks and MAX the maximum allowed number of retransmissions of each chunk. The PRISM source code is given below.

// bounded retransmission protocol [D'AJJL01]
// gxn/dxp 23/05/2001

mdp

// number of chunks
const int N;
// maximum number of retransmissions
const int MAX;

module sender

	s : [0..6];
	// 0 idle
	// 1 next_frame	
	// 2 wait_ack
	// 3 retransmit
	// 4 success
	// 5 error
	// 6 wait sync
	srep : [0..3];
	// 0 bottom
	// 1 not ok (nok)
	// 2 do not know (dk)
	// 3 ok (ok)
	nrtr : [0..MAX];
	i : [0..N];
	bs : bool;
	s_ab : bool;
	fs : bool;
	ls : bool;
	
	// idle
	[NewFile] (s=0) -> (s'=1) & (i'=1) & (srep'=0);
	// next_frame
	[aF] (s=1) -> (s'=2) & (fs'=(i=1)) & (ls'=(i=N)) & (bs'=s_ab) & (nrtr'=0);
	// wait_ack
	[aB] (s=2) -> (s'=4) & (s_ab'=!s_ab);
	[TO_Msg] (s=2) -> (s'=3);
	[TO_Ack] (s=2) -> (s'=3);
	// retransmit
	[aF] (s=3) & (nrtr<MAX) -> (s'=2) & (fs'=(i=1)) & (ls'=(i=N)) & (bs'=s_ab) & (nrtr'=nrtr+1);
	[] (s=3) & (nrtr=MAX) & (i<N) -> (s'=5) & (srep'=1);
	[] (s=3) & (nrtr=MAX) & (i=N) -> (s'=5) & (srep'=2);
	// success
	[] (s=4) & (i<N) -> (s'=1) & (i'=i+1);
	[] (s=4) & (i=N) -> (s'=0) & (srep'=3);
	// error
	[SyncWait] (s=5) -> (s'=6); 
	// wait sync
	[SyncWait] (s=6) -> (s'=0) & (s_ab'=false); 
	
endmodule

module receiver

	r : [0..5];
	// 0 new_file
	// 1 fst_safe
	// 2 frame_received
	// 3 frame_reported
	// 4 idle
	// 5 resync
	rrep : [0..4];
	// 0 bottom
	// 1 fst
	// 2 inc
	// 3 ok
	// 4 nok
	fr : bool;
	lr : bool;
	br : bool;
	r_ab : bool;
	recv : bool;
	
	
	// new_file
	[SyncWait] (r=0) -> (r'=0);
	[aG] (r=0) -> (r'=1) & (fr'=fs) & (lr'=ls) & (br'=bs) & (recv'=T);
	// fst_safe_frame
	[] (r=1) -> (r'=2) & (r_ab'=br);
	// frame_received
	[] (r=2) & (r_ab=br) & (fr=true) & (lr=false)  -> (r'=3) & (rrep'=1);
	[] (r=2) & (r_ab=br) & (fr=false) & (lr=false) -> (r'=3) & (rrep'=2);
	[] (r=2) & (r_ab=br) & (fr=false) & (lr=true)  -> (r'=3) & (rrep'=3);
	[aA] (r=2) & !(r_ab=br) -> (r'=4);  
	// frame_reported
	[aA] (r=3) -> (r'=4) & (r_ab'=!r_ab);
	// idle
	[aG] (r=4) -> (r'=2) & (fr'=fs) & (lr'=ls) & (br'=bs) & (recv'=T);
	[SyncWait] (r=4) & (ls=true) -> (r'=5);
	[SyncWait] (r=4) & (ls=false) -> (r'=5) & (rrep'=4);
	// resync
	[SyncWait] (r=5) -> (r'=0) & (rrep'=0);
	
endmodule
	
module checker

	T : bool;
	
	[NewFile] (T=false) -> (T'=false);
	[NewFile] (T=false) -> (T'=true);
	
endmodule

module	channelK

	k : [0..2];
	
	// idle
	[aF] (k=0) -> 0.98 : (k'=1) + 0.02 : (k'=2);
	// sending
	[aG] (k=1) -> (k'=0);
	// lost
	[TO_Msg] (k=2) -> (k'=0);
	
endmodule

module	channelL

	l : [0..2];
	
	// idle
	[aA] (l=0) -> 0.99 : (l'=1) + 0.01 : (l'=2);
	// sending
	[aB] (l=1) -> (l'=0);
	// lost
	[TO_Ack] (l=2) -> (l'=0);
	
endmodule
View: printable version          Download: brp.nm

We note that, as in [DJJL01], we have added a checker process which ensures that when checking properties we are only considering the transmission of one file, that is, we are not interested in checking properties after a transmission was successful or unsuccessful.

Model Statistics

The table below shows statistics for each model we have built. The first section gives the number of states in the MDP representing the model. The second part refers to the MTBDD which represents this MDP: the total number of nodes and the number of leaves (terminal nodes).

N: MAX:   Model:   MTBDD:
States: Nodes: Leaves:
1621,5122,9386
1631,9662,9336
1642,4203,0146
1652,8743,0026
3222,8563,0586
3233,7263,0536
3244,5963,1346
3255,4663,1226
6425,544 3,1786
6437,246 3,1736
6448,948 3,2546
64510,6503,2426

Model Construction Times

The table below gives the times taken to construct the models. There are two stages. Firstly, the system description (in our module based language) is parsed and converted to the MTBDD representing it. Secondly, reachability is performed to identify non-reachable states and the MTBDD is filtered accordingly. Reachability is performed using a BDD based fixpoint algorithm. The number of iterations for this process is also given.

N: MAX:   Construction:   Reachability:
Time (s): Time (s): Iter.s:
1620.350.39114
1630.260.41118
1640.260.46122
1650.260.50126
3220.280.76210
3230.280.79214
3240.290.88218
3250.270.91222
6420.281.64402
6430.291.71406
6440.281.78410
6450.301.83414

Model Checking

The PRISM source code for the properties considered is given below.

// property A of [D'AJJL01]
// the maximum probability that eventually the sender reports a certain unsuccessful transmission but the receiver got the complete file
Pmax=?[ F srep=1 & rrep=3 & recv ]

// property B of [D'AJJL01]
// the maximum probability that eventually the sender reports a certain successful transmission but the receiver did not get the complete file
Pmax=?[ F srep=3 & !(rrep=3) & recv ]

// property 1 of [D'AJJL01]
// the maximum probability that eventually the sender does not report a successful transmission
Pmax=?[ F s=5 & T ]

// property 2 of [D'AJJL01]
// the maximum probability that eventually the sender reports an uncertainty on the success of the transmission
Pmax=?[ F s=5 & T & srep=2 ]

// property 3 of [D'AJJL01]
// the maximum probability that eventually the sender reports an unsuccessful transmission after more than 8 chunks have been sent successfully
Pmax=?[ F s=5 & T & srep=1 & i>8 ]

// property 4 of [D'AJJL01]
// the maximum probability that eventually the receiver does not receive any chunk and the sender tried to send a chunk
Pmax=?[ F !(srep=0) & T & !recv ]
View: printable version          Download: brp.pctl

There are two precomputation steps in the model checking procedure involving BDD based fixpoint algorithms: Prob1E and Prob0A which finds those states such that the maximum probability of satisfying the formula is 1 and 0 respectively.

In the main algorithm we stop iterating when the relative error between subsequent iteration vectors is less than 1e-6, that is:

  • Property A of [DJJL01]: "The maximum probability that eventually the sender reports a certain unsuccessful transmission but the receiver got the complete file."

    Model checking times: As in none of the reachable states the sender reports a certain unsuccessful transmission while the receiver got the complete file, the probability of satisfying this property is 0 and model checking reduces to an invariance check.

    N: MAX:   Time (s):
    1620.035
    1630.036
    1640.040
    1650.040
    3220.041
    3230.042
    3240.038
    3250.037
    6420.038
    6430.037
    6440.039
    6450.040
  • Property B of [DJJL01]: "The maximum probability that eventually the sender reports a certain successful transmission but the receiver did not get the complete file."

    Model checking times: As in none of the reachable states the sender reports a certain unsuccessful transmission while the receiver got the complete file, the probability of satisfying this property is 0 and model checking reduces to an invariance check.

    N: MAX:   Time (s):
    1620.040
    1630.038
    1640.039
    1650.038
    3220.041
    3230.040
    3240.038
    3250.041
    6420.039
    6430.039
    6440.041
    6450.044
  • Property 1 of [DJJL01]: "The maximum probability that eventually the sender does not report a successful transmission."

    Model checking times:

    N: MAX:   Precomputation:   Main Algorithm:   Probability:
    Prob1E Prob0A Time (s): Iterations:
    Time (s): Iterations: Time (s): Iterations:
    1626.44 712 0.141919.722204.23E-4
    1637.91 840 0.142325.992241.26E-5
    1649.43 968 0.182731.682263.76E-7
    16510.811,0960.213136.912281.12E-8
    32213.151,4160.121965.96 4188.46E-4
    32315.991,6720.162391.49 4222.52E-5
    32419.341,9280.2027111.564247.52E-7
    32522.112,1840.2231131.874262.24E-8
    64227.492,8240.1219243.098120.001692
    64333.633,3360.1523330.068165.05E-5
    64440.813,8480.1927423.568181.51E-6
    64546.284,3600.4331511.228204.48E-8
  • Property 2 of [DJJL01]:"The maximum probability that eventually the sender reports an uncertainty on the success of the transmission."

    Model checking times:

    N: MAX:   Precomputation:   Main Algorithm:   Probability:
    Prob1E Prob0A Time (s): Iterations:
    Time (s): Iterations: Time (s): Iterations:
    1621.612340.4011012.152242.64E-5
    1631.752420.4311416.092287.89E-7
    1641.792500.4211814.562302.35E-8
    1651.862580.4212213.022327.00E-10
    3222.844260.6720640.404242.64E-5
    3232.924340.6721053.604287.89E-7
    3243.274420.9221432.494302.35E-8
    3253.294500.9721831.884327.00E-10
    6425.778102.01398146.268222.64E-5
    6435.998181.97402195.058247.89E-7
    6446.178262.07406162.188262.35E-8
    6456.188342.1041090.078287.00E-10
  • Property 3 of [DJJL01]:"The maximum probability that eventually the sender reports an unsuccessful transmission after more than 8 chunks have been sent successfully."

    Model checking times:

    N: MAX:   Precomputation:   Main Algorithm:   Probability:
    Prob1E Prob0A Time (s): Iterations:
    Time (s): Iterations: Time (s): Iterations:
    1622.363420.286817.092161.85E-4
    1633.224380.307223.062185.52E-6
    1644.425380.397630.112221.65E-7
    1655.436420.408027.722244.90E-9
    3224.49694 0.366866.38 4126.08E-4
    3235.71854 0.407289.12 4161.81E-5
    3247.021,0180.6176115.144185.41E-7
    3258.611,1860.4580124.714201.61E-8
    6428.25 1,3980.4168253.238060.001454
    64310.401,6860.4172416.968104.34E-5
    64412.981,9780.7076449.418121.29E-6
    64515.302,2740.4980515.218143.85E-8
  • Property 4 of [DJJL01]: "The maximum probability that eventually the receiver does not receive any chunk and the sender tried to send a chunk."

    Model checking times:

    N: MAX:   Precomputation:   Main Algorithm:   Probability:
    Prob1E Prob0A Time (s): Iterations:
    Time (s): Iterations: Time (s): Iterations:
    1620.20300.06194.671258.00E-6
    1630.22340.07235.541271.60E-7
    1640.26380.09273.291313.20E-9
    1650.28420.10312.981296.40E-11
    3220.21300.061910.842278.00E-6
    3230.24340.072312.612291.60E-7
    3240.23380.09277.55 2333.20E-9
    3250.25420.10316.57 2386.40E-11
    6420.21300.061926.254278.00E-6
    6430.24340.082329.164291.60E-7
    6440.42380.152718.534333.20E-9
    6450.30420.103115.014336.40E-11

Case Studies