The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+1 vote
Isn't the flow control mechanism helping to prevent congestion in the network ?

I am not getting how there is congestion at process end , if we say that buffer size is full and the sender is still sending the packet , then that comes under flow control mechanism .

I have gone through web links but there I am not getting the basic insight as to how congestion control is not related to flow control or how is it different from flow control mechanism because even if the sender is not overwhelming the receiver , congestion would not occur , even if it occurs , it will occur at the network portion , which has nothing to do with $TCP$ congestion control mechanism .


Please explain precisely .
asked in Computer Networks by Loyal (7.2k points)
edited by | 120 views

1 Answer

0 votes
Best answer

Flow control mechanism is to prevent sender from overwhelming the receiver. It controls the rate of sending packets by a sender through a buffer (window) maintained at sender side. This window moves to next set of packet(s) only when an acknowledgement is received from the receiver.

So, basically it works this way:

  • Sender has a window of size N, while receiver has a window of size 1 (For simplicity we are considering Go Back to N). Sender Window was Packets number $#1, #2... #N$
  • Sender sends $Packet #1, Packet #2 ... Packet #N$ to the receiver and waits for ACK.
  • When senders gets ACK for Packet #1, it shifts a window to $Packet #2, Packet #3.. Packet #N + 1$
  • When senders gets ACK for Packet #2, it shifts a window to $Packet #3, Packet #4.. Packet #N + 2$
  • The process goes on

So, sender wants for receiver to ACK the packet so that it is not overwhelmed with lot of packets being sent to the receiver. That is the whole idea behind this mechanism that a faster sender must not overwhelm a slow receiver

Internet as a whole can be considered a Queue of Packets. There are nodes which are putting packets and there are nodes which are picking packets from this queue. If there are too many nodes putting packets then what can be picked up from the queue by the nodes, then this degrades performance and is known as congestion. There can be several reasons for this congestion like bursty traffic, slow processing at nodes (routers).. etc. When congestion occurs, the routers drop the packets as they are unable to cope up with the flow. This means that when a device sends a packet and does not receive an acknowledgment from the receiver, in most the cases it can be assumed that the packets have been dropped by intermediate devices due to congestion. Remember that in case of Flow Control mechanism, it would retransmit the packets again to the sender, at the same rate (whatever amount of packets are in window). This would only cause more harm to the situation, right ?

While there are several methods to control this congestion in the network like Leaky Bucket, Token Bucket, but for for now, would only talk about TCP Congestion control mechanism. It works by setting the size of amount of data to be sent equal to the Maximum Segment Size (Negotiated during connection establishment). When an ACK is received for this segment, the maximum size of data that can now be sent is set to 2 MSS. When ACK is received for this, then the size of data that can now be sent is set to 4 MSS .. and so on. This keeps on doubling till a threshold is reached. If the ACK is not received, and the timer times out waiting for ACK, then the maximum size of data that can be sent is set to 1 MSS and the threshold is to half the size of maximum data which was last sent. This is called TCPs Additive Increase Multiplicative Decrease (AIMD).


So, while flow control is used to stop sender from overwhelming the receiver, the congestion control is used to dynamically control the flow of packets sent from sender to receiver so that the network as a whole remain within its carrying capacity.

answered by Loyal (5.3k points)
selected by
Firstly thanks a lot for such a brief explanation . I have some doubts :

1. what is the significance of Threshold value ?

2. why do we have specifically this TCP Congestion control mechanism , couldn't network layer alone handle this , because packets are dropped at router when congestion is there and router has no Transport layer so when dropping of packets occur at network layer , was there any need to have congestion control mechansim at the Transport layer ?
1. Threshold value is the value after which increase in window size happens linearly. Till the time threshold is not reached, the window size doubles.

2. Network layer is responsible for handling communication between networks. Consider there are three networks - Network#1, Network #2, Network #3 one after the another. A sender (in Network #1) wants to send packets to receiver (in Network #3). If above congestion control is employed at data link layer, then it can only handle communication between Network#1 and Network #2 or Network #2 and Network #3, but not between Network #1 and Network #3, as it is node to node layer. Since TCP is responsible to end to end delivery, it can see the entire path (between sender receiver) and take care congestion control in the entire channel from sender till the receiver, which may encompass many networks
Understood the 2nd point , plz explain threshold point again , is it the Vue of MSS at which congestion occured or congestion was observed ?

I am a bit confused at this point .
Simply putting, it is just a value - used while applying the congestion control algorithm.

Congestion is observed by TCP when one of its segments is lost or when it receives 3 duplicate ACKs for a segment.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,106 questions
45,608 answers
49,233 users