Enter the website domain name in the browser and press ENTER for the detailed procedure

Source: Internet
Author: User
Tags response code browser cache

There are several main parts:

1 DNS resolution, get Web server IP2 establishing a TCP connection3 sending an HTTP request to the Web server4 The Web server receives the request and processes5 The Web server returns a response6 The browser decodes the response and displays the data7 when the page display is complete, the browser sends an asynchronous request8 Closing the TCP connection

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 establishing a TCP connection

Establish a TCP connection first locate the target server (get the Physical Address): (1) If the destination IP is in 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, and the router is used to forward it.

The requester (client) makes a request to the Web server (server side) to establish a TCP connection. The process of connecting is a three-time handshake:

  

3 sending an HTTP request to the Web server

(1) 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.

(2) Send an HTTP request.

4 The Web server receives the request and processes5 The Web server returns a response

The return response code may be 2xx: Success, 3xx: Redirect, 4xx: Client error.

6 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.

7 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.

8 Closing the TCP connection

The Web server initiates a shutdown of the TCP connection by four disconnects:

  

Original Portal: please click

Enter the website domain name in the browser and press ENTER for the detailed procedure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.