Page 119 - DCAP207_NETWORKS_DCAP406_COMPUTER_NETWORKS
P. 119
Computer Networks/Networks
Notes sign) and a message reception transition is indicated by a “+” (plus sign). A full duplex, error-
free, FIFO channel connects each pair of processes.
Figure 8.2: A Correctly Designed Protocol
Figure 8.2 shows a correctly designed protocol involving two processes P1 and P2. Initially,
both processes are in their state 1. P1 transmits message 1 to P2 and enters state 2. P2 receives the
message 1 and enters state 2. At this time, P2 either transmits message 2 and returns to the initial
state or transmits message 3 and enters a new state 3. Similarly, P1 returns to its initial state or
goes to a new state 3 depending on the message received. When both the processes are in state
3, the only possible transition is the transmitting and receiving of message 4 by P1 and P2
respectively.
Petri Net Models
Petri net model also uses a graph to indicate states and transitions and consist of four parts:
Places: It is denoted by a circle and represents the state of the system. Figure 8.3 has two places
A and B.
Transitions: It is denoted by horizontal or vertical bar.
Arrows: Each transition has zero or more input arrows coming from its input places and zero or
more input arrows going to its output places.
Figure 8.3: A Petri Net with Two States
Tokens: It is denoted by heavy dot and tells the current state of the system. Figure 8.3 indicates
that the system is in State A.
A transition is enabled if each of its input places has at least one input token.
Any enabled transition is fired and the tokens at each input places are removed to store in
each of the output places.
After firing, the number of tokens may vary depending upon the number of input and
output places.
One transition can fire at a time; however the choice of a transition to fire is indeterminate.
Petri net of Figure 8.3 can be used to model any two phase process and therefore deterministic.
112 LOVELY PROFESSIONAL UNIVERSITY