The advantage of the UDP protocol is that it is relatively simple and easy to implement, but the disadvantage is that it has poor reliability. Once a data packet is sent, it is impossible to know whether the other party has received it.
In order to solve this problem and improve network reliability, the TCP protocol was born. This protocol is very complex, but it can be approximated as a UDP protocol with a confirmation mechanism, which requires confirmation every time a data packet is sent. If a data packet is missing, it will not receive confirmation, and the sender will know that it is necessary to resend the data packet