UDP protocol for TCP/IP protocol

Source: Internet
Author: User
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 .)

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.