What magical things happen when you enter a URL in your browser?

What magical things happen when you enter a URL in your browser?

After entering the URL in the browser, the website opens.

You may not imagine how complicated the technical steps are behind this simple step.

To facilitate understanding, we invite the protagonists of this article, Zhao Si and Liu Neng, to understand from their perspective what happens from the time a user enters a URL to the time the website is opened.

One day, Zhao Si heard that Liu Neng had built a personal website and wanted to check it out. So he typed the domain name zhaosi.com into the browser and pressed Enter.

[[393075]]

[[393076]]

The browser is Liu Neng's little brother. No matter what Liu Neng orders, the browser will do it obediently. But the browser is also a principled person. If there are some obviously wrong commands, it will immediately feedback to Liu Neng and tell him that this is wrong.

The browser will first check whether the URL Liu Neng entered is legal. If Liu Neng enters the URL zha.osi.com or [email protected], the browser will immediately tell Liu Neng that this is wrong.

For his own convenience, Liu Neng often gave vague commands. For example, when he visited the website this time, he directly entered zhaosi.com without telling the browser whether to use the http or https protocol.

It's not a good idea to ask Liu Neng, so the browser has its own way of dealing with it. If the boss doesn't tell me explicitly, then I will use the http protocol by default. If he tells me explicitly to use https, then I will open the website https://zhaosi.com.

The above is just the first step of a long journey. If you want to establish a connection between Liu Neng and Zhao Si's website, there is still a long way to go to open zhaosi.com.

The first obstacle is TCP/IP, which is a very large company that monopolizes the entire express delivery industry. If you want to send a courier, you can only go through this company, and everyone only recognizes it.

It is not afraid of being fined. Alibaba was fined 18 billion yuan for monopolistic behavior two days ago, but TCP/IP just smiled and said nothing.

[[393077]]

This company has a rule: only IP is recognized, not URL (domain name).

It is no use telling TCP/IP to send this message to Zhao Si's website; you must tell it the exact address, down to the house number (IP).

But Liu Neng doesn't know what the IP address of Zhao Si's website is. What should he do?

So the browser found the DNS company, whose main business is similar to the 114 directory service. 114 can help look up phone numbers, while DNS can help look up the IP address corresponding to a domain name.

[[393078]]

Liu Neng told DNS that Zhao Si's website address was zhaosi.com, and asked it to help query the corresponding IP address and then contact TCP/IP.

After the DNS accepts the commission, it starts to query. It first checks the DNS cache in its memory, but does not find it! Then it checks the host file on the local hard disk, but still does not find it. Finally, it can only contact its own DNS server 8.8.8.8.

The long journey of finding the IP address begins.

DNS packages its queries.

  • Recipient address: 8.8.8.8
  • Sender: 1.1.1.1

UDP was the one who received the package. After receiving it, he wrote a few words on it:

  • Recipient No. 53
  • Sender No. 56002

The reason for writing the house number is that one address may correspond to many house numbers.

After completing these tasks, he contacted the IP driver and asked him to deliver the package to the destination. The IP driver checked the IP routing table and found that it needed to pass customs, and the requirement for passing customs was that the driver must know the MAC address.

What to do? The IP driver thought of a good way. Just ask the locals if they think of ARP.

ARP immediately called out, and the gateway MAC address was safely in its pocket: xx.xx.xx.xx.xx.xx

With the MAC address, the IP driver passed through customs smoothly, got on the Internet highway, and drove all the way...

Finally, the package reaches the DNS server. The DNS server sees that the IP address of zhaosi.com is in the local cache and directly tells the browser.

What if the local cache is not there?

The DNS will initiate a query to the root domain name server. It will first ask the root domain name server: "Do you have the IP address of zhaosi.com?"

The root domain name server told him: "Go to the com server to find it."

Then he asks the com server, layer by layer, and finally finds out the IP address of zhaosi.com, and finally tells the browser.

After going through a lot of hardships, DNS finally lived up to its mission and got the IP address. Now we can contact the TCP/IP company.

According to the TPC agreement, if Liu Neng wants to visit Zhao Si's website, he must first ask Zhao Si if he is there. Usually, he needs to contact the other party like this:

"Are you there? I want to visit you."

Zhao Si: "I'm here, welcome!"

"Okay, I'll be there soon."

After these three conversations (three-way handshakes), the package can reach its destination smoothly.

Liu Neng finally opened Zhao Si's personal website.

Liu Neng would never know that one of his actions would generate such a complex amount of calculations...

<<:  German media: Shenzhen has more 5G base stations than the whole of Europe

>>:  Internet services for the elderly have been standardized

Recommend

RackNerd Los Angeles restock, low-cost US VPS annual payment starts from $9.89

RackNerd is a foreign hosting company founded in ...

7 ways to understand the 5G standards in June

MicrosoftInternetExplorer402DocumentNotSpecified7....

iWebFusion: 1-10Gbps server from $49/month, 4G memory VPS from $9.38/month

iWebFusion (or iWFHosting) is a site under the ol...

How to save a SaaS product that is unsustainable

[[355134]] I have briefly mentioned this topic be...

Blockchain, IoT and 5G

5G networks are starting to roll out across the U...

What kind of report card did the operators submit?

Over the past three years, my country's 5G co...

What is Wi-Fi 7?

The Wireless Broadband Alliance (WBA) announced i...

5G, IoT, edge and cloud: a winning combination

The number of 5G connections is expected to grow ...

Five trends in edge computing for 2022

Edge computing trends play a key role in business...

Talking about IPv6 technology research in 2019

In March 2019, the "Report on the Implementa...