Dynamic ARP entries are automatically generated and maintained when ARP packets are sent and received. They can be aged, updated, or overwritten by Static ARP entries.
Dynamic ARP applies to complex networks that transmit delay-sensitive services.
Dynamic ARP broadcasts ARP Request packets and unicasts ARP Reply packets to complete address resolution.
In Figure 1, Host_1 and Host_3 are on the same network segment, and Host_1 needs to communicate with Host_3.
In Figure 1, Host_1 and Host_4 are on different network segments, and a default gateway address (the Router's IP address) has been set on Host_1. If Host_1 and Host_4 need to communicate, Host_1 must first discover the Router's MAC address. The process for Host_1 to learn the Router's MAC address and for the Router to learn Host_4's MAC address is similar to that between Host_1 and Host_3. When the data packet from Host_1 arrives at the Router, the Router forwards the packet to Host_4.
In Figure 1, if Host_1 broadcasts an ARP Request packet every time it sends data to Host_3, network communication traffic will greatly increase. Furthermore, all other hosts on the network have to receive and process the ARP Request packets, which lowers network efficiency. To resolve this problem, each host or device maintains a high-speed cache that stores the recently learned IP-to-MAC mappings (namely, dynamic ARP entries).
A host or device first queries the local high-speed cache for the IP-to-MAC mappings every time it sends a packet. If the MAC address is found, the host or device no longer sends an ARP Request packet but directly sends the data packet to the MAC address. If the MAC address is not found, the host or device broadcasts an ARP Request packet for address resolution.
Devices age and update dynamic ARP entries to ensure that the capacity limit of the ARP tables is not exceeded and that the ARP entries in the table are correct.
The aging parameters of a dynamic ARP entry include the aging time, number of aging probe attempts, and aging probe mode. After the aging time of a dynamic ARP entry expires, the device sends an aging probe packet (ARP Request packet) to detect whether the peer device is present. If the device receives an ARP Reply packet, it updates this dynamic ARP entry. If the device does not receive an ARP Reply packet, it deletes the dynamic ARP entry.
The aging probe packet can be a unicast or broadcast packet. By default, the device only broadcasts the last ARP aging probe packet to the peer host or device, and unicasts other ARP aging probe packets. When the MAC address of the peer device is fixed, an interface can be configured to unicast ARP aging probe packets.
If the interface goes Down, the device immediately deletes the interface's dynamic ARP entries.
The length of an ARP packet is 42 bytes. The first 14 bytes represent an Ethernet frame header, and the last 28 bytes contain the ARP packet information.
Figure 2 shows the format of an ARP packet.
Table 1 describes the fields within an ARP packet.
Field |
Length |
Description |
---|---|---|
Ethernet destination MAC |
48 bits |
Ethernet destination MAC address. This field in an ARP Request packet is the broadcast address 0xffff-ffff-ffff. |
Ethernet source MAC |
48 bits |
Ethernet source MAC address. |
Frame type |
16 bits |
Data type. The value of this field is 0x0806 for an ARP Request or Reply packet. |
Hardware type |
16 bits |
Type of the hardware address. The value of this field is 1 for an Ethernet. |
Protocol type |
16 bits |
Type of the protocol address to be mapped on the sender. The value of this field is 0x0800 for an IP address. |
Hardware address length |
8 bits |
Hardware address length. The value of this field is 6 for an ARP Request or Reply packet. |
Protocol address length |
8 bits |
Protocol address length. The value of this field is 4 for an ARP Request or Reply packet. |
OP |
16 bits |
Operation type. The values are as follows:
|
Source MAC |
48 bits |
Source MAC address. The value of this field is the same as the Ethernet source MAC address in the Ethernet frame header. |
Source IP |
32 bits |
Source IP address. |
Destination MAC |
48 bits |
Destination MAC address. The value of this field in an ARP Request packet is 0x0000-0000-0000. |
Destination IP |
32 bits |
Destination IP address. |