Network Programming in Linux: UDP packet format

Source: Internet
Author: User

The UDP datagram format consists of the header and data. The header is very simple, 8 bytes in total. Including:
◆ Source Port: 2 bytes, Source Port number.
◆ Destination Port: 2 bytes. Destination Port number.
◆ Length: 2 bytes. The total Length of UDP User Datagram, in bytes.
◆ Checksum: 2 bytes. It is used to verify the number segment of a UDP datagram and the "pseudo Header" containing the UDP datagram header ". The verification method is the same as the header checksum in the IP Group header.

The Pseudo header, also known as the Pseudo-Baotou
Header): indicates the format of the TCP segment or UDP datagram, the extended header structure consists of 12 bytes including the source IP address, destination IP address, protocol field of the IP Group, and the total length of the TCP or UDP datagram. This pseudo-header is a temporary structure that is passed up or down only to ensure the correctness of the socket.


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.