6
4

2 回答 2

4

Internet 主机的 RFC1122 要求对此进行了讨论。

     2.3.2.1  ARP Cache Validation

        An implementation of the Address Resolution Protocol (ARP)
        [LINK:2] MUST provide a mechanism to flush out-of-date cache
        entries.  If this mechanism involves a timeout, it SHOULD be
        possible to configure the timeout value.

      ...

       DISCUSSION:
             The ARP specification [LINK:2] suggests but does not
             require a timeout mechanism to invalidate cache entries
             when hosts change their Ethernet addresses.  The
             prevalence of proxy ARP (see Section 2.4 of [INTRO:2])
             has significantly increased the likelihood that cache
             entries in hosts will become invalid, and therefore
             some ARP-cache invalidation mechanism is now required
             for hosts.  Even in the absence of proxy ARP, a long-
             period cache timeout is useful in order to
             automatically correct any bad ARP data that might have
             been cached.

网络可以是非常动态的;当旧的租用时间到期时(使当前的 ARP 数据无效),DHCP 服务器可以将相同的 IP 地址分配给不同的计算机,可能存在除非定期发出 ARP 请求,否则永远不会注意到的 IP 冲突等。

它还提供了一种检查主机是否仍在网络上的机制。假设您正在通过 UDP 将视频流式传输到某个 IP 地址 192.168.0.5。如果你永远缓存那台机器的 MAC 地址,即使主机出现故障,你也会继续发送垃圾邮件 UDP 数据包。时不时地执行 ARP 请求将停止流并出现目的地不可达错误,因为没有人响应该 IP 的 MAC。

于 2013-03-19T20:10:45.853 回答
2

它起源于对路由协议的不信任,尤其是在非以太网世界(尤其是 MIT 的 CHAOS 网络)。早期“ARPAnauts”之一的 Chris Moon 在原始 ARP RFC 中专门引用了这一点。

当然,您可以通过主动广播您自己的 ARP 公告来防止其他人的 ARP 缓存超时。大多数以太网层将在其缓存中接受无偿的 ARP 响应,而不会尝试将它们与之前发送的 ARP 请求相关联。

于 2013-03-15T22:39:43.020 回答