What is TCP?

TCP is a connection-oriented, reliable, IP(byte stream) – based transport layer protocol
TCP is the underlying protocol of HTTP

A complete HTTP request process (inputwww.baidu.com, to the page rendering process)

  1. The inputwww.baidu.com, and press EnterThe DNS, get the IP address;
  2. Based on the IP address, find the server and goEstablishing a TCP Connection, three handshakes;
  3. The browserSending an HTTP request, the server performsThe responseHTML file;
  4. The browserparsingThe HTML file,loadingResources needed in HTML files (images, CSS, JS);
  5. The browser completes the page parsingApply colours to a drawing;
  6. The HTTP service was released. ProcedureClosing a TCP ConnectionFour times.

Triple handshake (essentially: initiation of connection + two confirmations between two parties)

Four times to wave

In fact, A will continue to wait for 2MSL before disconnecting.

  • Note: The initiator of the three-way handshake and four-way wave can be either the client or the server