Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is a tcp sticker?

Shulou Source: shulou.com Published: 2022-06-03 02:55:13 10月02日 Update

What is a tcp sticky bag? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Tcp sticky packet means that several packets of data sent by the sender are glued into a packet when they arrive at the receiver. From the point of view of the receiving buffer, the head of the latter packet is immediately followed by the tail of the previous packet. There are many reasons for sticky packets, which may come from the sender or receiver.

1. What is the TCP sticky package problem?

TCP sticky packet means that several packets of data sent by the sender are glued into a packet when they arrive at the receiver. From the point of view of the receiving buffer, the head of the latter packet is immediately followed by the end of the previous packet. There are many reasons for sticky packets, which may come from the sender or the receiver.

2. The cause of TCP sticking.

(1) reason of sender

TCP uses the Nagle algorithm by default (the main purpose is to reduce the number of segments in the network), while the Nagle algorithm does two main things:

A: the next packet will be sent only if the previous packet is confirmed.

B: collect multiple small packets and send them together when a confirmation arrives

Nagle algorithm causes the problem of sticking packets on the sender.

(2) the reason of the receiver

When TCP receives a packet, it is not immediately handed over to the application layer for processing, or the application layer does not immediately process it. In fact, TCP stores the received packets in the receive cache, and then the application actively reads the received packets from the cache. In this way, if the TCP receives packets to the cache faster than the application can read packets from the cache, multiple packets will be cached and it is possible for the application to read multiple packets glued end to end.

3. When do you need to deal with the sticky bag phenomenon?

A: if multiple groups of data sent by the sender are already different parts of the same piece of data, for example, a file is sent into multiple parts, there is certainly no need to deal with the sticky packet phenomenon.

B: if multiple groups are irrelevant or even juxtaposed, then the sticky packet phenomenon must be dealt with at this time.

After reading the above, have you mastered what is the method of tcp gluing package? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Data reason one packet multiple cache grouping processing application problem application receiver phenomenon program algorithm content that is application layer method time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Shulou Information Docker Apple