UDP protocol Detailed

Source: Internet
Author: User

1. The role of the UDP protocol

The IP protocol cannot differentiate multiple applications on the same host system. UDP uses ports to identify different applications on the same host.

The process ID cannot be taken to identify the cause of the different applications:

1) The process ID assignment and destruction of the application in the system is dynamic and the sender cannot determine what the application's process ID is

2) Sometimes it is possible to implement multiple functions in one process, and the process needs to differentiate the packets to determine which function to implement, using the process ID to not do so.

3) Sometimes when you need to access a standard service on a host, you don't need to know which program is implementing the service, and you don't have to know the process ID, just a single unified identity

Therefore, it is unrealistic to use the process ID as the identity of the application on the same host.

2. Features of the UDP protocol

The UDP protocol adds multiplexing, separation and error detection functions to IP protocols. Features of UDP:

A) is non-connected . Compared to the TCP protocol, the UDP protocol does not need to establish a connection before transmitting the data, and of course it does not release the connection.

B) is delivered to the fullest extent possible . This means that the UDP protocol cannot guarantee that the data can be delivered to the destination host accurately. There is no need to verify the UDP packets received.

C) is message-oriented . That is , the UDP protocol encapsulates the data transmitted by the application layer in a UDP packet without splitting or merging. Therefore, the transport layer after receiving the other side of the UDP packet, will be removed after the header, the data intact to the application process.

D) no congestion control . Therefore, the transmission rate of the UDP protocol does not affect the congestion of the network.

E) UDP supports a pair of one or one-to-many, many-to-one, and many-to-many interactive communications.

F) UDP has a smaller head footprint and takes only 8 bytes .

3. UDP message Format

The UDP protocol is the first field and data field, where the header field occupies only 8 bytes, which is a two-byte source port, a destination port, a length, and a test and a.

Length: The entire size of the UDP message, with a minimum of 8 bytes (only the first part).

Inspection and: When a test and calculation is performed, a pseudo-header is added together to perform the operation. The pseudo header (occupies 12 bytes) is: 4 bytes of source IP address, 4 bytes of destination IP address, 1 bytes of 0, a byte of the number 17, and 2 bytes of UDP length. This pseudo-header is not the true header of the message, but is introduced in order to compute the checksum. With respect to the IP protocol, only the header is computed, and the UDP checksum verifies the header with the data. The checksum of the receiving end and the checksum in the UDP message should be all 1 if error-free. If it is wrong, the message is discarded or sent to the application layer with error warnings.

UDP protocol Detailed

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.