Network lower layer-data packet -- Explanation

Source: Internet
Author: User
Lower network layer-data packet-explanation-Linux Enterprise Application-Linux server application information. The following is a detailed description. Application layer entities (such as client or server process) Exchange PDU as application data, where TCP application processes exchange a single bidirectional byte stream with no length constraints, A single record whose length does not exceed the buffer size sent by UDP is exchanged between UDP application processes. In SCTP (stream control transmission protocal) for applications, see single or multiple two-way record streams without the total length limit. The Transport Layer entity (for example, a run of the transport layer protocol code corresponding to a port) changes to the message from the PDU. The tcp pdu are called the segmented segment. The length of a message (or shard) is limited.

In the TCP transmission layer, the sending end TCP writes the byte stream data from the application process (that is, the data written to the sending end TCP socket by the application process through multiple output operations) after the data is divided in order, it is encapsulated in each byte and sent to the receiving end tcp. The data encapsulated in each byte may be the result of a single output operation by the sending application process, it may also be a record of the output operations several times in a row, and a single shard may correspond to both the complete output results and the output results of the corresponding part, depends on the maximum shard size (maximum segment size, MSS) advertised by the peer during the connection establishment phase and the maximum transfer unit (MTU) under the excuse of going out) or the path of the outbound path MTU (if the network layer has the path MTU discovery function, such as IPv6 ). In addition to carrying application data, this module is also used to establish connections (SYN segments), terminate connections (FIN segments), terminate connections (RST segments), and confirm data receipt (ACK segments) push data to be sent (PSH sub-sections) and carry emergency data pointers (URG sub-sections), and these features (including carrying data) can be flexibly combined. The UDP Transport layer is quite simple. The sender UDP encapsulates a single record from the application process in the UDP message and sends it to the receiver UDP.

SCTP introduces a data unit called a chunk. An ACTP message is composed of one or more chunks added to a public header. The public header is similar to a UDP message header, only the checksum of the source host port number and the entire SCTP message is provided. The block can carry both DATA (into DATA blocks) and control information (including SACK blocks, INIT, init ack, cookie echo, cookie ack, SHUTDOWN, SHUTDOWNACK, SHUTDOWNCOMPLETE, ABORT, ERROR, HEARTBEAT, and heartbeat ack ). The sender SCTP encapsulates the stream DATA of (one or more) records from the application process in each DATA block according to the internal sequence and record boundary, the DATA block header records the respective stream IDs. A record usually corresponds to a DATA block. For too long records, the sending terminal SCTP can reject sending as UDP does, or split them into multiple DATA blocks for sending, the receiving end SCTP collects and combines them into a single record for upload. The SCTP message, as a PDU in the transport layer, can be a single block (DATA block and control block), or contain multiple blocks (called block bundling) under the MTU limitation of the interface, control block before, DATA block after), but INIT, INITACK and SHUTDOWNCOMPLETE blocks cannot be bundled with any other blocks. The two ends of SCTP send and receive processes each block bound to the same message independently. In view of this, we can directly treat the block as the PDU of the transport layer.

The PDUS exchanged between entities at the network layer are called IP datagrams. The maximum length is 65535 bytes for IPv4 datagram and 65575 bytes for IPv6 datagram. The sender's IP address encapsulates messages (or TCP segments) from the transport layer in the IP header and the transmitted layer data (that is, the network-switched PDU are called a transfer frame) the length depends on the specific interface. IP datagram is composed of the IP header and the data at the transport layer (that is, the SDU at the network layer. An excessively long IP datagram cannot be encapsulated in a single frame. fragmentation needs to be performed on its SDU first, and then each segment is encapsulated into multiple frames with a new IP header. During the transfer of an IP datagram from source to destination, the sharding operation may occur both on the source and on the way, and its inverse operation is reassembly) generally, this occurs only on the destination side. SCTP adopts similar partitioning and restructuring measures to transmit too long records.

In order to improve the efficiency, TCP/IP protocol families will try to avoid IP sharding/restructuring; TCP limits the size of each shard Based on MSS and MTU, and SCTP reassembles long records based on MTU. (SCTP's block bundle aims to improve the performance of IP address sharding/restructuring. block Transmission Efficiency ); in addition, IPv6 prohibits multipart operations (based on its path MTU discovery function), and IPv4 tries its best to avoid such operations. No matter whether it is sharded or not, the IP address is used as the SDU of The Link Layer to pass into the link layer, and the data encapsulated by the link layer in the frame is called a group (packet, also known as a packet ). It can be seen that a group may be a complete IP datagram, or a segment of the SDU of an IP datagram is ended with a new IP header. MSS is the interface attribute Between TCP and transport layers at the application layer, while MTU is the interface attribute between the network layer and the link layer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.