User access to the site process

Source: Internet
Author: User
Tags ack website server domain name server browser cache domain server

When we open the browser input URL enter, to see the page page, there are two main steps: first , the domain name to resolve the process of IP, second , through the IP to find the site server, the request to open a specific Web page, the server response request, the client browser received a response message , render the HTML document, and finally get the page we see on the page.


process of DNS resolution, we all know, the computer can only communicate with each other through IP, because the IP is not good to remember, so only use DNS server to resolve the domain name to the corresponding IP, here to resolvewww.oldboyedu.comAs an example, when we enter this URL return, the browser will first query the browser cache, the cache can survive only 1 minutes, if not found, then to query the local DNS cache and Hosts file, If there is a www.oldboyedu.com this domain corresponding IP, then directly through this IP access to the website server. If the local DNS cache and Hosts file is not found, this time will send the request to the network card configuration information in the DNS server, the default is two, only if dns1 can not access, will use DNS2. We also call the DNS in the NIC configuration information local DNS, when local DNS queries its cache first. There is no www.oldboyedu.com corresponding record, if there is, then return to the user, if not, will be access to the root name server, the world a total of 13 root name servers, root name server look, is looking for. com, and will send the IP of the. com top-level domain name server to local DNS, at which point the local DNS again accesses the. com top-level domain server, the. com top-level domain name server, looking for a domain name oldboyedu.com, and then send the oldboyedu.com IP to local DNS, and then continue to look down, Until you find Www.oldboyedu.com's authoritative DNS's a record or CNAME, this time local DNS sends the IP of the found www.oldboyedu.com to the client and logs it in the cache, so that the next time another user accesses the domain name www.oldboyedu.com, the local DNS cache is logged. When the client receives the IP that the local DNS sends over, it accesses the server via IP and records the IP in the DNS cache.
the above is the principle of DNS resolution.
After DNS resolution, you get the IP, you can send HTTP requests through IP to the server, because HTTP is working in the seventh layer of application, TCP is working in the fourth layer of transport, so before the HTTP request occurs, the TCP three handshake.
the three-time handshake for TCP is: The client first sends a random number with a SYN ID and a SEQ to the server, and after the service has received it, it needs to respond to the client with a Ack,ack value of +1, which is the value of the SEQ random number, in the response packet, a SYN identifier and a seq Random number . After the client receives the response packet from the service side, sending a Ack,ack value to the server is the value of SEQ that was sent from the server just now (+1). Once the three steps are complete, the three handshake is complete, and the data is now ready to be transmitted.
This is the beginning of sending HTTP request messages.

Request message for HTTP, mainly including, request line, request header, blank line, request body
and the request line includes, the request method, the URL, the protocol version, the request method mainly has , POST, PUT, DELETE, Move,url is the Uniform Resource Locator, through this can find the unique Web resources on the server, the protocol version, At present the mainstream is http1.1, the beginning of the popular protocol version is http1.0, the relative should be http1.0,http1.1 mainly from scalability, cache processing, bandwidth optimization, persistent connection, host header, error notification, message delivery, content negotiation and other aspects do some optimization, The above is the content of the request line
some more, request the head, request the head of the main media type, language type, support compression, client type, host name, etc., the media type is mainly text files, picture files, video files, etc., the language type is to tell the server client's accepted language, support compression, you can save bandwidth, Client type, will show the version information of the client browser, operating system information, such as blank lines, the end of the request header, also represents the request body of the start Request message body, only use post to submit the form, only the corresponding when the server received the request message, will give a response message.

User access to the site process

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.