Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the sticking and unpacking of tcp transport

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what is the sticky package and unpacking of tcp transmission". In the daily operation, I believe that many people have doubts about what is the sticky package and unpacking problem of tcp transmission. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "what is the sticky package and unpacking of tcp transmission"! Next, please follow the editor to study!

Ethernet data frame

The so-called Ethernet data frame is the packet transmitted by the link layer. The data length of Ethernet data frames is limited to 46-1500 bytes, and these 1500 bytes are called link layer MTU.

These 1500 bytes also include ip headers (at least 20 bytes) and TCP headers (at least 20 bytes). The maximum data length of the application layer is 1460, which is actually about 1400 bytes.

MSS maximum segment message

A field in the TCP layer refers to the largest packet that can be transmitted by the application layer at a time over TCP.

If the application layer packet exceeds the MSS, the application layer packet is split into two segments to send.

If the application layer packet is relatively small, much smaller than MSS, the application layer packet will stick, and multiple packets will be sent as a segment.

Sticking and unpacking

The so-called sticky packets and unpacked packets are for application layer packets.

Normally, an TCP packet transmits an application packet. When gluing packets, two or more application packets are glued together and transmitted over a TCP.

In the case of unpacking, an application packet will be split into two or more segments to be transmitted separately, and the other segment may be glued to other application packets.

The so-called sticky package is divided into the sender sticky packet and the receiver sticky packet.

In the sticky packet of the sender, the application layer sends multiple packets at a time, and tcp will package multiple packets into a tcp message and send them out.

The receiver's sticky packet, and the receiver fails to read out the data in the tcp reception cache in time.

The so-called unpacking, that is, if the data sent by the application layer at one time exceeds the maximum value that can be transmitted by a tcp message, tcp will split a packet into multiple maximum length tcp messages and transmit them separately.

The solution of gluing and unpacking

If sticking occurs, the packages glued together need to be taken apart.

If unpacking occurs, the split package needs to be merged back.

The usual practice is to add a data header in which the length of the actual data is stored.

If you stick the packet, you can read it according to the length saved in the data header.

If the packet is unpacked, you need to wait for the next packet to arrive and continue reading until the complete packet is read.

At this point, the study on "what is the sticky package and unpacking of tcp transmission" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report