Basic for beginners: UDP protocol

Source: Internet
Author: User

In the network communication protocol, the UDP protocol, which is equally important to TCP, is described briefly today. We often see this protocol in some network firewalls or anti-virus software. So what is the specific meaning of this protocol?

UDP protocol

User Data Protocol (UDP) is also a communication Protocol on the OSI transport layer. However, UDP is a non-connection-oriented protocol. TCP is a surface connection protocol ). The establishment of a UDP connection does not require the server to listen like the TCP protocol, nor requires a client to request a connection to the server to establish a connection before both parties can communicate.

Overview of UDP protocol

User Datagram Protocol (UDP) is a simple datagram-oriented transport layer protocol. ietf rfc 768 is the formal specification of UDP. In the TCP/IP model, UDP provides a simple interface under the network layer and the application layer.

UDP only provides unreliable data delivery. Once an application sends data to the network layer, data backup is not retained. Therefore, UDP is sometimes considered an unreliable datagram protocol ). UDP only adds multiplexing and data validation fields to the IP datagram header ).

The UDP header field consists of four parts, two of which are optional. Each 16-bit source port and destination port are used to mark the application process sent and received. Because UDP does not need to respond, the source port is optional. If the source port is not used, set it to zero. The destination port is followed by a fixed length field in bytes, which is used to specify the length of the UDP datagram including the data part.

Due to lack of reliability, UDP applications generally have to allow a certain amount of packet loss, errors, and replication. Due to the lack of congestion avoidance and control mechanisms of UDP, the network-based mechanism is required to reduce the congestion collapse effect caused by runaway traffic and high-speed UDP traffic load.

UDP only adds a few functions to the IP datagram service. This means that the port function can be reused and reused at the transport layer with the port function. In addition, UDP applications can be clients or server programs, without having to create client programs and server programs separately as TCP applications do. In remote control software, if the screen information is transmitted within the LAN, it is easier to use UDP protocol. However, UDP does not provide reliability. Its reliability is handled by other network devices. At the same time, the data transmitted through UDP is generally small. It requires the IP protocol to segment the data. Theoretically, the maximum IP protocol datagram length is 65535 bytes.

UDP datagram format

In the datagram format, the source port is an optional domain. when it makes sense, it refers to the UDP port for sending the application. If you do not use it, enter 0 in this field. The destination port is meaningful when a specific destination network address exists. It refers to the UDP port of the target application. The length refers to the 8 bytes of the User Datagram length, which indicates that the minimum datagram length is 8 ). Checksum is also a simple mathematical operation used to check bit-level errors in UDP messages. Returns the opposite and opposite numbers of IP headers, UDP headers, and data headers. The UDP protocol package does not have the complex reliability and Control Mechanism of the TCP protocol package. There are no "sequence" or "validation" fields.

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.