In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to achieve reliable transmission of TCP. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
one。 Sliding window in bytes
In TCP, the receiver (B) reports the size of a window to the sender (A), which is called Advertised window.
1. Without receiving the confirmation from B, A can send all the data in the window continuously. For all data that has been sent, in
It must be temporarily reserved until an acknowledgment is received so that it can be used in the event of a timeout retransmission.
two。 The sequence number in the send window indicates the sequence number allowed to be sent. Obviously, the larger the window, the sender can continue before receiving the other party's confirmation.
Send more data, so it is possible to achieve higher transmission efficiency. But the receiver must have time to process the data received.
3. The latter part of the trailing edge of the sending window indicates that it has been sent and that an acknowledgement has been received. It is clear that these data no longer need to be retained.
4. If the front part of the sending window indicates that sending is not allowed, it should be because the receiver does not reserve temporary cache space for this part of the data.
5. There are two kinds of changes along the trailing edge of the sending window: do not move (no new confirmation is received) and move forward (new confirmation is received)
6. There are two kinds of changes in the front of the sending window: constantly moving forward or may not move (no new confirmation has been received)
two。 Choice of timeout retransmission time
The sender of TCP retransmits the sent message segment without receiving an acknowledgement within a specified period of time. The concept of retransmission is simple, but the choice of retransmission time
It is indeed one of the most complex problems in TCP. TCP uses an adaptive algorithm, which records the time when a message segment is sent and when the corresponding acknowledgment is received.
The difference between the two times is the round trip time RTT of the message segment. TCP retains a weighted average round-trip time for RTT. The timeout retransmission time RTO is slightly larger than the weighted average round-trip time.
Three: select confirm SACK
If there is no error in the received message segment, but it is not numbered, and some serial number data is missing in the middle, is it possible to transmit only the missing data without retransmitting the data that has correctly reached the receiver?
The answer is yes, and choosing confirmation is a feasible way to deal with it.
If you want to use the option to confirm SACK, then when establishing a TCP connection, add the option "allow SACK" to the TCP header, and both parties must agree in advance. If you use selection confirmation
Then the use of the "confirmation number field" in the original first part remains the same. The SACK document does not specify how the sender should respond to SACK. So most implementations still retransmit all unacknowledged blocks.
Fourth: flow control of TCP
Generally speaking, we always want the data to be transmitted faster, but if the sender sends the data too fast, the receiver may not have time to receive it, which will result in the loss of data. The so-called flow control is to make the sender's transmission rate not too fast, so that the receiver can receive it in time.
Five: congestion control of TCP
The link capacity in the computer network, the cache and processors in the switching node are all the resources of the network. In a certain period of time, if the demand for a resource in the network exceeds the available part of the resource, the performance of the network
It's going to go bad. This situation is called congestion.
Congestion control methods:
1. Slow start and congestion avoidance
two。 Fast retransmission and fast recovery
3. Random early detection
The above content is how to realize the reliable transmission of TCP. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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: 0
*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.