Persistent timer for TCP 1. Basic Concepts
The receiver of TCP named the Data bytes (window size) that it wants to receive from the sender, and if the window size is 0, the broadcaster will prevent the data from being sent until the receiver sends an ACK with the new window size. So what if the receiver sends this ACK halfway lost (is that possible)? At this point the sender does not receive information, the default window size is still 0, then it continues to block there, causing a deadlock. So how to solve this kind of problem, the solution is the topic of my blog post, TCP persistence timer. To prevent the deadlock from occurring, the sender of TCP uses a persistent timer to periodically query the receiver to see if the window has been enlarged
2. Confused window syndrome
If you have known about TCP before, then believe that we have heard the confused window syndrome bar. Its general meaning is that when the receiver window size becomes 0 o'clock, the sender will block, as mentioned above, when the receiver window size just empty a small space and then to notify the sender, the sender will also send a small amount of data, and then cause the receiver window to become 0, Wait for the receiver to make a little space .... In this way, each sender and receiver can only get very little data, seriously reducing the transmission efficiency, which is called the confused window syndrome
We can use the following methods to solve this kind of problem
(1) The receiving party does not advertise the small window. The sender is advertised unless the window is larger than the MSS or is smaller than the normal space cached by the receiver
(2) The sender to avoid confusion window measures are only the following conditions to send data
. You can send a full-length message segment
Can send a message segment that is at least half the receiver's buffer (mainly for small cache hosts)
. ability to send all data at hand, and do not want to receive an ACK (this algorithm may prohibit the Nagle algorithm)
KeepAlive Timer for TCP
When the two sides of TCP establish a connection, and do not send any data, so long as these two hosts do not collapse, regardless of the length of time, the intermediate route is broken, the telephone line is broken, this connection will remain
This behavior indicates that neither application has detected an inactive timer on its own.
keepalive function Timer
When the two ends of a TCP connection fail temporarily, the KeepAlive function produces a good termination effect.
The KeepAlive function is provided primarily for server programs, and the server needs to know if the client has crashed
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
TCP/IP Detailed learning note--tcp persistence and keepalive timer