Differences Between TCP and UDP protocols

Source: Internet
Author: User


First, both TCP and UDP protocols run on the transport layer.


UDP protocol: user data packet Protocol


1. UDP is connectionless. That is to say, you do not need to establish a connection before data transmission (of course, there is no link release at the end of data transmission), which reduces the overhead and the latency before data transmission.

2. UDP uses the best delivery effort, but does not guarantee reliable delivery. Therefore, the host does not need to maintain a complex link status table.

3. UDP is for packets. The sender's UDP retains the boundary of the packets sent by the application process without merging or splitting them. That is to say, when the application layer delivers the same number of packets to UDP, UDP sends the same message at a time. At the same time, on the receiver side, UDP User Datagram sent from the IP layer is removed from the header and then delivered to the application process at the application layer. That is to say, UDP delivers a complete packet at a time. Therefore, the packet size must be appropriate to reduce the data transmission efficiency. If the message is too long, you need to shard the packets at the IP layer, which will reduce the efficiency of the IP layer. Conversely, if the message is too short, after UDP delivers it to the IP layer, the IP datagram header is too long, which also reduces the efficiency of the IP layer.

4. UDP has no congestion control


TCP: Transmission Control Protocol


1. TCP is a connection-oriented transport layer protocol. Before using the TCP protocol, you must establish a TCP connection.

2. Each TCP connection can have only two endpoints

3. reliable delivery, because the IP layer only provides transmission without bit errors.

4. Full Duplex Communication.

5. byte stream oriented. In TCP, "stream" refers to the byte sequence that flows into or out of the process.

Differences Between TCP and UDP protocols

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.