Flow Control and Error Control
Flow control refers to a set of procedures Flow control refers to a set of procedures used to restrict the amount of data that the used to restrict the amount of data that the
sender can send before waiting for sender can send before waiting for acknowledgment.acknowledgment.
NoteNote::
Error control in the data link layer is based Error control in the data link layer is based on automatic repeat request, which is the on automatic repeat request, which is the
retransmission of data.retransmission of data.
NoteNote::
Stop-and-wait ARQ
Stop-and-wait ARQ
In the stop-and-wait mechanism ,the receiver sends a positive acknowledgement (ACK) if there is no error in data frame.
If error then it responds with a negative acknowledgement (NAK)
The sending device keeps a copy of the last frame transmitted until it receives an acknowledgement for that frame.
For Identification purposes, both data frames and acknowledgement frames are numbered alternatively 0 and 1.
A Damaged or Lost frame is treated in the same manner by the receiver i.e. Dropped
The Sender has a control variable ‘ S’ that holds the number (0 or 1) of recently sent frame. The Receiver has also a control variable ‘ R’ that holds the number (0 or 1) of the next frame expected.
The sender starts a Timer when it sends a frame. If the ack is not received with in the allotted time period ,the sender assumes that the frame (sent earlier) was lost or damaged
The receiver send s only positive ack for frames received safe and sound.– Note it that the ack number always define
the number of next expected frame.
Normal operation
Stop-and-Wait ARQ, lost frame
Stop-and-Wait ARQ, lost ACK frame
In Stop-and-Wait ARQ, numbering frames In Stop-and-Wait ARQ, numbering frames prevents the retaining of duplicate frames.prevents the retaining of duplicate frames.
NoteNote::
Stop-and-Wait ARQ, delayed ACK
Numbered acknowledgments are needed if Numbered acknowledgments are needed if an acknowledgment is delayed and the an acknowledgment is delayed and the
next frame is lostnext frame is lost. .
NoteNote::
Piggybacking
Go-Back-N ARQGo-Back-N ARQ
Sequence Number
Sender and Receiver Sliding Window
Control Variables and Timers
Acknowledgment
Resending Frames
Operation
Go-Back-N ARQGo-Back-N ARQ Each data frame carries a sequence number for its
identification.if there are “n ” bits then the length of the window size will be 2n -1
The sending end maintains a window containing a fixed number of data frames ready for transmission.these frames can be sent without waiting for any acknowledgement .
Copy of each transmitted frame is retained in the window till it is acknowledged.
The number of frames in a window is called its size.
Go-Back-N ARQGo-Back-N ARQ
The receiver acknowledges receipt of one or more data frames by sending back a numbered acknowledgement(Receive ready,RR-N),where N is the sequence number of the next frame it expects to receive.
All previous data frames are assumed acknowledged on receipt of an acknowledgement.
When an acknowledgement is received by the sending end,it slides the window deleting the copies of acknowledged data frames and inserting the same number of new frames from the queue.
A timer is provided at the sending side.
Sender sliding window
Receiver sliding window
Control variables
Go-Back-N ARQ, normal operation
Go-Back-N ARQ, lost frame
Go-Back-N ARQ: sender window size
In Go-Back-N ARQ, the size of the sender In Go-Back-N ARQ, the size of the sender window must be less than 2window must be less than 2mm; the size of ; the size of
the receiver window is always 1.the receiver window is always 1.
NoteNote::
Selective-Repeat ARQSelective-Repeat ARQ
Sender and Receiver Windows
Operation
Sender Window Size
Bidirectional Transmission
Pipelining
Selective-Repeat ARQSelective-Repeat ARQ
In this technique the receiver requests retransmission of the missing data frame only by sending a Selective Reject(SREJ-N),N is the sequence number of missing data frame.
Selective Repeat ARQ, sender and receiver windows
Selective Repeat ARQ, lost frame
In Selective Repeat ARQ, the size of the sender In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of and receiver window must be at most one-half of
22mm..
NoteNote::
Selective Repeat ARQ, sender window size
Bit stuffing is the process of adding one Bit stuffing is the process of adding one extra 0 whenever there are five consecutive extra 0 whenever there are five consecutive 1s in the data so that the receiver does not 1s in the data so that the receiver does not
mistake the mistake the data for a flag.data for a flag.
NoteNote::
11.24 Bit stuffing and removal
End of Lecture