30
TCP CONGESTION CONTROL M.Owais Asghar Jara

TCP Congestion Control By Owais Jara

Embed Size (px)

Citation preview

Page 1: TCP Congestion Control By Owais Jara

TCP CONGESTION CONTROL

M.Owais Asghar Jara

Page 2: TCP Congestion Control By Owais Jara

CONGESTION:

CONGESTION means: OVERCROWDING

In DCCN: TRAFFIC ≥ THRESHOLD

Page 3: TCP Congestion Control By Owais Jara

PREVIOUSLY

In flow control we have discussed that the size of send window is controlled by the receiver using the value of rwnd (Receiving Window).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.

Page 4: TCP Congestion Control By Owais Jara

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.

Hence TCP defines another variable called CONGESTION WINDOW, cwnd, whose size is controlled by the congestion situation in the network.

Page 5: TCP Congestion Control By Owais Jara

CONTINUED…

Now ‘rwnd’ and ‘cwnd’ both control the size of the window in TCP.

Rwnd= controls congestion at the end.(Receiving Window)

Cwnd= controls congestion in the middle.(Congestion Window)

Hence:

Actual window Size=minimum(rwnd , cwnd)But, How TCP sender can detect the possible existence of detection?

Page 6: TCP Congestion Control By Owais Jara

CONGESTION DETECTION

Two events indicate congestion in a network

1. Time-Out (Retransmission Trip Time )

2. Three Duplicate ACKs.Time-Out: If TCP 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.

Page 7: TCP Congestion Control By Owais Jara

CONTINUED…

Three Duplicate ACKs: Means four ACKs with same acknowledgment number. When TCP 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.

Page 8: TCP Congestion Control By Owais Jara

CONGESTION POLICIES

Three ALGORITHMS :

1. Slow Start

2. Congestion Avoidance

3. Fast Recovery

Page 9: TCP Congestion Control By Owais Jara

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.

Page 10: TCP Congestion Control By Owais Jara
Page 11: TCP Congestion Control By Owais Jara

CONTINUED…

Slow start can not continue indefinitely.When re must be a threshold to stop this phase. The sender keeps track of Slow Start Threshold (ssthresh)When cwnd ≥ ssthresh congestion detected These formulae holds for non-delayed segments. What if segments are delayed two segments are acknowledged simultaneously ?

Page 12: TCP Congestion Control By Owais Jara

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 definitely occur. Non-Linear and Unreliable. Solution: we must slow down our exponential growth. Benefit: Fast Transmission rate

Page 13: TCP Congestion Control By Owais Jara

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.

Page 14: TCP Congestion Control By Owais Jara
Page 15: TCP Congestion Control By Owais Jara

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.

Page 16: TCP Congestion Control By Owais Jara

3. FAST RECOVERY: (OPTIONAL)

New Versions of TCP 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 the TCP move from on policy to another ?

Page 17: TCP Congestion Control By Owais Jara

POLICY TRANSITION

There versions of TCP:

1. Taho TCP:

2. Reno TCP:

3. New Reno TCP:

Page 18: TCP Congestion Control By Owais Jara

1. TAHO TCP: (EARLY TCP)

Uses two algorithms:

1. Slow-Start

2. Congestion AvoidanceTreats two signs used for congestion detection similarly using a simple Finite State Machine (FSM).

1. Time-Out

2. Three Duplicate ACKs

Page 19: TCP Congestion Control By Owais Jara
Page 20: TCP Congestion Control By Owais Jara

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.)

Page 21: TCP Congestion Control By Owais Jara
Page 22: TCP Congestion Control By Owais Jara

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

Page 23: TCP Congestion Control By Owais Jara
Page 24: TCP Congestion Control By Owais Jara

CONTINUED…

Difference from TAHO TCP 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.)

Page 25: TCP Congestion Control By Owais Jara
Page 26: TCP Congestion Control By Owais Jara

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.

Page 27: TCP Congestion Control By Owais Jara

ADDITIVE INCREASE , MULTIPLICATIVE DECREASE (AIMD)

IF slow start state is ignored :

Then TCP Congestion Window 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.

Page 28: TCP Congestion Control By Owais Jara
Page 29: TCP Congestion Control By Owais Jara

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.

Page 30: TCP Congestion Control By Owais Jara

THE END