mac地址 和以太网地址_为什么需要以太网/ MAC地址?

mac地址 和以太网地址

mac地址 和以太网地址

why-are-ethernet-mac-addresses-needed-00

If you are still new to the whole networking thing, then it can be a bit overwhelming when you first start learning about the different kinds of addresses involved and how they work together. Today’s SuperUser Q&A post seeks to clear up the confusion for a curious reader.

如果您还不熟悉整个网络,那么当您第一次开始了解所涉及的各种地址以及它们如何协同工作时,可能会有些不知所措。 今天的《超级用户问答》旨在消除好奇读者的困惑。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Image courtesy of Wikipedia.

图片由Wikipedia提供

问题 (The Question)

SuperUser reader user2449761 wants to know more about the need for Ethernet/MAC addresses:

SuperUser阅读器user2449761想了解有关以太网/ MAC地址需求的更多信息:

I do not understand why Ethernet/MAC addresses are needed. Surely all computers could just be connected to a unified network and use IP addresses to communicate?

我不明白为什么需要以太网/ MAC地址。 当然所有计算机都可以连接到统一网络并使用IP地址进行通信吗?

For example, there is the following mechanism in Ethernet:

例如,以太网中有以下机制:

  • A computer with the IP address 192.168.1.1 (X.1) wants to send a packet to the address 192.168.1.2 (X.2).

    IP地址为192.168.1.1(X.1)的计算机希望将数据包发送到地址192.168.1.2(X.2)。
  • X.1 uses ARP to get the MAC address of X.2.

    X.1使用ARP获取X.2的MAC地址。
  • To do so, X.1 needs to send a packet to all computers in the network and only one will answer.

    为此,X.1需要向网络中的所有计算机发送一个数据包,并且只有一台计算机可以应答。
  • X.1 gets a MAC address and sends the packet.

    X.1获取MAC地址并发送数据包。

It would be simpler to just do it in one step:

只一步就可以做到:

  • X.1 sends a packet to all computers in the network and only X.2 will process it, the others will ignore it.

    X.1将数据包发送到网络中的所有计算机,只有X.2将处理它,其他X.2将忽略它。

My other question is: Why are IP addresses needed if all devices have unique MAC addresses?

我的另一个问题是:如果所有设备都有唯一的MAC地址,为什么需要IP地址?

Why is there a need for Ethernet/MAC addresses?

为什么需要以太网/ MAC地址?

答案 (The Answer)

SuperUser contributor Paul has the answer for us:

超级用户贡献者Paul为我们提供了答案:

The different network layers are there to allow them to be swapped for different technologies. The two layers you are talking about here are Layers 2 and 3. Layer 2 in this scenario is Ethernet – from which MAC addresses arise, and Layer 3 is IP.

那里有不同的网络层,可以将它们交换为不同的技术。 您在这里谈论的两层是第2层和第3层。在这种情况下,第2层是以太网-产生MAC地址,第3层是IP。

Ethernet only works at the local level between network devices connected to a broadcast network “data link”, whereas IP is a routable protocol and can target devices on remote networks.

以太网仅在连接到广播网络“数据链路”的网络设备之间的本地级别工作,而IP是可路由的协议,并且可以定位到远程网络上的设备。

The requirements for each of these layers is different. Ethernet specifies a family of technologies that allow packets to be sent and received between network devices, whereas IP defines a protocol that allows packets of data to traverse multiple networks.

这些层中的每一层的要求都不同。 以太网指定了一系列技术,允许在网络设备之间发送和接收数据包,而IP定义了一种协议,该协议允许数据包穿越多个网络。

Neither is reliant on the other, which is what gives networking its flexibility. For example, you may choose to connect to your Internet service using IP over Ethernet, but in your internal network, you might choose to use IP over paper (where someone writes down the contents of each packet and physically walks it over to another machine and types it in). Clearly this would not be particularly fast, but it would still be IP provided the person carrying around the bits of paper respected IP routing rules.

两者都不依赖对方,这就是赋予网络灵活性的原因。 例如,您可以选择使用基于以太网的IP连接到Internet服务,但是在内部网络中,您可以选择使用基于纸的IP(有人写下每个数据包的内容,然后将其物理地传递到另一台计算机,然后输入)。 显然,这不是特别快,但是如果携带随身携带的纸张遵守IP路由规则的人,那将仍然是IP。

In the real world there are different data link protocols that you are already using (although their addressing schemes are the same): 802.3 – Ethernet, and 802.11 – Wi-Fi.

在现实世界中,您已经在使用不同的数据链路协议(尽管它们的寻址方案是相同的):802.3 –以太网,以及802.11 – Wi-Fi。

IP does not care what the underlying layer is. Equally, IP can be swapped out for different network layer protocols (provided it happens for all participants) such as Asynchronous Transfer Mode (ATM).

IP不在乎底层是什么。 同样,可以将IP换成不同的网络层协议(前提是所有参与者都可以使用),例如异步传输模式(ATM)

While there is nothing directly preventing the creation of a protocol that encompasses both Layers 2 and 3, it would be less flexible, less attractive, and therefore unlikely to be used.

尽管没有什么可以直接阻止同时包含第2层和第3层的协议的创建,但是它的灵活性,吸引力都将降低,因此不太可能被使用。

Make sure to read through the rest of the lively discussion thread via the link below!

确保通过下面的链接通读其余的热烈讨论线程!



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/201412/why-are-ethernetmac-addresses-needed/

mac地址 和以太网地址

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值