TCP CONGESTION CONTROL M.Owais Asghar Jara
CONGESTION:
CONGESTION means: OVERCROWDING
In DCCN:TRAFFIC ≥THRESHOLD
PREVIOUSLY
In flow control we have discussed that the size of send
window is controlled by the receiver using the value of rwnd
(ReceivingWindow).
No CONGESTION at receiving end.
What if intermediate BUFFERS or BUFFERS in routers
become congested?
If segment misses then resending the same segment again
resulting in the worsening the congestion and finally the
communication collapses.
CONGESTION WINDOW
Conclusion:TCP must define policies:
1. Accelerate the data transmission when there is no congestion
in the network.
2. Decelerate the transmission when there is congestion in the
network.
HenceTCP defines another variable called CONGESTION
WINDOW, cwnd, whose size is controlled by the congestion
situation in the network.
CONTINUED…
Now ‘rwnd’ and ‘cwnd’ both control the size of the window in
TCP.
Rwnd= controls congestion at the end.(ReceivingWindow)
Cwnd= controls congestion in the middle.(Congestion Window)
Hence:
Actual window Size=minimum(rwnd , cwnd)
But, HowTCP sender can detect the possible existence of
detection?
CONGESTION DETECTION
Two events indicate congestion in a network
1. Time-Out (Retransmission TripTime )
2. Three Duplicate ACKs.
Time-Out: IfTCP sender do not receive ACK for a segment or a
group of segments before time-out occurs, it assumes that the
corresponding segment or segments are lost and loss is due to
congestion. Sign of strong congestion in the network.
CONTINUED…
Three Duplicate ACKs: Means four ACKs with same
acknowledgment number.WhenTCP sends three duplicate ACKs
it is the sign of the missing segment which can be due to
congestion in the network. But weak congestion.
TCP uses only one feedback from the other end to detect
congestion.
CONGESTION POLICIES
Three ALGORITHMS :
1. Slow Start
2. Congestion Avoidance
3. Fast Recovery
1. SLOW START : EXPONENTIAL INCREASE
MISLEADING Algorithm:
Idea:The size of the congestion window starts with one
maximum segment size (MSS) but it increases one MSS each
time an ACK arrives.
Assume that size of each segment is same and it carries MSS
bytes of data and rwnd >> cwnd so size of window is always equal
to cwnd. (Ignore delays for simplicity)
In the slow-start algorithm, the size of the congestion
window increases exponentially until it reaches a threshold.
CONTINUED…
Slow start can not continue indefinitely.
When re must be a threshold to stop this phase.
The sender keeps track of Slow StartThreshold (ssthresh)
When cwnd ≥ ssthresh congestion detected
These formulae holds for non-delayed segments.
What if segments are delayed two segments are acknowledged
simultaneously ?
CONTINUED…
If two segments are acknowledged simultaneously then the
size of the cwnd increases only by 1, not 2.
Growth is still exponential but now it is a power of 1.5, not 2.
Problem: Exponential Growth is aggressive and congestion will
will definitely occur. Non-Linear and Unreliable.
Solution: we must slow down our exponential growth.
Benefit: FastTransmission rate
2. CONGESTION AVOIDANCE:
ADDITIVE INCREASE
Idea: Additively increase the ‘cwnd’ when the size of the
congestion window reaches slow start threshold. Here we can
use them collectively to improve efficiency.
Choose a case of threshold of slow start where cwnd=ssthresh=i
Now the size of the congestion window is increased by 1.
If an ACK arrives , cwnd=cwnd + (1/cwnd) means all the
previous segments should be acknowledged to increase the
window 1 MSS bytes.
CONTINUED…
In this algorithm, by looking at the cwnd, we find that the
growth rate is linear (increased by 1) which is more conservative
then the slow start approach.
In the congestion avoidance algorithm, the size of the
congestion window increases additively until congestion is
detected.
PROBLEM: Slow data transmission.
BENEFIT: Linear growth rate so more conservative and reliable.
3. FAST RECOVERY: (OPTIONAL)
NewVersions ofTCP Use this algorithm.
Idea: Algorithm same as the congestion avoidance but when a
duplicate ACKs arrives after the three duplicate ACKs, it increases
the size of the congestion window,
If a Duplicate ACK arrives, cwnd= cwnd + (1/cwnd)
PROBLEM: How we will use the algorithms collectively and
how will theTCP move from on policy to another ?
POLICY TRANSITION
There versions ofTCP:
1. TahoTCP:
2. RenoTCP:
3. New RenoTCP:
1. TAHO TCP: (EARLY TCP)
Uses two algorithms:
1. Slow-Start
2. Congestion Avoidance
Treats two signs used for congestion detection similarly using a
simple Finite State Machine (FSM).
1. Time-Out
2. Three Duplicate ACKs
CONTINUED…
Note: No Ceiling in Congestion Avoidance Process It will
continue till the data transfer ends unless congestion occurs.
If Congestion detected by time out or three duplicate ACKs
then reset ssthresh to half of the current cwnd.
The Size of the ssthresh is continuously adjusted and it can not
be always lower then the previous value.
Continuing with example 24.9 (Forouzan 5th ed.)
2. RENO TCP (NEWER VERSION)
Uses three algorithms:
1. Slow-Start
2. Congestion Avoidance
3. Fast Recovery
Treats two signs used for congestion detection differently.
1. Time-Out
2. Three Duplicate ACKs
CONTINUED…
Difference fromTAHOTCP is that when 3 dupACK
arrives then it moves to the FAST RECOVERY algorithm
which will increment the cwnd by plus 1.
But it is noted that when cwnd ≥ ssthresh then we need
Congestion avoidance immediately in both RENO and
TAHO because that will simply reset the ssthresh and
aggressiveness is stopped.
We will go with an example 24.10 (Forouzan 5th ed.)
3. NEW RENO TCP
 Extra optimization:TCP checks to see if more then one
segment is lost in the current window when three ACKs arrive.
If the segment defined by the ACK is also lost then New Reno
TCP retransmits this segment to avoid receiving more and more
duplicate ACKs for it.
ADDITIVE INCREASE ,
MULTIPLICATIVE DECREASE (AIMD)
IF slow start state is ignored :
ThenTCP CongestionWindow is
Cwnd=cwnd+(1/cwnd) (Additive increase)
And cwnd=cwnd/2 when congestion is detected in the absence of
SS. (Multiplicative Decrease)
Congestion window follows a saw tooth pattern called AIMD.
TCP THROUGHPUT
Throughput can be found because cwnd is a constant function
of RTT.
An unrealistic assumption is throughput= cwnd/RTT if cwnd is a
flat line.
But we do not have a straight line in any graph discussed
before.
So throughput=(0.75)Wmax/RTT
Wmax=average of window sizes when the congestion occurs.
Because value of maximum is twice the half of the minimum.
THE END

TCP Congestion Control By Owais Jara

  • 1.
    TCP CONGESTION CONTROLM.Owais Asghar Jara
  • 2.
  • 3.
    PREVIOUSLY In flow controlwe have discussed that the size of send window is controlled by the receiver using the value of rwnd (ReceivingWindow). No CONGESTION at receiving end. What if intermediate BUFFERS or BUFFERS in routers become congested? If segment misses then resending the same segment again resulting in the worsening the congestion and finally the communication collapses.
  • 4.
    CONGESTION WINDOW Conclusion:TCP mustdefine policies: 1. Accelerate the data transmission when there is no congestion in the network. 2. Decelerate the transmission when there is congestion in the network. HenceTCP defines another variable called CONGESTION WINDOW, cwnd, whose size is controlled by the congestion situation in the network.
  • 5.
    CONTINUED… Now ‘rwnd’ and‘cwnd’ both control the size of the window in TCP. Rwnd= controls congestion at the end.(ReceivingWindow) Cwnd= controls congestion in the middle.(Congestion Window) Hence: Actual window Size=minimum(rwnd , cwnd) But, HowTCP sender can detect the possible existence of detection?
  • 6.
    CONGESTION DETECTION Two eventsindicate congestion in a network 1. Time-Out (Retransmission TripTime ) 2. Three Duplicate ACKs. Time-Out: IfTCP sender do not receive ACK for a segment or a group of segments before time-out occurs, it assumes that the corresponding segment or segments are lost and loss is due to congestion. Sign of strong congestion in the network.
  • 7.
    CONTINUED… Three Duplicate ACKs:Means four ACKs with same acknowledgment number.WhenTCP sends three duplicate ACKs it is the sign of the missing segment which can be due to congestion in the network. But weak congestion. TCP uses only one feedback from the other end to detect congestion.
  • 8.
    CONGESTION POLICIES Three ALGORITHMS: 1. Slow Start 2. Congestion Avoidance 3. Fast Recovery
  • 9.
    1. SLOW START: EXPONENTIAL INCREASE MISLEADING Algorithm: Idea:The size of the congestion window starts with one maximum segment size (MSS) but it increases one MSS each time an ACK arrives. Assume that size of each segment is same and it carries MSS bytes of data and rwnd >> cwnd so size of window is always equal to cwnd. (Ignore delays for simplicity) In the slow-start algorithm, the size of the congestion window increases exponentially until it reaches a threshold.
  • 11.
    CONTINUED… Slow start cannot continue indefinitely. When re must be a threshold to stop this phase. The sender keeps track of Slow StartThreshold (ssthresh) When cwnd ≥ ssthresh congestion detected These formulae holds for non-delayed segments. What if segments are delayed two segments are acknowledged simultaneously ?
  • 12.
    CONTINUED… If two segmentsare acknowledged simultaneously then the size of the cwnd increases only by 1, not 2. Growth is still exponential but now it is a power of 1.5, not 2. Problem: Exponential Growth is aggressive and congestion will will definitely occur. Non-Linear and Unreliable. Solution: we must slow down our exponential growth. Benefit: FastTransmission rate
  • 13.
    2. CONGESTION AVOIDANCE: ADDITIVEINCREASE Idea: Additively increase the ‘cwnd’ when the size of the congestion window reaches slow start threshold. Here we can use them collectively to improve efficiency. Choose a case of threshold of slow start where cwnd=ssthresh=i Now the size of the congestion window is increased by 1. If an ACK arrives , cwnd=cwnd + (1/cwnd) means all the previous segments should be acknowledged to increase the window 1 MSS bytes.
  • 15.
    CONTINUED… In this algorithm,by looking at the cwnd, we find that the growth rate is linear (increased by 1) which is more conservative then the slow start approach. In the congestion avoidance algorithm, the size of the congestion window increases additively until congestion is detected. PROBLEM: Slow data transmission. BENEFIT: Linear growth rate so more conservative and reliable.
  • 16.
    3. FAST RECOVERY:(OPTIONAL) NewVersions ofTCP Use this algorithm. Idea: Algorithm same as the congestion avoidance but when a duplicate ACKs arrives after the three duplicate ACKs, it increases the size of the congestion window, If a Duplicate ACK arrives, cwnd= cwnd + (1/cwnd) PROBLEM: How we will use the algorithms collectively and how will theTCP move from on policy to another ?
  • 17.
    POLICY TRANSITION There versionsofTCP: 1. TahoTCP: 2. RenoTCP: 3. New RenoTCP:
  • 18.
    1. TAHO TCP:(EARLY TCP) Uses two algorithms: 1. Slow-Start 2. Congestion Avoidance Treats two signs used for congestion detection similarly using a simple Finite State Machine (FSM). 1. Time-Out 2. Three Duplicate ACKs
  • 20.
    CONTINUED… Note: No Ceilingin Congestion Avoidance Process It will continue till the data transfer ends unless congestion occurs. If Congestion detected by time out or three duplicate ACKs then reset ssthresh to half of the current cwnd. The Size of the ssthresh is continuously adjusted and it can not be always lower then the previous value. Continuing with example 24.9 (Forouzan 5th ed.)
  • 22.
    2. RENO TCP(NEWER VERSION) Uses three algorithms: 1. Slow-Start 2. Congestion Avoidance 3. Fast Recovery Treats two signs used for congestion detection differently. 1. Time-Out 2. Three Duplicate ACKs
  • 24.
    CONTINUED… Difference fromTAHOTCP isthat when 3 dupACK arrives then it moves to the FAST RECOVERY algorithm which will increment the cwnd by plus 1. But it is noted that when cwnd ≥ ssthresh then we need Congestion avoidance immediately in both RENO and TAHO because that will simply reset the ssthresh and aggressiveness is stopped. We will go with an example 24.10 (Forouzan 5th ed.)
  • 26.
    3. NEW RENOTCP  Extra optimization:TCP checks to see if more then one segment is lost in the current window when three ACKs arrive. If the segment defined by the ACK is also lost then New Reno TCP retransmits this segment to avoid receiving more and more duplicate ACKs for it.
  • 27.
    ADDITIVE INCREASE , MULTIPLICATIVEDECREASE (AIMD) IF slow start state is ignored : ThenTCP CongestionWindow is Cwnd=cwnd+(1/cwnd) (Additive increase) And cwnd=cwnd/2 when congestion is detected in the absence of SS. (Multiplicative Decrease) Congestion window follows a saw tooth pattern called AIMD.
  • 29.
    TCP THROUGHPUT Throughput canbe found because cwnd is a constant function of RTT. An unrealistic assumption is throughput= cwnd/RTT if cwnd is a flat line. But we do not have a straight line in any graph discussed before. So throughput=(0.75)Wmax/RTT Wmax=average of window sizes when the congestion occurs. Because value of maximum is twice the half of the minimum.
  • 30.