识别无偿 ARP

网络工程 以太网 协议论 ARP 播送
2022-02-08 04:39:11

我想识别一个免费的 ARP。

我可以说:如果发送方IP地址和目标IP地址相等,它总是一个免费的ARP吗?

1个回答

您可以通过查看 ARP 发送方协议地址和 ARP 目标协议地址来识别免费 ARP,因此正如您提到的,当它们相同时,它就是免费 ARP。请参阅RFC 2002,第 4.6 节以获取参考(重点 -!!!!>并且<!!!!是我的)...

      4.6. ARP, Proxy ARP, and Gratuitous ARP

      <...>

      A Gratuitous ARP [23] is an ARP packet sent by a node in order to
      spontaneously cause other nodes to update an entry in their ARP
      cache.  A gratuitous ARP MAY use either an ARP Request or an ARP
      Reply packet.  In either case, the (!!!!>) ARP Sender Protocol Address
      and ARP Target Protocol Address are both set to the IP address
      of the cache entry to be updated (<!!!!), and the ARP Sender Hardware
      Address is set to the link-layer address to which this cache
      entry should be updated.  When using an ARP Reply packet, the
      Target Hardware Address is also set to the link-layer address to
      which this cache entry should be updated (this field is not used
      in an ARP Request packet).

      In either case, for a gratuitous ARP, the ARP packet MUST be
      transmitted as a local broadcast packet on the local link.  As
      specified in [16], any node receiving any ARP packet (Request or
      Reply) MUST update its local ARP cache with the Sender Protocol
      and Hardware Addresses in the ARP packet, if the receiving node
      has an entry for that IP address already in its ARP cache.  This
      requirement in the ARP protocol applies even for ARP Request
      packets, and for ARP Reply packets that do not match any ARP
      Request transmitted by the receiving node [16].