UDP has the following features:
1. UDP does not establish a connection with the other party before transmitting data, that is, UDP is not connected. Before transmitting data, the sender and receiver exchange information with each other for synchronization between the two parties.
2. UDP does not sort the received data. There is no information about the data sequence in the UDP packet header (such as the serial number used by TCP ), in addition, messages do not necessarily arrive in order, so the receiving end cannot be arranged.
3. UDP does not send a confirmation signal for the received datagram. The sender does not know whether the data is correctly received or resend the data.
4. UDP transfers data faster than TCP, with less system overhead.
5. Due to the lack of congestion control, a network-based mechanism is required to reduce the congestion collapse effect caused by runaway traffic and high-speed UDP traffic load. In other words, because UDP senders cannot detect congestion, network basic devices such as routers using packet queue and discard technology often become an effective tool to reduce excessive UDP traffic. The Datagram congestion control protocol (DCCP) is designed to reduce this potential problem by adding host congestion control in High-Speed UDP streams such as streaming media.
We can see from the above characteristics that UDP provides a connectionless and unreliable data transmission method and is a data delivery service with the best effort.
UDP Service and application scenarios
The services provided by UDP are unreliable and connectionless. UDP is suitable for situations where no response is required and only a small amount of data is transmitted at a time. Because the UDP protocol does not need to establish a logical connection during data transmission and does not check the datagram, UDP has good real-time performance and high efficiency. In some cases, network applications of many customer/Server models, including video teleconference systems, must use UDP protocol.
Several features of UDP protocol
[1] (1) UDP is a connectionless protocol. The source end of data transmission does not establish a connection with the terminal. when it wants to transmit data, it simply crawls data from the application, and throw it to the network as quickly as possible. At the sending end, the speed of UDP data transmission is limited only by the speed at which the application generates data, the ability of the computer, and the transmission bandwidth. at the receiving end, UDP puts each message segment in the queue, the application reads a message segment from the queue each time.
(2) Since no connection is established for data transmission, you do not need to maintain the connection status, including the sending and receiving status. Therefore, a server can transmit the same message to multiple clients at the same time.
(3) The title of the UDP information package is very short, with only 8 bytes. The additional overhead of the 20 bytes information package of TCP is very small.
(4) throughput is not adjusted by the congestion control algorithm, but is limited by the data generation rate, transmission bandwidth, source end and terminal host performance of the application software.
Although UDP is an unreliable protocol, it is an ideal protocol for information delivery. For example, report the stock market on the screen, and display aviation information on the screen. UDP is also used to modify the route table in the route information protocol rip (Routing Information Protocol. In these applications, if a message is lost, another new message will be replaced in a few seconds. UDP is widely used in multimedia applications. For example, RealAudio software developed by progressive networks is a software that transfers pre-recorded or live music to the client in real time over the Internet, this software uses RealAudio audio-on-Demand
Protocol is the protocol running on UDP, and most Internet telephone software products also run on UDP.
Application of UDP protocol
[2] UDP is an unreliable network protocol. What is its value or necessity? In fact, in some cases, UDP may become very useful. Because UDP has a speed advantage beyond the reach of TCP. Although various security protection functions are embedded in the TCP protocol, a large amount of system overhead will be occupied during actual execution, and the speed will undoubtedly be seriously affected. In contrast, UDP eliminates the information reliable transfer mechanism and transfers security and sorting functions to upper-layer applications, greatly reducing the execution time and ensuring the speed.
The earliest specification for UDP protocol was rfc768, which was released in 1980. Although it has been a long time, UDP continues to play a role in mainstream applications. Many applications, including video teleconference systems, prove the value of UDP. Compared with reliability, these applications focus more on actual performance. Therefore, in order to achieve better performance (for example, a higher frame refresh rate), certain reliability (for example, meeting quality ). This is the trade-off between UDP and TCP. Based on different environments and features, the two transmission protocols will play a more important role in the future online world.
Difference between UDP protocol and TCP protocol
The Chinese name of TCP protocol isTransmission Control Protocol. The Chinese name of UDP protocol isUser Datagram Protocol
.
TCP is a very important protocol in the development of the Internet. When using TCP as the underlying protocol, it can ensure that the data you send arrives at the destination in a certain time series, in addition, the destination verifies the integrity and correctness of the data based on the control data of the TCP protocol. At the same time, when the network traffic is congested, TCP can control the data traffic to prevent packet loss. You need to know that the TCP protocol is a very rigorous protocol. It can ensure that data is securely transmitted over poor media networks (such as WiFi and GRPS connections.
However, the rigor of the TCP protocol also brings about a problem. Due to the strict requirements on data integrity and correctness, the TCP protocol has to add a lot of control content to the Protocol itself. These controls can be used to check the time sequence, integrity, and correctness of data packets. The addition of the data increases the computing workload of the sender and receiver, and the addition of the control data increases the volume of transmitted data. Increased the load on the network. These problems finally point to a fatal problem: the data delay has increased.
For online games, video chats, and voice chats, users have high requirements on real-time data, but have lower requirements on completely correct data. (For example, when chatting, if some packets are lost or incorrect, you may get some unclear voices without affecting the chat experience .) UDP is born under this demand.
Therefore, to sum up, UDP is widely used in scenarios where network data transmission is highly real-time and data accuracy is not very demanding. The high-speed improvement (optical fiber) of physical media transmitted over the network also reduces the probability of packet loss. When the network status is good, the two shortcomings of UDP can be overcome to a great extent.