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

dtmc

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

// prevents more than one file being sent
module tester 

	T : bool;
	
	[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
Download: brp.pm

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:
16 2 677 2,182 6
16 3 886 2,179 6
16 4 1,095 2,237 6
16 5 1,304 2,230 6
32 2 1,349 2,272 6
32 3 1,766 2,269 6
32 4 2,183 2,327 6
32 5 2,600 2,320 6
64 2 2,693 2,362 6
64 3 3,526 2,359 6
64 4 4,359 2,417 6
64 5 5,192 2,410 6

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. We give the overall construction time and both the time and iterations for the reachability process.

N: MAX: Construction: Reachability:
Time (s): Time (s): Iter.s:
16 2 0.12 0.10 105
16 3 0.12 0.11 107
16 4 0.14 0.12 109
16 5 0.15 0.12 111
32 2 0.22 0.22 201
32 3 0.27 0.22 203
32 4 0.28 0.26 205
32 5 0.28 0.25 207
64 2 0.50 0.42 393
64 3 0.52 0.43 395
64 4 0.55 0.43 397
64 5 0.58 0.44 399

Model Checking

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

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

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

// property 1 of [D'AJJL01]
// the probability the sender does not report a successful transmission
P=?[ F s=5 ]

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

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

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

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

In the main algorithm we use the Jacobi iterative method and 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}