First of all, I want to emphasize that the TCP/IP protocol is a protocol cluster. It includes many protocols, UDP is just one of them. The reason why it is named TCP/IP protocol is that TCP and IP protocols are two very important protocols, so they are named after them. The difference between the two protocols is that when using them in practice, you only need to remember that "TCP generally does not cause packet loss when sending data in a normal connection (excluding other factors in the upper and lower layers), while UDP packet loss is very common." 1 The following focuses on the differences between TCP protocol and UDP protocol
Through the above analysis, some people may think that since TCP is a reliable transmission protocol, it must be better than UDP, but this is not the case. Here is an example to illustrate this problem: TCP is used when reliable transmission is necessary at the transport layer. Since it is link-oriented and has mechanisms such as sequence control and retransmission control, it can provide reliable transmission for applications. On the other hand, UDP is mainly used for communications or broadcast communications that require high-speed transmission and real-time performance. Let's take an example - when making a call through an IP phone, if TCP is used, the data will be resent if it is lost in the transmission diagram, but this will not smoothly transmit the caller's voice, resulting in an inability to communicate normally. With UDP, it will not be resent. Therefore, there will be no problem of significant delay in the arrival of the sound. Even if some data is lost, it will only affect a small part of the call. In addition, UDP is also used instead of TCP in multicast and broadcast channels. TCP (Transmission Control Protocol) is a connection-oriented protocol, which means that before sending or receiving data, a reliable connection must be established with the other party. A TCP connection must go through three "conversations" to be established. The process is very complicated. I will only briefly describe the simple process of these three conversations:
The purpose of the three "conversations" is to synchronize the sending and receiving of data packets. After three "conversations", host A officially sends data to host B, which is also a prerequisite for ensuring reliable transmission. 6 UDP (User Data Protocol)
We often use the "ping" command to test whether the TCP/IP communication between two hosts is normal. In fact, the principle of the "ping" command is to send a UDP data packet to the other host, and then the other host confirms receipt of the data packet. If the message whether the data packet has arrived is fed back in time, then the network is connected. The ping command is used to detect whether hosts can communicate with each other. If a host cannot be pinged, it means that a connection cannot be established with the host. The ping command uses IP and Internet Control Message Protocol (ICMP), so it does not involve any transport protocol (UDP/TCP) and application. It sends an ICMP echo request message to the destination host. ICMP protocol stipulates that the destination host must return an ICMP echo reply message to the source host. If the source host receives the reply within a certain period of time, it is considered reachable. |
>>: How 5G will reshape future smart home life
In campus networks, there are many emerging trend...
Recently, the incident in which a local operator ...
80VPS is a long-established Chinese hosting compa...
WiFi has been expanding its deployment and applic...
HostKvm is a Chinese VPS service provider founded...
CCTV News: The reporter learned from the Ministry...
The HTTP protocol is very important to us program...
At the 5G Message High-level Forum of the China I...
In our daily development, we will more or less be...
SD-WAN technology helps make wide area networks m...
Visible light communication is a technology that ...
With over 250 million students, India has one of ...
From August 31 to September 5, the 2022 China Int...
Preface There is no love, only technology. Let me...
Finding the right service provider can be challen...