0% found this document useful (0 votes)
3 views22 pages

4.6.TCP Congestion Control Contd.

Uploaded by

SUDHAN R CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views22 pages

4.6.TCP Congestion Control Contd.

Uploaded by

SUDHAN R CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

Computer Networks (R19EC253)

Session by

1
cussion about the previous sessions

• Transport Layer Protocol


• TCP
• UDP

2
Agenda of the session

• TCP Congestion Control

3
TCP Congestion Control

TCP uses different policies to handle the congestion in the network.

Congestion Policies

Slow Start: Exponential Increase


Congestion Avoidance: Additive Increase
Fast Recovery

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 Congestion Policy

TCP’s general policy for handling congestion consists of following three phases
 Slow Start
 Congestion Avoidance
 Congestion Detection

Slow Start Phase

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

Threshold = Maximum number of TCP segments that receiver


window can accommodate / 2

= (Receiver window size / Maximum Segment Size) / 2

7
Slow start, exponential increase

8
Congestion Avoidance Phase - Additive Increase

After reaching the threshold,


 Sender increases the congestion window size linearly to avoid the congestion.
 On receiving each acknowledgement, sender increments the congestion window size by 1.
Congestion window size = Congestion window size + 1
 This phase continues until the congestion window size becomes equal to receiver window size.

9
Congestion avoidance, additive increase

In congestion-avoidance algorithm, the size of congestion window increases additively


10
until congestion is detected.
Congestion Detection Phase - Multiplicative Decrease
When sender detects the loss of segments, it reacts in different ways depending on how the loss is
detected?.

Case-01: Detection On Time Out

 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

In this case, sender reacts by


 Setting the slow start threshold to half of the current congestion window size.
 Decreasing the congestion window size to 1 MSS.
 Resuming the slow start phase.

11
Case-02: Detection On Receiving 3 Duplicate Acknowledgements

 Sender receives 3 duplicate acknowledgements for a segment.


 This case suggests the weaker possibility of congestion in the network.
 There are chances that a segment has been dropped but few segments sent later may have
reached.

Reaction

In this case, sender reacts by


 Setting the slow start threshold to half of the current congestion window size.
 Decreasing the congestion window size to slow start threshold.
 Resuming the congestion avoidance phase.

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)

Three versions of TCP: Taho TCP,


Reno TCP,
New Reno TCP.

14
Congestion Avoidance - Random Early Detection(RED)

 With increasingly high-speed networks, it is important to have mechanisms that keep


throughput high but average
 queue sizes low.
 Congestion avoidance scheme maintains network in a region of low delay and high throughput
 Congestion avoidance is achieved through packet dropping

 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

packet loss occurs


Random: In order to avoid biases against bursty traffic and global synchronization.
RED uses randomization in choosing which arriving packets to drop or mark.

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.

RED algorithm Process


 RED aims to control the average queue size by informing the end host to slow down the
transmission of packets.
 It monitors the average queue size and drops or marks packets based on statistical
probabilities

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

You might also like