需要IP地址

发布于 2024-09-28 10:35:36 字数 49 浏览 7 评论 0原文

当 MAC 地址是唯一的时,为什么我们还需要 IP 地址?不能只用MAC地址通讯吗?

Why do we need an IP address when the MAC address is unique? Cant we communicate only with the MAC address?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

中性美 2024-10-05 10:35:36

您可以仅使用 MAC 地址进行通信,但只能在本地网络上进行。 IP 地址是可路由的,网络上的每个系统都不需要相互了解。您只需要知道本地网络上的一系列地址,然后将其他所有内容交给路由器即可。同样的事情也发生在 ISP 级别。 “所有 216.xxx 流量都这样,所有 105.xxx 流量都这样……”(显然过于简单化,但这是基本过程)。

如果我们尝试通过 MAC 地址路由所有内容,则网络上的每台计算机都必须维护所有其他参与者的列表,而且它无法扩展。

You COULD communicate using only the MAC address, but only on your local network. IP addresses are routeable, without every system on the network needing to know about every other. You just need to know a range of addresses that are on your local network, and throw everything else up to your router. The same thing happens at the ISP level. "All 216.x.x.x traffic goes that way, all 105.x.x.x goes that way..."(Obviously a gross oversimplification, but that's the basic process).

If we tried to route everything by MAC address, every machine on the network would have to maintain a list of every other participant, and it just wouldn't scale.

无所谓啦 2024-10-05 10:35:36

不。MAC 地址特定于以太网,IP 独立于底层硬件。如果您有所需的网桥,则可以将不使用以太网的计算机连接到 Internet。

No. MAC addresses are specific to Ethernet, IP is independent of the underlying hardware. You can connect machines that don't use Ethernet to the Internet, if you have the required bridges.

夢归不見 2024-10-05 10:35:36
  • MAC 地址不是唯一的。 MAC 地址在媒体之间重复使用。这就是无线 (802.11) 和有线 (802.3) 不能同时出现在一个冲突域中的原因(请参阅 802.1D)。
  • MAC 地址不是集群的——这意味着网络空间中附近的设备没有附近的 MAC 地址。 IP 地址确实具有这种局部性属性。您打算通过将通用 MAC 地址列表复制到 Internet 上的每台计算机来路由数据包,还是打算通过位置层次结构将数据包路由到其目的地?
  • 在单个冲突域上,MAC 地址可以是主要寻址模式(qv arp 和 rarp)。然而,由于上述原因,扩展到多个冲突域是无效的。
  • MAC addresses are not unique. MAC addresses are reused between media. This is why wireless (802.11) and wired (802.3) may not both be present on one collision domain (see 802.1D).
  • MAC addresses are not clustered -- meaning that devices which are nearby in network space do not have nearby MAC addresses. IP addresses do have this property of locality. Do you intend to route packets by having a universal list of MAC addresses copied to every computer on the Internet, or do you intend to route packets to their destinations through a hierarchy of localities?
  • On a single collision domain, MAC addresses can be the primary addressing mode (q.v. arp and rarp). However, extension to multiple collision domains is ineffective for the above reasons.
各空 2024-10-05 10:35:36

我的一位伟大教授乔治·瓦尔盖斯(George Varghese)现在就职于加州大学圣地亚哥分校,他做了以下恰当的类比:你想给某人寄一封信。根据 MA​​C 地址发送到美国任何地方的设备就像向某人发送一封只知道其社会安全号码的信件。它确实唯一地标识了某人(好吧,是的,SSN 不能保证唯一,但假设这是为了举例),但如果没有一张包含每个人居住地的巨大表格供您查找,就很难找到他们按他们的 SSN 索引。

IP 地址(以及类似的开放系统互连 (OSI) 网络地址)更像是带有区号和交换号码的美国电话号码:(AAA) BBB-CCCC,其中 AAA 是区号,BBB 是交换号码, CCCC 在该交易所确定一条单独的线路。该号码中编码了分层信息,因此当您距离目的地很远时,您只需要一个按区号索引的小表即可确定将呼叫转发到的良好“下一跳”,而不是一个包含所有呼叫的表该国的电话号码。

A great professor of mine named George Varghese, now at UCSD, made the following apt analogy: You want to send someone a letter. The analogy of sending to a device anywhere in the USA based on its MAC address is like sending someone a letter knowing only their Social Security Number. It does uniquely identify someone (OK, yes, SSN isn't guaranteed unique, but suppose it was for the sake of example), but it would be very hard to find them without some giant table of where everyone lived that you could look up indexed by their SSN.

An IP address (and the similar Open Systems Interconnect, or OSI, network addresses) are more like USA phone numbers with area codes and exchange numbers: (AAA) BBB-CCCC, where AAA is an area code, BBB is an exchange number, and CCCC identifies an individual line at that exchange. There is hierarchical information encoded in that number, so that when you are far away from the destination, you only need a small table indexed by area code to determine a good "next hop" to forward the call to, rather than a table of all phone numbers in the country.

策马西风 2024-10-05 10:35:36

以太网是一种媒体访问层协议。它专门设计用于连接同一网络上的计算机。如果您想连接远程计算机,您当然需要通过多个路由器跳跃跳转到目的地。 IP(互联网协议)就是为了这个目标而设计的,因此需要它,而以太网协议不支持路由。只有某些形式的原始桥接无法扩展到像互联网这样的大型事物。

Ethernet is a Medium Access Layer protocol. It was designed specifically to connect computers on the same network. If you want to connect computers remotely located, you certainly need to jump to destination by hopping through several routers. IP (Internet Protocol) was designed with this goal in mind, hence the need for it, while Ethernet protocol does not support routing. Only some forms of primitive bridging that would not scale for something huge like the Internet.

后eg是否自 2024-10-05 10:35:36

它们用于不同的协议层。

they are used for different protocol layer.

也只是曾经 2024-10-05 10:35:36

MAC 地址是您设备的特定地址。与您当前所在的地理位置等无关。

例如:您可以在美国购买手机/笔记本电脑并在日本使用,
澳大利亚等。但 MAC 地址保持不变。但IP地址
会根据您所连接的网络而改变。

因此,在便携式设备的互联网络中路由数据包尤其困难。

会怎样:
假设您有一个便携式网络访问设备,您可以在该设备上使用互联网。如果我们仅使用 MAC 地址,任何传入数据包将如何找到您的便携式设备的位置。由于 MAC 地址仅提供固定的 48 位设备地址。 (最坏的情况是使用台式计算机并拥有 MAC 地址,但没有 IP 设施。将其与静态表结合起来,根据 MA​​C 地址找到您的预定义位置,但如果没有这些便携式设备,我们的生活就不完整,对吗?

)我们需要一些寻址方案来帮助我们在像互联网这样的大型便携式环境中进行寻址,因此 IP 的作用就显现出来了,其中地址是分层的,以提供更准确的地理位置。

MAC address is your device specific address. It has no relation with the geographical location, etc. you are in currently.

Ex: You can buy a cellphone/laptop in US and use it in Japan,
Australia, etc. But MAC address would remain the same. But IP address
would change with respect to the network you are connected to.

So it is difficult to route packet in an internetwork of portable devices especially.

How would it be:
Consider you have a portable network-accessing device with you on which you are using the internet. If we use only the MAC address, how would any incoming packet find the location of your portable-device. Since MAC address gives you only a fixed 48-bit device address. (The worst case scenario is using a desktop computer and having a MAC address without the IP facility. Coupling it with the static table to find your predefined location based on the MAC address, but our life is incomplete without these portable devices right?)

Thus we need some addressing scheme that can help us with addressing in a big and portable environment like internet, and thus the role of IP comes into picture, where address is hierarchal to provide a more geographically exact location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文