Difference and use of TCP and UDP

Source: Internet
Author: User

Difference Between TCP and UDP

TCP-the transmission control protocol provides connection-oriented and reliable byte stream services. Before the customer and the server exchange data with each other, a TCP connection must be established between the two parties before data can be transmitted. TCP provides timeout resend, discard duplicate data, test data, traffic control, and other functions to ensure data can be transferred from one end to the other.
UDP-the User Datagram Protocol is a simple datagram-oriented transport layer protocol. UDP does not provide reliability. It only sends the data from the application to the IP layer, but it cannot guarantee that the data can reach the destination. Because UDP does not need to establish a connection between the client and the server before transmitting the datagram, and there is no timeout and re-transmission mechanism, the transmission speed is very fast (as3 does not support udp)


Purpose

TCP is generally used for file transmission (ftp http requires high data accuracy, and the speed can be relatively slow), sending or receiving emails (pop imap smtp requires high data accuracy, non-urgent applications ), remote Logon (Telnet SSH has certain requirements on data accuracy and connection concepts). UDP is generally used for Instant Messaging (QQ chat has low requirements on data accuracy and packet loss, but the speed must be fast), online videos (RTSP must be fast to ensure video continuity, but sometimes one image frame is spent, which is acceptable ), network voice calls (VOIP voice packets are generally relatively small and need to be sent at high speed. Occasionally, there is no problem with disconnected or crosstalk.

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.