We all know that TCP is a reliable, connection-oriented transport layer protocol. We always hope that TCP can transmit data as quickly as possible. If there is such a situation that the sender sends data very quickly and the receiver has exhausted its resources and has no time to receive it, then the excess data will be discarded, which violates the principle of TCP reliability.
Therefore, it is necessary to introduce a method of flow control: to prevent the sender from sending too fast, so that the receiver can receive the data smoothly without causing congestion of the network link. Ideas Following this idea: let the sender not send too fast. Then let the receiver control the sender's data size, and notify the sender how much space is left to receive data each time it responds. Of course, the actual interaction is not that simple, it just provides a way of thinking. Using this idea, the sliding window method was born. Sliding Window The sliding window is like a window that tells the sender the size of the data that can be sent. It can also be said that the window marks the size of the receiver's buffer. The window size also indicates how much data can be sent at a time, and this window can slide, hence the name sliding window. How to tell the sender the window size? How to inform the sender of the window size? Do we need to resend a packet of data to tell the other party? This is obviously unreasonable. We can use the confirmation response packet cleverly. Having a confirmation response packet is not enough. What if it is the first interaction? Therefore, we need to inform the other party during the three-way handshake. (rwnd means receiving window) In the original confirmation response strategy, each time data is sent, an Ack response is required. The next data segment will be sent only after receiving the Ack. What if the sender does not receive the Ack response? This method is too inefficient. With the use of a sliding window, data can be sent multiple times as long as it does not exceed the other party's window size. This greatly improves efficiency. Sliding Window Details
Examples A sends data to B. When the connection is established, B tells A: "My receiving window rwnd = 400 (bytes). Note: The capital ACK above the arrow in the figure represents the confirmation bit ACK in the header, and the lowercase ack represents the value of the confirmation field. The above process is as follows:
|
<<: Summarize various issues between wireless AP and AC of WiFi system
Hello everyone, I am Bernie, an IT pre-sales engi...
Installing fiber optic cable is a complex and tim...
As the popularity of his e-commerce website grew,...
2020 is a critical year for the large-scale const...
LOCVPS has released a permanent 50% discount coup...
[[374308]] This article is reprinted from the WeC...
No two networks are designed and built alike. One...
Last week we shared CloudCone's VPS hosting B...
On the afternoon of December 4, the first stop of...
Continuing with the year-end summary, many friend...
According to China News Service, on March 1, the ...
PacificRack has recently released some unusual pa...
If you were to pick the most used feature in Chro...
China Unicom recently released its financial resu...
LOCVPS has started the 10th anniversary event war...