The browser takes the URL and parses it
Protocol: indicates the protocol header, such as HTTP and FTP. Host: indicates the host domain name or IP address. Port: indicates the port number. Path: indicates the directory path. Query: indicates the query parameter. Fragment: hash value after #, used to locate a location.
The IP address is obtained by DNS query
- Browsers have caching
- PC local cache
- The host file
- Query information on the DNS server
- There may be a route, there may be a cache in the route, or there may be a custom DNS resolution in the route
Establish TCP/IP communication
Communication over the Internet requires a network protocol. TCP/IP is a protocol family customized for the Internet. Therefore, the protocol of the Internet is TCP/IP. Note: TCP/IP is not a protocol, but a protocol family. It includes IP protocol, IMCP protocol, TCP protocol and so on. HTTP requests made by browsers are essentially TCP/IP requests. TCP divides HTTP long packets into short packets and establishes a connection with the server through three-way handshake for reliable transmission. Once the connection is established, the data is transferred.
Making an HTTP request
- After the communication between the client and server is established, the client initiates an HTTP request
- After receiving the HTTP request, the server processes the request and returns the processing result to the client
- The client receives the data returned by the server
Disable the TCP/IP connection
Four waves are required to disconnect the connection (four waves are required because it is full-duplex).
Browser processing returns the result
- The browser parses the HTML and generates a DOM tree
- The browser parses CSS rules and generates a CSS rule tree
- The browser generates the Render rendering tree through DOM tree and CSS rule tree structure
- Display the page