Address Resolution Protocol

ARP determines a host's MAC address when the IP address is known. For example, to ping one device from another, the Layer 2 MAC fields require a destination MAC address. Because this is the first such request, a broadcast packet is sent across the wire to discover the remote host's MAC address. Figure 1-11 displays a scenario where PC1 wants to ping Host PC2.

Figure 1-11 ARP Request

IP address 1.1.1.3

MAC address 3333.3333.3333

IP address 1.1.1.3

MAC address 3333.3333.3333

IP address 1.1.1.1

MAC address 1111.1111.1111

IP address 1.1.1.2

MAC address 2222.2222.2222

IP address 1.1.1.1

MAC address 1111.1111.1111

IP address 1.1.1.2

MAC address 2222.2222.2222

When PC1 sends a ping request to PC2 using the known IP address 1.1.1.2 (Layer 3), a broadcast Layer 2 frame must first be sent by PC1; without a Layer 2 MAC address, PC1 cannot communicate with PC2. PC1 will then send a Layer 2 frame to the destination address FF-FF-FF-FF-FF-FF, and ARP (the ARP frame contains the source MAC address, destination MAC address, the source IP address, and the destination address) is sent to all devices requesting the Layer 2

MAC address of the device configured with the IP address 1.1.1.2 (by sending a Layer 2 broadcast frame). PC2 responds to the ARP request with its source MAC address, 2222.2222.2222. PC1 now has PC2's MAC address and sends a packet to the destination address, 2222.2222.2222, and Layer 3 destination address, 1.1.1.2.

NOTE A less common ARP term used in ARP terminology is gratuitous ARP. A gratuitous ARP is an ARP request with its own IP address as the target address. It refreshes a device's ARP table entries and also looks up duplicate IP addresses. Routers are devices that can send a gratuitous ARP.

To view the IP ARP table on a Cisco router, the command is show ip arp. The IP ARP table from Figure 1-11 is displayed in Example 1-2.

Example 1-2 show ip arp Command on Router A

RouterA#show ip arp

Protocol

Address

Age (min)

Hardware Addr

Type

Interface

Internet

1.1.1.3

3333.3333.3333

ARPA

Ethernet0

Internet

1.1.1.1

170

1111.1111.1111

ARPA

Ethernet0

Internet

1.1.1.2

94

2222.2222.2222

ARPA

Ethernet0

NOTE If you have ever wondered why the first ping request on a Cisco router fails, it is because an ARP request is sent first when an entry is not present in the ARP table. Subsequent pings will have 100 percent success.

0 0

Post a comment