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.
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 PhaseGATE 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.
- GATE CS 2008, Question 56
- GATE CS 2012, Question 65
- GATE CS 2014 (Set 1), Question 65
- 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.
Similar Reads
Longest Prefix Matching in Routers What is Forwarding? Forwarding is moving incoming packets to the appropriate interface. Routers use a forwarding table to decide which incoming packet should be forwarded to which next hop. What is an IP prefix? IP prefix is a prefix of IP address. All computers on one network have the same IP prefi
3 min read
Classification of Routing Algorithms Pre-requisites: Difference between Static and Dynamic RoutingRouting is the process of establishing the routes that data packets must follow to reach the destination. In this process, a routing table is created which contains information regarding routes that data packets follow. Various routing alg
8 min read
Difference between Distance vector routing and Link State routing Routing is a process in computer networks which is used to find best path to transmit data packets from one node to another. Distance Vector Routing and Link State Routing are two most used dynamic routing algorithms. They both are a part of Intradomain routing which refer to routing of devices with
3 min read
Fixed and Flooding Routing algorithms In most situations, packets require multiple hops to make a journey towards the destination. Routing is one of the most complex and crucial aspects of packet-switched network design. Desirable Properties of Routing Algorithms:- Correctness and SimplicityRobustness: Ability of the network to deliver
5 min read
Distance Vector Routing (DVR) Protocol Distance Vector Routing (DVR) Protocol is a method used by routers to find the best path for data to travel across a network. Each router keeps a table that shows the shortest distance to every other router, based on the number of hops (or steps) needed to reach them. Routers share this information
5 min read
Unicast Routing - Link State Routing Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between the sender and receiver. There are various unicast protocols such as TCP, HTTP, etc. TCP (Transmission Control Protocol) is the most commonly used unicast protocol. It is a connecti
6 min read
Internet Control Message Protocol (ICMP) Internet Control Message Protocol is known as ICMP. The protocol is at the network layer. It is mostly utilized on network equipment like routers and is utilized for error handling at the network layer. Since there are various kinds of network layer faults, ICMP can be utilized to report and trouble
11 min read
Open Shortest Path First (OSPF) Protocol Fundamentals Open Shortest Path First (OSPF) is a link-state routing protocol designed to efficiently route data within an Autonomous System (AS). It operates by using the Shortest Path First (SPF) algorithm to calculate the best path for packet forwarding. Unlike distance-vector protocols, OSPF triggers updates
7 min read
Types of Spanning Tree Protocol (STP) In Ethernet networks, switches use frames to forward data between devices. However, if there are multiple active paths between switches (such as when switches are interconnected), a loop can occur, causing frames to circulate indefinitely. This loop results in broadcast storms, high CPU utilization,
5 min read
Differences Between Virtual Circuits and Datagram Networks Computer networks that provide connection-oriented services are called Virtual Circuits while those providing connection-less services are called Datagram networks. For prior knowledge, the Internet that we use is based on a Datagram network (connection-less) at the network level as all packets from
7 min read