In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "the difference between flow control and congestion control of TCP". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the difference between flow control and congestion control in TCP.
1. TCP flow control
Flow control is to make the sender's transmission rate not too fast, so that the receiver can come and receive it.
The principle is to control the sending rate of the sender by confirming the window field in the message, and the sending window size of the sender cannot exceed the window size given by the receiver.
Considering a special case, after the receiver sends a zero-window message segment to the sender, the receiver has some storage space. A message segment with a non-zero window is sent with the receiver to the sender. However, this message segment was lost in the course of transmission. The sender's send window has always been zero, resulting in a deadlock.
To solve this problem, each connection has a persistence timer that starts the persistence counter as soon as the connected party receives a zero window notification. If the duration counter setting time expires, a zero window probe message segment is sent, and the other party is confirming the value of the window in which the probe message segment appears. If the window is still zero, the party that receives the message resets the persistent counter, otherwise, the deadlock can be broken.
Congestion Control of 2.TCP
Congestion control: prevents too much data from being injected into the network, which can overload routers or links in the network. If the network is congested, the packet will be lost, and the sender will continue to retransmit, resulting in a higher degree of network congestion. Therefore, when congestion occurs, the rate of the sender should be controlled. This is very similar to flow control, but from a different starting point. The purpose of flow control is to enable the receiver to receive in time (end-to-end communication), while congestion control is to reduce the congestion of the whole network (global).
Congestion Control method of 2.1TCP
There are four algorithms for congestion control in TCP, namely, slow start, congestion avoidance, fast retransmission, and fast recovery.
The sender makes his sending window equal to the congestion window. the size of the congestion window depends on the degree of congestion of the network and is changing dynamically.
The data is transmitted in one direction, and the other party only sends a confirmation message.
The receiver always has enough cache space, so the size of the sending window is determined by the degree of network congestion.
Slow start and congestion avoidance
The initial execution of the transmission starts slowly, so that cwnd = 1, the sender can only send one segment; when the acknowledgement is received, the cwnd is doubled, so the number of segments that the sender can send after that is: 2, 4, 8.
When cwnd > ssthresh (slow start threshold), the congestion avoidance algorithm is used instead, and the congestion avoidance algorithm adds 1 for each round trip time cwnd.
When cwnd = ssthresh, either a slow start or a congestion avoidance algorithm can be used.
When cwnd < ssthresh, start the algorithm slowly.
When the network times out, ssthresh = cwnd / 2, and set the congestion window cwnd=1. Enter the slow start algorithm.
two。 Fast retransmission and fast recovery
The fast retransmission algorithm requires the receiver not to wait for the data to be sent before piggyback confirmation, but to send the confirmation immediately. Even if the disordered message segment is received, the message segment that has been sent is repeatedly acknowledged. The sender shall retransmit as soon as it receives three repeated confirmations in a row. In this case, only individual message segments are lost, not network congestion. Therefore, to perform fast recovery, the sender adjusts the threshold value ssthresh = cwnd/2, sets the congestion window cwnd=ssthresh, and starts the congestion avoidance algorithm.
The speed of slow start and fast recovery refers to the set value of cwnd, not the growth rate of cwnd. Slow start cwnd is set to 1, while fast recovery cwnd is set to ssthresh.
At this point, I believe you have a deeper understanding of "the difference between TCP flow control and congestion control". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 268
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.