TCP and UDP difference

TCP (Transmission Control Protocol) transport control protocol

UDP (User Datagram Protocol) User Datagram Protocol

Both are transport layer protocol

TCP :

Advantages: reliable and stable, based on the link for the byte stream. Reliability: need three-way handshake agreement before establishing a connection. Stability: confirmation during data transmission, retransmission window, congestion control mechanisms to ensure data transmission.

When data transfer is complete, the connection is closed. 

Disadvantages: low efficiency due to slow connection confirmation mechanism, retransmission mechanism leading to congestion window mechanism footprint

Be used: less data transmission, high-accuracy data requirements, packet loss, the data sequence. E.g. HTTP FTP AMQP other protocols.

UDP:

Advantages: high transfer rate, no link for the message. Support many-to-many interaction

Cons: best effort, that does not guarantee reliable delivery

Application scenarios: a large amount of data transmission, high speed transmission requirements such as voice and video.

Guess you like

Origin www.cnblogs.com/934827624-qq-com/p/11023313.html