Explain in detail the flow control and congestion control mechanisms in TCP.

 

1. FLOW CONTROL (TOPICS & SUBTOPICS)

1.1 Flow Control

  • Definition

  • Purpose

  • End-to-End Control

1.2 TCP Sliding Window Mechanism

  • Byte-oriented window

  • Send window

  • Receive window

  • Advertised window (rwnd)

  • Window update

  • Zero window condition

1.3 Window Management Parameters

  • Window size

  • Window scaling

  • Acknowledgment handling


2. CONGESTION CONTROL (TOPICS & SUBTOPICS)

2.1 Congestion Control

  • Definition

  • Need for congestion control

  • Network overload conditions

2.2 TCP Congestion Control Mechanisms

  • Congestion window (cwnd)

  • Slow start threshold (ssthresh)

2.3 Slow Start

  • Initialization

  • Exponential growth

  • ssthresh detection

2.4 Congestion Avoidance (AIMD)

  • Additive Increase

  • Multiplicative Decrease

  • Linear growth

2.5 Fast Retransmit

  • Duplicate ACKs

  • Early retransmission trigger

2.6 Fast Recovery

  • cwnd adjustment

  • ssthresh update

  • Skipping slow start


3. CONGESTION AVOIDANCE METHODS

3.1 DECbit Scheme

  • Congestion-indication bit

  • Queue length measurement

  • Window increase/decrease rules

3.2 RED (Random Early Detection)

  • Minimum threshold

  • Maximum threshold

  • Dropping probability


4. TCP CONTROL VARIABLES

  • cwnd

  • rwnd

  • ssthresh

  • RTT

  • MSS



Flow Control is the process of managing the rate of data transmission between two nodes to prevent a fast sender from overwhelming a slow receiver. It provides a mechanism for the receiver to control the transmission speed, ensuring that the receiving node is not overwhelmed with data from the transmitting node.

Congestion Control refers to the mechanisms and techniques that control the congestion and keep the load below the capacity of the network. It prevents congestion before it occurs or removes congestion after it has happened by regulating the number of packets entering the network so that the load does not exceed network capacity.


1. FLOW CONTROL IN TCP (Expanded)

1.1 Definition
Flow Control is the mechanism that manages the rate of data transmission so that a fast sender does not overwhelm a slow receiver. It ensures smooth end-to-end data flow and prevents receiver buffer overflow.

1.2 Purpose of Flow Control

  • Prevents receiver buffer saturation

  • Maintains synchronization between sender and receiver

  • Ensures efficient bandwidth utilization

  • Supports error-free and loss-free delivery

1.3 Mechanism – TCP Sliding Window

Key Points

  • Uses byte-oriented sliding window

  • Receiver advertises window size (rwnd) in each segment

  • Sender transmits up to rwnd bytes without waiting for ACK

Window Behaviour

  • Window expands when buffer has free space

  • Window shrinks when receiver becomes slow

  • Effective window = min(cwnd, rwnd) to satisfy flow + congestion rules

Zero Window Condition

  • When rwnd = 0, sender must pause transmission to avoid overload

1.4 Advantages of Flow Control

  • Prevents receiver overload

  • Avoids packet loss from buffer overflow

  • Maintains stable flow

  • Supports TCP’s reliable byte stream service


2. CONGESTION CONTROL IN TCP (Expanded)

2.1 Definition
Congestion Control includes techniques to control or reduce network congestion when traffic exceeds network capacity. It protects routers from buffer overflow and prevents network collapse.

2.2 Need for Congestion Control
Congestion occurs due to:

  • Too many packets entering the network

  • Slow router processing

  • Buffer overflow

  • Bandwidth mismatch

  • Bursty traffic

2.3 TCP CONGESTION CONTROL MECHANISMS
(From cn1.pdf)

  • Slow Start

  • Congestion Avoidance (AIMD)

  • Fast Retransmit

  • Fast Recovery


2.3.1 SLOW START (Expanded)

Concept
TCP begins transmission slowly to check network capacity. cwnd grows exponentially until it reaches the available bandwidth.

Operation

  • Start with cwnd = 1 MSS

  • For every ACK → cwnd = cwnd × 2

  • Growth continues until ssthresh is reached

Purpose

  • Avoids sudden traffic bursts

  • Prevents early congestion


2.3.2 CONGESTION AVOIDANCE – AIMD (Expanded)

Principle
When cwnd ≥ ssthresh, growth becomes linear instead of exponential.

Working

  • Additive Increase: cwnd = cwnd + 1 MSS per RTT

  • Multiplicative Decrease: On timeout → cwnd = cwnd / 2

Why AIMD?

  • Ensures fairness

  • Prevents congestion collapse

  • Maintains stable throughput


2.3.3 FAST RETRANSMIT (Expanded)

Trigger Condition

  • When 3 duplicate ACKs arrive, sender assumes a segment is lost

Action

  • Retransmit the missing segment immediately (no timeout needed)

Advantage

  • Reduces retransmission delay

  • Speeds up recovery


2.3.4 FAST RECOVERY (Expanded)

After Fast Retransmit

  • Do not reduce cwnd to 1 MSS

  • Set cwnd = ssthresh

  • Grow cwnd using additive increase

Benefit

  • Maintains high throughput even during loss


3. ADDITIONAL CONGESTION AVOIDANCE TECHNIQUES
(From cn2.pdf)


3.1 DECbit SCHEME (Expanded)

Key Idea
Routers set a Congestion Indicator Bit (DECbit) when average queue length > 1.

Sender Reaction

  • If < 50% ACKs have DECbit → Increase window by 1

  • If ≥ 50% ACKs have DECbit → cwnd = 0.875 × cwnd

Advantages

  • Prevents queue instability

  • Detects congestion early

  • Reduces packet loss


3.2 RED – RANDOM EARLY DETECTION (Expanded)

Concept
Routers randomly drop packets before the queue becomes full.

Mechanism

  • Calculate average queue length

  • If queue > MinThreshold → drop with low probability

  • If queue > MaxThreshold → drop all incoming packets

Benefits

  • Avoids global synchronization

  • Smooths bursty traffic

  • Gives early congestion indication