What happened in the process of loading from the input URL to the page?

Source: Internet
Author: User
Tags connection pooling get ip

1) Divide the URL into several parts: protocol, network address, resource path. Where the network address indicates which computer on the network, can be a domain name or IP address, can include the port number, the protocol is the way to obtain resources from the computer, the common is HTTP, FTP, different protocols have different communication content format; The resource path indicates which resource is fetched from the server.

Example: http://www.guokr.com/question/554991/
Protocol section: HTTP
Network address: www.guokr.com
Resource path:/question/554991/

2) If the address is not an IP address, the address is resolved to an IP address through DNS (domain Name System). The IP address corresponds to a computer on the network, the DNS server itself has IP, and your network settings contain the IP of the DNS server.
For example: Www.guokr.com is not an IP, ask DNS to request www.guokr.com corresponding IP, get ip:111.13.57.142. In this process, your computer directly asked the DNS server may not www.guokr.com the corresponding IP, will be to its superior server query, the superior server may also not, in accordance with this layer up to find, up to the root node, found or all can not find until.

3) If the address does not contain a port number, determine one based on the default port number of the protocol. The port number of the computer is like the window number of the bank, a bank has multiple windows, each window has a number, different windows can be responsible for different services. The port is just a logical concept, not related to the computer hardware.
For example: Www.guokr.com does not contain a port number, the HTTP protocol default port number is 80. If you enter a URL that is http://www.guokr.com:8080/, it means that the default port number is not used and the specified port number is 8080.

4) Initiate a network connection to the IP and port numbers identified by 2 and 3.
Example: initiating a connection to port 80 of 111.13.57.142

5) According to the requirements of the HTTP protocol, the organization of a request packet, which contains a large number of request information, including the requested resource path, your identity
For example: in natural language to express this packet, probably is: request/question/554991/, my identity is xxxxxxx.

6) The server responds to the request and returns the data to the browser. The data may be Web pages organized according to the HTML protocol, which contains the layout and text of the page. Data can also be pictures, scripts, and so on. Now you can use the browser's "view Source" function to feel what the server is returning. If a resource path indicates a resource that does not exist, the server returns a well-known 404 error.

7) if (6) returns a page, based on the URL of some outside chain of the page, the address of the sample, according to (1)-(6) to obtain again.

8) Start by organizing resources into the image displayed on the screen based on the type of resource, this process is called rendering, Web page rendering is the most complex and core function of the browser.

9) Display the rendered page image and start responding to the user's actions.

The above is only the most basic steps, it is impossible to be so simple, some optional steps such as Web caching, connection pooling, loading strategy, encryption and decryption, proxy relay and so on are not mentioned. Even though the basic steps themselves have very complex sub-steps, TCP/IP, DNS, HTTP, HTML: Each one can be expanded into a huge topic, and the basis of the browser-operating system, compilers, hardware, etc. is more complex than a. Not the computer professional students read the above explanation completely do not understand is very normal, may ask why to make so complex, but I guarantee that each step is considered and the test of time. You enter the URL to browse the Internet, and the computer system behind the countless you do not see the work, the computer's various sub-fields of countless engineers to pay your unimaginable efforts.

What happened in the process of loading from the input URL to the page?

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.