4.6.TCP Congestion Control Contd.
4.6.TCP Congestion Control Contd.
Session by
1
cussion about the previous sessions
2
Agenda of the session
3
TCP Congestion Control
Congestion Policies
4
TCP reacts to congestion by reducing the sender window size.
size of the sender window is determined by the following two factors
Receiver window size
Congestion window size
Receiver window size - is an advertisement of
“How much data (in bytes) the receiver can receive without acknowledgement?”
Sender should not send data greater than receiver window size.
Otherwise, it leads to dropping the TCP segments which causes TCP Retransmission.
So, sender should always send data less than or equal to receiver window size.
Receiver dictates its window size to the sender through TCP Header.
Congestion Window
Sender should not send data greater than congestion window size.
Otherwise, it leads to dropping the TCP segments which causes TCP Retransmission.
So, sender should always send data less than or equal to congestion window size.
Different variants of TCP use different approaches to calculate the size of congestion window.
Congestion window is known only to the sender and is not sent over the links.
5
Sender window size = Minimum (Receiver window size, Congestion window size)
TCP’s general policy for handling congestion consists of following three phases
Slow Start
Congestion Avoidance
Congestion Detection
Initially, sender sets congestion window size = Maximum Segment Size (1 MSS).
After receiving each acknowledgment, sender increases the congestion window size by 1
MSS.
In this phase, the size of congestion window increases exponentially.
Congestion window size = Congestion window size + Maximum segment size
6
•After 1 round trip time, congestion window size = (2) 1 = 2 MSS
•After 2 round trip time, congestion window size = (2) 2 = 4 MSS
•After 3 round trip time, congestion window size = (2) 3 = 8 MSS and
so on.
•This phase continues until the congestion window size reaches the
slow start threshold.
7
Slow start, exponential increase
8
Congestion Avoidance Phase - Additive Increase
9
Congestion avoidance, additive increase
Time Out Timer expires before receiving the acknowledgement for a segment.
This case suggests the stronger possibility of congestion in the network.
There are chances that a segment has been dropped in the network.
Reaction
11
Case-02: Detection On Receiving 3 Duplicate Acknowledgements
Reaction
12
Additive Increase, Multiplicative Decrease (AIMD)
Out of the three versions of TCP, Reno version is most common today.
In this version, most of the time the congestion is detected and taken care of by observing
three duplicate ACKs.
Even if there are some time-out events, TCP recovers from them by aggressive exponential
growth.
In a long TCP connection, if we ignore the slow-start states and short exponential growth during
fast recovery,
TCP congestion window is cwnd = cwnd + (1 / cwnd) when an ACK arrives (congestion
avoidance),
cwnd = cwnd / 2 when congestion is detected,
The first is called additive increase
It means that the congestion window size, after it passes the initial slow-start state, follows a
13
saw tooth pattern called
Additive increase, multiplicative decrease
(AIMD)
14
Congestion Avoidance - Random Early Detection(RED)
RED was proposed by Floyd and Van Jacobson in the early 1990s
It address network congestion in a responsive rather than reactive manner.
Goal - To provide congestion avoidance by controlling average queue size.
- Avoidance of global synchronization
- Introduce fairness to reduce the bias against bursty traffic
Global synchronization - Each sender will reduce and then increase their transmission rate at
the same time when 15
Early: It suggests that router drops the packet earlier than it would have to, so as to
notify the source that it should decrease its congestion window sooner than it would
normally.
16
We have an incoming packet
• The average queue length is computed
• If avr<min length threshold then the packet
is
placed in the queue
• If min < avr < max qulen thres then check
dropping
probability (Pa)
If high probability => packet is dropped
If low probability => packed placed in
the queue
If avr >max =>packet is dropped
17
Rate of packet drop increases linearly as the average queue size increases until the average
queue size reaches the
maximum threshold.
The packet drop probability is based on the minimum threshold, maximum threshold, and
mark probability
When the average queue depth is above the minimum threshold, RED starts dropping
packets.
The min thres should be high enough to maximize link usage.
If the min thres is too low, then may packets be dropped unnecessarily
Difference between min and max thres should be enough in order to avoid global
synchronization.
If the difference is not enough, then senders will back-off almost at the same time.
With RED TCP global synchronization is avoided.
18
RED gateways avoid global synchronization by marking packets at as low a rate as possible.
RED Algorithm
19
20
Advantages of RED gateways
• Congestion Avoidance
• If the RED gateway drops packets when avgQ reached maxQ,
the avgQ will never exceed maxQ.
• Appropriate time scales
• Source will not be notified of transient congestion.
• No Global Synchronization.
• All connection wont back off at same time.
• Simple
• High link utilization
• Fair
Session Handler Details
22