Error Control and Flow Control
Overview
Section titled “Overview”| Layer | Flow Control Example | Error Control Example | Scope |
|---|---|---|---|
| Data Link Layer (L2) | Yes ✅ Stop-and-Wait, Sliding Window | Yes ✅ Parity Bit, Checksum / CRC, ARQ (3 types) | Node-to-Node (Hop-to-Hop) |
| Transport Layer (L4) | Yes ✅ TCP Receive Window | Yes ✅ TCP Checksum + Retransmission | End-to-End |
Important Difference ⭐
Section titled “Important Difference ⭐”Data Link Layer
- Error Control:
- Error Detection: CRC
- Retransmission: ARQ
- Flow Control:
- Stop-and-Wait, Sliding Window
Transport Layer
- Error Control:
- Error Detection: TCP Checksum
- Retransmission: Timeout + ACKs
- Flow Control:
- TCP Sliding Window
Note:
- Error Detection in L2 can be done using Parity Bit, Checksum, or CRC.
- However, for GATE and interviews, associate: L2 Error Detection → CRC L4 Error Detection → TCP Checksum
- CRC is emphasized because it is widely used in practice (Ethernet, Wi-Fi) and is much better at detecting burst errors.
Data Link Layer (L2)
Section titled “Data Link Layer (L2)”- Controls data transfer between two directly connected devices.
- Detects/corrects errors on a single link.
- Ensures one device doesn’t overwhelm the next device.
A ---- B ---- C
L2 Flow/Error Control:A <-> BB <-> CIf frame A→B is corrupted, B asks A to retransmit.
Data Link Layer (L2) Flow Control
Section titled “Data Link Layer (L2) Flow Control”Suppose:
A -------- B(Sender) (Receiver)If A sends frames too fast and B’s buffer becomes full, flow control mechanisms like:
- Stop-and-Wait
- Sliding Window
make A slow down or wait for ACKs.
Data Link Layer (L2) Error Control
Section titled “Data Link Layer (L2) Error Control”A sends:
Frame + CRC- B recalculates CRC.
- If CRC mismatches, frame is considered corrupted.
- B discards it and requests retransmission using ARQ techniques:
- Stop-and-Wait ARQ
- Go-Back-N ARQ
- Selective Repeat ARQ
Transport Layer (L4)
Section titled “Transport Layer (L4)”- Controls data transfer between source and destination applications.
- End-to-end reliability.
- Ensures the sender does not overwhelm the receiver.
- Retransmits lost segments if needed.
A ---- B ---- C ---- D
L4 Flow/Error Control:A <-----------------> DEven if B and C forward correctly, if D misses data, A retransmits.
Memory Shortcut
- L2: “My neighbor got the frame correctly?”
- L4: “Did the final destination get the entire message correctly?”
Detailed
Section titled “Detailed”Transport Layer (L4) Flow Control
Section titled “Transport Layer (L4) Flow Control”In TCP:
Client <---------> ServerThe receiver advertises:
Window Size = 5000 bytesThe sender can send at most 5000 bytes without waiting.
If the receiver is busy:
Window Size = 0The sender stops sending temporarily.
This is called TCP Flow Control using the sliding window mechanism.
Transport Layer (L4) Error Control
Section titled “Transport Layer (L4) Error Control”TCP sends:
Segment + TCP ChecksumIf:
- Segment is corrupted, or
- Segment is lost, or
- ACK is not received before timeout,
then TCP retransmits the segment.
A -----> B (Segment #3 lost)
A <----- B (No ACK for #3)
Timeout occurs
A -----> B (Retransmit #3)