The Wayback Machine - https://web.archive.org/web/20241124164359/https://www.geeksforgeeks.org/tcp-congestion-control/
Open In App

TCP Congestion Control

Last Updated : 30 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

TCP congestion control is a method used by the TCP protocol to manage data flow over a network and prevent congestion. TCP uses a congestion window and congestion policy that avoids congestion. Previously, we assumed that only the receiver could dictate the sender’s window size. We ignored another entity here, the network. If the network cannot deliver the data as fast as it is created by the sender, it must tell the sender to slow down. In other words, in addition to the receiver, the network is a second entity that determines the size of the sender’s window.

Congestion Policy in TCP

  • Slow Start Phase: Starts slow increment is exponential to the threshold.
  • Congestion Avoidance Phase: After reaching the threshold increment is by 1.
  • Congestion Detection Phase: The sender goes back to the Slow start phase or the Congestion avoidance phase.

TCP Congestion Control ensures smooth data transmission over the network. For an in-depth understanding of network protocols, the GATE CS Self-Paced Course includes detailed networking modules.

Slow Start Phase

Exponential Increment: In this phase after every RTT the congestion window size increments exponentially. 

Example: If the initial congestion window size is 1 segment, and the first segment is successfully acknowledged, the congestion window size becomes 2 segments. If the next transmission is also acknowledged, the congestion window size doubles to 4 segments. This exponential growth continues as long as all segments are successfully acknowledged.

Initially cwnd = 1
After 1 RTT, cwnd = 2^(1) = 2
2 RTT, cwnd = 2^(2) = 4
3 RTT, cwnd = 2^(3) = 8

Congestion Avoidance Phase

Additive Increment: This phase starts after the threshold value also denoted as ssthresh. The size of CWND (Congestion Window) increases additive. After each RTT cwnd = cwnd + 1.

For example: if the congestion window size is 20 segments and all 20 segments are successfully acknowledged within an RTT, the congestion window size would be increased to 21 segments in the next RTT. If all 21 segments are again successfully acknowledged, the congestion window size will be increased to 22 segments, and so on.

Initially cwnd = i
After 1 RTT, cwnd = i+1
2 RTT, cwnd = i+2
3 RTT, cwnd = i+3

Congestion Detection Phase

Multiplicative Decrement: If congestion occurs, the congestion window size is decreased. The only way a sender can guess that congestion has happened is the need to retransmit a segment. Retransmission is needed to recover a missing packet that is assumed to have been dropped by a router due to congestion. Retransmission can occur in one of two cases: when the RTO timer times out or when three duplicate ACKs are received.

Case 1: Retransmission due to Timeout – In this case, the congestion possibility is high.

(a) ssthresh is reduced to half of the current window size.
(b) set cwnd = 1
(c) start with the slow start phase again.

Case 2: Retransmission due to 3 Acknowledgement Duplicates – The congestion possibility is less.

(a) ssthresh value reduces to half of the current window size.
(b) set cwnd= ssthresh
(c) start with congestion avoidance phase

Example

Assume a TCP protocol experiencing the behavior of slow start. At the 5th transmission round with a threshold (ssthresh) value of 32 goes into the congestion avoidance phase and continues till the 10th transmission. At the 10th transmission round, 3 duplicate ACKs are received by the receiver and entered into additive increase mode. Timeout occurs at the 16th transmission round. Plot the transmission round (time) vs congestion window size of TCP segments.

Congestion Detection Phase in TCP

Congestion Detection Phase

GATE CS Corner Questions 

Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.

  1. GATE CS 2008, Question 56
  2. GATE CS 2012, Question 65
  3. GATE CS 2014 (Set 1), Question 65
  4. GATE IT 2005, Question 73

Conclusion

In summary, TCP congestion control helps balance the data flow in a network, ensuring that all users can send and receive data efficiently without Overloading the network. It dynamically adjusts the data flow based on the network’s current state, ensuring stable and reliable communication.

Frequently Asked Questions on TCP Congestion Control – FAQs

What do you mean by congestion control?

Congestion control is a system that manages how data packets enter the network. It helps make better use of shared network resources and prevents the network from becoming too crowded and failing.

Which is the best TCP congestion algorithm?

 Best TCP congestion algorithm is Reno TCP congestion control.

Is congestion control TCP or UDP?

UDP does not manage network congestion, but TCP uses special methods to prevent congestion and keep data flowing smoothly.


Previous Article
Next Article

Similar Reads

TCP Congestion Control Algorithms: Reno, New Reno, BIC, CUBIC
TCP (Transmission Control Protocol) congestion control algorithms are important for dealing with network congestion and ensuring green information switches over the Internet. Several congestion control algorithms have been developed through the years to deal with specific aspects of community conduct. Here's a top-level view of the noted algorithms
15 min read
Difference between Flow Control and Congestion Control
Flow Control and Congestion Control are traffic controlling methods for different situations. The main difference between flow control and congestion control is that, In flow control, rate of traffic received from a sender can be controlled by a receiver. On the other hand, In congestion control, rate of traffic from sender to the network is contro
4 min read
Program to find the final size of Congestion Window in TCP Reno
Given the initial congestion window size cwnd, threshold value ssthresh, connection time rtt and an array arr where arr[i] implies the time when a packet loss is detected. The task is to find the final congestion window size when all the packet drops are being encountered by the sender. The TCP Reno follows below conditions: The initial value of cw
7 min read
Find the final size of Congestion Window in TCP Tahoe
Given the initial congestion window size cwnd, threshold value ssthresh, connection time rtt and an array arr where arr[i] implies the time when a packet loss is detected. The task is to find the final congestion window size when all the packet drops are being encountered by the sender. The TCP Tahoe follows below conditions: The initial value of c
8 min read
What is DCCP (Datagram Congestion Control Protocol)?
Congestion in a network means deterioration of network or services which are caused due to overloading of network nodes, basically, this problem is primarily associated with large networks, in which a large amount of data and information is being transmitted. Congestion can be caused by several reasons: either the routers which are being used are n
6 min read
Congestion Control in Datagram Subnets
In this article, we will discuss different approaches to Congestion control in the data-gram subnet. Also, we will discuss the drawback and will explain each approach in detail. Let's discuss them one by one. Pre-requisite -Congestion control Congestion control in data-gram and sub-nets :Some congestion Control approaches which can be used in the d
4 min read
Slow Start Restart Algorithm For Congestion Control
Once a connection is established between client and server, the sender sends the data to the receiver in form of packets. If the network is congested then packets get dropped. This happens when the buffer of intermediaries devices such as Router is filled. TCP sender has to detect whether it has filled up ‘buffers at the intermediate devices’, and
5 min read
When To Use Congestion Control?
Answer: Congestion control is used in computer networks when the volume of data traffic exceeds the capacity of the network, leading to congestion and degradation of performance. It's employed to regulate the flow of data, prevent network collapse, and ensure fair access to network resources for all users.Congestion control guarantees that all comm
2 min read
Congestion Control in Computer Networks
Congestion control is a crucial concept in computer networks. It refers to the methods used to prevent network overload and ensure smooth data flow. When too much data is sent through the network at once, it can cause delays and data loss. Congestion control techniques help manage the traffic, so all users can enjoy a stable and efficient network c
8 min read
Congestion Control techniques in Computer Networks
Congestion control refers to the techniques used to control or prevent congestion. Congestion control techniques can be broadly classified into two categories: Open Loop Congestion ControlOpen loop congestion control policies are applied to prevent congestion before it happens. The congestion control is handled either by the source or the destinati
5 min read
TCP with explicit link failure notification (TCP-ELFN)
TCP with Explicit Link Failure Notification (TCP-ELFN) is an end to end approach used in TCP Ad Hoc wireless networks to improve the performance by decoupling the path break information from congestion information. TCP-ELFN does not depend upon any routing protocols as it requires explicitly only the link failure notification when there is a path f
2 min read
TCP Tahoe and TCP Reno
TCP is known as a connection-oriented protocol, which ensures reliability and is also responsible for congestion control mechanisms in the network. TCP Tahoe and TCP Reno are two techniques of TCP congestion control, these are used when the sender receives three duplicate acknowledgments. TCP Tahoe where Tahoe is a lake in the USA. This particular
4 min read
TCP Fast Open and TCP/IP Acceleration
The TCP Fast Open (TFO) and TCP/IP Acceleration are techniques used to improve the performance and efficiency of TCP connections in computer networks. These techniques aim to reduce the latency and improve the throughput of the TCP connections, especially for short-lived connections and web browsing scenarios. TCP Fast Open (TFO): The TCP Fast Open
3 min read
When Transmission Control Protocol (TCP) most appropriate?
TCP(Transmission Control Protocol) is a protocol of the Transport layer. TCP is a connection-oriented, reliable, and secured protocol. To provide reliable service TCP implements Error control, Congestion control, Flow control. Services provide by TCP : The process to process communication -It is achieved using the port number.Stream Delivery Servic
2 min read
Error Control in TCP
Prerequisite - TCP/IP Model TCP protocol has methods for finding out corrupted segments, missing segments, out-of-order segments and duplicated segments. Error control in TCP is mainly done through the use of three simple techniques : Checksum - Every segment contains a checksum field which is used to find corrupted segments. If the segment is corr
2 min read
How Flow Control is Achieved in TCP?
Answer: In computer networks, reliable data delivery is important. The Transmission Control Protocol guarantees in-order and error-free data transfer using flow control. This is to prevent the sender from flooding the receiver so as to make sure it can work efficiently in turn.TCP utilizes a sliding window protocol for flow control. The receiver ad
2 min read
What is TCP (Transmission Control Protocol)?
TCP (Transmission Control Protocol) is one of the main protocols of the TCP/IP suite. It lies between the Application and Network Layers which are used in providing reliable delivery services. Transmission Control Protocol (TCP) ensures reliable and efficient data transmission over the internet. TCP plays a crucial role in managing the flow of data
6 min read
Working of Explicit Congestion Notification
Explicit Congestion Notification (ECN) is an extension to the Internet Protocol and to the Transmission Control Protocol. It is defined in RFC 3168. It allows end-to-end notification of network congestion without dropping packets. ECN is an optional feature that may be used between two ECN - enabled endpoints when the underlying network infrastruct
6 min read
What is ECN(Explicit Congestion Notification)?
ECN stands for Explicit Congestion Notification algorithm. It is not a congestion control algorithm like slow start restart and AIMD. This algorithm has only one responsibility to inform the sender about congestion building at the routers. Hence, ECN is a congestion notification or congestion signaling algorithm. It informs the sender about congest
7 min read
Difference Between Network Congestion and Network Latency
Network congestion refers to a situation in which a network experiences an excessive amount of traffic, resulting in a reduction of available bandwidth and increased delays for network users. This can occur in both wired and wireless networks and can have a significant impact on the performance and reliability of the network. Congestion can occur d
9 min read
How Does the Central Node in a Star Topology Handle Traffic Congestion?
Answer: The central node in a star topology handles traffic congestion as in star topology all the systems are connected with central switch/ server hence the unicast data transmission is used that reduce the network congestion and enhances the performance of the network.As we know that each system in star topology is connected to a central switch
2 min read
What is Network Congestion? Common Causes and How to Fix Them?
Network congestion occurs when the request for network resources overcomes the available capacity, managing to slower data transmission, packet loss, and delays. This situation is commonly observed in computer networks, such as internet, where multiple devices and applications resist for limited transmission capacity. As more users accessing the ne
8 min read
Difference between Control Structure and Control Statement
1. Control Structure :Control Structure, as name suggests, is basically a set of statements and control statements that are controlling their execution. 2. Control Statement :Control Statement, as name suggests, is basically a statement that is used to determine control flow of set of statements. It makes decision on basis of condition provided by
2 min read
Difference Between Flow Control and Error Control
In data transmission, the general aspect of maintaining effective and accurate transfer of data between gadgets is very important. This is where the flow control and the error control mechanisms will be of help. Flow control regulates the amount of data being transmitted from the sender to the receiver so that it does not overpower the receiver, wh
5 min read
Basic concept of TCP-Vegas
TCP Reno and TCP Tahoe models can determine the congestion in the network only when there some packet loss occurred in the system. So in these models, we have compensated for the packet to sense the congestion in the network. In these models when packet loss occurs the window size is decreased and the system enters the congestion avoidance phase. W
3 min read
TCP flags
In TCP connection, flags are used to indicate a particular state of connection or to provide some additional useful information like troubleshooting purposes or to handle a control of a particular connection. Most commonly used flags are "SYN", "ACK" and "FIN". Each flag corresponds to 1 bit information. Types of Flags: Synchronization (SYN) - It i
4 min read
What is TCP Window Scaling?
In the TCP header, the window size field is of size 16 bits. Using this field TCP users (client or server) can advertise a maximum of 216 = 65536 bytes or 64 KiB as its buffer size to its other end-user. But modern endpoint devices (e.g., phones, tabs, PCs, etc) have much more memory available in their buffers. This 16-bit field was enough during t
5 min read
Wrap Around Concept and TCP Sequence Number
Prerequisite - TCP | Services and Segment structure Transmission Control Protocol (TCP) is one of the most important protocols of the internet protocol. It provides full transport-layer service to applications and generates a virtual circuit between sender and receiver that is active for the duration of the transmission. Its segment consists of a T
6 min read
Devices used in each layer of TCP/IP model
Prerequisite - TCP/IP Model, Network Devices 1. Physical Layer - Physical layer of TCP/IP model is responsible for physical connectivity of two devices. Some of the devices used in Physical layers are, Hubs: Hubs are devices commonly used to connect segments of a LAN. It contains multiple input/output ports. when signal is at any input port, this s
4 min read
TCP and UDP in Transport Layer
Layer 3 or the Network layer uses IP or Internet Protocol which being a connection less protocol treats every packet individually and separately leading to lack of reliability during a transmission. For example, when data is sent from one host to another, each packet may take a different path even if it belongs to the same session. This means the p
4 min read
Article Tags :
three90RightbarBannerImg