Browser and enter a url through the middle of the process

A common exam, is not easy to answer fully, you can answer the following questions from the perspective of

What comes to the middle of the process

Each process may involve what network protocols

What each protocol have done?

These are ideas to answer this question.

(Reminder: know what to say, do not bring their own pit, where one familiar with the agreement said, where one layer)

 

Network is a common five layered model: the physical layer, link layer, network layer, transport layer and application layer.

OSI seven layer protocol: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer.

Seven agreements the application layer protocol for the five segments session layer, presentation layer, application layer.

 

A request to initiate a TCP handshake until the end of the middle through a process from which the browser?

     flow chart:

    DNS query - "TCP handshake -" HTTP request - "reverse proxy Nginx-" uwsgi / gunicom- "web app response -" TCP handshake.

       When the browser that initiated the request does not actually start doing DNS queries, but the first to see there is no DNS cache, if not in the hosts file and DNS cache inside there is no time, it will initiate a local DNS server DNS query if the DNS is not found in local time (recursive DNS query is a query) it will continue to the upper query, continues to perform recursive queries anonymous server and root server. Until after the completion of inquiries we returned to the corresponding IP address, such as: input www.aliyun.com Ali cloud will return the corresponding IP address: 106.11.62.15.

       After you complete DNS query to obtain an IP address, when to get the IP address of the browser can call the Socket function come and initiate a TCP request to establish a connection through a three-way handshake with the server,

       After the connection is established, the originating application layer protocol HTTP request, the HTTP request is not initiated by a start hit the web frame, but hit Nginx reverse proxy, much higher than the access to the site will use nginx as a reverse proxy and load balancing, forwarding to multiple servers via nginx.

       After Nginx reverse proxy server on the WSGI this layer, uwsgi / gunicom role is mainly compatible web application (flask / django / tornado). Forwarded to the web application layer (App web response) frame layer web is then requested by uwsgi. In web application layer is generally made of some database change search deletions or send a message or the like, and finally the request Response, sent to the user via TCP.

      If no other time of data transmission, TCP will perform four times and waved.


----------------
Disclaimer: This article is the original article CSDN bloggers "AllardZhao", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/qq_37189082/java/article/details/98110340

Guess you like

Origin www.cnblogs.com/suger43894/p/12666928.html