Chapter 2
Chapter 2
Chapter 2
control protocols)
3.2 DATA LINK PROTOCOLS NOISY CHANNELS
(Flow&Error control protocols)
❑ Stop and wait with ARQ: Automatic Repeat reQuest (ARQ), an error control method,
Example 1.
⮚ Figure 1 shows an example of Stop-and-Wait ARQ.
Event :
1. Frame 0 is sent and acknowledged.
2. Frame 1 is lost and resent after the time-out.
3. The resent frame 1 is acknowledged and the timer stops.
4. Frame 0 is sent and acknowledged, but the acknowledgment is lost.
5. The sender has no idea if the frame or the acknowledgment is lost.
6. so after the time-out, it resends frame0, which is acknowledged.
1.Stop-and-Wait ARQ (Automatic Repeat reQuest)
protocol(cont…)
1. Stop-and-Wait
ARQ
(Automatic
Repeat Request)
protocol
(cont,d…)
Figure : Flow
diagram for
Example 1
1.Stop-and-Wait ARQ (Automatic Repeat reQuest)
1.3 Efficiency of Stop-and-Wait ARQ (cont’d…)
protocol(cont…)
❑ Advantages of stop and wait ARQ
1. It can be used for noisy channels
2. It has both error and flow control mechanism
3. It has timer implementation
❑ Disadvantages of stop and wait ARQ
1. Efficiency is very less.
2. Only 1 frame is sent at a time
3. Timer should be set for each individual frame
4. No pipelining
5. sender window size is 1( disadvantage over Go back N ARQ)
6. receiver window size is 1( disadvantage over selective repeat ARQ)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ)***
❑ The send window is an imaginary box covering the sequence numbers of the data frames
which can be in transit.
❑ The window at any time divides the possible sequence numbers into four regions.
▪ First Region: It defines the sequence numbers belonging to frames that are already
acknowledged
▪ Second Region: It defines the range of sequence numbers belonging to the frames that
are sent and have an unknown status. call these “outstanding frames.”
▪ Third Region: It defines the range of sequence numbers for frames that can be sent; but
not yet been received from the network layer.
▪ Fourth Region: It defines sequence numbers that cannot be used until the window
slides
❑ The send window is an abstract concept defining an imaginary box of size 2m − 1 with
three variables: Sf, Sn, and Ssize.
3.23.2Go-Back-N Automatic Repeat reQuest (ARQ)
Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
❑ The send window can slide one or more slots when a valid acknowledgment arrives
❑ The receive window is an abstract concept defining an imaginary box of size 1 with one
single variable Rn. The window slides when a correct frame has arrived; sliding occurs
one slot at a time
3.2 Go-Back-N Automatic Repeat reQuest (ARQ)
(cont..)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
⮚ Timers
▪ Although there can be a timer for each frame that is sent, in this protocol use only one.
▪ The reason is that the timer for the first outstanding frame always expires first; send
all outstanding frames when this timer expires.
⮚ Acknowledgment
▪ The receiver sends a positive acknowledgment if a frame has arrived safe and sound
and in order.
▪ If a frame is damaged or is received out of order, the receiver is silent and will discard
all subsequent frames until it receives the one it is expecting.
▪ The silence of the receiver causes the timer of the unacknowledged frame at the
sender site to expire.
▪ This, in turn, causes the sender to go back and resend all frames, beginning with the
one
with the expired timer.
▪ The receiver does not have to acknowledge each frame received. It can send one
cumulative acknowledgment for several frames.
3.2 Go-Back-N Automatic Repeat reQuest (ARQ)
(cont..)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
⮚ Resending a Frame
▪ When the timer expires, the sender resends all outstanding frames. For example,
suppose
the sender has already sent frame 6, but the timer for frame 3 expires.
▪ This means that frame 3 has not been acknowledged; the sender goes back and
sends frames 3, 4,5, and 6 again. That is why the protocol is called Go-Back-N
ARQ.
3.2 3.2
Go-Back-N Automatic Repeat reQuest (ARQ)
Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
Figure 5 : Design of Go-Back-N ARQ
❑ Send Window Size
▪ In Go-Back-N ARQ, the size of the send window must be less than 2m ; the size of the receiver window is
always 1.
o Figure 6 Window size for Go-Back-N ARQ
3.2 3.2
Go-Back-N Automatic Repeat reQuest (ARQ)
Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
❑ Algorithms ( Algorithm.7 Go-Back-N sender algorithm)
(continued)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
❑ Algorithms ( Algorithm.7 Go-Back-N sender algorithm)
(continued)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ)
3.2 Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
❑ Algorithms : Go-Back-N receiver algorithm
3.23.2Go-Back-N Automatic
Go-Back-N Automatic Repeat
Repeat reQuest (ARQ) reQuest (ARQ)
(cont’d….)
(cont..)
❑ Example 1
▪ Figure 1 shows an example of Go-Back-N.
▪ This is an example of a case where the forward channel is reliable, but the reverse is not.
▪ No data frames are lost, but some ACKs are delayed and one is lost.
▪ The example also shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost.
▪ After initialization, there are seven sender events. Request events are triggered by data
from the network layer; arrival events are triggered by acknowledgments from the
physical layer.
▪ There is no time-out event here because all outstanding frames are acknowledged before
the timer expires.
▪ Note that although ACK 2 is lost, ACK 3 serves as both ACK 2 and ACK 3.
3.2 3.2
Go-Back-N Automatic Repeat reQuest (ARQ)
Go-Back-N Automatic Repeat reQuest (ARQ) (cont’d….)
(cont..)
❑ Example 1 ( Figure 1 Flow diagram for Example 1)
Selective Repeat Automatic Repeat Request
●
Go-Back-N ARQ simplifies the process at receiver site.
●
Receiver keeps track of only one variable
●
Out of order frames are discarded
●
But this method is inefficient for noisy channel.
●
Noisy channel frame has higher probability of damage ,resending frames uses bandwidth and
Windows
●
Two windows used
●
A send window
●
A receive window
●
Send window and receive window both are of same size (2m-1)
Selective Repeat Automatic Repeat Request
●
Protocol allows as many frames as the size of the sender window
●
Frames arrive out of order and be kept until there is a set of in-order frames to be delivered to the
network layer
●
All frame in the send frame can arrive out of order and be stored until they can be delivered
●
If size of window is 2 and all acknowlegments are lost ,the time for frame 0 expires and frame 0 is
resent
●
However ,the window of the receiver is now expecting frame 2 ,not frame 0,so this duplicate frame is
correctly discarded.
●
When the size of the window is 3 and all acknowledgements lost ,the sender sends a duplicate of
frame 0
●
However this time the window of receiver expects to receive frame 0(0 is part of the window ),so it
accepts frame 0,not as a duplicate ,but as the first frame in the next cycle.