0

Suppose a packet comes from the Internet, let's say a HTTP response from a Web Server.

The router directs the packet to a switch. But the switch does not change the destination and source MACs. That means that the router has to know beforehand at which MAC address belongs to the host with that IP.

So the question is, does the router has its own ARP cache just like any host with Windows and Linux has in the memory?

1

The router directs the packet to a switch.

No it does not. The router send the packet to an IP address.

And for that it needs to know the next hops ARP adrress. So it will use its own cache for that or delay until after it has send an 'ARP who has XXXX?'

But the switch does not change the destination and source MACs. That means that the router has to know beforehand at which MAC address belongs to the host with that IP.

Correct. There is nothing special about this case. With our without a switch. A datagram arrives, gets parsed. The routes now knows the destination (and that this destination is not the router itself). Thus the routing tables is checked to determine which network (and which NIC) needs to output to the next hop. And if the next hop's ARP is needed for that.

And the ARP follow the fully normal method: 1a check check. 1b) if not known retrieve and store in cache. 2) send.

1

Yes, the router has its own ARP store. And often actually is a Windows or Linux based machine.

7
  • meta: sure seem to be a bunch of ARP related questions today :) – infixed Mar 15 '16 at 17:29
  • To integrate with @Hennes answer, yes, a router only needs the next hop. But if the router's next hop resolves to one of its local networks that the router is fronting, then the ARP process becomes involved again – infixed Mar 15 '16 at 17:33
  • And if it does not point to local then it still needs the ARP of the next hop. (Assuming router means router and not 'multifunction go go gadget device with a build in modem and routing'). :) – Hennes Mar 15 '16 at 18:47
  • I was considering point to point type transport, and switched networks carrying the packet from node to node as well as IP transport. While it was phasing out when I first started to deal with networking, I still recall some transport systems set up via X.25, with IP tunneled through them. That would not need an ARP for that hop. There were circuits established IIRC. – infixed Mar 15 '16 at 18:55
  • Good point. I grew up in an environment where IPs where normal. Regular IPs, not RFC1918's. My default is still to assume that and forget about point to point etc. – Hennes Mar 15 '16 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.