URL in your browser to access analytic process

When we entered www.baidu.com in the browser, the browser will load the Baidu home page, then the browser process behind what is it?
Overall, this is probably the process!
1) When you enter the URL, the browser will request the server DNS, to obtain the corresponding IP through DNS.
2) to find the corresponding server through the IP, requesting establishment of a TCP connection.
3) the browser sends an HTTP request packet, the server receives the process start.
4) server receives a request, calls itself began to return to service HTTP request packet.
After the appropriate 5) client receives the server begins operation, and disconnect the TCP connection after receiving entirety.

1, DNS resolve

When we enter a URL in the browser is not directly connected, you need to resolve in order to connect the converted URL address will be entered as an IP address with a DNS address.
Specific process is divided into:
1) enter the URL in the browser, the browser will first check your local hosts file has no cache, and if so, direct the completion of parsing.
2) If you own hosts file is not cached, find LDNS (local DNS), the local DNS server if there is a direct complete resolution.
3) If the local DNS server hosts and do not, requests the DNS server to the field LDNS.

2, socket connection

When we launched a request, we must first establish a socket connection, socket is to be established through the IP and port, so for DNS resolution.

3, http request transmission

After the connection is established, start sending a request to the web server, when the browser makes a request to a Web server, it sends a block of data to the server, that is, request information, usually get and post.
HTTP request information consists of three parts:
1) a method Request URI Protocol / version
2) request headers (the Request Header)
3) request body

4, server response

Server for processing upon request. From its document space in search of index.html mydir subdirectory. If the file is found, Web server sends the file content to the appropriate Web browser. Web server first transmits a number of HTTP headers, the more common are:
. 1) 200 is the OK HTTP 1.0
2) MIME_Version: 1.0
. 3) the content_type; indicates the MIME type of the HTTP message body.
4) content_length

5, Disconnect

After the end of the response, the browser and the server must be disconnected, in order to ensure that other browsers can connect to the server.

Guess you like

Origin blog.51cto.com/14375911/2415993