0% found this document useful (0 votes)
11 views

Stop and Wait Protocol and Go-BackN ARQ.

Vgcv

Uploaded by

Rengeshwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Stop and Wait Protocol and Go-BackN ARQ.

Vgcv

Uploaded by

Rengeshwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Flow and Error Control

The most important responsibilities of the


data link layer are flow control and error
control. these functions are known as :

data link control.


Sliding Window Protocols
Topics

■ Stop and Wait Protocol

■ Go Back N Sliding Window Protocol

■ Selective Repeat Sliding Window Protocol


Data link control
Data must be checked and processed before
they can be used.
The rate of such processing is often slower
than the rate of transmission.
For this reason , each receiver has a buffer to
store incoming data until they are processed.
If buffer begin to fill up, the sender must slow
or halt transmission.

10.
Note

Flow control refers to a set of procedures used


to restrict the amount of data that the sender can
send before waiting for acknowledgment.

10.
Data link
control.
Error control : is both error detection and
correction. Error correction in data link layer is
implemented simply: anytime an error is
detected in exchange, specified frames are
retransmitted. This process is called Automatic
Repeat Request

10.
Note

Error control in the data link layer is based on


automatic repeat request, which is the
retransmission of data.

10.
PROTOCOLS

Now let us see how the data link layer can


combine flow control , and error control to
achieve the delivery of data from one node to
another . The protocols are normally implemented
in software by using one of the common
programming languages.
Stop-and-Wait ARQ
PROTOCOLS
Go-Back-N ARQ

Selective Repeat ARQ


Stop-and-Wait ARQ

It is the simplest flow and error control mechanism . A


transmitter sends a frame then stops and waits for an
acknowledgment.
Stop-and-Wait ARQ has the following features:
✔ The sending device keeps a copy of the sent frame transmitted
until it receives an acknowledgment( ACK)
✔ The sender starts a timer when it sends a frame. If an ACK is not
received within an allocated time period, the sender resends it
✔ Both frames and acknowledgment (ACK) are numbered
alternately 0 and 1( two sequence number only)
✔ This numbering allows for identification of frames in case of
duplicate transmission
Stop-and-Wait ARQ

The acknowledgment number defines the number of next


expected frame. (frame 0 received ACK 1 is sent)
A damage or lost frame treated by the same manner by the
receiver
If the receiver detects an error in the received frame, or receives
a frame out of order it simply discards the frame
The receiver send only positive ACK for frames received safe; it
is silent about the frames damage or lost.
The sender has a control variable Sthat holds the number of most
recently sent frame (0 or 1). The receiver has control variable R,
that holds the number of the next frame expected (0,or 1)
Design of the Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ

Cases of Operations:

1.Normal operation
2.The frame is lost
3.The Acknowledgment (ACK) is lost
4.The ACK is delayed
Stop-and-Wait ARQ
Normal operation

The sender will not


send the next frame
until it is sure that
the current one is
correctly receive
sequence number is
necessary to check
for duplicated
frames
Stop-and-Wait ARQ
2. Lost or damaged frame

A damage or lost frame


treated by the same
manner by the receiver.

No NACK when frame is


corrupted / duplicate
Stop-and-Wait ARQ
3. Lost ACK frame

Importance of frame
numbering
Stop-and-Wait ARQ
4. Delayed ACK and lost frame

Importance of frame
numbering
Sender-site algorithm for Stop-and-Wait ARQ

(continued)
Sender-site algorithm for Stop-and-Wait ARQ (continued)
Receiver-site algorithm for Stop-and-Wait ARQ Protocol
Note

In Stop and-Wait ARQ, numbering frames


prevents the retaining of duplicate frames.

10.
Note

Numbered acknowledgments are needed if an


acknowledgment is delayed and the next frame
is lost.

10.
Piggybacking ( Bidirectional transmission)

• Is a method to combine a data frame with an acknowledgment.


• It can save bandwidth because data frame and an ACK frame
can combined into just one frame
Stop-and-Wait ARQ

After each frame sent the host must wait for an ACK
❖inefficient use of bandwidth

To improve efficiency ACK should be sent after multiple


frames

Alternatives: Sliding Window protocol


✔Go-back-N ARQ
✔Selective Repeat ARQ
Pipelining

Pipelining: A task is begun before the previous task


has ended

❖There is no pipelining in stop and wait ARQ because


we need to wait for a frame to reach the destination
and be acknowledged before the next frame can be
sent
❖Pipelining improves the efficiency of the transmission
Sliding window protocol
Sliding window protocols apply Pipelining :
✔Go-Back-N ARQ
✔Selective Repeat ARQ
Sliding window protocols improve the efficiency
multiple frames should be in transition while waiting
for ACK. Let more than one frame to be outstanding.
Outstanding frames: frames sent but not
acknowledged
We can send up to W frames and keep a copy of these
frames(outstanding) until the ACKs arrive.
This procedures requires additional feature to be
added :sliding window
Sliding window
Go_Back _N ARQ

Sender sliding window

If m = 3; sequence
numbers = 8 and window
size =7

Acknowledged frames
Design of Go-Back-N ARQ
Go-Back-N sender algorithm

(continued)
Go-Back-N sender algorithm (continued)
Go-Back-N receiver algorithm
Go_Back _N ARQ

Receiver sliding window


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.
Go-Back-N ARQ
control variables
Outstanding frames: frames sent but
not acknowledged

S: hold the sequence number of the recently sent frame


SF: holds sequence number of the first frame in the
window
SL: holds the sequence number of the last frame
R: sequence number of the frame expected to received
Go-Back-N ARQ
Go-Back-N ARQ
Normal operation

How many frame scan


be transmitted Without
acknowledgment?
ACK1 is not necessary
if ACK2 is sent:
Cumulative ACK
Go-Back-N ARQ

Bidirectional transmission : piggybacking

As Stop-and-Wait we can use piggybacking to improve the


efficiency of bidirectional transmission . Each direction
needs both a sender window and a receiver window.
Note

Stop-and-Wait ARQ is a special case of


Go-Back-N ARQ in which the size of the
send window is 1

10.
Selective Repeat ARQ

Go-Back-N ARQ is inefficient of a noisy link.

In a noisy link frames have higher probability of damage ,


which means the resending of multiple frames.
this resending consumes the bandwidth and slow down the
transmission .
Solution:
Selective Repeat ARQ protocol : resent only the damage
frame
It defines a negative Acknoledgment (NAK) that report the
sequence number of a damaged frame before the timer expires
It is more efficient for noisy link, but the processing at the
receiver is more complex
Design of Selective Repeat ARQ
Sender-site Selective Repeat algorithm

(continued)
Sender-site Selective Repeat algorithm (continued)

(continued)
Sender-site Selective Repeat algorithm (continued)
Receiver-site Selective Repeat algorithm
Receiver-site Selective Repeat algorithm
Selective Repeat ARQ
Selective Repeat ARQ
m=3
Lost Frame Sequences no=2m =8 :
0,1,2 ,3,4,5,6,7Window
size =2m/2= 8/2=4
Note

In Selective Repeat ARQ, the size of In the


sender and receiver window must be at
most one-half of 2m.
More efficient than Go – back - N

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy