340 likes | 484 Views
Flow Control and Error Control. 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. Note :.
E N D
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.
Note: Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.
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.
Note: In Stop-and-Wait ARQ, numbering frames prevents the retaining of duplicate frames.
Note: Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost.
Go-Back-N ARQ Sequence Number Sender and Receiver Sliding Window Control Variables and Timers Acknowledgment Resending Frames Operation
Go-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 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.
Note: In Go-Back-N ARQ, the size of the sender window must be less than 2m; the size of the receiver window is always 1.
Selective-Repeat ARQ Sender and Receiver Windows Operation Sender Window Size Bidirectional Transmission Pipelining
Selective-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.
Note: In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2m.
Note: Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the data so that the receiver does not mistake the data for a flag.