Flow Control Mechanisms
You'll learn how networks prevent fast senders from overwhelming slow receivers using stop-and-wait and sliding window protocols.
What is Flow Control?
Flow control ensures that a sender doesn't transmit data faster than the receiver can process it. Imagine trying to fill a bucket with water from a fire hose—without flow control, data overflows and gets lost. The Data Link Layer implements protocols to synchronize sender and receiver speeds.
Stop-and-Wait Protocol
The simplest approach: send one frame, then wait for an acknowledgment (ACK) before sending the next.
How it works:
- Sender transmits a single frame
- Sender stops and waits
- Receiver processes the frame and sends an ACK
- Sender receives ACK, sends next frame
Analogy: Like a conversation where you speak one sentence, wait for "I understood," then continue. Safe but slow—the link sits idle while waiting.
Sliding Window Protocol
A more efficient approach: allow multiple frames "in flight" before requiring acknowledgment.
How it works:
- Sender maintains a "window" of frames it can send without waiting
- Receiver has a window indicating how many frames it can buffer
- As ACKs arrive, the sender's window "slides" forward
- Window size determines how many unacknowledged frames are allowed
Analogy: Like sending multiple letters before waiting for replies. The "window size" is how many unanswered letters you're willing to have outstanding. Larger windows = better link utilization, but require more buffer space.
Key benefit: Keeps the channel busy while acknowledgments travel back, dramatically improving throughput compared to stop-and-wait.
Key Takeaway: Flow control prevents buffer overflow at receivers—stop-and-wait is simple but inefficient (one frame at a time), while sliding window allows multiple outstanding frames for better performance.