How Data Link Layers Provide Flow and Error Control (with Examples)
The Data Link Layer provides two key services to make transmission dependable and efficient on a shared physical medium: flow control and error control.
At a high level:
- Flow control coordinates sender/receiver rates so the receiver’s buffering is not exceeded.
- Error control ensures corrupted frames are detected (usually via a checksum) and retransmitted when needed (via ARQ-style protocols).
Below is a structured view of the dominant approaches used in link layers, including concrete examples (e.g., stop-and-wait, sliding window, CRC-based detection, and retransmission strategies).
Note: The exact flow/error control used depends on the link technology (e.g., Ethernet vs. Wi-Fi) and link-layer protocol (e.g., HDLC/LLC-like framing, or 802.11 MAC reliability mechanisms).
Flow Control & Error Control (Link-Layer ARQ, Stop-and-Wait, Sliding Window)
Key building blocks: frames, checksums, and acknowledgements
Most data link protocols follow a common pattern:
-
Frame formation
The sender groups bits into a frame with fields like header, payload, and a FCS (or checksum). -
Error detection
The receiver recomputes the CRC/checksum over the received frame and compares it to the FCS / checksum. -
Error recovery (ARQ) If the check fails, the receiver triggers ARQ behavior—commonly by sending ACK (success) or NACK/reject (failure) and the sender retransmits.
This is conceptually similar to transport-layer reliability, but it is done hop-by-hop (per link), so the link layer can isolate local corruption and delay retransmission to the right place.
Key terms to remember
- Frame
- Flow control
- Error control
- ARQ
- FCS
Step-by-step: Stop-and-Wait flow + error control on a single link
- 1Step 1
The sender sends one frame and starts a timer. It keeps only one outstanding frame to avoid overwhelming the receiver.
- 2Step 2
The receiver validates the FCS (CRC/checksum). If correct, it accepts the payload.
- 3Step 3
If the frame is correct, send ACK; if incorrect, send NACK/reject (or simply omit ACK, depending on the protocol).
- 4Step 4
If ACK arrives before timeout, sender sends the next frame. If NACK or timeout occurs, retransmit the same frame.
- 5Step 5
"This continues until all frames are delivered correctly."
Example (conceptual timeline):
This design provides strong flow control (only one in flight) and simple error control (retransmit on detected failure), but it can have lower throughput due to idle time while waiting for ACK.
From stop-and-wait to sliding window (improves throughput)
To increase efficiency, many link layers use a sliding window protocol with sequence numbers.
- Sender may transmit multiple frames before receiving all ACKs.
- Receiver acknowledges correctly received frames (cumulatively and/or selectively).
- On error detection, the sender retransmits based on the acknowledgment policy.
Common ARQ strategies
- Go-Back-N
- Selective Repeat
These strategies determine how much retransmission overhead occurs when corruption affects a specific frame.
Qualitative comparison of ARQ strategies (efficiency vs. retransmission cost)
Higher throughput generally corresponds to more buffering and more complex receiver logic.
Flow control in the data link layer: preventing buffer overflow
Even if frames are error-free, the receiver can become overloaded due to:
- variable processing time,
- limited buffer space,
- slower consumption by upper layers,
- bursts from a fast sender.
Data link flow control mitigates this with one (or a combination) of:
-
Window-based flow control
The sender’s maximum number of outstanding frames is limited by a receiver-advertised or negotiated window size. This naturally caps the data rate to what the receiver can store. -
Receiver-driven backpressure
The receiver signals “slow down” (or “stop”) using MAC/control frames or by reducing allowed credit. -
Pause/feedback signals (technology-specific)
Some technologies include explicit mechanisms to temporarily reduce transmission rate.
Mental model for flow control
Flow control is about how much can be in flight (buffer occupancy), while error control is about whether frames are correct (integrity) and what to do if they aren’t.
Common misconception
ACK-based reliability is not always automatic flow control. Even with ACKs, a receiver can still overflow if the protocol allows too many outstanding frames without a window/credit limit.
Putting it together: example scenarios
Example 1: Noisy link with stop-and-wait ARQ
Assume frames get corrupted with some probability . With stop-and-wait:
- corruption causes receiver to reject or not ACK,
- sender times out and retransmits.
Flow is inherently safe: only one frame is outstanding.
Where error control acts: at the receiver’s CRC/FCS check, then via retransmission triggered by ACK/NACK or timeout.
Where flow control acts: by allowing only one in-flight frame.
Example 2: High-latency link using sliding window + selective repeat
With longer propagation delay, stop-and-wait wastes time waiting for ACKs. Sliding window allows the sender to keep the link busy.
Selective repeat:
- receiver accepts good frames even if some earlier ones are missing (within the window),
- sender retransmits only the missing/corrupted frames.
Flow control mechanism: window size bounds outstanding frames to receiver buffer capacity.
Error control mechanism: per-frame CRC/FCS detection + targeted retransmissions.
How do data link layers detect errors in practice?
1Receiver detects an error in frame k 2=> ACK for frames < k only 3Sender retransmits from k onward
Link-level reliability lifecycle (per frame)
Framing
1. Create frameAdd header, payload, and FCS."
Send within flow limits
2. TransmitSender respects window/credit constraints."
Detect errors
3. ValidateReceiver checks FCS."
Feedback
4. AcknowledgeReceiver sends ACK/NACK or cumulative ACK."
Retransmit if needed
5. RecoverSender retransmits using ARQ policy (stop-and-wait / Go-Back-N / selective repeat)."
Pass to upper layer
6. DeliverOnly validated frames are delivered upward."
Link-layer Flow & Error Control Flashcards
Knowledge Check
Which mechanism directly prevents the sender from overwhelming the receiver’s buffer?