probabilistic verification of gbn group members: lin huang(lh2647), yuechen qin(yq2158), xi...

19
Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Upload: marilyn-brown

Post on 04-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Probabilistic Verification of GBN

Group Members:

Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426)

04/08/2014

Page 2: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Probabilistic Verification of GBN

Introduction

Test Algorithm

Discussion

Page 3: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Introduction

Probabilistic Verification of GBN ( Applied Tests ) For any possible state in the GBN protocol, we need to

generate all the possible next state. For each of the possible next state, call the step above

recursively to check if it could successfully end up at a stop point.

If the protocol is right, the verification would end within a finite amount of time.

Page 4: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm

Components of States

Assumption

Algorithm Modules Stack Sender Receiver Channel(Forward, Reverse)

Implementation

Optimization

Page 5: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Components of States

<S, R, Fc, Rc, prob, action, num, father, son> S: sender state, range R: receiver state, range Fc: forward channel Rc: reverse channel Prob: low probability action: service sequence num: indices of messages father: predecessor of the current state son: successor of the current state

Page 6: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Assumption

At most 8 packets can be simultaneously in the forward channel

At most 4 packets can be simultaneously in the reverse channel

Channel would lose 1 packet at a time; Sender and Receiver process 1 packet at a time.

Given Window size of 4, for both sender and receiver, states that have the same value of S(or R) mod 4 are considered to be identical

Page 7: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Assumption

Time out Fc == E & Rc == E

Stopping Points S > 4 & R > 4

True stopping points for the protocol:

S mod 4 ==1; R mod 4 == 1; Fc == E; Rc == E; prob 4 The appearance of a state that has already been in the

stack.

Page 8: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Algorithm Modules

Stack Push

Check if the state already existed

in the stack Check if the prob == 4 Bubble sort to ensure that the

stack locates the states with

monotonically increasing low

probability Pop

Pop the state on top of the stack

Page 9: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Algorithm Modules

Sender Input the current state <S, R, Fc, Rc, prob, action, num,

father, son> to the sender function ; Let base = S; If Fc == E & Rc == E, put Msg[base] ~ Msg[base + 3] in

Fc Extract the1st packet in Rc, name it ack

If ack < base, do nothing If ack == base, put Msg[base + 4] in Fc, base ++ If ack > base, put Msg[base + 4] ~ Msg[ack + 4] in Fc,

base = ack +1 Return the new state

Page 10: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Algorithm Modules

Receiver Input the current state <S, R, Fc, Rc, prob, action, num,

father, son> to the receiver function ; Let ExpectedNum = R;

If Fc == E, do nothing; Extract 1st packet in Fc, name it Msg

If Msg == ExpectedNum, put Ack[ExpectedNum] in Rc If Msg != ExpectedNum, put Ack[ExpectedNum - 1] in

Rc Return the new state

Page 11: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Algorithm Modules

Channel Functionality

Generate all possible error situation (1 packet lost), low probability increases by 1 ( prob ++ ) ;

Push the generated state into the stack.

Page 12: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Implementation Problem

Assume the current state <S, R, Fc, Rc> is <1, 2, 234, 1>, what is the next state? <2, 2, 2345, E>: ack1 arrives at sender first; <1, 3, 34, 12>: msg2 arrives at receiver first; <1, 4, 4, 123>: msg2 and msg3 are faster than ack1; <1, 5, E, 1234>: msg2, msg3 and msg4 are all faster than ack1;

Solution For a certain state, input it into three functions, which are sender, receiver,

channel; Output

State sender: sender gets ack first; state receiver: receiver gets msg first; state channel: all possible packet-lost situation

Page 13: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Implementation

Example

Page 14: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Implementation

Steps Push the initial state into the stack; Check if stack is empty, if so, end; if not, continue; Pop the top state in the stack; Put the popped state into channel; Put the popped state into sender and receiver, get the

new state S1 and S2 accordingly; if S1 or S2 is different from the popped state, push it into the stack;

Go back to the 2nd step

Page 15: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Optimization

Problem (a): push E child of D into the stack, there’s already a E

node in the stack (b): push E child of C into the stack, there’s no E node in

the stack (c): E can be produced by another E

Page 16: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Test Algorithm : Optimization

Solution Use an array to store all the states(/nodes) that have been

in the stack Check if the popped state is already in the array:

if so, check if this identical state in the array is one of the predecessor of the popped state; if so, push it into the stack, otherwise discard;

If not, push it into the stack

Results # of steps: 15,000+ 400+

Page 17: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Discussion

Here the protocol failure is only possible when there are four packet losses happening continuously. Although this state is wiped out from the simulation due to its low probability, it may still happen, leading to the deadlock. Theoretically it may happen twice continuously so that the average sequence length is 0. However, only when the length is large enough, the probability can be larger than ”sufficiently small”, where we define as .

We mention that the time interval is the same as length interval, since the source xmits message once per second.

Page 18: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Discussion

Calculation of the probabilistic minimal interval The failure rate

Here we make

And we can find out that

Page 19: Probabilistic Verification of GBN Group Members: Lin Huang(lh2647), Yuechen Qin(yq2158), Xi Chen(xc2257), Runxi Zhou(rz2286), Shuang Zhang(sz2426) 04/08/2014

Thank you for attention!

Questions are warmly welcomed!