What happens in the process from input URL to page load completion

Source: Internet
Author: User
Tags domain name server domain server

What is the process description from the input URL to the completion of the page loading process
    1. Browser to find the corresponding IP address of the domain name;
    2. The browser establishes a socket connection to the server based on the IP address;
    3. Browser communication with server: Browser request, server processing request;
    4. The browser is disconnected from the server.
Find IP Address concept resolution based on domain name
    1. IP Address: The IP protocol is a logical address assigned to each network and each host on the Internet. The IP address is like a house number, and an IP address determines the location of a host. Server nature is also a host, want to access a server, you must first know its IP address;
    2. Domain name (HOST): The IP address is composed of four numbers, the middle with a dot number connection, in the use of the process difficult to remember and easy to input errors, so we are familiar with the combination of letters and numbers to replace the pure digital IP address, for example, we will only remember Www.baidu.com (Baidu domain name) and not 220.181.112.244 (one of Baidu's IP addresses);
    3. DNS: Each domain name corresponds to one or more IP addresses that provide the same service server, only know the server IP address to establish a connection, so you need to resolve the domain name through DNS to an IP address.

Knowing the concept above, you probably know that you want to get the server's house number, you need to first convert the domain name to an IP address. The conversion process is as follows (in the case of querying the IP address of www.baidu.com, where 2, 3, and 4 steps are not successfully queried in the previous step):

Find process
    1. The browser searches its own DNS cache (maintains a table of names and IP addresses);
    2. Search the DNS cache in the operating system (maintain a table of names and IP addresses);
    3. Search the Hosts file of the operating system (under Windows environment, maintain a table of the domain name and IP address);
    4. The operating system sends the domain name to the LDNS (local domain name server, if you connect to the Internet in the school, then the LDNS server is in the school, if the Internet through the telecommunications, then the LDNS server is in your native telecommunications there. LDNS queries its own DNS cache (general search success rate is around 80%), find success returns results, failure initiates an iterative DNS resolution request;
      1. Ldns to Rootnameserver (the root name server, which does not have specific information for each domain name, but stores the address of the top-level nameservers responsible for each domain, such as COM, net, org, etc.) initiating the request, where Root name server returns COM The address of the domain's top-level domain server;
      2. LDNS initiates a request to the top-level domain name server of the COM domain and returns the Baidu.com domain name server address;
      3. LDNS to baidu.com domain name server request, get www.baidu.com IP address;
    5. LDNS returns the IP address to the operating system and caches the IP address itself;
    6. The operating system returns the IP address to the browser and caches the IP address itself;
    7. At this point, the browser has been given the domain name corresponding IP address.
Additional Information
    1. The domain name and URL are two concepts: the domain name is the names of one or a group of servers used to determine the location of the server on the Internet; A URL is a Uniform Resource locator used to determine the specific location of a file, for example, Zhihu.com is the domain name, according to this domain name can find the server, Zhihu.com/people/compileyouth is the URL, you can locate my home based on this URL;
    2. The IP address and the domain name is not a one by one corresponding relationship: You can set up multiple servers with the same service IP to the same domain name, but at the same time a domain name can only resolve an IP address, at the same time, an IP address can be bound to multiple domain names, the number of unlimited;
Establish connection: three-time handshake

Knowing the IP address of the server, the following begins to establish a connection to the server.

In layman's words, the establishment of a communication connection requires the following three processes:

    1. The host sends a request to the server to establish a connection (hello, I want to know you);
    2. The server sends a signal that agrees to connect after receiving the request (OK, nice to meet you);
    3. After the host has received a signal to accept the connection, it sends a confirmation signal to the server (and I am pleased to know you), since then the host and the server have established a connection.

Supplemental Instructions: TCP protocol: Three handshake process using TCP protocol, which can guarantee the reliability of information transmission, three handshake process, if one party does not receive the confirmation signal, the protocol will require re-send signal.

Data transmission

After the server has established a connection with the host, the following host communicates with the server. A Web request is the process of a one-way request, which is the process by which a host requests data from the server and the server returns the corresponding data.

    1. The browser generates an HTTP request based on the content of the URL, including the location of the requested file, the way the file was requested, etc.
    2. After the server receives the request, it will decide how to obtain the corresponding HTML file according to the contents of the HTTP request;
    3. The server sends the resulting HTML file to the browser;
    4. When the browser has not fully received the HTML file, it starts rendering, displaying the Web page;
    5. In the execution of HTML code, as needed, the browser will continue to request pictures, CSS, javsscript and other files, the process with the request HTML;
Disconnect: four times wave
    1. The host sends a disconnect request to the server (it's not too early, I should go);
    2. The server sends a signal confirming receipt of the request after receiving the request (know);
    3. The server sends a disconnect notification to the host (I should go too);
    4. The host disconnects after disconnecting and feedback a confirmation signal (well, OK), the server disconnects after receiving the acknowledgement signal;
Additional Information

Why does the server not immediately agree to disconnect when receiving a disconnect request: When the server receives a disconnected request, there may still be data not being sent, so the server sends a confirmation signal and then agrees to disconnect after all the data has been sent.

After the fourth handshake, the host sends a confirmation signal and does not immediately disconnect, but waits for 2 message delivery cycles, because if the confirmation message of the fourth handshake is lost, the server will resend the third handshake's disconnected signal, and the server is aware that the packet dropped and the resend of the disconnected connection arrived at the host time exactly 2 Message transmission cycles.

This article roughly describes the input URL to the page loading complete process, I personally feel that the description is good, so I want to put on their own blog, for themselves and everyone to share and learn.

Original address: What happens in the process from input URL to page load completion

What happens in the process from input URL to page load completion (RPM)

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.