- 1. Check whether the browser cache can be removed. If yes, it is displayed directly
- 2. No, DNS parses the IP address.
- 3. During an HTTP session, the browser initiates a TCP connection to the server and shakes hands with the browser three times
- 4. The client sends a request header to request data packets
- 5. The server returns the response header and returns the data to the browser
- 6. The browser receives the response, downloads the HTML document, parses and generates a DOM tree
- 8. Web page display
TCP: Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte stream based transport-layer communication protocol. During the three-way handshake, if one party does not receive the confirmation signal, the protocol requires that the signal be resend.
TCP three-way handshake:
- The host sends a request to the server to establish a connection. (SYN)
- After receiving the request, the server sends the signal that agrees to connect to the host. (SYN+ACK)
- The host sends an ACK to the server after receiving the signal agreeing to connect.
- The connection to complete
Four times to wave
- The host sends a disconnection request to the server.
- After receiving the request, the server sends a signal confirming receipt of the request.
- The server sends a disconnect notification to the host.
- The host disconnects after receiving the disconnection notice and feeds back a confirmation signal. The server disconnects after receiving the confirmation signal.
Why the server does not immediately agree to disconnect when it receives a disconnect request:
When a server receives a disconnection request, it may still have incomplete data transmission. Therefore, the server sends an acknowledgement signal first and then agrees to disconnection after all data transmission is complete.Copy the code
After the fourth handshake, the host does not immediately disconnect after sending the confirmation signal, but waits for two packet transmission periods. The reason is as follows:
If the confirmation information of the fourth handshake is lost, the server resends the disconnection signal of the third handshake. However, the server detects that the lost packet and the re-sent disconnection reach the host within two packet transmission periods.Copy the code