TCP vs. UDP

  1. The message format is different. The TCP header is large, 20 bytes; UDP is 8 bytes.
  2. TCP provides reliable data transmission; UDP delivers as much as possible, unreliable.
  3. TCP needs a 3-way handshake to establish a connection before transmitting data; UDP does not need to establish a connection.
  4. TCP transmits data for byte streams, and groups the data at the sending end and reassembles them at the receiving end; UDP transmits data for packets without packet overhead.
  5. TCP provides flow and congestion control; UDP does not, there will be packet loss.

Guess you like

Origin blog.csdn.net/SJ1551/article/details/109164869