当我们可以从以太网标头中提取回复/请求 ARP 数据包中的 MAC 地址时,它有什么用
我很困惑为什么我们需要 ARP 数据包中的 MAC 地址,而我们可以从以太网标头中提取它。只需保留 IP 地址和其他字段不变,并删除 MAC 地址即可。我们可以从以太网中提取它们。我的想法中遗漏了一些东西。
谢谢。
I am getting confused why do we require mac addresses in ARP packet, when we can extract it from ethernet header. Just keep the IP addresses and other fields as they are and remove the MAC address. We can extract them from ethernet. AM I missing something in my thinking.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ARP 数据包正文中没有 MAC 地址将导致(至少)以下情况:
ARP 无法通过 L2 网桥:网桥需要转发传入的 ARP 请求,并将自己的出接口的 MAC 放入 L2 协议头的源字段中。回复(除非广播)将被发送至网桥本身而不被转发。 (参见此处查看表格,显示和比较 ARP 消息的 L2 和 L3 字段。)
任何 ARP 实现都依赖于底层 MAC 协议:接收 ARP 消息的代码需要有关在哪里查找源 MAC 地址的信息MAC 层,并且此信息必须可由 ARP 代码访问。
Not having MAC addresses in the ARP packet body would result in (at least) the following:
ARP would not work over L2 bridge: the bridge needs to forward incoming ARP request putting MAC of own outgoing interface in the source field of the L2 protocol header. Replies (unless broadcasted) would be destined to the bridge itself and not forwarded. (See here for the table, showing and comparing L2 and L3 fields of ARP messages.)
Any ARP implementation would be dependent on the underlying MAC protocol: the code receiving ARP messages would need information about where to look for the source MAC address in the MAC layer, and this information must be accessible by the ARP code.
ARP 请求以广播目标 MAC 地址和发送者的 MAC 地址作为源 MAC 地址发出。这是因为发送者不知道目标 MAC 地址并且正在询问它。广播目标 MAC 地址可确保 LAN 上的每个主机都会收到请求。
ARP 回复以原始发送者的地址作为目的地址,这样回复只会到达原始发送者,而不会打扰 LAN 上的所有主机。
An ARP request goes out with the broadcast destination MAC address and the sender's MAC address as the source MAC address. This is because the sender doesn't know the destination MAC address and is asking for it. The broadcast destination MAC address makes sure that every host on the LAN will receive the request.
The ARP reply has the original sender's address as the destination address so that the reply only goes to the original sender, and it doesn't bother all the hosts on the LAN.