0% found this document useful (0 votes)
301 views22 pages

Error Control

Flow and error control are important functions of the data link layer known as data link control. Flow control restricts the amount of data the sender transmits before receiving acknowledgment, while error control relies on automatic repeat request (ARQ) where damaged frames are retransmitted. The stop-and-wait protocol is the simplest approach but is inefficient, while sliding window and selective repeat protocols allow multiple outstanding frames to improve throughput.

Uploaded by

Suhail Qadir
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)
301 views22 pages

Error Control

Flow and error control are important functions of the data link layer known as data link control. Flow control restricts the amount of data the sender transmits before receiving acknowledgment, while error control relies on automatic repeat request (ARQ) where damaged frames are retransmitted. The stop-and-wait protocol is the simplest approach but is inefficient, while sliding window and selective repeat protocols allow multiple outstanding frames to improve throughput.

Uploaded by

Suhail Qadir
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/ 22

Flow and Error Control

(Data Link Control)

SUHAIL Q. MIR

MSc. IT
Directorate of Information Technology & Support Systems
University of Kashmir
The most important responsibilities of the data link
layer are flow control and error control. Collectively,
these functions are known as data link control.

Flow control refers to a set of


procedures used to restrict the Error control in the data link layer is
amount of data that the sender based on automatic repeat request,
can send before waiting for which is the retransmission of data.
acknowledgment.
Error Control Approaches

Acknowledgment − acknowledgment may be positive or


Retransmission − The sender maintains a negative.
clock and sets a timeout period. If an
Positive ACK − On receiving a correct frame, the receiver
acknowledgment of a data-frame previously
sends a positive acknowledge.
transmitted does not arrive before the
timeout, or a negative acknowledgment is Negative ACK − On receiving a damaged frame or a
received, the sender retransmits the frame duplicate frame, the receiver sends a negative
acknowledgment back to the sender
Error Control Approaches
Flow and Error Control Protocols
The design of the simplest protocol with no flow or error control
Stop-and-Wait Protocol

sender sends one data frame, waits for


acknowledgement (ACK) from receiver before
proceeding to transmit next frame
Flow diagram

This simple flow control


will break down if ACK
gets lost or errors occur !
sender may wait for
ACK that never arrives

The sender sends one frame and waits for feedback from the receiver. When the ACK arrives,
the sender sends the next frame. Note that sending two frames in the protocol involves the
sender in four events and the receiver in two events.
Stop and Wait with ARQ
Stop and wait with ARQ: Automatic Repeat reQuest (ARQ), an error control
method, is incorporated with stop and wait flow control protocol

simplest flow and error control mechanism


• sender sends an information frame to receiver
• sender, then, stops and waits for an ACK
• if no ACK arrives or NAK arrives within time-out, sender will
resend the frame, and again stop and wait
- time-out period > roundtrip time

• abnormalities (and how to fix them)


- lost acknowledgment
- delayed acknowledgment
If no ACK or NAK is received during
timeout period, it re-sends the frame
Lost Acknowledgment

frame received correctly, but ACK


undergoes errors / loss
- after time-out period, sender resends
frame receiver receives the same
frame twice
Lost Acknowledgment

• frames must be numbered so that


receiver can recognize and discard
duplicate frames
- sequence Numbers are included in
packet header
Delayed Acknowledgment
(Premature Timeout)

ACKs can be delayed due to problems with


links or network congestion
- time-out expires early, sender resends frame
- when delayed ACK arrives, sender assumes
that given ACK is for the last frame sent
Delayed Acknowledgment
(Premature Timeout)

ACKs must be numbered to prevent


gaps in delivered packet sequence

How large should the


packet / ACK sequence
be? Only 1-bit long !!!
Delayed Acknowledgment
(Premature Timeout)

timeout
To avoid receiving and
accepting two copies of same
frame, frames and ACKs are
alternatively labeled 0 or 1:
ACK0 for frame 1, ACK1 for
frame 0

timeout
Sliding Window Protocol
(Flow Control )

ACK3 means that receiver


has received frame 0 to
frame 2 correctly, ready to
receive frame 3
(and rest of N frames within
window)
Sliding Window Protocol
(Flow Control )

– Frames and acknowledgements are numbered using


sequence numbers
– Sender maintains a list of sequence numbers (frames) it is
allowed to transmit, called sending window
– Receiver maintains a list of sequence numbers it is prepared
to receive, called receiving window
– A sending window of size N means that sender can send up
to N frames without the need for an ACK
Go-Back-N ARQ

overcomes inefficiency of Stop-and-Wait ARQ – sender continues


sending enough frames to keep channel busy while waiting for
ACKs

Discarded
frames to the right of the window cannot be sent
until the window slides over them

whenever a new ACK arrives, the window slides


to include new unsent frames

the size of receiver window is always 1

receiver is always looking for a specific frame


to arrive in a specific order
any frame arriving out of order is discarded
and needs to be resent
Selective Repeat ARQ

• Go-Back-N is NOT suitable for ‘noisy links’ – in case of a lost/damaged


frame a whole window of frames need to be resent

• excessive retransmissions use up the bandwidth and slow down


transmission

• Selective Repeat ARQ overcomes the limitations of Go-Back-N by adding


2 new features
(1) retransmission mechanism is modified – sender only
retransmits frames for which a NAK is received
(2) receiver window > 1 frame, so that out-of-order but error-free
frames can be accepted

• Selective Repeat ARQ is used in TCP !!!


Selective Repeat ARQ
Selective Repeat ARQ

You might also like