本文共 4884 字,大约阅读时间需要 16 分钟。
my-medium.cnf
by Andrea Zanin
由Andrea Zanin
Hey did you notice what just happened? You clicked a link, and now here you are reading this article. But did you think about how your browser knew that the link you clicked referred to this article, and that this article contained these words?
嘿,您注意到发生了什么吗? 您单击了一个链接,现在您正在这里阅读本文。 但是您是否考虑过浏览器如何知道您单击的链接引用了本文,并且本文包含了这些词?
It’s something so common that we forget about it, but the mechanism behind it is fascinating. In this article we will explore it using real world analogies.
这是很常见的事情,我们忘记了,但是它背后的机制令人着迷。 在本文中,我们将使用现实世界的类比进行探索。
When you open a website, your browser is asking some other computer somewhere in the world for the data that will allow it to show you the page (for example, the text you are reading now).
当您打开网站时,浏览器正在向世界其他地方的其他计算机询问数据,以使其能够显示页面(例如,您正在阅读的文本)。
This act of asking another computer is not unlike sending a piece of mail (physical mail, not an email) to a friend and waiting for his reply.
询问另一台计算机的行为与向朋友发送一封邮件(物理邮件,而不是电子邮件)并等待其答复无异。
If John wants to send Brittany some mail, he needs to know her address. In the internet world, instead of having physical addresses we have IP addresses. They work the same way, just with a computer instead of a mailbox.
如果约翰想发送一些邮件给布列塔尼,他需要知道她的地址。 在互联网世界中,我们没有IP地址,而是拥有物理地址。 它们的工作方式相同,只是使用计算机而不是邮箱。
Before we dive in the details about IP addresses, I want you to imagine that you are staying in a luxurious hotel with hundreds of rooms and a fancy doorman (not bad right?).
在我们深入介绍IP地址的细节之前,我想让您想象一下,您住在一家豪华酒店,里面有数百个房间和一个看门的门卫(还不错吧?)。
Now back to IP addresses: your standard IP address looks like this: 102.134.122.234. The first 9 digits are the address of the virtual hotel you are staying in, while the last 3 are your room. While the address of the virtual hotel is fixed, the room you are staying in is chosen by the hotel.
现在回到IP地址:您的标准IP地址如下所示:102.134.122.234。 前9位数字是您所住虚拟酒店的地址,后3位数字是您的房间。 虚拟酒店的地址固定后,酒店将选择您要入住的房间。
If anyone wants to send you a message, they need to know the address of the hotel and your room number. So they send the message to the hotel and the doorman delivers it directly to you.
如果有人想向您发送消息,他们需要知道酒店的地址和您的房间号。 因此,他们将消息发送给酒店,然后门卫将消息直接传递给您。
The virtual hotel is like your home WiFi network. Its address is decided by your internet provider, while your room number is decided by your home router.
虚拟酒店就像您的家庭WiFi网络。 它的地址由您的互联网提供商决定,而房间号由家庭路由器决定。
You may have noticed that if you want to open medium.com you don’t need to know its IP address. This is where the internet becomes smarter than the postal service.
您可能已经注意到,如果要打开medium.com,则无需知道其IP地址。 这是互联网变得比邮政服务更智能的地方。
On top of IP addresses, there is a system to match easy to remember names to IPs: the Domain Name System.
在IP地址的顶部,有一个将易于记忆的名称与IP进行匹配的系统:域名系统。
Finally, here is what happens when your phone wants to open medium.com
最后,这是您的手机要打开medium.com时发生的情况
Finally your phone can send the request directly to Medium’s address (IP). All of this in less than a tenth of a second.
最终,您的手机可以将请求直接发送到Medium的地址(IP)。 所有这些都在不到十分之一秒的时间内。
Yes we will run out of IP addresses — and soon. But don’t panic, a solution is already being implemented.
是的,我们很快就会用完IP地址。 但是请不要惊慌,已经在实施一种解决方案。
First we have to take a step back: up until now I talked about IP addresses, but I should have said IP version 4. The solution is IP version 6, and it looks even uglier: 2001:0db8:0000:0042:0000:8a2e:0370:7334
首先,我们必须退后一步:到目前为止,我谈到的是IP地址,但我应该说的是IP版本4。解决方案是IP版本6,它看起来更难看:2001:0db8:0000:0042:0000: 8a2e:0370:7334
This alphanumeric monstrosity leads to an astronomical amount of possible IPs, so issue solved ??.
这种字母数字的怪异性导致可能的IP数量达到天文数字,因此问题得以解决。
In this article we analyzed how your phone understands what medium.com is, but what about the HTTPS part of the link? I wrote another article about it: .
在本文中,我们分析了您的手机如何理解media.com,但是该链接的HTTPS部分又如何呢? 我写了另一篇文章: 。
If you liked the article don’t forget that you can ? up to 50 times.
如果您喜欢这篇文章,别忘了可以吗? 最多50次
翻译自:
my-medium.cnf
转载地址:http://wjgwd.baihongyu.com/