"Windows socket+ip+udp+tcp"

Source: Internet
Author: User

Windows sockets+ Network
      Winsock is the standard for socket under Windows . Winsock programming is divided into UDP"Windows Sockets + UDP", TCP"Windows Socket + TCP" programming. Windows sockets built on the network, UDP programming using User Datagram Protocol (subscriber Datagram Protocol, UDP), TCP programming using Transmission Control Protocol (transmission Control protocol,tcp). Udp,tcp different features to suit different application needs. The UDP,TCP protocol is based on Internet Protocol (PROTOCOL,IP).           1. Internetwork Protocol (Internet protocol,ip):
the function of IP protocol: the transmission of data between interconnected networks, that is, from one IP host to another IP host.
        IP protocol is the data transmission protocol between host and host, and it can only complete the datagram transmission between host and host. The IP datagram format is as follows:
IP Header: IP datagram information, including the source IP, destination IP and other IP data, these IP data like the address on the letter, to ensure that the datagram transmission to the target IP host. IP data: transmitted data. IP protocol is unreliable protocol, may occur drops, errors, etc., does not guarantee that the data must be delivered to the target host.
2. Subscriber Datagram Protocol (user Datagram Protocol, UDP):      UDP is located above the IP protocol and uses IP as the underlying transport protocol, and UDP encapsulates its own UDP datagram in the IP data transmission.
UDP Header: Contains data such as source port, destination port, and so on. The port guarantees that the data can be accurately transferred to the specified process. UDP Data: the transmitted data. UDP is based on IP protocol, IP protocol is an unreliable protocol, UDP itself does not have any measures to ensure reliable, so the UDP protocol is unreliable. UDP protocol is suitable for data reliability, sequential delivery of non-required programs, UDP can provide faster, smaller consumption of transmission services.
3. Transmission Control Protocol (transmission-protocol,tcp):        as with the UDP protocol, TCP is also located above the IP protocol, encapsulating the TCP datagram in the IP data transmission.
TCP header: When compared to UDP,TCP also contains the source port, the target port and other data, TCP also contains the serial number, confirmation number and other information, which is used to confirm whether the data is fully delivered, TCP is the reason for the reliable protocol is here. TCP Data: the transmitted data. TCP is based on unreliable protocol IP, but TCP employs a variety of mechanisms to ensure the orderly and reliable delivery of data. TCP is used for applications that require high data security, such as the Web, e-mail, and more.
4. Extensions: This is simply a brief introduction to the relationship between the IP,UDP,TCP protocols and the features of these protocols, which are not exhaustive. Readers interested, can read computer network related books, "Computer network", "UNIX network Programming" and so can solve your confusion.

Related Article

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.