UDP protocol overview

The two more important protocols in the transport layer are TCP and UDP. TCP is connection-oriented, and UDP is connectionless-oriented.

The so-called establishment of a connection is to maintain the connection between the client and the server, and establish a certain data structure to maintain the interactive status of both parties. This data structure is used to ensure the so-called connection-oriented characteristics.

TCP provides reliable delivery. The data transmitted through the TCP connection is error-free, not lost, not repeated, and arrives in order. We all know that there is no guarantee of reliability of IP packets. Once they are sent out, it is like seeking scriptures from the West. If they get lost or are eaten by monsters, they can only let it go. But TCP claims to be able to do what the connection maintenance program does, which I will describe in detail in the next two sections. UDP inherits the characteristics of IP packets and does not guarantee that they will not be lost or arrive in order.

TCP is byte stream oriented. When sending, it is a stream with no beginning or end. An IP packet is not a stream, but individual IP packets. The reason why it becomes a stream is that TCP's own state maintenance is done. UDP inherits the characteristics of IP and is based on datagrams, which are sent one by one and received one by one.

TCP can also have congestion control. When it realizes that the packet has been dropped or the network environment is not good, it will adjust its behavior according to the situation to see if it should send faster or slower. UDP does not work. If the application asks me to send it, I will send it, regardless of the flood.

Network transmission is based on packets. The second layer is called a frame, the network layer is called a packet, and the transport layer is called a segment. We loosely call it a package.

The three major characteristics of UDP are: simple communication, credulity in others, stupidity, and lack of understanding of contingency in doing things.

Three major usage scenarios of UDP:

1. Applications that require few resources, are on an intranet with good network conditions, or are not sensitive to packet loss

2. It does not require one-to-one communication and establishment of a connection, but an application that can be broadcasted.

3. The processing speed needs to be fast, the delay is low, and a small number of packet losses can be tolerated, but even if the network is congested, it must not shrink back and move forward indomitably.

If the application feels that some packets are lost and there is no need to retransmit them, just forget them. If some packets are more important, the application will retransmit them without relying on TCP.

 QUIC (Quick UDP Internet Connections, Quick UDP Internet Connections) is an improved communication protocol based on UDP proposed by Google. Its purpose is to reduce the delay of network communication and provide a better user interaction experience.

At the application layer, QUIC will implement fast connection establishment, reduce retransmission delays, and adaptive congestion control.

UDP is used in web or APP access, streaming media protocols, real-time games, IoT, and mobile communications.

This article is a study note for Day 10 in September. The content comes from Geek Time's "Internet Protocol". This course is recommended.

Guess you like

Origin blog.csdn.net/key_3_feng/article/details/132796181