my-medium.cnf_您的手机如何打开medium.com-我将让门卫和图书管理员解释。

my-medium.cnf

by Andrea Zanin

由Andrea Zanin

您的手机如何打开medium.com-我将让门卫和图书管理员解释。 (How your phone opens medium.com — I’ll let a doorman and a librarian explain.)

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.

这是很常见的事情,我们忘记了,但是它背后的机制令人着迷。 在本文中,我们将使用现实世界的类比进行探索。

电脑如何对话 (How computers talk)

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地址,而是拥有物理地址。 它们的工作方式相同,只是使用计算机而不是邮箱。

告诉我有关此IP的更多信息 (Tell me more about this IP thing)

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网络。 它的地址由您的互联网提供商决定,而房间号由家庭路由器决定。

数字很​​复杂 (Numbers are complicated)

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时发生的情况

  • The phone sends the request to the doorman (router) and asks it to send it to medium.com

    电话将请求发送到门卫(路由器),并要求将其发送到medium.com
  • the router asks a trusted agency (your internet provider) for the IP of medium.com

    路由器向可信代理商(您的互联网提供商)询问medium.com的IP
  • this trusted agency then refers to a worldwide organization (the Root Server) that recognizes the Top Level Domain (.com, .us, .org, …)

    然后,该受信任的代理机构指的是认可顶级域(.com,.us,.org等)的全球组织(根服务器)。
  • the Root Server then asks the digital librarian responsible for that TLD

    然后,根服务器询问负责该TLD的数字图书馆员
  • finally the librarian opens his master record, looks for the website we requested, and responds with the IP

    最后,图书馆管理员打开他的主记录,查找我们请求的网站,并以IP进行回复

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)。 所有这些都在不到十分之一秒的时间内。

我们会用完地址吗? (Will we run out of addresses?)

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数量达到天文数字,因此问题得以解决。

离开之前 (Before you leave)

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: https explained with carrier pigeons.

在本文中,我们分析了您的手机如何理解media.com,但是该链接的HTTPS部分又如何呢? 我写了另一篇文章: https用信鸽解释

If you liked the article don’t forget that you can ? up to 50 times.

如果您喜欢这篇文章,别忘了可以吗? 最多50次

翻译自: https://www.freecodecamp.org/news/how-can-your-phone-open-medium-com-62ec36b1429f/

my-medium.cnf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值