There are several main parts:
1 DNS resolution, get Web server IP
2 sending an HTTP request to the Web server
3 The Web server receives the request and processes
4 The Web server returns a response
5 The browser decodes the response and displays the data
6 When the page display is complete, the browser sends an asynchronous request
The following detailed procedure:
1 DNS resolution, get Web server IP
The requester follows the DNS resolution in the following order:
(1) Browser cache
(2) System cache
(3) Router cache
(4) ISP DNS Server cache
(5) Root name server
If the domain name is not found in step (5), the domain name does not exist.
2 sending an HTTP request to the Web server
(1) If the destination IP is on the same subnet as the native IP, the requestor sends ARP to get the MAC address of the destination IP, otherwise the MAC address of the gateway is used as the destination MAC address for forwarding
(2) Generate HTTP packets, and sequentially hit TCP, IP, Ethernet protocol header. Where the TCP header mainly contains the native port and the destination port information, to identify the different processes of the same host, HTTP default port is 80, the native browser is a 1024 to 65535 port number. The IP header mainly contains information such as local IP and destination IP. The Ethernet protocol header is primarily the MAC address of both sides. If the package is too large, you also need to split the package and send it separately.
(3) The requestor establishes a TCP connection with the Web server through three handshakes
(4) Send request data (Ethernet frame)
3 The Web server receives the request and processes
4 The Web server returns a response
Return response code may be 2xx: Success, 3xx: Redirect, 4xx: Client Error
5 The browser decodes the response and displays the data
When the browser does not fully accept the entire HTML document, it has started to display this page, if it is a static page, get this is basically the end. If it is dynamic, then when the browser displays HTML, it gets the objects embedded in the HTML, and the browser sends a GET request to retrieve the files. These requests go through a process similar to HTML reading.
For static page content, browsers typically cache, and for dynamic content, browsers do not normally cache.
6 When the page display is complete, the browser sends an asynchronous request
The client keeps in touch with the server to update some page information in a timely manner. Finally, the TCP connection is eventually broken.
Enter the website domain name in the browser and press ENTER