You are on page 1of 14

Error Control in Data Link Layer

Prakasam P
School of Electronics Engineering
VIT University
Introduction
 Peer-to-Peer protocols: many protocols involve the
interaction between two peers
◦ Detailed discussion of ARQ provides example of
development of peer-to-peer protocols
 Data Link Layer
◦ Framing
◦ PPP & HDLC protocols

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 2


Error control in Data Link Layer

Packets Packets Data Link operates


Data link Data link


over wire-like, directly-
layer Frames layer connected systems
A B  Frames can be
Physical Physical
layer
layer corrupted or lost, but
arrive in order
 Data link performs
error-checking &
12 3 21 12 3 21 retransmission
Medium  Ensures error-free
2 packet transfer
A B 1
1 Physical layer entity between two systems
2 Data link layer entity
There is one network layer entity per node
but one data link layer entity per link.
3 Network layer entity
6/6/2023 Prakasam P/BECE401L/Fall 2023-24 3
ARQ Protocols and Reliable
Data Transfer
Automatic Repeat Request (ARQ)
 Purpose: to ensure a sequence of information
packets is delivered in order and without errors or
duplications despite transmission errors & losses
 We will look at:
◦ Stop-and-Wait ARQ
◦ Go-Back N ARQ
◦ Selective Repeat ARQ
 Basic elements of ARQ:
◦ Error-detecting code with high error coverage
◦ ACKs (positive acknowledgments)
◦ NAKs (negative acknowledgments)
◦ Timeout mechanism

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 5


Stop-and-Wait ARQ- 1-Bit Sequence
Transmit a frame, wait for ACK
Error-free
Packet
packet
Information frame
Transmitter Receiver
Timer set after (Process A) (Process B)
F0-0
each frame F1-1
transmission Control frame

Header
CRC
Information Header
packet CRC
Information frame Control frame: ACKs
6/6/2023 Prakasam P/BECE401L/Fall 2023-24 6
Need for Sequence Numbers
(a) Frame 1 lost Time-out
Time
A Frame Frame Frame Frame
0 1 1 2
ACK ACK
B

(b) ACK lost Time-out


Time
A Frame Frame Frame Frame
0 1 1 2
ACK ACK ACK
B

◦ In cases (a) & (b) the transmitting station A acts the same way
◦ But in case (b) the receiving station B accepts frame 1 twice
◦ Question: How is the receiver to know the second frame is also frame 1?
◦ Answer: Add frame sequence number in header
◦ Slast is sequence number of most recent transmitted frame

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 7


Sequence Numbers
(c) Premature Time-out

Time-out
Time
A Frame
0 Frame Frame Frame
ACK 0 1 2
ACK
B

◦ The transmitting station A misinterprets duplicate ACKs


◦ Incorrectly assumes second ACK acknowledges Frame 1
◦ Question: How is the sender to know second ACK is for frame 0?
◦ Answer: Add frame sequence number in ACK header
◦ Rnext is sequence number of next frame expected by the receiver
◦ Implicitly acknowledges receipt of all prior frames

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 8


Stop-and-Wait ARQ
Transmitter Receiver
Ready state Always in Ready State
 Await request from higher layer for  Wait for arrival of new frame
packet transfer  When frame arrives, check for
 When request arrives, transmit errors
frame with updated Slast and CRC  If no errors detected and sequence
 Go to Wait State number is correct (Slast=Rnext), then
Wait state ◦ accept frame,
 Wait for ACK or timer to expire; ◦ update Rnext,
block requests from higher layer ◦ send ACK frame with Rnext,
 If timeout occurs ◦ deliver packet to higher layer
◦ retransmit frame and reset timer  If no errors detected and wrong
 If ACK received: sequence number
◦ If sequence number is incorrect ◦ discard frame
or if errors detected: ignore ACK ◦ send ACK frame with Rnext
◦ If sequence number is correct  If errors detected
(Rnext = Slast +1): go to Ready
state ◦ discard frame

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 9


Performance Issues
 Stop and Wait ARQ works well on channels that have
low propagation delay.
 Becomes inefficient when the propagation delay is
much greater than the time to transmit a frame.
 Suppose we are transmitting 1000 bits long over a
channel that has a speed of 1.5Mbps and the time that
elapses from the beginning of the frame transmission to
the receipt of its acknowledgement is 40ms.
 No. of bits that can be transmitted over the channel in
40ms*1.5Mbps = 60,000bits(Delay Bandwidth Product)
 But Stop and wait protocol can transmit only 1000 bits in this
period of time,
 Efficiency = 1000/60,000 = 1.67%

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 10


Stop-and-Wait Efficiency
Last frame bit ACK
First frame bit enters channel arrives
enters channel Channel idle while transmitter
waits for ACK

A t

B t

First frame bit Receiver


arrives at Last frame bit processes frame
receiver arrives at and
receiver prepares ACK

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 11


Modelling of Stop-and-Wait ARQ
t0 = total time to transmit 1
A frame
tproc

B
frame
tprop tproc tack tprop
tf time

t0  2t prop  2t proc  t f  t ack


bits/Information frame
nf
na
 2t prop  2t proc   bits/ACK frame
R R
-n is the no. of bits in info frame
f

- na is the no. of bits in ack frame Bit rate of the transmission channel
6/6/2023 Prakasam P/BECE401L/Fall 2023-24 12
Efficiency on Error-free channel
Effective transmission rate: bits for header & CRC

number of informatio n bits delivered to destinatio n n f  no


R0
eff   ,
total time required to deliver th e informatio n bits t0

Transmission efficiency:
Effect of
n f  no no
1 frame overhead
Reff t0 nf
0    .
R R na 2(t prop  t proc ) R
1 
nf nf

Effect of
Delay BW
ACK frame Product
6/6/2023 Prakasam P/BECE401L/Fall 2023-24 13
S&W Efficiency in Channel with Errors

 Pf be the probability that a frame has errors and need to


retransmitted.
 Let 1 – Pf = probability frame arrives w/o errors
 Avg. # of transmissions to first correct arrival is 1/ (1–Pf )
 Avg. total time per frame is then tsw=t0/(1 – Pf)

n f  no
no
t0 1
Reff 1  Pf nf
 SW    (1  Pf )
R R na 2(t prop  t proc ) R
1 
nf nf
Effect of
frame loss

6/6/2023 Prakasam P/BECE401L/Fall 2023-24 14

You might also like