Differences between TCP/IP, UDP, Http, and Socket

Source: Internet
Author: User

Differences between TCP/IP, UDP, Http, and Socket
From top to bottom: presentation layer and application layer: HTTP protocol (based on the transport layer of TCP protocol, mainly to solve how to package data)
Session Layer
Transmission Layer: TCP protocol (Network-layer IP protocol) and TPC/IP protocol (mainly to solve how data is transmitted in the Network)
Network Layer: IP protocol
Data Link Layer
Physical Layer 4. socket is the encapsulation and Application of TCP/IP protocol (programmer level). Socket itself is not a protocol, but an interface called (API, it only provides an interface for TCP or UDP programming). Through Socket, we can use the TCP/IP protocol. In fact, the Socket and TCP/IP protocol are not necessarily related.
The Socket programming interface is designed to adapt to other network protocols. Therefore, the appearance of Socket only makes it easier for programmers to use the TCP/IP protocol stack. It is an abstraction of the TCP/IP protocol, this forms some of the most basic function interfaces we know, such as create, listen, connect, accept, send, read, and write.

6. the relationship between TCP/IP and HTTP is easy to understand in the Network: "When we transmit data, we can only use the (Transport Layer) TCP/IP protocol, however, without the application layer, the data content cannot be identified. To make the transmitted data meaningful, you must use the application layer protocol. There are many application layer protocols, for example, HTTP, FTP, and TELNET, you can also customize the application layer protocol. The WEB uses HTTP as the application layer protocol to encapsulate HTTP text information, and then uses TCP/IP as the transport layer protocol to send it to the network ."
10. the network has a saying that the relationship between socket and TCP/IP protocol is easier to understand: "TCP/IP is just a protocol stack, just like the operating mechanism of the operating system, it must be implemented in detail, it also provides external operation interfaces. Just as the operating system provides standard programming interfaces, such as win32 programming interfaces, TCP/IP also provides interfaces that programmers can use for network development. This is the Socket programming interface."
11. CSDN has a more vivid description: HTTP is a car that provides a specific form of encapsulation or display data. Socket is an engine and provides network communication capabilities.

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.