In-depth analysis: the difference between TCPIP, HTTP proxy and socks

Insert picture description here
We know that the network can be divided into 7 layers from bottom to top: physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer.

Among them, the IP protocol corresponds to the network layer, the TCP protocol corresponds to the transport layer, and the HTTP protocol corresponds to the application layer. The three are essentially incomparable, and the socket is an encapsulation and application of the TCP/IP protocol. It can also be said that the TPC/IP protocol is a transport layer protocol, which mainly solves how data is transmitted in the network, while HTTP is an application layer protocol which mainly solves how to package data.

Regarding the relationship between TCP/IP and HTTP, the network has a relatively easy to understand introduction: "When we transmit data, we can only use the TCP/IP protocol, but in that case, if there is no application layer, the data content will not be recognized. If it is. If you want to make the transmitted data meaningful, you must use the application layer protocol.
Insert picture description here

And what is the socket we usually talk about most? In fact, socket is an encapsulation of the TCP/IP protocol. Socket itself is not a protocol, but a calling interface. Through Socket, we can use the TCP/IP protocol. In fact, Socket is not necessarily related to the TCP/IP protocol.

Guess you like

Origin blog.csdn.net/zhimaHTTP/article/details/115135177