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
In recent years, the rapid development of domesti...
In the previous issue of k8s-Service Mesh Practic...
Anynode released a Black Friday discount plan, of...
Part 01 What is 6LoWPAN In order to enable low-sp...
Recently, the three major operators released thei...
need: In IoT devices, the TCP/IP network protocol...
Switches are in the arena, and it is not okay to ...
TmhHost is a Chinese hosting company founded in 2...
Chinese people are already familiar with the thre...
The next generation of wireless connectivity, 5G,...
The Internet is constantly flooded with new infor...
On September 27, at the China (Beijing) Internati...
The tribe has shared information about RackNerd m...
[[400629]] Recently, 5G has become a hot topic on...
The trend toward supporting multiple connections ...