π€ What is Flow Control? (Basic Idea)
In a network, sender and receiver may not work at the same speed.
π Example:
Sender is very fast π¨
Receiver is slow π’
π If sender sends data too fast:
Receiverβs buffer gets full β
Data is lost β
Errors occur β
π To avoid this problem, we use Flow Control.
π§ Simple Definition
π Flow control is a technique that controls the rate of data transmission so that the sender does not overwhelm the receiver.
π§ Real-Life Analogy
π° Water Tap & Bucket Example
Tap = Sender
Bucket = Receiver
If water flows too fast:
Bucket overflows β
π Solution: Control water flow
That is exactly what flow control does in networking.
π― Why Flow Control is Needed
Flow control helps to:
π Prevent buffer overflow
βοΈ Avoid data loss
β‘ Improve efficiency
π Maintain smooth communication
πΆ Match sender speed with receiver speed
π§± Where is Flow Control Used?
Flow control is mainly used in:
Data Link Layer
Transport Layer
π In this module, we focus on Data Link Layer flow control.
π§ Main Flow Control Techniques
There are two main flow control methods:
1οΈβ£ Stop-and-Wait Flow Control
2οΈβ£ Sliding Window Flow Control
Weβll understand both in detail π
βΈοΈ 1. Stop-and-Wait Flow Control

πΉ What is Stop-and-Wait?
In this method:
Sender sends one frame
Then waits for acknowledgment (ACK)
After ACK, sender sends next frame
π Only one frame at a time is in transit.
π§ Step-by-Step Working
1οΈβ£ Sender sends Frame 1
2οΈβ£ Sender waits
3οΈβ£ Receiver receives Frame 1
4οΈβ£ Receiver sends ACK
5οΈβ£ Sender sends Frame 2
β‘οΈ Process repeats π
π§ Simple Example
Think of WhatsApp voice note π€:
Send one message
Wait for βDeliveredβ
Send next message
β Advantages
Very simple
Easy to implement
No buffer overflow
β Disadvantages
Very slow β
Poor channel utilization
Wastes bandwidth
π Suitable only for small or slow networks.
πͺ 2. Sliding Window Flow Control

πΉ What is Sliding Window?
Sliding Window allows the sender to:
Send multiple frames at a time
Without waiting for ACK of each frame
π Number of frames allowed = Window Size
π§ Key Concept: Window
Sender Window β Frames sender can send
Receiver Window β Frames receiver can accept
π Window slides forward as ACKs are received.
π§ Step-by-Step Working
1οΈβ£ Sender sends multiple frames (within window size)
2οΈβ£ Receiver accepts frames
3οΈβ£ Receiver sends ACKs
4οΈβ£ Window slides forward
5οΈβ£ New frames are sent
π§ Simple Analogy
π¦ Courier Truck Example:
Truck can carry multiple boxes
Doesnβt wait after every box
Delivers efficiently
β Advantages
High efficiency β‘
Better bandwidth utilization
Faster transmission
β Disadvantages
More complex
Needs buffer memory
Harder to implement
π§© Types of Sliding Window Protocols
(Important for exams π)
1οΈβ£ Go-Back-N
2οΈβ£ Selective Repeat
π These are part of ARQ, but also support flow control.
Weβll study them in detail in later topics.
π Stop-and-Wait vs Sliding Window
Feature | Stop-and-Wait | Sliding Window |
|---|---|---|
Frames in transit | 1 | Multiple |
Speed | Slow | Fast |
Efficiency | Low | High |
Complexity | Simple | Complex |
Bandwidth usage | Poor | Good |
π§ Flow Control vs Error Control (Common Confusion)
Aspect | Flow Control | Error Control |
|---|---|---|
Purpose | Control speed | Control errors |
Prevents | Buffer overflow | Data corruption |
Focus | Rate of data | Accuracy of data |
π Both work together, but they are different concepts.
β One-Line Summary
πΉ Flow control ensures that a fast sender does not overwhelm a slow receiver in a network.