0
0
Computer Networksknowledge~3 mins

Why TCP flow control (sliding window) in Computer Networks? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if you could send many messages at once without losing track or overwhelming your friend?

The Scenario

Imagine you are sending a long letter to a friend by passing notes through a chain of people. You can only send one note at a time and must wait for your friend to confirm they received it before sending the next. This makes the whole process very slow.

The Problem

Sending one note at a time means you spend a lot of time waiting. If your friend is slow to reply or busy, you can't send more notes, causing delays. Also, if you send too many notes without checking, your friend might get overwhelmed and lose some notes.

The Solution

TCP flow control with sliding window lets you send multiple notes at once without waiting for each confirmation. You keep track of how many notes your friend can handle and adjust the number you send accordingly. This keeps the flow smooth and avoids overwhelming your friend.

Before vs After
Before
send(note1)
wait_for_ack()
send(note2)
wait_for_ack()
After
window_size = 5
send(notes[0:window_size])
while not all_acked:
  receive_acks()
  slide_window()
What It Enables

It enables efficient and reliable data transfer by balancing speed and safety, so networks run smoothly without losing information.

Real Life Example

When you stream a video online, TCP flow control helps your device receive data fast without getting overwhelmed, so the video plays without pauses or glitches.

Key Takeaways

Manual one-by-one sending is slow and inefficient.

Sliding window allows multiple packets to be sent before waiting for acknowledgments.

This balances network speed and reliability for smooth communication.