For TCP, its main function is transmission and control. However, the specific operation process is not that simple. Now let's take a look at this knowledge. First, let's talk about the content of the Transmission Policy. We hope to provide a reference for you.
Transmission Policy
The TCP protocol uses a sliding window for transmission control. The size of the sliding window means that the receiver has a large buffer that can be used to receive data.
The sender can determine the number of bytes of data to be sent by sliding the window.
When the sliding window is 0, the sender generally cannot send another datagram, except in two cases, one is to send emergency data, for example, allows you to terminate processes running on a remote machine.
In another case, the sender can send a 1-byte datagram to notify the receiver to re-declare the next byte it wants to receive and the size of the sender's sliding window.
Congestion Control
When the load capacity loaded to a network exceeds its processing capacity, congestion may occur.
There are two potential problems for the Internet-network capacity and receiver capacity, which should be handled separately. The sender always maintains two windows: Windows recognized by the receiver and congestion windows.
Take the minimum values of the two windows as the number of bytes that can be sent.
When a TCP protocol connection is established, the sender initializes the congestion window size to the maximum datagram length value used by the connection, and then sends a maximum datagram length.
If the datagram is confirmed before the timer times out, the sender adds a byte value of the datagram to the original congestion window to double the maximum datagram size, then, two data packets are sent.
When each of these datagram values is confirmed, the congestion window size increases the length of a maximum datagram.
When the congestion window is an hour of N datagram data packets, if all N data packets sent are confirmed in time, the congestion window size is increased by the number of bytes corresponding to N data packets.
The congestion window maintains an exponential increase until the data transmission times out or reaches the window size set by the receiver.
The congestion window is set to the number of bytes that do not cause timeout or reach the receiver's window size.
Timer Management
The TCP protocol uses multiple timers, such as resend timers, continuous timers, and "keep alive" timers.
The most important thing is the resend timer. When sending a datagram, start a data retransmission timer.
If the datagram is confirmed before the timer times out, the timer is disabled; on the contrary, if the timer times out before the confirmation arrives, the datagram needs to be resent.
The continuous timer is used to prevent deadlocks. When a connection remains idle for a long time, the "keep alive" timer times out and causes one party to check whether the other party still exists. If it does not receive a response, terminate the connection.