Joke Collection Website - Cold jokes - The difference between udp and tcp

The difference between udp and tcp

TCP transport protocol is a connection-oriented, reliable and byte stream-based transport layer communication protocol, which is defined by RFC793 of IETF. UDP is an Internet protocol set that supports connectionless transport protocols. It provides an application with a way to send encapsulated IP packets without establishing a connection.

Many characteristics of TCP are related to the basic connection-oriented characteristics of TCP. Therefore, it is necessary to have a clearer understanding of TCP connection. Each TCP connection is uniquely determined by two endpoints at both ends of the communication. An endpoint is a socket (or socket).

Socket representation: write the port number after dotted decimal IP address. For example, if the IP address is 192.3.4.5 and the port number is 80, then the socket is (192.3.4.5: 80).

? The difference between TCP and UDP:

1, TCP is connection-based and UDP is connectionless.

2. Requirements for system resources: more TCP (TCP has 20-byte packets) and less UDP (UDP packets have only 8 bytes).

3.UDP program structure is relatively simple.

4.TCP is a byte stream mode and UDP is a data message mode.

5.TCP guarantees the correctness, security and reliability of data and the order of data, while UDP may lose packets, and UDP does not guarantee the order of data.

Refer to the above? Baidu encyclopedia -UDP protocol