Advantages and disadvantages of UDP and TCP

     The advantages and disadvantages of UDP and TCP?

           • TCP connection-oriented (such as dialing to establish a connection before making a call); UDP is connectionless, that is, there is no need to establish a connection before sending data

           • TCP provides reliable services. That is to say, the data transmitted through the TCP connection has no errors, no loss, no repetition, and arrives in order; UDP does its best to deliver, that is, reliable delivery is not guaranteed (Tcp through checksum, retransmission control, sequence number identification, Sliding window and confirmation response realize reliable transmission. For example, retransmission control when packet is lost, order control can also be performed on out-of-order sub-packets).

           • UDP has better real-time performance, higher work efficiency than TCP, and is suitable for high-speed transmission and real-time communication or broadcast communication.  

           • Each TCP connection can only be point-to-point, one-to-one; UDP supports one-to-one, one-to-many, many-to-one and many-to-many interactive communications

           • TCP requires more system resources, while UDP requires less system resources.

Guess you like

Origin blog.csdn.net/feng8403000/article/details/114955787