TCP-IP Study Notes-UDP (User Datagram Protocol)

Source: Internet
Author: User


TCP-IP learning notes of UDP (User Datagram Protocol) I. Introduction UDP is a simple datagram-oriented transport layer protocol: Each output operation of the process generates a UDP datagram, and assembled into an IP datagram to be sent. This is different from the stream-oriented character protocol, such as TCP. The full data generated by the application may be unrelated to the Single IP datagram actually sent. Www.2cto.com
Figure 1: UDP encapsulation UDP does not provide reliability: it sends data from the application to the IP layer, but it does not guarantee that the data can reach the destination. 2. Fields 2 of the UDP header u d p header are shown below:

Figure 2: UDP header port number indicates the sending and receiving processes. TCP and UDP use the destination port number to separate data from the IP layer. Because the IP layer has allocated IP datagram to TCP or UDP (based on the protocol field value in the IP header), the TCP port number is viewed by TCP, while the UDP port number is viewed by UDP. The TCP port number and the UDP port number are independent of each other.
The UDP length field refers to the byte length of the UDP header and UDP data. The minimum value of this field is 8 bytes (sending a 0-byte UDP datagram is OK ). The UDP length is redundant. The length of an IP datagram is the total length of the datagram. Therefore, the length of a UDP datagram is the total length minus the length of the IP header. Www.2cto.com 3. UDP test and overwrite UDP header and UDP data. Note: The IP header check only overwrites the IP header-does not overwrite any data in the IP datagram. Both UDP and TCP have the test that overwrites their header and data. UDP checks are optional, while TCP checks are required. Note: Both UDP datagram and TCP segment contain a 1-2-byte pseudo header, which is set for calculation and validation. The pseudo header contains some IP header fields. The purpose is to let UDP check whether the data has arrived at the destination correctly twice (for example, if the IP address is not accepted and the address is not the datagram of the host, and the IP does not send the datagram that should be sent to another high-level layer to UDP ). The pseudo-Header Format in UDP datagram is as follows:
Figure 3: fields used in the UDP test and calculation process

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.