[Network Engineering] What happens when the browser enters the URL and loads the page?

Table of contents

1. URL input

2. DNS resolution

3. Establish a TCP connection

4. Send HTTP/HTTPS request

5. The server responds to the request

6. The browser parses and renders the page

7. The HTTP request ends and the TCP connection is disconnected


1. URL input

First, the user enters the domain name in the browser, and the operating system will check whether there is a record of the domain name in the browser cache and the local hosts file, and if so, find the corresponding IP address from the record to complete the domain name resolution.

2. DNS resolution

If the record in the cache and hosts file is not found, the IP address is queried from the DNS server to complete domain name resolution.

3. Establish a TCP connection

Then the browser initiates a TCP connection request to port 80 of the server, and establishes a connection through a three-way handshake.

4. Send HTTP/HTTPS request

If HTTPS is used, there will be an additional layer of protocol between TCP and HTTP as an encryption and authentication service. HTTPS uses SSL and TLS protocols to ensure information security.

The role of the SSL protocol is to authenticate the client and server to ensure that data is sent to the correct client and server.

Encrypted data prevents data from being stolen midway, maintains data integrity, and ensures that data is not changed during transmission.

The role of the TSL protocol is to provide confidentiality and data integrity between two communicating applications.

5. The server responds to the request

When the browser establishes a connection with the web server, the browser sends a GET request, and the server responds with an HTML data

6. The browser parses and renders the page

After the browser receives the response, it starts parsing and rendering the page.

Process html markup and build a DOM tree

Handle CSS

Layout according to the DOM tree, after rendering each node to the page, disconnect the TCP connection

7. The HTTP request ends and the TCP connection is disconnected

Wave four times when the page is disconnected. Students who do not understand the three-way handshake and four-way handshake can read the simple and easy-to-understand analysis below.

"Easy to understand TCP/IP protocol three-way handshake and four-way wave"

Guess you like

Origin blog.csdn.net/haidong55/article/details/126899660