Chapter 5 Data Link Layer
Chapter 5 Data Link Layer
Networks
Ketema D.(MSc.)
Data Link Layer Introduction
Introduction
The data link layer is responsible for carrying a frame from one hop
(computer or router) to the next hop; i.e., it has local responsibility
unlike the network layer
Position of the data link layer
2 / 85
Data Link Layer Introduction
Introduction
The data link layer transforms the physical layer, a raw transmission
facility, to a reliable link.
It makes the physical layer appear error-free to the network layer. The
following figure shows the relationship of the data link layer to the
network and physical layers.
The data link layer is responsible for moving frames from one hop
(node) to the next.
3 / 85
Data Link Layer Introduction
Error control. The data link layer adds reliability to the physical layer by
adding mechanisms to detect and retransmit damaged or lost frames.
It also uses a mechanism to recognize duplicate frames.
Error control is normally achieved through a trailer added to the end
of the frame.
Access control. When two or more devices are connected to the same
link, data link layer protocols are necessary to determine which device
has control over the link at any given time.
5 / 85
Data Link Layer Introduction
6 / 85
Data Link Layer Introduction
8 / 85
Data Link Layer Error Detection and Correction
• Burst error: 2 or more bits in the data unit have changed; most likely to
occur in serial transmissions.
10 / 85
Data Link Layer Error Detection and Correction
11 / 85
Data Link Layer Error Detection and Correction
12 / 85
Data Link Layer Data Link Control and Protocols
For reliable data delivery across the link, the data link layer has two most
important responsibilities: flow control and error control, collectively
known as data link control
Flow Control
Refers to a set of procedures used to restrict the amount of data that
the sender can send before receiving an acknowledgement
It is an end-to-end mechanism for regulating traffic between source
and destination
Congestion control: a mechanism used by the network to limit
congestion
Flow control and congestion control are not really separable, and
we will refer to both as flow control
13 / 85
Data Link Layer Data Link Control and Protocols
• Limiting factors: speed of the receiver (to process incoming data), amount
of memory (buffer) to store the incoming data before processed, and
network capacity
Rate of processing is normally slower than rate of transmission
The receiver must be able to inform the sender to temporarily
halt transmission until it is ready to receive more
If no flow control
When overload occurs:
Queues build up
Packets are discarded
Sources retransmit messages
Congestion increases instability
Flow control prevents network instability by keeping packets
waiting outside the network rather than in queues inside the network
14 / 85
Data Link Layer Data Link Control and Protocols
Error Control
Refers to both error detection and error correction
In the data link layer, error control refers primarily to methods of
error detection and retransmission
Anytime an error is detected, specified frames are retransmitted;
this process is called automatic repeat request (ARQ)
15 / 85
Data Link Layer Data Link Control and Protocols
16 / 85
Data Link Layer Data Link Control and Protocols
• 2 Stop-And-Wait ARQ
Protocols in which the sender sends one frame and then waits
for an acknowledgement before proceeding are called
stop-and-wait
17 / 85
Data Link Layer Data Link Control and Protocols
18 / 85
Data Link Layer Data Link Control and Protocols
19 / 85
Data Link Layer Data Link Control and Protocols
20 / 85
Data Link Layer Data Link Control and Protocols
Step 1: Firstly, the sender will send the first four frames to the receiver, i.e.,
0,1,2,3, and now the sender is expected to receive the acknowledgment of the
0th frame.
23 / 85
Data Link Layer Data Link Control and Protocols
24 / 85
Data Link Layer Data Link Control and Protocols
The sender will then send the next frame, i.e., 4, and the window slides
containing four frames (1,2,3,4).
25 / 85
Data Link Layer Data Link Control and Protocols
The receiver will then send the acknowledgment for the frame no 1. After
receiving the acknowledgment, the sender will send the next frame, i.e., frame
no 5, and the window will slide having four frames (2,3,4,5).
26 / 85
Data Link Layer Data Link Control and Protocols
Now, let’s assume that the receiver is not acknowledging the frame no 2,
either the frame is lost, or the acknowledgment is lost. Instead of sending the
frame no 6, the sender Go-Back to 2, which is the first frame of the current
window, retransmits all the frames in the current window, i.e., 2,3,4,5.
27 / 85
Data Link Layer Data Link Control and Protocols
28 / 85
Data Link Layer Data Link Control and Protocols
29 / 85
Data Link Layer Data Link Control and Protocols
30 / 85