1. UDP: A transport layer protocol for user datagram. Unreliable and connectionless.
2. header (8B in total): source port number (2B), destination port number (2B), UDP length (2B), UDP checksum (2b)
Note: (1) for UDP port numbers, the port numbers are used to mark the application process. TCP and UDP can share a port number, which can be distinguished by protocol fields in the IP header.
(2) UDP length is the sum of the header length and the data part length. In fact, this information can also be obtained from the IP header, Which is redundant.
(3) UDP checksum: It is optional. It verifies not only the UDP header, but also the content of the UDP datagram. The calculation and verification methods are the same as the IP address checksum. However, with the pseudo header of 12B (only used for verification calculation and verification), the pseudo header of 12B is: source IP address (4b), destination IP address (4b), 0 (1B ), protocol field (1B) of the IP header, UDP length (2b ). If the UDP data part is an odd byte, the end is supplemented with the byte 0 for calculation. If the calculation result is all 0, the value of the saved checksum field is all 1, if the value of the entered checksum field is all 0, the sender does not calculate the checksum. During verification, if the result is all 1, there is no error. (The result of empirical statistics is that TCP checksum errors are much higher than UDP errors .)