What if your messages could fly faster and safer without waiting forever for replies?
Why Flow control (stop-and-wait, sliding window) in Computer Networks? - Purpose & Use Cases
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.
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.
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.
send one packet; wait for ack; send next packet; wait for ack;
send multiple packets within window size; receive acks; slide window forward; repeat;
These flow control techniques enable fast, reliable data transfer over networks without overwhelming the receiver or losing track of information.
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.
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.