Socket programming 2: two link types: UPD and UPD

Source: Internet
Author: User

In the previous article, I talked about some basic knowledge about computer networks and introduced socket. From this section, I started to get started.


1 Probability

TCP:Transimission Control Protocol Transmission Control Protocol.

UPD: User datav protocol user data packet protocol.

Both belong to the transport layer protocol, the fourth layer in the OSI model described in the previous article.

Comparison:

  1. TCP is connection-oriented, and UDP is non-connection-oriented)
  2. Slow TCP transmission speed and fast UDP transmission speed)
  3. TCP has a packet loss retransmission mechanism, but UDP does not; (Retransmission)
  4. TCP ensures data correctness and UDP may cause packet loss (correctness)
  5. TCP is suitable for transmitting a large amount of data, and UPD is suitable for transmitting a small amount of data. (Data volume)
2. TCP link Process

3. UDP Link

* Both images are from the network.

Socket programming

Socket is an API for TCP/IP networks. programmers use socket interfaces to exchange data.


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.