Computer Network Learning-User Datagram Protocol UDP (9)

Source: Internet
Author: User

Two main Protocols at the transport layer:

(1) TCP: Transmission Control Protocol, Transmission Control Protocol

(2) UDP: User datasync protocol, User Datagram Protocol

The Transport Layer implements communication between processes in the host. The data transmitted during communication is called a protocol data unit. TCP transmission is called a TCP packet, while UDP transmission is called a UDP user datagram.

UDP: a connectionless transport layer protocol that does not provide traffic control.

TCP: connection-oriented transport layer protocol that provides traffic control and error detection functions.

Below are some application layer protocols and the transport layer protocols used:

UDP features:

(1) connectionless. No connection is required to send data, reducing overhead and latency.

(2) Use the best effort to deliver, and do not guarantee reliable delivery.

(3) packet-oriented. UDP does not merge or split the packets sent to the application layer. Instead, it directly uses the packets as the Data Part Of The UDP user datagram and adds the UDP header before the data part. If the UDP user datagram is too large, it will be split at the IP layer.

(4) UDP has no congestion control or traffic control. Network blocking does not reduce the sending rate of the source host.

(5) the header has a small overhead and only eight bytes. Unlike TCP, the header has at least 20 bytes.

(6) supports one-to-one, one-to-many, one-to-one, and multiple-to-many interactive communication.

The UDP Message format is as follows:

The UDP header consists of 8 bytes and consists of 4 fields. Each field occupies 2 bytes, as shown below:

(1) source port number. It is used when the recipient needs to send the information back. Otherwise, it can be filled with all 0.

(2) destination port number.

(3) length. The total length of a UDP User Datagram, including the header and data. The minimum value is 8 (including only the header ).

(4) inspection. Check whether user datagram is incorrect during transmission. If there is a mistake, discard it.

We can see that a pseudo header is added before the UDP header, which consists of 12 bytes. The pseudo header is used only for calculation and validation.

The UDP verification method is similar to the method used to calculate the IP datagram header verification. The difference is that the IP datagram verification is only for the header, and the UDP datagram verification also includes the data part. The verification method is very simple, that is, the pseudo header and the entire UDP User Datagram are regarded as a whole. First, the checksum field is filled with 0, in the unit of 16 bits (if the length is not an integer multiple of 16 bits, add 0) to the binary sum, and fill in the anticode of the addition into the checksum field. After receiving the UDP datagram on the transmission layer of the target host, the UDP datagram is added in the same way. If the sum is 0, no error occurs. Otherwise, an error occurs, this datagram will be discarded.

When the destination host receives a UDP User Datagram at the transport layer, it submits the UDP datagram data to the application process on the corresponding port based on the destination port number. If the port number is incorrect, an ICMP endpoint inaccessible message is sent to the source host.

Related Article

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.