After entering a URL, what happens??

Source: Internet
Author: User
Tags ack domain name server

(1) Browser parsing

(2) Query cache

(3) DNS queries

The sequence is as follows, if one of the steps succeeds directly in establishing the connection section:

--Browser's own DNS

--Operating system DNS

--Local Hosts file

--Like a domain name server sending requests

(4) Establishing a connection

--TCP three-time handshake (Three-way handshaking)

--Sender: SYN (synchonize)

--Recipient: syn/ack (acknowledgement), confirming information transmission

--Sender: ACK-confirms the receiver's re-line to receive the message, the handshake ends

Accept

--1, send side: The packet labeled SYN sent to you.

--2, receiver: I get it! I got the packet you sent me! (and send a packet labeled Syn/ack)

--3, understand! (send packets marked with ACK)

The advantage of the TCP three handshake is that the sender can confirm that the recipient is still online and will not waste resources because of white hair.

(5) Sending an HTTP request

--Message header (get/index.html http/1.1)

--Method

--URL

--HTTP version

--Empty line

--Message body

Note: The 1,http is non-connected, stateless, that is, after the HTTP retransmission is complete, it will be disconnected and the last login status will not be logged on the next login.

2, about CR (carriage return, carriage return) and LF (line Feed, newline)

DOS and Windows cr/LF means the next line UNIX/Linux uses LF to indicate that the next line ofMac OS system uses CR for the next line

(6) The server sends the response

--Message header (http/1.1 OK)

--HTTP version

--Response status code

--Status Code information

--Empty line (CR+LF)

--Message body

(7) The client receives the page

(8) Parsing HTML

--Building the DOM tree

--Download Resources

--CSS-building Csssom Tree

--js-wait for download and parse after execution

(9) Building a render tree

Invisible elements are not rendered according to Dom and Csssom tree rendering

(10) Browser layout rendering

--layout-according to the rendering book layout

--draw-draw each point on the screen

After entering a URL, what happens??

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.