In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Four kinds of TCP timer
Retransmission timer, persistence timer, keep alive timer, time waiting timer
Retransmission timer:
Created when TCP sends a message, it is used to confirm whether the message has been sent successfully. If it exceeds the predetermined time, it will be resent. After setting the retransmission timer, there are usually two situations:
1. If an acknowledgement signal for sending a message is received before the timer deadline arrives, the counter will be revoked.
2. If the timer time arrives and the acknowledgement signal is not received, the message is retransmitted and the timer is reset.
Stick to the timer:
This kind of timer is usually related to the window size.
First consider such a scenario: because the sending speed is too fast, the window size of the receiving end is zero, this is the receiving section will send a signal to tell the sending end, I now the window size is zero, do not send data yet, after the receiving end receives, pause sending data After a while, the receiver has a new window size, and then an acknowledgement signal is sent to the sending segment. I now have room in the buffer and told myself the window size [as you can see in the previous three handshakes and four waves, we don't need to reconfirm the confirmation signal]. However, the problem that may arise here is that the acknowledgement packet sent by the receiver may be lost. once lost, the receiver is waiting for the sender to send data, and the sender is waiting for the receiving segment to send an acknowledgement signal to continue to send data. this creates a deadlock.
Obviously, this situation is due to the problem that may be caused by a zero window size at the receiver. In order to avoid this situation, there is the generation of persistence counters. When the sender receives a confirmation signal with a window size of 0, the persistence counter is activated. If the acknowledgement signal from the receiver is not received after the time of the persistence counter arrives, it will actively send a special message, called a probe message. The probe message has only one byte of data, it has a sequence number, and unlike ordinary messages, its sequence number does not need to be confirmed. The purpose of the probe message is to remind the receiver that the size of the window just sent to me has been lost. If you want me to send the ACK confirmation signal again, if the receiver does not respond, you need to send a probe message again, and double the time to persist in the counter until it increases to 60s. After that, a probe message is sent every 60s until the window reopens.
TCP stipulates that even if the window size is 0, there are three kinds of messages that must be received: the zero window probe message segment, the acknowledgement message segment, and the message segment carrying emergency data.
Keep alive timer:
It is used to prevent the connection between two TCP from being idle for a long time.
When client opens a connection to server and transmits data for a short period of time, it remains silent, possibly for a variety of reasons, but it is now in an idle state. If the client fails, the connection remains open.
In order to avoid this situation, a survival timer is introduced. Whenever server receives a message from client, it clears the timer to zero. If the server does not receive any message beyond the survival timer, it will send a probe message segment to the client. If there is no response after sending 10 probe message segments, the client failure will be considered and the server will actively disconnect.
Time waiting timer:
Use [TIME_WAIT] during connection termination.
First of all, know a concept, MSL, the maximum lifetime of a message. Any message that surpasses the MSL on the network will be discarded directly.
During the third wave of TCP, the client receives the FIN message from the server, and then the client starts the TIME_WAIT timer, sets the time to 2MSL, and sends the last ACK. It ensures that the server can receive the last ACK acknowledgement signal within the 2MSL time, and at the same time ensures that the message sent before will not harass the server again after the connection is closed, because the time for the packet in the network to arrive at the destination is uncertain.
The retransmission timer is usually set to 60s
Stick to the timer threshold value of 60s
The keeping alive timer is usually set to 2 hours.
The time waiting timer is usually set to 2MSL
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 261
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.