What's the difference between Flow Control and Congestion Control in TCP?
Asked Answered
D

8

95

What's the difference between flow control and congestion control in TCP?

This question can be broken down into two parts:

  1. What is the overall purpose of flow and congestion control?
  2. How is the task accomplished?

According to Wikipedia, TCP flow control relies on the window size reported in an ACK message. Congestion control also relies on acknowledgement messages. I would like to know what the difference is between the two goals, and how they work.

Deafmute answered 9/5, 2013 at 23:51 Comment(1)
Not a homework question. More of an interview prep question. What is "off-topic" about it? @EJPDeafmute
C
137

As to part 1, super general overview:

Flow control is controlled by the receiving side. It ensures that the sender only sends what the receiver can handle. Think of a situation where someone with a fast fiber connection might be sending to someone on dialup or something similar. The sender would have the ability to send packets very quickly, but that would be useless to the receiver on dialup, so they would need a way to throttle what the sending side can send. Flow control deals with the mechanisms available to ensure that this communication goes smoothly.

Congestion control is a method of ensuring that everyone across a network has a "fair" amount of access to network resources, at any given time. In a mixed-network environment, everyone needs to be able to assume the same general level of performance. A common scenario to help understand this is an office LAN. You have a number of LAN segments in an office all doing their thing within the LAN, but then they may all need to go out over a WAN link that is slower than the constituent LAN segments. Picture having 100mb connections within the LAN that ultimately go out through a 5mb WAN link. Some kind of congestion control would need to be in place there to ensure there are no issues across the greater network.

As to part 2:

If this is an interview-prep question, as you said above, I would consider taking some time to read up on TCP/IP in general. Don't use Wikipedia. RTFM! This is VERY much worth your time. You could argue that this is the most important protocol holding up most of the modern internet.

Things to read about for Flow Control: stop and wait, sliding window, PAUSE frames.

Things to read about for Congestion Control: QoS (Quality-of-Service), retransmission policies, windowing policies.

Beyond that, you can search for any particular vendor implementations (Cisco, etc..)

Corena answered 10/5, 2013 at 11:16 Comment(4)
Good answer but there's at least one mistake: "PAUSE frames" are not used in Congestion Control, they are a mechanism for Flow Control.Chain
You are absolutely correct. Added in the wrong paragraph, editing now.Corena
where is the manual? google only give some blogs.Empathic
One should not rely solely on Wikipedia, but it can be a valid resource.Yand
D
30

Flow Control: Sender will send enough data that can be accommodated at the receiver end.

Congestion Control: Sender will reduce the amount of sent packets to avoid overflowing the router's buffer(Queue).

Ducks answered 6/10, 2013 at 12:42 Comment(0)
W
23

Flow Control:

  • It makes sure that the sender does not overload the receiver.
  • It's a local phenomenon, unlike congestion control.
  • It's generally initiated by the sender.

Congestion control:

  • It makes sure that the network is able to handle the load of packets.
  • It's a global phenomenon and affects every host connected with that network.
  • It's initiated by the router.
Woolsack answered 12/5, 2015 at 20:21 Comment(0)
C
6

Congestion control is a global issue – involves every router and host within the subnet

Flow control, that is scoped from point to point, involves just sender and receiver.

Craniometer answered 30/9, 2014 at 18:57 Comment(0)
R
5

Flow control is mainly done on the receiver side, to adjust how much data the sender is injecting into the network; congestion control is mainly done on the sender side, trying to sense congestion on the network by the timing of ACK-packets, to adjust the volume of data sent to the corresponding situation.

Rye answered 16/6, 2016 at 16:33 Comment(0)
I
2

Congestion control:In addition to preventing the router's buffer from overflowing it also deals with two other important factors

  • Fairness: Starvation shouldn't occur for any host connected to the network.Although the terminology is way more complex.
  • Efficiency: The links should be utilised to their maximum capacity such that it doesn't cause congestion.
Irradiance answered 16/6, 2016 at 8:25 Comment(0)
B
2

Flow Control is done at the receiver side. If the sender sends packets greater than the receiver's buffer size, overflow occurs at the receiver's buffer. To avoid this overflow at the receiver side, there is a windowing technique used at the sender side. Congestion control is done at the sender side. This is a global phenomenon. This happens at the router. Router's buffer overflows when many senders try to push more packets through the same link.

Benfield answered 31/7, 2016 at 7:4 Comment(1)
This looks like a honest attempt to answer the question, but right now, your answer is a bit confusing. It is also rather short. Please consider spending one or two full paragraphs on flow control and one or two full paragraphs on congestion control, with more commas and fewer word omissions.Schecter
E
0

Flow Control:

  1. When the sender buffer is full then we prevent the source from sending the data so that data should not be dropped.
  2. Receiver buffer is full in this case.
  3. It can be achieved easily by sliding window protocol.

Congestion Control

  1. When we start transmitting the data from source then it reaches the destination with the help of the network. Congestion control preventing the source so the data should not be dropped by the router in the network.

  2. This issue is related to the queue of the router

  3. It is more complicated to achieve because router gets different packets from the different source connected to its network.

Elstan answered 4/5, 2018 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.