Tommy

Tommy

写代码是热爱,但也是生活 !
github

The difference between TCP and UDP 😈

Main Features of TCP#

  1. TCP is connection-oriented. It is similar to making a phone call to your girlfriend, where you need to establish a connection first and then disconnect after the call.
  2. Each TCP connection can only have two endpoints, meaning it is point-to-point. Just like when you call your girlfriend, you don't want anyone else to interfere. Hehehe.
  3. TCP provides reliable delivery service for transmitted data, ensuring no loss, no errors, and maintaining the correct order.
  4. TCP provides full-duplex communication, allowing both parties to send messages at any time. Both ends of the connection have send and receive buffers to temporarily store the data being communicated between the two parties.
  5. TCP is stream-oriented. Although the interaction between the application program and TCP is done in blocks of data (of varying sizes), TCP treats the data passed down by the application program as a continuous and unstructured stream of bytes.

Main Features of UDP#

  1. First of all, UDP is connectionless and message-oriented.
  2. UDP supports one-to-one, one-to-many, many-to-one, and many-to-many communication.
  3. UDP uses best-effort delivery, which means it does not guarantee reliable delivery. Therefore, hosts do not need to maintain complex connection states (which involve many parameters).
  4. UDP does not have congestion control, so network congestion does not reduce the sending rate of the source host (which is useful for real-time applications such as live streaming and real-time video conferences).

Conclusion#

TCP and UDP both belong to the transport layer of the five-layer network model and are protocols used for data transmission.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.