Computer Networking Unit 2
Computer Networking Unit 2
Problem with Stop-And-Wait protocol is that it is very inefficient. At any one moment, only in frame is in
transition. The sender will have to wait at least one round trip time before sending next. The waiting can
be long for a slow network such as satellite link.
Stop and Wait Protocol
Characteristics Fig. 2.8 Stop and Wait- Lost Acknowledgement
• Used in Connection-oriented communication.
• It offers error and flow control 3. Delayed Acknowledgement/Data: After timeout on sender side, a long-delayed acknowledgement
• It is used in Data Link and Transport Layers might be wrongly considered as acknowledgement of some other recent packet.
• Stop and Wait ARQ mainly implements Sliding Window Protocol concept with Window Size 1
Useful Terms: Stop and Wait ARQ (Automatic Repeat Request)
• Propagation Delay: Amount of time taken by a packet to make a physical journey from one router to Above 3 problems are resolved by Stop and Wait ARQ (Automatic Repeat Request) that does both error
another router. control and flow control.
That is, two or more packets received each one with insufficient SNR to allow individual decoding can be
combined in such a way that the total signal can be decoded!
The following image explains this procedure. The transmitter sends a package [1]. The package [1] arrives,
and is 'OK'. If the package [1] is 'OK' then the receiver sends an 'ACK'.
Fig 2.31
When a transition fires, it takes the tokens that enabled it from the input places; it then distributes tokens
to output places according to arc weights. If the arc weights are all the same, it appears that tokens are
moved across the transition. If they differ, however, it appears that tokens may disappear or be created.
That, in fact, is what happens; think of the transition as removing its enabling tokens and producing output
tokens according to arc weight.
Fig 2.28 Petri Net Model
A special kind of arc, the inhibitor arc, is used to reverse the logic of an input place. With an inhibitor arc,
Arcs have capacity 1 by default; if other than 1, the capacity is marked on the arc. Places have infinite
the absence of a token in the input place enables, not the presence:
capacity by default, and transitions have no capacity, and cannot store tokens at all. With the rule that arcs
can only connect places to transitions and vice versa, we have all we need to begin using Petri Nets. A few
other features and considerations will be added as we need them.
A transition is enabled when the number of tokens in each of its input places is at least equal to the arc
weight going from the place to the transition. An enabled transition may fire at any time. When fired, the
tokens in the input places are moved to output places, according to arc weights and place capacities. This
results in a new marking of the net, a state description of all places.
Fig 2.32
This transition cannot fire, because the token in P2 inhibits it.
Tokens can play the following roles:
A physical object: a robot;
• An information object: a message between two robots;
• A collection of objects: the people mover;
• An indicator of a state: the state in which a robot is: defender/attacker;
• An indicator of a condition: a token indicates whether a certain condition is fulfilled (ex. Soccer game
Fig 2.29
starts when the referee gives the signal).
When arcs have different weights, we have what might at first seem confusing behaviour. Here is a similar net, ready
to fire: Transitions can play the following roles:
• An event: start a thread, the switching of a machine from normal to safe mode;
• A transformation of an object: a robot that changes his role, see further;
• A transport of an object: the ball is passed between the robots.
An arc connects only places and transitions and indicates the direction in which the token travels.
Fig 2.30