[Computer Network] TCP flow control - sliding window and cumulative response

Cumulative responses

The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly.

What we said earlier is that every time we send a packet, the other end must reply with an ack, so the efficiency is too slow. We have a cumulative response mechanism here, which means that our client sends multiple packets cumulatively, and then the server Then respond together.

TCP flow control - sliding window

So what determines how much data we send when accumulating responses and then respond to an ack uniformly? It is determined by the size of the window we mentioned before.

  • The concept of window: TCP requires a confirmation response every time a piece of data is sent. When the response to the previous data packet is received, the next one is sent. This model is a bit like me and you chatting face to face, you say something to me. However, the disadvantage of this method is that its efficiency is relatively low.
  • With the window, you can specify the window size. The window size refers to the maximum value that can continue to send data without waiting for a confirmation response.
  • The window size is told by the receiver to the sender. In the ACK, the first time the receiver and the sender exchange the window size is in the second and third handshakes of the three-way handshake.
  • The size of the data sent by the sender cannot exceed the window size of the receiver, otherwise the receiver will not be able to receive the data normally.

The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly.

When one or more packets are lost during the process of sending data, an ack is returned from the position with the smallest sequence number, allowing the sending end to resend.

flow control:

The so-called flow control mainly means that the receiver transmits information to the sender so that it does not send data too fast. It is an end-to-end control . The main method is that the returned ACK will contain the size of its own receiving window, and the size will be used to control the sender's data transmission.

Guess you like

Origin blog.csdn.net/jia_03/article/details/132867011