xkonekt
Language: EN
  • English
  • Türkçe
  • Español, Coming soon
  • Português, Coming soon
  • Deutsch, Coming soon
  • Français, Coming soon

Ethernet and switching · Introduction · Module 3

ARP: from IP address to MAC address

Show topologyHide topology
H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.533010.0.1.0/2410.0.1.0/2410.0.2.0/24Et0/0.10Et0/1Et0/2eth0.20Et0/0Et0/0.1Et0/1.1eth0.30Et0/0 = Ethernet0/0.1 = the last number of the addressSW1’s three cables are one network

Interfaces and addresses · MAC addresses are written as IOS prints them.

  • 10.0.1.0/24SW1 Et0/0R1 Et0/0 10.0.1.1 aabb.cc00.0200
  • 10.0.1.0/24SW1 Et0/1H1 Et0/0 10.0.1.10 aabb.cc00.0300
  • 10.0.1.0/24SW1 Et0/2H2 eth0 10.0.1.20 5254.0000.5320
  • 10.0.2.0/24R1 Et0/1 10.0.2.1 aabb.cc00.0210H3 eth0 10.0.2.30 5254.0000.5330
Topology · SW1 joins H1, H2 and R1 in one network, 10.0.1.0/24; R1 joins it to H3’s network, 10.0.2.0/24.

Five device icons joined by four plain cables. At the top the host H1, MAC address aabb.cc00.0300: its Et0/0, address ending .10, is cabled down to the switch SW1’s Et0/1. To the right of SW1, the host H2, MAC address 5254.0000.5320: its eth0, address ending .20, is cabled to SW1’s Et0/2. Under SW1, the router R1: its Et0/0, address ending .1, is cabled up to SW1’s Et0/0. SW1’s three cables are one network, 10.0.1.0/24; SW1 has no address of its own, and its fourth port, Et0/3, has no cable. At the bottom the host H3, MAC address 5254.0000.5330: its eth0, address ending .30, is cabled up to R1’s Et0/1, address ending .1, in the network 10.0.2.0/24. The list under the drawing gives each end in full, with R1’s two MAC addresses.

What ARP is

The MAC address of the next device

Whose MAC address the sender needs

H1 has a packet for H3, a host in another network. Before the packet can leave, H1 must write a destination MAC address in the frame. Whose address goes there?

Not H3’s, because a frame travels across one network only. For a frame to one device, its destination MAC address must belong to the device on the sender’s own network that takes the packet next.

To find that device, H1, at 10.0.1.10/24, compares the network part of the destination with its own, under its mask. If they are equal, the packet goes directly to the destination host. H2, at 10.0.1.20, is in H1’s network, so H1 needs H2’s MAC address.

If they differ, as for H3’s 10.0.2.30, the destination can be reached only through a router. A host with one network sends its packets for other networks through one on its own network; that router’s address there is its default gateway. For H1 and H2 that is 10.0.1.1, R1’s Ethernet0/0 (Et0/0, Figure 3.1). The device you are reading this on most likely has one too.

For a host in another network, H1 needs its gateway’s MAC address, not the far host’s.

H1hostSW1switchH2hostR1routerH3hostto H2: same networkframe to H2’s MACto H3: another networkframe to R1’s MAC
Figure 3.1 · Same network: H1 needs H2’s MAC address. Another network: H1 needs its gateway’s, R1’s.

The network: H1 at the top, SW1 under it, H2 to its right, R1 under SW1 and H3 at the bottom. Arrows beside the cables go from H1 down to SW1, from SW1 across to H2 and from SW1 down to R1. A note right of the H1 cable reads “to H2: same network, frame to H2’s MAC”. A highlighted note beside the cable from SW1 to R1 reads “to H3: another network, frame to R1’s MAC”.

H1 knows the IP address of the device it needs, 10.0.1.20 or 10.0.1.1, but not its MAC address. ARP, the Address Resolution Protocol, is how a device asks on its own network which MAC address belongs to an IPv4 address.

H1 has a packet for 10.0.2.30 (H3). Which IP address does H1 ask ARP about?

One question to everyone, one answer to the asker

H1 knows H2’s IP address, 10.0.1.20. How does it learn H2’s MAC address?

It asks, with an ARP request: “Who has 10.0.1.20? Tell 10.0.1.10.” The request carries H1’s own IP and MAC addresses. It is a frame to the broadcast address ffff.ffff.ffff, so it goes to every device on the network.

Normally only the device that has 10.0.1.20 answers. Its ARP reply says “10.0.1.20 is at 5254.0000.5320.” H2 read H1’s MAC address in the request, so it sends the reply straight to H1, not as a broadcast (Figure 3.2).

ARP requestto everyoneffff.ffff.fffftype0806 (ARP)Who has 10.0.1.20? Tell 10.0.1.10.Sent by H1, from aabb.cc00.0300ARP replyto H1’s MACaabb.cc00.0300type0806 (ARP)10.0.1.20 is at 5254.0000.5320.Sent by H2
Figure 3.2 · The request goes to everyone and carries the asker’s addresses. The reply goes straight back to the asker.

Two messages, one under the other. “ARP request”: to everyone, ffff.ffff.ffff; type 0806 (ARP); the message “Who has 10.0.1.20? Tell 10.0.1.10.”, sent by H1, from aabb.cc00.0300. “ARP reply”, with its destination highlighted: to H1’s MAC, aabb.cc00.0300; type 0806 (ARP); the message “10.0.1.20 is at 5254.0000.5320.”, sent by H2.

Both ends keep what they learned. H1 writes 10.0.1.20 with 5254.0000.5320 in its ARP cache, its list of IP-to-MAC pairs. H2 keeps H1’s pair too, taken from the request. Each entry is kept for a time, then refreshed or removed, so a pair that has changed is learned again.

Key idea

ARP asks everyone; normally only the device that has the address answers, straight to the asker, and both keep the pair.

Who receives H1’s ARP request for 10.0.1.20?

How it works

The first two pings

H1’s first ping to H2

H1 has not sent a packet to H2 yet. It tests H2 with ping, a command that sends test packets and counts the replies. What happens before any test packet can go?

H1 must first learn H2’s MAC address, because 10.0.1.20 is in H1’s own network. H1 tested H3 before H2, so its ARP cache already holds its gateway’s line. show ip arp prints the cache.

On H1, before the test to H2:

Two lines, and no line for 10.0.1.20.

Output · IOS XE 17.18.2
H1#show ip arp1Protocol InternetAddress 10.0.1.1Age (min) 0Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/02Protocol InternetAddress 10.0.1.10Age (min) -Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0
  1. R1, its gateway, at aabb.cc00.0200. Age is how many minutes old the entry is.
  2. Here, a line with Age - is the device’s own address, so this is H1’s.
Full output · 3 lines
H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                0   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0

So H1 broadcasts the question “Who has 10.0.1.20?” SW1 floods it out of every other port that is up, to H2 and R1. R1 sees that the address is not its own and adds no new entry.

H2 sees its own address in the request. How does it send its answer?

H2 answers “10.0.1.20 is at 5254.0000.5320” straight to H1’s MAC address and keeps H1’s pair from the request (Figure 3.3).

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerrequestrequestrequestreplyreplyrequest, to everyone, ffff.ffff.ffffWho has 10.0.1.20? Tell 10.0.1.10.reply, to H1’s MAC only10.0.1.20 is at 5254.0000.5320.
Figure 3.3 · H1’s request goes to everyone on its network; H2’s reply goes straight back to H1.

H1 at the top with its MAC address aabb.cc00.0300, SW1 under it, H2 to the right of SW1 with 5254.0000.5320, and R1 under SW1, joined by plain cables. Arrows marked “request” go beside the cables from H1 down to SW1 and on to both H2 and R1. Arrows marked “reply” go on the other side of the cables, from H2 to SW1 and up to H1. Under the drawing two notes, the first “request, to everyone, ffff.ffff.ffff” over “Who has 10.0.1.20? Tell 10.0.1.10.”, and, highlighted, “reply, to H1’s MAC only” over “10.0.1.20 is at 5254.0000.5320.”

A debug makes a device print lines about what it does. During the test H1 had debug arp on. show logging | begin IP ARP lists those lines, from the first one that holds IP ARP.

On H1, the lines its debug printed during the test:

Output · IOS XE 17.18.2
H1#show logging | begin IP ARP1IP ARP: creating incomplete entry for IP address: 10.0.1.20 interface Ethernet0/0 tableid 0… 1 more line (see Full output)2IP ARP: sent req src 10.0.1.10 aabb.cc00.0300,2                 dst 10.0.1.20 0000.0000.0000 Ethernet0/03IP ARP: rcvd rep src 10.0.1.20 5254.0000.5320, dst 10.0.1.10 Ethernet0/0 tableid 0… 1 more line (see Full output)
  1. creating incomplete entry: H1 opens a line for 10.0.1.20 before it has an answer.
  2. sent req, the request, from 10.0.1.10 aabb.cc00.0300. Its second line names the address asked for; the MAC address there is all zeros because H1 does not know it yet.
  3. rcvd rep, H2’s reply, from 10.0.1.20 5254.0000.5320, to 10.0.1.10, in on H1’s Ethernet0/0. tableid 0 is an internal table number.
Full output · 6 lines
H1#show logging | begin IP ARPIP ARP: creating incomplete entry for IP address: 10.0.1.20 interface Ethernet0/0 tableid 0 In ip_arp_sendrequest_internal: ELse case using src: 10.0.1.10IP ARP: sent req src 10.0.1.10 aabb.cc00.0300,                 dst 10.0.1.20 0000.0000.0000 Ethernet0/0IP ARP: rcvd rep src 10.0.1.20 5254.0000.5320, dst 10.0.1.10 Ethernet0/0 tableid 0IP ARP: rcvd rep src 10.0.1.20 5254.0000.5320, dst 10.0.1.10 Ethernet0/0 tableid 0

Impact A debug uses system resources. Keep it on for a few seconds only, then turn it off again.

R1 had debug arp on too. Did it answer?

On R1, during H1’s test to H2:

Output · IOS XE 17.18.2
R1#show logging | begin IP ARP1IP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.20 Ethernet0/0 tableid 0… 1 more line (see Full output)
  1. rcvd req, H1’s request for 10.0.1.20, in on R1’s Ethernet0/0 (R1 logged it twice; the repeat is left out). No sent rep line follows, so R1 sent no reply.
Full output · 2 lines
R1#show logging | begin IP ARPIP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.20 Ethernet0/0 tableid 0IP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.20 Ethernet0/0 tableid 0

With the pair in its cache, H1 sends its test packets in frames to H2’s MAC address, and SW1 forwards them out of H2’s port only. H1’s ping sent five test packets; each ! is one that got a reply.

On H1:

Output · IOS XE 17.18.2
H1#ping 10.0.1.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.20, timeout is 2 seconds:1.!!!!2Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
  1. The first dot (.): the first test packet got no answer while H1 waited for the ARP reply.
  2. 80 percent, because H2 replied to the other four.

Key idea

On its own network H1 asks for the destination itself: a broadcast question, an answer straight back, then the packet.

H1’s first ping to H3, through R1

H1’s first test went to H3, in the other network, before the test to H2. Whose MAC address did H1 ask for?

Only its gateway’s, R1’s, because 10.0.2.30 is in another network. During this test, H1 and R1 both had debug arp on.

On H1, before its first test to H3:

One line, H1’s own address.

Output · IOS XE 17.18.2
H1#show ip arpProtocol InternetAddress 10.0.1.10Age (min) -Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0
Full output · 2 lines
H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0

Step through the test in Figure 3.4.

Step 1 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.533010.0.2.30: another networkto the gateway 10.0.1.1

10.0.2.30 is not in H1’s network, so the packet goes to H1’s default gateway, 10.0.1.1. H1’s cache holds only its own address.

Step 2 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.5330Who has 10.0.1.1?to everyone, flooded

H1 broadcasts “Who has 10.0.1.1?”, the gateway’s address, not H3’s. SW1 floods the request to R1 and H2.

Step 3 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.533010.0.1.1 is ataabb.cc00.0200

R1 answers with its Et0/0 MAC address, aabb.cc00.0200, and keeps H1’s pair.

Step 4 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.5330frame to R1’s MACpacket still to 10.0.2.30

H1 sends a test packet in a frame to R1’s MAC address. Inside, the packet is still addressed to 10.0.2.30. R1’s cache has no line for 10.0.2.30 yet.

R1 now has the packet for 10.0.2.30. What does R1 do before it can send the packet on?

  • It asks “Who has 10.0.2.30?” out of Et0/1. (Correct): 10.0.2.30 is on R1’s other network. R1 needs H3’s MAC address for the new frame, so R1 asks for 10.0.2.30 out of Ethernet0/1.
  • It sends H1’s frame on to H3 unchanged.: A frame stays on one network. R1 puts the packet in a new frame for H3’s network, and for that it needs H3’s MAC address.
  • It passes H1’s ARP request on to H3’s network.: H1’s request asked for 10.0.1.1 and stopped at R1. For H3, R1 sends a request of its own, out of Et0/1.
  • It sends the packet to ffff.ffff.ffff out of Et0/1.: The packet is for one host. R1 broadcasts only its ARP request, then sends the packet in a frame to H3’s MAC address.

Step 5 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.5330frame to R1’s MACpacket still to 10.0.2.30Who has 10.0.2.30?H3 answers R1

R1 needs H3’s MAC address on its other network. It asks “Who has 10.0.2.30?” out of Et0/1, and H3 answers.

Step 6 of 6

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.5330first frameto R1, aabb.cc00.0200second frameto H3, 5254.0000.5330

R1 puts the packet in a new frame, to H3’s MAC address. Two ARP exchanges, one on each network, came before a test packet could go end to end.

Step 1 of 6

H1 at the top with its MAC address aabb.cc00.0300, SW1 under it, H2 to its right, R1 under SW1 and H3 at the bottom with 5254.0000.5330, joined by plain cables. At step 1 a note reads “10.0.2.30: another network, to the gateway 10.0.1.1”. At step 2 arrows beside the cables go from H1 to SW1 and on to both R1 and H2, and the note reads “Who has 10.0.1.1?” over “to everyone, flooded”. At step 3 arrows go from R1 up to SW1 and on to H1, and the note reads “10.0.1.1 is at aabb.cc00.0200”. At step 4 arrows go from H1 to SW1 and on to R1, and the note reads “frame to R1’s MAC, packet still to 10.0.2.30”. At step 5, beside the cable from R1 to H3, an arrow goes down and an arrow up, and a note under R1 reads “Who has 10.0.2.30? H3 answers R1”. At step 6 arrows go from H1 to R1 and from R1 to H3, and the notes read “first frame, to R1, aabb.cc00.0200” and “second frame, to H3, 5254.0000.5330”.

Figure 3.4 · H1’s first test to H3, through R1.10.0.2.30 is not in H1’s network, so the packet goes to H1’s default gateway, 10.0.1.1. H1’s cache holds only its own address.Debug line at this stepIP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.1 Ethernet0/0 tableid 0H1 broadcasts “Who has 10.0.1.1?”, the gateway’s address, not H3’s. SW1 floods the request to R1 and H2.Debug lines at this stepIP ARP: creating entry for IP address: 10.0.1.10, hw: aabb.cc00.0300 tableid 0IP ARP: sent rep src 10.0.1.1 aabb.cc00.0200, dst 10.0.1.10 aabb.cc00.0300 Ethernet0/0R1 answers with its Et0/0 MAC address, aabb.cc00.0200, and keeps H1’s pair.H1 sends a test packet in a frame to R1’s MAC address. Inside, the packet is still addressed to 10.0.2.30. R1’s cache has no line for 10.0.2.30 yet.Debug lines at this stepIP ARP: creating incomplete entry for IP address: 10.0.2.30 interface Ethernet0/1 tableid 0IP ARP: sent req src 10.0.2.1 aabb.cc00.0210, dst 10.0.2.30 0000.0000.0000 Ethernet0/1IP ARP: rcvd rep src 10.0.2.30 5254.0000.5330, dst 10.0.2.1 Ethernet0/1 tableid 0R1 needs H3’s MAC address on its other network. It asks “Who has 10.0.2.30?” out of Et0/1, and H3 answers.R1 puts the packet in a new frame, to H3’s MAC address. Two ARP exchanges, one on each network, came before a test packet could go end to end.

On R1, the lines its debug printed during H1’s first test to H3, each with its step:

Lines appear as you step through.

Output · IOS XE 17.18.2
R1#show logging | begin IP ARP2IP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.1 Ethernet0/0 tableid 03IP ARP: creating entry for IP address: 10.0.1.10, hw: aabb.cc00.0300 tableid 03IP ARP: sent rep src 10.0.1.1 aabb.cc00.0200,3                 dst 10.0.1.10 aabb.cc00.0300 Ethernet0/0… 3 more lines (see Full output)5IP ARP: creating incomplete entry for IP address: 10.0.2.30 interface Ethernet0/1 tableid 0… 1 more line (see Full output)5IP ARP: sent req src 10.0.2.1 aabb.cc00.0210,5                 dst 10.0.2.30 0000.0000.0000 Ethernet0/15IP ARP: rcvd rep src 10.0.2.30 5254.0000.5330, dst 10.0.2.1 Ethernet0/1 tableid 0
Full output · 12 lines
R1#show logging | begin IP ARPIP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.1 Ethernet0/0 tableid 0IP ARP: creating entry for IP address: 10.0.1.10, hw: aabb.cc00.0300 tableid 0IP ARP: sent rep src 10.0.1.1 aabb.cc00.0200,                 dst 10.0.1.10 aabb.cc00.0300 Ethernet0/0IP ARP: rcvd req src 10.0.1.10 aabb.cc00.0300, dst 10.0.1.1 Ethernet0/0 tableid 0IP ARP: sent rep src 10.0.1.1 aabb.cc00.0200,                 dst 10.0.1.10 aabb.cc00.0300 Ethernet0/0IP ARP: creating incomplete entry for IP address: 10.0.2.30 interface Ethernet0/1 tableid 0 In ip_arp_sendrequest_internal: ELse case using src: 10.0.2.1IP ARP: sent req src 10.0.2.1 aabb.cc00.0210,                 dst 10.0.2.30 0000.0000.0000 Ethernet0/1IP ARP: rcvd rep src 10.0.2.30 5254.0000.5330, dst 10.0.2.1 Ethernet0/1 tableid 0

After its answer to H1, R1 asks for 10.0.2.30 out of Ethernet0/1, and rcvd rep is H3’s answer, 5254.0000.5330.

On H1, during the same test:

Output · IOS XE 17.18.2
H1#show logging | begin IP ARPIP ARP: creating incomplete entry for IP address: 10.0.1.1 interface Ethernet0/0 tableid 0… 1 more line (see Full output)IP ARP: sent req src 10.0.1.10 aabb.cc00.0300,                 dst 10.0.1.1 0000.0000.0000 Ethernet0/01IP ARP: rcvd rep src 10.0.1.1 aabb.cc00.0200, dst 10.0.1.10 Ethernet0/0 tableid 0… 1 more line (see Full output)
  1. R1’s answer: 10.0.1.1 is at aabb.cc00.0200.

H1 asked only for its gateway, 10.0.1.1. No line names 10.0.2.30.

Full output · 6 lines
H1#show logging | begin IP ARPIP ARP: creating incomplete entry for IP address: 10.0.1.1 interface Ethernet0/0 tableid 0 In ip_arp_sendrequest_internal: ELse case using src: 10.0.1.10IP ARP: sent req src 10.0.1.10 aabb.cc00.0300,                 dst 10.0.1.1 0000.0000.0000 Ethernet0/0IP ARP: rcvd rep src 10.0.1.1 aabb.cc00.0200, dst 10.0.1.10 Ethernet0/0 tableid 0IP ARP: rcvd rep src 10.0.1.1 aabb.cc00.0200, dst 10.0.1.10 Ethernet0/0 tableid 0

On H1, the test to H3:

Output · IOS XE 17.18.2
H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:1.!!!!2Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/3 ms
  1. The first dot (.): the first test packet got no answer while H1 and R1 waited for their ARP replies.
  2. 80 percent, because H3 replied to the other four.

Use the steps of Figure 3.4. Step 1 is done for you; choose step 2 and step 3.

H2 (10.0.1.20, default gateway 10.0.1.1) has a packet for H3 and an empty ARP cache. Step 1: is 10.0.2.30 in H2’s network? No. Step 2: which address does H2 ask ARP about? Step 3: what is the frame’s destination MAC address?

Key idea

For another network the host asks only for its gateway’s MAC address. The router then asks, on its next network, for the next device’s MAC address.

Verify

Read H1’s and R1’s ARP caches

After both tests, what does H1’s ARP cache hold?

Its own address and the two it asked about, 10.0.1.1 and 10.0.1.20, so expect three lines. H3 is not among them; H1 never asked for it.

show ip arp lists the cache, one line per IP address, with its MAC address in the Hardware Addr column.

On H1, after its tests to H2 and H3:

Tap a line, or “Not in the output”, then submit.

Find the line whose MAC address H1 writes in its frames for packets to H3 (10.0.2.30).

Output · IOS XE 17.18.2
H1#show ip arp

Three lines, as expected.

  1. R1, the gateway, at aabb.cc00.0200 on Ethernet0/0. Packets for H3 leave in frames to this MAC address.
  2. Here, a line with Age - is the device’s own address, so this is H1’s.
  3. H2, at 5254.0000.5320, in H1’s own network. No line follows for 10.0.2.30.
Full output · 4 lines
H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                0   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.1.20               0   5254.0000.5320  ARPA   Ethernet0/0

A route is one network and the way to send packets for it. H1’s default gateway is set as a default route, ip route 0.0.0.0 0.0.0.0 10.0.1.1, for network 0.0.0.0 with mask 0.0.0.0, which matches any destination. IOS, H1’s and R1’s software, calls 10.0.1.1 the gateway of last resort, and show ip route | include Gateway prints only the line that holds Gateway.

On H1:

Output · IOS XE 17.18.2
H1#show ip route | include Gateway1Gateway of last resort is 10.0.1.1 to network 0.0.0.0
  1. Gateway of last resort is 10.0.1.1, H1’s default gateway, for the default route to 0.0.0.0.

R1 keeps one ARP cache for both its networks.

On R1, after H1’s test to H3:

Output · IOS XE 17.18.2
R1#show ip arpProtocol InternetAddress 10.0.1.1Age (min) -Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/01Protocol InternetAddress 10.0.1.10Age (min) 0Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.2.1Age (min) -Hardware Addr aabb.cc00.0210Type ARPAInterface Ethernet0/12Protocol InternetAddress 10.0.2.30Age (min) 0Hardware Addr 5254.0000.5330Type ARPAInterface Ethernet0/1
  1. H1: aabb.cc00.0300, learned on Ethernet0/0 from H1’s request.
  2. H3: 5254.0000.5330, learned on Ethernet0/1 from H3’s reply.

R1 keeps H1 on Ethernet0/0 and H3 on Ethernet0/1, plus its own two addresses.

Full output · 5 lines
R1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                -   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               0   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.2.1                -   aabb.cc00.0210  ARPA   Ethernet0/1Internet  10.0.2.30               0   5254.0000.5330  ARPA   Ethernet0/1

A learned entry stays up to the ARP timeout of its interface, which the ARP line of show interfaces prints.

On R1, for Ethernet0/0:

Output · IOS XE 17.18.2
R1#show interfaces Ethernet0/0 | include ARP  Encapsulation ARPA, loopback not set1  ARP type: ARPA, ARP Timeout 04:00:00
  1. ARP Timeout 04:00:00, four hours. R1 keeps an entry learned on Ethernet0/0 for up to that time.

Key idea

show ip arp lists the device’s own addresses and the addresses it has recently asked about or learned from a request for one of its own addresses. For other networks, a host with the right mask normally lists only its gateway.

In R1’s cache, which MAC address does R1 write in its frames to H3?

Troubleshoot

When ARP gets no answer

H1 can have a wrong gateway, or a too-wide mask, one that makes far hosts look like neighbors. Both can end in a request that no device answers. How can you tell them apart?

You tell them apart by whose address gets no answer. Its line in show ip arp reads Incomplete in the Hardware Addr column, a question the device asked and nobody has answered yet.

Case 1 of 2.H1 reaches H2, but nothing in H3’s network

  1. Case 1 · Symptom

    H1 tests H3 and gets no reply.

    Output · IOS XE 17.18.2
    H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
    1. 0 percent: not one of the five test packets got a reply.
  2. Case 1 · Command

    H1’s ARP cache shows whose MAC address is missing:

  3. Case 1 · Output

    Output · IOS XE 17.18.2
    H1#show ip arp1Protocol InternetAddress 10.0.1.1Age (min) 1Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.10Age (min) -Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.20Age (min) 0Hardware Addr 5254.0000.5320Type ARPAInterface Ethernet0/02Protocol InternetAddress 10.0.1.254Age (min) 0Hardware Addr IncompleteType ARPAInterface —
    1. R1’s line, 10.0.1.1, is still there.
    2. Key line 10.0.1.254 Incomplete. H1 asked who has 10.0.1.254, and no device answered.
    Full output · 5 lines
    H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                1   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.1.20               0   5254.0000.5320  ARPA   Ethernet0/0Internet  10.0.1.254              0   Incomplete      ARPA   

    H1’s gateway explains why:

    Output · IOS XE 17.18.2
    H1#show ip route | include Gateway1Gateway of last resort is 10.0.1.254 to network 0.0.0.0
    1. Gateway of last resort is 10.0.1.254: H1 sends everything for other networks to 10.0.1.254.
  4. Case 1 · How far it reaches

    Does H1 still reach H2?

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.20, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
    1. 100 percent: H2 replies to every test packet.
  5. Case 1 · What it means

    H1hostSW1switchH2hostR1routerH3hostWho has 10.0.1.254?no device answers
    Figure 3.5 · Case 1 · H1 asks for 10.0.1.254, its wrong gateway; no device has it.

    H1 at the top, SW1 under it, H2 to its right, R1 under SW1 and H3 at the bottom. Arrows beside the cables go from H1 to SW1 and on to both H2 and R1. A highlighted note reads “Who has 10.0.1.254?” over “no device answers”.

    • No device has 10.0.1.254. H1’s request gets no answer, so the line stays Incomplete and H1 has no MAC address to put in a frame for H3.
    • H2 is in H1’s own network. H1 needs no gateway for it, so the test to H2 still works.
  6. Case 1 · Fix

    Give H1 its real gateway in configuration mode, which configure terminal opens:

    Output · IOS XE 17.18.2
    H1#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1H1(config)#no ip route 0.0.0.0 0.0.0.0 10.0.1.2542H1(config)#ip route 0.0.0.0 0.0.0.0 10.0.1.13H1(config)#end
    1. no in front of the wrong route removes it.
    2. The default route: every other network through 10.0.1.1.
    3. end leaves configuration mode.

    Impact Changing the default route changes at once where H1 sends packets for other networks.

  7. Case 1 · Proof

    H1 tests H3 again:

    Output · IOS XE 17.18.2
    H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. 100 percent: H3 replies to every test packet.

End of case 1. Solved: H1 sends packets for H3 to R1 again.

Case 2 of 2.H1 reaches R1, but not H3, and the gateway is right

  1. Case 2 · Symptom

    H1 tests H3 and gets no reply. Its gateway is set right this time.

    Output · IOS XE 17.18.2
    H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
    1. 0 percent: not one of the five test packets got a reply.
  2. Case 2 · Command

    H1’s ARP cache shows whose MAC address is missing:

  3. Case 2 · Output

    Output · IOS XE 17.18.2
    H1#show ip arpProtocol InternetAddress 10.0.1.1Age (min) 0Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.10Age (min) -Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.20Age (min) 0Hardware Addr 5254.0000.5320Type ARPAInterface Ethernet0/01Protocol InternetAddress 10.0.1.254Age (min) 0Hardware Addr IncompleteType ARPAInterface —2Protocol InternetAddress 10.0.2.30Age (min) 0Hardware Addr IncompleteType ARPAInterface —
    1. 10.0.1.254, the wrong gateway set earlier, is still in the cache.
    2. Key line 10.0.2.30 Incomplete. H1 asked for H3 itself, as if H3 were on its own network.
    Full output · 6 lines
    H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                0   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.1.20               0   5254.0000.5320  ARPA   Ethernet0/0Internet  10.0.1.254              0   Incomplete      ARPA   Internet  10.0.2.30               0   Incomplete      ARPA   

    H1’s address and mask show why it thinks so:

    Output · IOS XE 17.18.2
    H1#show ip interface Ethernet0/0 | include Internet address1  Internet address is 10.0.1.10/16
    1. 10.0.1.10/16: a /16 mask, not /24.

    Proxy ARP is a router answering, with its own MAC address, a request for an address it reaches through another interface. On R1, the interface toward H1:

    Output · IOS XE 17.18.2
    R1#show ip interface Ethernet0/0 | include Proxy ARP1  Proxy ARP is disabled… 1 more line (see Full output)
    1. Proxy ARP is disabled, so R1 does not answer for addresses it reaches through another interface.
    Full output · 2 lines
    R1#show ip interface Ethernet0/0 | include Proxy ARP  Proxy ARP is disabled  Local Proxy ARP is disabled
  4. Case 2 · How far it reaches

    H1 tests its gateway:

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.1, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
    1. 100 percent: R1 replies to every test packet.
  5. Case 2 · What it means

    H1hostSW1switchH2hostR1routerH3hostWho has 10.0.2.30?With /16, H3 seemsto be on H1’s networkR1 does not passthe request on
    Figure 3.5 · Case 2 · With a /16 mask H1 asks for H3 itself; the question stops at R1.

    H1 at the top, SW1 under it, H2 to its right, R1 under SW1 and H3 at the bottom. Arrows beside the cables go from H1 to SW1 and on to both H2 and R1. A highlighted note reads “Who has 10.0.2.30? With /16, H3 seems to be on H1’s network”. A cross beside the cable from R1 to H3 with the note “R1 does not pass the request on”.

    • With a /16 mask the network part is the first two octets of the address. 10.0.2.30 starts the same way as 10.0.1.10, so H1 takes H3 for a neighbor and asks for it directly.
    • The request is a broadcast, so it stops at R1. H3 never gets it.
    • With proxy ARP, R1 could still answer for H3 with its own MAC address, but on R1 it is off (Proxy ARP is disabled).
  6. Case 2 · Fix

    Give H1 its real mask:

    Output · IOS XE 17.18.2
    H1#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1H1(config)#interface Ethernet0/02H1(config-if)#ip address 10.0.1.10 255.255.255.03H1(config-if)#end
    1. Opens the settings of H1’s interface.
    2. The address again, with the mask 255.255.255.0, /24.
    3. end leaves configuration mode.

    Impact Changing the mask changes at once which addresses H1 takes for its own network.

  7. Case 2 · Proof

    H1 tests H3 again:

    Output · IOS XE 17.18.2
    H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. 100 percent: H3 replies to every test packet.

End of case 2. Solved: H1 sends packets for H3 to its gateway again.

Both cases

Proxy ARP is on by default in Cisco IOS. With it on at R1, the /16 mistake of the second case stays hidden.

On H1, with the /16 mask and proxy ARP on at R1:

Output · IOS XE 17.18.2
H1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
  1. 100 percent: the test works, although the mask is wrong.

On H1, right after:

Output · IOS XE 17.18.2
H1#show ip arpProtocol InternetAddress 10.0.1.1Age (min) 0Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.10Age (min) -Hardware Addr aabb.cc00.0300Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.20Age (min) 0Hardware Addr 5254.0000.5320Type ARPAInterface Ethernet0/01Protocol InternetAddress 10.0.2.30Age (min) 0Hardware Addr aabb.cc00.0200Type ARPAInterface Ethernet0/0
  1. H1 holds 10.0.2.30 with R1’s MAC address, aabb.cc00.0200, not H3’s.

H1 still asks for each far host that the /16 mask makes it take for a neighbor, and R1 answers for each one it reaches through another interface.

Full output · 5 lines
H1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                0   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               -   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.1.20               0   5254.0000.5320  ARPA   Ethernet0/0Internet  10.0.2.30               0   aabb.cc00.0200  ARPA   Ethernet0/0

Key idea

Read whose address is Incomplete. If it is a wrong gateway address, check the default gateway. If it is a far host’s address, check for a too-wide mask.

H2’s default gateway is set to 10.0.1.254 by mistake. What still works?

Check

H2 has a packet for H1 (10.0.1.10). Whose MAC address does it need?
Which ARP message goes to every device on the network?

R1’s cache after H1’s test to H2:

Tap a line, or “Not in the output”, then submit.

Find R1’s line for H2 (10.0.1.20).

Output · IOS XE 17.18.2
R1#show ip arp
Full output · 5 lines
R1#show ip arpProtocol  Address          Age (min)  Hardware Addr   Type   InterfaceInternet  10.0.1.1                -   aabb.cc00.0200  ARPA   Ethernet0/0Internet  10.0.1.10               0   aabb.cc00.0300  ARPA   Ethernet0/0Internet  10.0.2.1                -   aabb.cc00.0210  ARPA   Ethernet0/1Internet  10.0.2.30               0   5254.0000.5330  ARPA   Ethernet0/1
H3 (10.0.2.30, default gateway 10.0.2.1) has a packet for H2 and an empty ARP cache. Whose MAC address does H3 ask for?
H2’s mask is set to /16 by mistake, and R1 has proxy ARP on, the IOS default. H2 tests H3. Which MAC address does H2 hold for 10.0.2.30 after the test?

Summary

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.5330first frameto R1, aabb.cc00.0200second frameto H3, 5254.0000.5330
Figure 3.4, recap · R1 puts the packet in a new frame, to H3’s MAC address. Two ARP exchanges, one on each network, came before a test packet could go end to end.

H1, SW1, H2, R1 and H3, joined by plain cables. Arrows go from H1 through SW1 to R1, with the note “first frame, to R1, aabb.cc00.0200”, and from R1 to H3, with the note “second frame, to H3, 5254.0000.5330”.

  • A host with one network needs the destination’s MAC address on its own network, and its default gateway’s for any other network.
  • ARP asks everyone with a broadcast request; normally only the device that has the address answers, straight to the asker, and each keeps the other’s pair.
  • Through R1: H1 learns its gateway’s MAC address, then R1 learns H3’s on its other network.
  • In show ip arp, a host with the right mask normally lists only its gateway for other networks.
  • Whose address is Incomplete points at the cause: a wrong gateway address at the default gateway, a far host’s address at a too-wide mask (with proxy ARP off).