当前位置:网站首页>Detailed explanation of the process after the browser enters the domain name and web address

Detailed explanation of the process after the browser enters the domain name and web address

2022-06-24 04:59:00 Zeng Gaofei

From the perspective of system network, we analyze the process after entering the domain name and web address in the browser :

1、 Client browser through DNS Resolved to https://www.fgba.net/,IP The address is 202.108.22.5, Through this IP Address to find the path from the client to the server . The client browser initiates a HTTP Conversation to 202.108.22.5, And then through TCP To encapsulate data packets , Input to network layer . 2、 In the client's transport layer , hold HTTP The session request is divided into message segments , Add source and destination ports , If the server uses 80 Port listens for client requests , The client is randomly selected by the system as 5000, Exchange with the server , The server returns the corresponding request to the client 5000 port . And then use IP Layer of IP Address search destination . 3、 The network layer of the client does not care about the application layer or the transport layer , The main task is to find out how to get to the server by looking up the routing table , It may pass through multiple routers , These are all the work done by routers , It's just to find the routing table to decide which path to go to the server . 4、 The link layer of the client , Packets are sent to the router through the link layer , Find a given... By neighbor protocol IP Address of the MAC Address , And then send ARP Request to find the destination address , If you get a response, you can use ARP Of requests to answer exchanged IP Packets can now be transmitted , And then send IP Packets arrive at the address of the server .

Sequence of events : (1) The browser gets the input www.fgba.net (2) Browser direction DNS Request parsing www.fgba.net Of IP Address (3) The domain name system DNS Analysis of Baidu server IP Address ( Detailed introduction DNS)- Go out through the gateway (4) The browser is set up with the server TCP Connect ( Default port number 80) (5) The browser sends out HTTP request , Request Baidu home page (6) Server pass HTTP Response to send home file to browser (7) TCP Connection release (8) The browser will parse the homepage file , And will Web The page shows the user .

The agreement involved : (1) application layer :HTTP(WWW access protocol ),DNS( Domain name resolution service ) DNS For the purpose of resolving domain names IP, adopt IP Find the server path , The client initiates... To the server HTTP conversation , Then through the transport layer TCP The protocol encapsulates the packets , stay TCP Based on the protocol . (2) Transport layer :TCP( by HTTP Provide reliable data transmission ),UDP(DNS Use UDP transmission ),HTTP The session is divided into message segments , Add source 、 Destination port ;TCP The agreement carries out the main work . (3) The network layer :IP(IP Packet transmission and routing ),ICMP( Provide error detection during network transmission ),ARP( Set the default gateway of this machine IP Address mapping to physical MAC Address ) Routing packets ,IP The agreement carries out the main work , Reliable transmission of adjacent nodes ,ARP The agreement will IP Address to MAC Address .

Simple understanding : Domain name resolution --> launch TCP Of 3 The second handshake --> establish TCP Initiate... After connecting http request --> Server response http request , The browser gets html Code --> Browser parsing html Code , And ask for html Resources in the code ( Such as js、css、 Pictures, etc ) --> The browser renders the page to the user .

原网站

版权声明
本文为[Zeng Gaofei]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/08/20210830102931288p.html