Main Features of TCP#
- 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.
- 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.
- TCP provides reliable delivery service for transmitted data, ensuring no loss, no errors, and maintaining the correct order.
- 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.
- 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#
- First of all, UDP is connectionless and message-oriented.
- UDP supports one-to-one, one-to-many, many-to-one, and many-to-many communication.
- 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).
- 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.