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.