1. TCP/IP is a protocol group that can be divided into three layers: network layer, transport layer and application layer.
In the network layer, there are IP protocol, ICMP protocol, ARP protocol, RARP protocol and BOOTP protocol.
There are TCP protocol and UDP protocol in the transport layer.
In the application layer, there are protocols such as FTP, HTTP, TELNET, SMTP, and DNS.
Therefore, HTTP itself is a protocol, a transmission protocol for transmitting hypertext from a web server to a local browser.
2. The HTTP protocol is based on the request/response model. First, the client establishes a TCP connection with the server, and sends a request to the server, which includes the request method, URI, protocol version, and related MIME style messages. The server responds with a status line containing the protocol version of the message, a success and failure code, and the associated MIME style of the message.
HTTP/1.0 establishes a new TCP connection for each HTTP request/response, so a page containing HTML content and pictures will need to establish multiple short-term TCP connections. The establishment of a TCP connection will require 3 handshakes.
In addition, in order to obtain the appropriate transmission speed, TCP needs to spend additional round-trip connection time (RTT). The establishment of each link requires this kind of regular overhead, and it does not carry actual useful data, but only ensures the reliability of the link. Therefore, HTTP/1.1 proposes a sustainable link implementation method. HTTP/1.1 will only establish a TCP connection once and use it repeatedly to transmit a series of request/response messages, thus reducing the number of connection establishments and regular connection overhead.

3. Conclusion: Although HTTP itself is a protocol, it is ultimately based on TCP. However, at present, some people are studying the HTTP protocol based on TCP+UDP mixture.
What is Socket?
Socket is an intermediate software abstraction layer for communication between the application layer and the TCP/IP protocol family, and it is a set of interfaces. In the design mode, Socket is actually a facade mode, which hides the complex TCP/IP protocol family behind the Socket interface. For users, a set of simple interfaces is all, and Socket organizes data to meet the specified protocol.





