0
0
Computer Networksknowledge~3 mins

Why Flow control (stop-and-wait, sliding window) in Computer Networks? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your messages could fly faster and safer without waiting forever for replies?

The Scenario

Imagine you are sending important letters to a friend by mail, but you can only send one letter at a time and must wait for a reply before sending the next. If your friend is slow to respond or the mail is delayed, you waste a lot of time waiting.

The Problem

This slow back-and-forth method causes delays and wastes time. If a letter gets lost, you might not know and keep waiting forever. It is hard to keep track of which letters arrived and which didn't, making communication unreliable and frustrating.

The Solution

Flow control methods like stop-and-wait and sliding window help manage sending data efficiently. Stop-and-wait ensures each piece is acknowledged before sending the next, preventing overload. Sliding window lets you send multiple pieces before waiting for replies, speeding up communication while keeping track of what's confirmed.

Before vs After
Before
send one packet; wait for ack; send next packet; wait for ack;
After
send multiple packets within window size; receive acks; slide window forward; repeat;
What It Enables

These flow control techniques enable fast, reliable data transfer over networks without overwhelming the receiver or losing track of information.

Real Life Example

When you stream a video online, sliding window flow control helps your device receive many data packets smoothly, so the video plays without pauses or glitches.

Key Takeaways

Manual one-at-a-time sending is slow and error-prone.

Stop-and-wait waits for confirmation before next send, simple but slow.

Sliding window sends multiple packets before waiting, improving speed and reliability.