TCP and Congestion Control
TCP and Congestion Control
Congestion happens when a network gets too much traffic — more than it can handle — and it
causes delays, packet loss, or retransmissions.
Example:
Imagine 50 students try to access the same online test server at the same time. The network slows
down, pages don’t load, and some requests are lost. This is network congestion.
Key Principles:
Example:
A college router checks how much data is coming from students’ devices. If traffic spikes
during class, it knows congestion might happen soon.
• Avoid Overload:
Instead of sending a large amount of data immediately, the sender starts slow and
increases speed only when it's safe.
Example:
When you upload a file to Google Drive, the speed increases gradually. If the network is
busy, the upload stays slow to avoid making things worse.
Example:
During a Zoom class, if voice or video becomes choppy, the app reduces video quality to
lower data usage and ease the network load.
Example:
A printer in a lab prints one document at a time. Even if 10 students click "Print" at once,
the printer handles them one by one.
• Admission Control:
The network may reject new connections if it's already too full.
Example:
A video conferencing tool won’t let new students join a class if the server is overloaded,
preventing call drops.
• Resource Reservation:
Reserves bandwidth for important data (like voice calls) so they aren’t affected by other
traffic.
Example:
In a hospital’s network, online patient monitoring tools get reserved bandwidth to ensure
doctors get real-time updates without delay.
• Retransmission Control:
If a packet is lost, it’s only resent after a timeout to avoid adding more pressure on the
network.
Example:
While downloading a YouTube video, if one part is missing, YouTube waits briefly, then
resends just that part.
• Window Adjustment:
The sender adjusts the number of packets it can send without waiting for ACKs.
Example:
A student downloads a course video. If the network is clear, more packets are sent at
once. If it’s busy, only a few go at a time.
• TCP begins sending just 1 segment and doubles the amount with each successful round.
Example:
You send a photo via WhatsApp. It starts slowly (1 segment), then 2, then 4, then 8,
increasing speed only if the network handles it.
2. Congestion Avoidance
• Once the data reaches a certain limit, TCP increases speed slowly (linearly), not
exponentially.
Example:
If your internet was fine during a video upload, but now it’s evening and more users are
online, the app increases upload speed slowly to stay safe.
3. Fast Retransmit
• Instead of waiting for a timeout, TCP detects loss when it receives three duplicate ACKs
and resends the lost packet immediately.
Example:
You're watching Netflix, and the video suddenly freezes. The app doesn’t wait long — it
quickly resends the missing chunk and continues playing.
4. Fast Recovery
• After fast retransmit, TCP cuts the congestion window in half, not back to 1. This lets
data keep flowing, but at a safer pace.
Example:
After a hiccup in your Microsoft Teams call, the system doesn’t restart everything — it
just slows down and keeps going smoothly.
• Sequencing:
Breaks data into small packets and numbers them for order.
Example:
Sending an email, your message is broken into 5 parts: packet 1 to 5. The receiver
arranges them back in order even if they arrive out of sequence.
• Acknowledgments (ACKs):
The receiver sends an ACK to confirm it got the data.
Example:
You send a document on Google Docs. When the server receives part 1, it says “ACK 2,”
meaning it’s ready for the second part.
Example:
If you send a resume via a job portal and the server doesn’t respond in 2 seconds, your
computer sends it again.
• Checksum:
Checks for data errors during transfer.
Example:
If part of your online exam answer gets corrupted during upload, the checksum fails and
the server asks for that part again.
Flow control prevents the sender from sending too much data if the receiver is slow or busy.
Example:
Your mobile phone says, “I can receive 2000 bytes right now,” so the server sends only
that much.
Example:
During a Zoom call, your friend’s old laptop says it can only take 1000 bytes at a time —
the server adjusts accordingly.
• Zero Window:
If the receiver is full, it advertises a window size of 0 — asking the sender to pause.
Example:
Your laptop is installing updates and gets slow. It tells websites, “Hold on! I can't take
more data now.