当前位置:网站首页>How is the network connected

How is the network connected

2022-06-21 14:27:00 Record brother

I found an interesting book recently :《 How is the network connected 》.

 

I remember reading a hot question on the Internet before : From input url Go to the browser to show what happened to the page ? This book explains this problem very well . To be precise , It should be a detailed answer to this question .


One . The browser generates messages

We will first explore how browsers work . You can think that our journey of exploration starts with entering the web address in the browser . For example, when we enter such a web address , The browser will analyze the meaning of the URL according to certain rules , Then the request message is generated according to its meaning .

https://www.baidu.com/

In the chestnuts above , The request message generated by the browser indicates : Please give me the data of this address . Then the browser will send the request message to web The server .

Of course , The browser doesn't take care of the data itself . Sending messages is the responsibility of the mechanisms that carry digital information . So the browser will entrust him to send the data . That is, please use the network control software in the operating system , It's the protocol stack boss , Send the message to the server .


Two . Transmit by electric signal TCP/IP data

Then , We will explore the mechanisms for moving data . The protocol stack is the first one . He will package the messages received from the browser , Then add the destination address and other control information . Like a post office , Just put the letter in an envelope , Then write the recipient's address on the envelope . The protocol stack has other capabilities ? for example , When a communication error occurs , Resend packets or adjust the rate of data transmission .

Next , The protocol stack will deliver the packets to the network card , The network card is set by such a person : Hardware responsible for Ethernet or wireless network communication . then , The network card will convert the data packets into electrical signals and send them out through the network cable . thus , The packet enters the network .


3、 ... and . From network cable to network equipment

The items coming out next will vary according to the form of Internet intervention . The client computer can access the Internet through home or company LAN , You can also access the Internet directly .

Let's take the most typical scenario as an example , Suppose the client computer is connected to the local area network of the home or company , And then through ADSL And broadband lines such as fiber to home access to the Internet .

In such a scenario , Packets sent by the network card will pass through switches and other devices , To the router used to access the Internet . Behind the router is the Internet , The network operator will be responsible for delivering the packets to the destination , It's like after we drop the letter into the letterbox , The postman will be responsible for delivering the letter to the addressee .


Four . Access to the Internet through the access network

Next , The data starts from the router used to access the Internet , Inside the Internet . The gateway to the Internet is called an access network . Generally speaking , We can use a telephone line ,ISDN,ADSL, Cable TV , Optical fiber , Special lines and other communication lines to access the Internet , These communication lines are collectively referred to as access networks . The access network is connected to the contracted network operator , And access a device called an access point .

The entity of the access point is a router specially designed for operators , Think of him as the nearest post office to your home . The letters collected from each mailbox will be sorted in the post office , And then sent to the whole country and even the whole world . The Internet is the same , The network packet is first sent to the access point through the access network , Then it will be sent to the whole country and even the world from here . Behind the access point is the backbone of the Internet .

There are many operators and a large number of routers in the backbone network , These routers connect to each other , Make a huge net , And our network package is in it , After the relay of several routers , It's finally sent to the target Web Server .


5、 ... and . What is the mystery of the LAN on the server side

After passing through the backbone network , The network packet finally arrived Web The server is in the local area network . next , He will run into a firewall , The firewall checks for incoming packets . You can think of the firewall as a security guard at the door , He will check all incoming bags , See if there are any dangerous bags in it . After inspection , Network packets may also encounter cache servers next . Part of the web data can be reused , The reusable data is stored in the cache server .

If the web data to be accessed can be found in the cache server , Then you don't have to bother Web The server , Read data directly from the cache server . Besides , In large websites , It may also be equipped to publish messages to multiple stations Web Load balancer on the server , It's also possible to use services that distribute content through caching servers distributed across the Internet . After these mechanisms , The packet will arrive Web The server . 


6、 ... and . Request arrival Web The server , Response back to browser

When the network packet reaches Web After the server , The data will be unpacked and restored to the original request message , And then to Web Server program . Same as client , This operation is also completed by the protocol stack in the operating system . Next ,Web The server program analyzes the meaning of the request message , And follow the instructions to load the data into the response message , And send it back to the client . The process of returning the response message to the client is just the opposite of the process we introduced .

When the response reaches the client , The browser will read the data of the web page and display it on the screen . Come here , visit Web A series of operations of the server are completed , Our journey of exploration has also reached the end !

If you still have more to say when you see this , So this e-book is tailor-made for you :

《 How is the network connected 》, Interested parties can reply in the background :【 The Internet 】, You can take her home .

Friends can hurry up and roll up , Taking advantage of the young spring , To enrich themselves , Make yourself stronger and stronger

原网站

版权声明
本文为[Record brother]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221425206186.html