Simple understanding of http, tcp and socket

1. Http belongs to the application layer, mainly to solve how to package data.

2. Tcp belongs to the transport layer, which mainly solves how data is transmitted on the network.

3.Socket is the encapsulation of TCP / IP protocol. Socket itself is not a protocol, but a calling interface (API). Socket can support different transport layer protocols (TCP or UDP). When the TCP protocol is used for connection, the Socket connection is a TCP connection, and the Socket is the engine, providing network communication capabilities. Can achieve cross-network communication.

4. IP belongs to the network layer and provides reliable transmission services to achieve communication between processes.

5. Most instant messaging uses sockets, and most websites use http.

 

 

Network seven-layer and five-layer model diagram:

Guess you like

Origin www.cnblogs.com/kerwincui/p/12693175.html