The following is a simple list of the more important steps in the request process:
1, enter the Web address in the browser, enter, the browser sends the request to the DNS, find the domain name corresponding IP
2, the browser based on the return request domain IP, plus the request port (default 80), and the request resource (resource location is/or index.html, etc.), the assembly request after the browser sends the request
-dns parsing the domain name process from the input URL to the page load completion process
3. The transport layer discovers that there is no connection to the destination IP, so initiates a request to establish a connection, and 3 times the handshake establishes the TCP connection process
-TCP three-time handshake from input URL to page load completion
4, after establishing the connection, send the request resource of the packet, the request type is assumed to be get (only request access to the resource content), the system through the transport layer, the network layer, the Data Link Layer Layer encapsulation, the final issue of the packet
Process from input URL to page load completion-packet assembly process
5, the packet in the NAT device and a number of routers flow, after a long jump to the server's NAT device, Nat according to the request port to forward the request to the intranet server
6, after the server accepts the request, may use the cache directly, may also send the request to the Web server to parse, finally after the server resolves, assembles the response content, sends the response data to the client. The response packet is returned to client NAT through the network and is forwarded to the client after NAT forwarding
7, the client network layer to unpack the packet layer, and the application layer to the packet (the packet may have multiple, when all arrived, will be the full data packet to the browser) back to the browser parsing
8. The browser parses the packet based on the HTTP header and the entity content of the response. and continue to request some additional resources in the page that need to be loaded, if the resource requested at this time in the CDN (Content distribution network, is the server near your home to hold the requested static resources; one way to reduce network latency is to use better transmission media-such as fiber, One is to shorten the transmission distance-CDN is to take advantage of this), then get the resources from the CDN (the process and the request server resources consistent, need to go through three handshake to establish a connection); If you continue to get the original server (the IP address of the domain name), continue to reuse the original TCP connection (provided that the HTTP1.1 is used, and the HTTP1.0 has a keep-alive head to maintain the connection effect).
9, the request for resources, idle for a period of time without interaction with the server (idle time is set, some applications in order to continuously open the TCP connection, will send a request to the server every once in a while, thus maintaining the connection, so that the user in initiating a real resource request, you can omit the TCP connection established process, However, too many of these connections consume the resources of the server, the TCP connection shutdown process occurs, and four interactions occur during the shutdown process.
10. Slow start, congestion prevention and control during TCP data transmission
11. Optimization method summarized from request interaction process
Each of these points will be written in separate article mapping analysis, please look forward to. The content of the article refers to network resources, the HTTP authoritative guide, the Web Performance authoritative guide. Finally say the recent reading feeling,Know hardware to design better software, understand the bottom can let oneself see more comprehensive.
What actually happens when you enter a URL