Review of key points
IP/UDP protocol
- IP is responsible for sending packets to the correct computer
- UDP is responsible for sending packets to the correct program
UDP shortcomings
UDP cannot verify whether the data is delivered to the computer, let alone whether the data transfer is complete.
TCP protocol
If you want to “verify that all data must arrive”, use the Transmission Control Protocol, or TCP
-
TCP can handle out-of-order and lost packets, which will be retransmitted. (Can be explained here)
-
The transfer rate can also be adjusted automatically according to congestion
Disadvantages of TCP
-
TCP returns a confirmation code packet, which doubles the number of packets compared to UDP, but does not transmit any more information
-
For programs that require time and height, such as online shooters, this is not a price worth paying