Differences between the TCP protocol and the UDP protocol

Source: Internet
Author: User

Differences between the TCP protocol and the UDP protocol
Whether connection-oriented connection oriented non-connected
Reliable unreliable transmission reliability
Applications transmit small amounts of data in large amounts of data
Slow speed

TCP requirements and server remain connected UDP does not require TCP data to be ordered (first written data is sprints first received) UDP data is unordered

Asyncsocket is a set of open source libraries designed for socket sockets under iOS, which encapsulates the CFNETWORK/BSD socket, provides an asynchronous development model and a simple development interface that supports TCP/UDP, supports UDP broadcasts, multicast

Asyncsocket support for Gcd/blocks and Runloop modes also supports arc

1.TCP (transmission Control Protocol, transmission Protocol) is a connection-based protocol, which means that a reliable connection must be established with the other party before the data is formally sent and received. A TCP connection has to go through three "conversations" to build it up, Let's take a look at the simple process of these three conversations: 1. Host A sends a connection request packet to Host B, 2. Host B transmits a consent connection to host A and requires synchronization (synchronization is two hosts one in the sending, one in the receiving, coordination work) packet; 3. Host A then sends a packet to confirm that Host B requires synchronization: " I'll send it now, and you go ahead! ", this is the third dialogue. Three times the purpose of the "conversation" is to synchronize the sending and receiving of packets, and after three "conversations", host a formally sends the data to Host B.
2.UDP (User data Protocol, Subscriber Datagram Protocol) is the protocol that corresponds to TCP.  It is a non-connected protocol that does not establish a connection with the other, but sends the packet over directly! UDP is suitable for applications that only transmit large amounts of data at a time and do not require high reliability.

Differences between the TCP protocol and the UDP protocol

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.