Question

I met a question on the CCNA exam which I got wrong and even though I found it on different websites with a few explanations available, I'm still confused about it.

The question is about what arp entry will a host have in its arp table after a successful ping to a another host on a different router. Now, through all my CCNA studies so far I've always been taught that the IP source and destination addresses do not change in the packet during the routing process, but only the MAC source and destination addresses change. However, the correct answer was indicating that both the IP and MAC addresses of the gateway were present in the arp table of the sending host, and no sign of host B.

This got me confused. And if this is the case, how will the default-gateway router know the destination IP of the other host? It's probably just a tricky question but still... Any clear thoughts on that?

Was it helpful?

Solution

Everything Joe says is correct.

Having just finished teaching this to a class myself. Let me put this in the terms I used in that class.

Your question says you have two hosts on two subnets. Let's call the remote host, a server and your local host, well let's stick with local host.

You local host has an IP address, a subnet mask and a default gateway.

When you ping the server, your local host uses it's IP address and subnet mask to see if the address being pinged is local or remote. In this case, your server's remote. Knowing this, it knows it has to send the ping to the default gateway. To do that, it has to arp for the default gateway's address. This leaves the entry in the arp table for your default gateway and it's mac address.

You're correct in thinking that the packet that then leaves your local host to your server has the mac address of the default gateway, but the IP address of the server, but this doesn't effect what's in the arp table.

Remember, an arp packet asks "Who has?" and provides an IP address. In the network you've described, your default gateway will only respond for it's own IP, not all the IP addresses it can route to.

Now I could really confuse you here by telling you about the network configurations where this would work differently, but I don't think that would be helpful.

However it's worth knowing that there are times in the real world when you find things don't work this way. (I'm looking at you NAT and proxy arp).

I'm not sure this is any clearer than what Joe wrote, but sometimes just hearing a few different explanations help things to click.

Hope this helps,

Alex

OTHER TIPS

The ARP is resolved only for the directly connected hosts. In case where you are pinging a host through a router/default-gateway, your target is not directly connected (in terms of IP reachability. When I say directly connected I mean, both are in same subnet). So how are you able to ping your target, the source will do a route lookup and it will get to know that the host/target will be reachable through say this router. Now, the source has to send the pkt to that router as the next hop. For that the ARP/adjacency for that router has to be resolved, if it is not resolved already. Now the ARP resolution is done for your router and then the packet is routed through that router. Now, what ARP entry you see in the source? it is of first-hop router/default-gateway.

Now I would reiterate my first sentence, The ARP is resolved only for the directly connected hosts. Clear?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top