Data Link Control
Data Link Control (DLC) is a service provided by the Data Link Layer (Layer 2) of the OSI Model. Its primary goal is to ensure reliable data transmission over a physical communication medium.
Why is Data Link Control Needed?
When data is transmitted across a network:
- Devices may try to send data simultaneously.
- The receiver may not process data as quickly as the sender.
- Frames may be damaged or lost during transmission.
Data Link Control solves these problems by:
- Coordinating communication between devices.
- Regulating the speed of transmission.
- Detecting and correcting transmission errors.
Main Functions of Data Link Control
1. Line Discipline
What is Line Discipline?
Line Discipline is the process of coordinating communication between
devices connected through a communication link.
It answers two important questions:
- Which device can send data?
- When can it send data?
Without proper coordination, devices may transmit simultaneously,
causing collisions and loss of information.
Methods of Line Discipline
There are two commonly used methods:
- ENQ/ACK
- Poll/Select
ENQ/ACK Method
What is ENQ/ACK?
ENQ (Enquiry) and ACK (Acknowledgement) are control messages used when
there is a dedicated communication path between two devices.
Before sending data, the sender checks whether the receiver is ready.
Working of ENQ/ACK
Step 1: Sender Sends ENQ
The sender transmits an ENQ frame asking:
"Are you ready to receive data?"
Step 2: Receiver Responds
The receiver sends either:
- ACK → Ready to receive
- NACK → Not ready to receive
Step 3: Data Transmission
If ACK is received:
- Sender transmits data.
- Transmission ends with an EOT (End of Transmission) frame.
If NACK is received:
- Sender stops transmission.
- Tries again later.
If no response is received:
- Sender assumes the ENQ was lost.
- Retries several times before terminating communication.
Real-World Example
Think of calling someone on the phone:
- "Hello, can you hear me?" → ENQ
- "Yes, go ahead." → ACK
- Then the conversation starts.
Poll/Select Method
What is Poll/Select?
This method is used in networks where:
- One device acts as the Primary Station.
- Other devices act as Secondary Stations.
The primary station controls all communication.
Example
A classroom teacher controls who can speak.
- Teacher = Primary Station
- Students = Secondary Stations
Students speak only when permitted.
Select Operation
The Select operation is used when the primary station wants to send
data.
Steps
- Primary sends a SEL (Select) frame.
- Frame contains the address of the target device.
- Secondary device responds with ACK.
- Primary sends data.
- Secondary acknowledges successful reception.
Example
A teacher says:
"Student A, please listen."
Student A responds:
"I'm ready."
The teacher then provides information.
Poll Operation
The Poll operation is used when the primary station wants to receive
data.
Steps
- Primary asks each secondary device one by one.
- Devices respond: ACK → Data available , NACK → No data available
- Devices with data are allowed to transmit.
Example
Teacher asks:
"Does anyone have a question?"
Students respond accordingly.
2. Flow Control
What is Flow Control?
Flow Control is a mechanism that regulates the rate of data
transmission between sender and receiver.
Its purpose is to prevent the sender from overwhelming the receiver.
Why is Flow Control Needed?
Consider:
- Sender speed = 100 Mbps
- Receiver speed = 10 Mbps
If data arrives too quickly:
- Receiver buffer becomes full.
- Data gets lost.
Flow control ensures that transmission occurs at a manageable speed.
Common Flow Control Techniques
- Stop-and-Wait
- Sliding Window
Stop-and-Wait Flow Control
How It Works
The sender:
- Sends one frame.
- Waits for acknowledgement.
- Sends the next frame only after receiving ACK.
This process continues until all data is transmitted.
Example
Sending parcels one at a time:
- Send Parcel 1
- Wait for confirmation
- Send Parcel 2
- Wait again
Advantages
- Easy to implement
- Reliable
- Simple error detection
Disadvantages
- Low efficiency
- Network bandwidth is underutilized
- Long waiting periods
Sliding Window Flow Control
What is Sliding Window?
The Sliding Window technique allows multiple frames to be transmitted
before receiving acknowledgements.
Instead of waiting after every frame, the sender continuously sends
several frames.
Benefits
- Better bandwidth utilization
- Faster communication
- Higher network efficiency
How It Works
A logical "window" defines how many frames can be sent without waiting
for ACK.
For example:
Window Size = 4
Sender can transmit:
- Frame 0
- Frame 1
- Frame 2
- Frame 3
before waiting for acknowledgement.
When ACK arrives:
- Window moves forward (slides).
- New frames can be transmitted.
Hence the name Sliding Window.
Real-World Example
Imagine a courier company.
Instead of sending one parcel and waiting for delivery confirmation,
it sends several parcels together.
After receiving confirmations, more parcels are dispatched.
This improves efficiency significantly.
Sender Window
The sender window keeps track of:
- Frames already sent
- Frames awaiting acknowledgement
- Frames ready for transmission
As ACKs arrive, the sender window slides forward and allows new
transmissions.
Receiver Window
The receiver window keeps track of:
- Frames expected
- Available buffer space
- Correct frame sequence
It helps ensure that frames are received in the proper order.
3. Error Control
What is Error Control?
Even with reliable communication systems, frames may:
- Become corrupted
- Arrive out of order
- Get lost during transmission
Error Control detects these problems and ensures correct data
delivery.
Objectives
- Detect transmission errors
- Recover lost data
- Retransmit damaged frames
Stop-and-Wait ARQ
What is ARQ?
ARQ (Automatic Repeat reQuest) is an error-control technique that uses
acknowledgements and retransmissions.
Working
- Sender transmits a frame.
- Receiver checks for errors.
- Receiver sends: ACK if correct , NAK if damaged
- Sender retransmits when necessary.
A timer is also used.
If ACK is not received before timeout:
- Sender retransmits the frame.
Scenario 1: Damaged Frame
- Sender transmits Frame 0.
- Frame becomes corrupted.
- Receiver sends NAK.
- Sender retransmits Frame 0.
Scenario 2: Lost Frame
- Sender transmits Frame 0.
- Frame never reaches receiver.
- No ACK arrives.
- Timer expires.
- Sender retransmits Frame 0.
Sliding Window ARQ
Sliding Window ARQ combines:
- Flow Control
- Error Control
It allows continuous transmission while also handling errors.
The sender keeps copies of transmitted frames until acknowledgements
are received.
Go-Back-N ARQ
How It Works
If one frame is lost or damaged:
- Receiver rejects that frame.
- All subsequent frames are discarded.
- Sender retransmits the lost frame and every frame after it.
Example
Frames Sent:
0, 1, 2, 3
If Frame 2 is damaged:
Receiver accepts:
0, 1
Receiver rejects:
2, 3
Sender retransmits:
2, 3
Advantages
- Easy implementation
- Less receiver complexity
Disadvantages
- Many unnecessary retransmissions
Selective Reject ARQ
How It Works
Only the damaged or lost frame is retransmitted.
Correctly received frames are stored temporarily in the receiver
buffer.
Example
Frames Sent:
0, 1, 2, 3
If Frame 2 is lost:
Receiver keeps:
0, 1, 3
Sender retransmits only:
2
No need to resend Frames 0, 1, and 3.
Advantages
- Highly efficient
- Fewer retransmissions
- Better bandwidth utilization
Disadvantages
- More complex implementation
- Requires larger receiver memory