The whole process of the browser entering the URL to the page

I reviewed some of the content in the video of Lake University of Science and Technology on station b. If you don’t understand the article, you can go to the get out of class again.

1. The user enters the URL address on the browser

2. The browser resolves the domain name to obtain the IP address of the server, and DNS domain name resolution . The DNS server is a database with the corresponding relationship between domain names and IP addresses.

 There are two ways of DNS domain name resolution, recursive query and iterative query

Recursive query: first query the local domain name server, and then query the root domain name server. (The root domain name server is the highest-level domain name server) Then go to the top-level domain name to check and select, as shown in the figure. com is the top-level domain name, and then go to the authority domain name server to check and select. If found, return in turn.

Iterative query: first query on the local domain name server, then query the root domain name server, tell the local domain name server which top-level domain name server to query, and return to the local server after getting the result to tell which authoritative domain name server to go to, and then return to the local domain name server. Until the iterative query reaches the result.

3. TCP three-way handshake resume connection between client and server

Because HTTP is a reliable transmission based on TCP, a three-way handshake of TCP is required.

 Here the client is an active connection, while the server is a passive connection.

The first handshake client to server: (client test connection) SYN=1 (synchronization bit) seq serial number (randomly generated x)

The second handshake server to client: (when the server agrees to establish a connection) SYN=1 (synchronization bit) ACK=1 (confirmation) seq=y (y randomly generated by the server) sequence number ack=x+1 indicates is an acknowledgment of sequence number x

The third handshake from the client to the server: (when the client actually agrees to establish a connection) ACK=1 (confirmation bit) seq=x+1 (the request serial number initiated from the client) ack=y+1 (to the server request response)

4. The client sends an HTTP request to obtain the static resources on the server

5. The server sends an HTTP response message to the client, and the client obtains the static resources of the page

6. TCP waved four times to close the connection between the client and the server

In the four waves of TCP, the client actively chooses to close, and the server passively chooses to close.

The first waving from the client to the server: (the client proposes to break up!) FIN=1 ACK=1 seq=u ack=v At this time, the client enters the FIN-WAIT-1 termination waiting state 1

Second waving from the server to the client: (the server is confused and asks if you are sure?) ACK=1 seq=v ack=u+1 (response to the previous message) At this time, the client enters FIN-WAIT-2 to terminate waiting state 2  

(At this time, the connection from the client to the server has been released, and the TCP is in a semi-closed state, but the process from the server to the client is not closed, which may last for a period of time. The server sends a message to the client, and the client still needs to receive it)

The third wave of hand from the server to the client: (I want to keep it again!) FIN=1 ACK=1 seq=w ack=u+1 (ack for repeated confirmation from the client to the server)

The fourth wave from client to server: (retained, separate) ACK=1 seq=u+1 ack=w+1 (ack confirms the message from server to client)

7. The browser parses the document resource and renders the page

(1) Parse html resources and build a DOM tree

(2) Parse css resources and build CSS Rule Tree

  (3) js operates the dom tree through DOM API and CSS OM API

(4) After the analysis is completed, the integrated DOM Tree and CSS Tree will generate a Render Tree and calculate the position of each element

(5) Call the drawing of the Native GUI of the operating system

(6) Page drawing

Guess you like

Origin blog.csdn.net/weixiwo/article/details/129541667