Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 8/29/2001 Reachability Analysis CFSM: Communicating Finite State Machines C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 CFSM Communicating Finite.

Similar presentations


Presentation on theme: "Page 1 8/29/2001 Reachability Analysis CFSM: Communicating Finite State Machines C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 CFSM Communicating Finite."— Presentation transcript:

1 Page 1 8/29/2001 Reachability Analysis CFSM: Communicating Finite State Machines C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 CFSM Communicating Finite State Machine Is represented by states and transitions and connected to channels. Here sender machine has two channels: C1 and C2. Channel are assumed to be FIFO. C1 is the outgoing channel for sender. C2 is the incoming channel for sender. When the sending transition of sender fires, It sends the msg in transition label to the outgoing channel. The receiving transition can only occurs if there is a msg of the same type in the head of CFSM’s incoming channel. CFSM 1 -R-R 2 Initial node with double circle, every CSFM only has one initial state State of a CFSM Transition of a CFSM - sign in label  sending + sign in label  receiving string after sign  msg type This transition sends msg R to the CFSM’s outgoing channel. It can also be represented as (1, 2, -R) 1 2

2 Page 2 8/29/2001 Reachability Analysis Operation of CFSM C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 current state When the network starts, the current states of both machines are set at their initial states. Receiver at state 1 can not fire the outgoing transition (1, 2, +R) Sender at state 1 can fire the outgoing transition (1, 2, -R), and result in current state of sender changed to 2 and msg R is put in channel C1. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 R

3 Page 3 8/29/2001 Reachability Analysis Operation of CFSM: Step 2 Now sender at state 2 has (2,1,+A) as its outgoing transition. There is no msg A in C2, therefore this receiving transition cannot be fired. It waits. Receiver at state 1 checks its outgoing receiving transition (1,2,+R) and found the msg label matched with the msg in the head of C1. It fires the transition, takes in the msg R (removes from C1) and changes its current state to state 2. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 R C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1

4 Page 4 8/29/2001 Reachability Analysis Operation of CFSM: Step 3 Now sender at state 2 has (2,1,+A) as its outgoing transition. There is no msg A in C2, therefore this receiving transition cannot be fired. It waits. Receiver at state 1 checks its outgoing receiving transition (1,2,+R) and found the msg label matched with the msg in the head of C1. It fires the transition, takes in the msg R (removes from C1) and changes its current state to state 2. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 R C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1

5 Page 5 8/29/2001 Reachability Analysis Operation of CFSM: Step 4 Now sender still at state 2 has (2,1,+A) as its outgoing transition. There is no msg A in C2, therefore this receiving transition cannot be fired. It waits. Receiver at state 2 checks its outgoing sending transition (1,2,-A). It fires the transition, put msg A in C2, and changes its current state to state 2. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 A

6 Page 6 8/29/2001 Reachability Analysis Operation of CFSM: Step 5 Receiver at state 1 checks its outgoing sending transition (1,2,+R). There is no msg R in C1. It waits. Now sender at state 2 has (2,1,+A) as its outgoing transition. There is a msg A in C2, therefore this receiving transition can be fired. It reads in A (remove from C2) and changes state to 1. Now Both machines get back to their initial states. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 A C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1

7 Page 7 8/29/2001 Reachability Analysis C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 What could happen next? In CFSM model, we assume only one transition can be fired in a time. No two simultaneous firing. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 Sender: (1,2,-R) Receiver: (2,1,-A) R A

8 Page 8 8/29/2001 Reachability Analysis What could happen next? Sender cannot move. Receiver can either receive msg R or send msg B. How many msgs can be in C1 for this network? How about C2? C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 -B-B R C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 -B-B R C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 -B-B Receiver: (1,2,+R) Receiver: (1,2,-B) B

9 Page 9 8/29/2001 Reachability Analysis What could happen next? Receiving state is a state where all its outgoing transition are all receiving transition. It can not move without msg in its incoming channel. Both machines are at receiving states and channels are empty. This is called deadlock. The network can not progress further. C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1

10 Page 10 8/29/2001 Reachability Analysis Unspecified Reception Error There is msg B in C2 but sender does not have a receiving transition with msg B. This is called unspecified reception. The network can not progress further. C1 C2 +A+A Sender 2 1 -R-R+R+R -A-A Receiver 2 1 B

11 Page 11 8/29/2001 Reachability Analysis Non-executable States and Transitions State 3 of Receiver will never be executed or become the current state. It is called non-executable state. Transitions (2,3,+B) and (3,1,-C) will never be executed. They are called non-executable transitions. How does one know they will never be executed? C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 B 3 -C-C +B+B

12 Page 12 8/29/2001 Reachability Analysis C1 C2 -R-R +A+A Sender 2 1 +R+R -A-A Receiver 2 1 1 1 E E Sender’s State Channel C1’s content Channel C2’s content Receiver’s State global state/reachable state CFSM 2 1 R E -R-R -B-B 2 1 B E gs0 gsn Global State ID gs2 -B-B Unspecified Reception Receiver do not know how to receive B E: channel empty 2 2 E E +R+R 2 1 E A -A-A +A+A gs1 gs3 gs4 Reachability Graph A process of generating all possible reachable states from the initial global state

13 Page 13 8/29/2001 Reachability Analysis Starting from initial global state, where channels are empty and machines at their initial state, explore all possible reachable state by firing the possible transitions (and generating global states) from any given reachable state. All deadlock and unspecified reception errors will be captured/marked as individual global state. By examining the number of msgs in the channels we can design the buffer size for the protocol. Can detect non-executable states and transitions by marking those state are touched and transition that are fired during the reachability analysis.

14 Page 14 8/29/2001 Reachability Analysis Reachability Analysis Exercise a)Perform the reachability analysis on the Network (M, N). b)What sizes of buffers are needed for the two FIFO channels? c)Are there non-executable states or transitions?

15 Page 15 8/29/2001 Reachability Analysis Solution One unspecified reception. Both channels need buffer size of 2. (see gs8 and gs9) No non-executable states and transitions. Since both machines send same types of msgs. We use Machine: to specify which machine fires the transition.


Download ppt "Page 1 8/29/2001 Reachability Analysis CFSM: Communicating Finite State Machines C1 C2 +A+A Sender 2 1 -R-R +R+R -A-A Receiver 2 1 CFSM Communicating Finite."

Similar presentations


Ads by Google