Differences and connections between TCP and UDP

Source: Internet
Author: User

Differences and connections between TCP and UDP 1. connection-oriented TCP www.2cto.com TCP (Transmission Control Protocol) is a connection-based Protocol. That is to say, before sending and receiving data, you must establish a reliable connection with the other party. A TCP connection can be established only after three "conversations". The process is very complicated. Here we only provide a simple and visual introduction. You only need to understand this process. Let's take A look at the simple process of the three conversations: host A sends A connection request packet to host B: "Can I send data to you ?", This is the first conversation; host B sends A packet to host A that agrees to the connection and requires synchronization (synchronization means that two hosts are sending, receiving, and coordinating): "Yes, when will you send it? ", This is the second conversation. host a sends another packet to confirm that host B's request is synchronized: "I will send it now, let's proceed !", This is the third dialogue. The purpose of the three "dialogs" is to synchronize the transmission and receipt of data packets. After the three "dialogs", host A formally sends data to host B. In short, TCP must undergo three handshakes to establish a connection. Advantages of www.2cto.com: 1. connection-oriented transmission; 2. stable and reliable data transmission; 3. End-to-End communication; 4. Full duplex mode; 5. disadvantages of transmission in bytes: transmission speed is not fast enough 2. for non-connection UDP, you do not need to establish a connection with the other party before the formal communication, and send the connection directly regardless of the other Party's status. This is very similar to the popular mobile phone text message: when you send a text message, you only need to enter the phone number of the other party and then OK. Www.2cto.com UDP (User Data Protocol) is the Protocol corresponding to TCP. It is a non-connection-oriented protocol. Instead of establishing a connection with the other Party, it directly sends data packets! The size of each packet is limited to 64 kB! Advantages: 1. fast transmission speed; 2. High Efficiency; disadvantage: data packets may be lost. Conclusion: UDP has no connection process, so its communication performance is high; but because of this, its reliability is not as high as that of the TCP protocol. QQ uses UDP to send messages, so sometimes messages cannot be received. TCP and UDP have their own strengths and weaknesses, and are suitable for communication environments with different requirements.

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.