1

Routing tables are queried using destination IP of a packet to get the next hop IP and to get the interface to send the packet through.

But since the router will strip the ethernet header first and then process the IP packet and then route. So it will again need to get the mac of the next hop ip for the new ethernet header.

So it will check the arp table and router's arp table also stores the interface along which this mac will be found. So the routing table and arp table both store the interface along which the device will be found.

Is there a purpose other then that which the interface field is needed for? or am I missing a point about it?

1 Answer 1

0

Including the interface in a routing table entry removes the requirement to identify it from the gateway address. It's basically an optimization feature.

There are more complex situations where looking up the interface at the same time as the next hop is really helpful or even required. For instance, you could specify an outgoing interface to a specific gateway when there are multiple interfaces to that subnet.

9
  • But then wouldn't it be just wasted storage on ARP table for router. As in user's ARP table it only has ip,mac & time and no interfaces then why doesn't router also just store the same and not interfaces if the use of interfaces field in ARP table becomes redundant Commented Jul 8 at 11:51
  • You question is about the routing table. The ARP cache is an entirely different topic.
    – Zac67
    Commented Jul 8 at 12:07
  • what I meant is why have two places with interfaces field if the router is going to search in both the places anyhow to get the next_hop_ip in routing table and mac of next_hop_ip in ARP table. Since user ARP cache entry and router ARP cache entry differ in the fact that router entry has an interface so why not just have interface in router table only and save space in arp table or the other way around Commented Jul 8 at 12:14
  • 1
    Remember that not every layer 2 protocol uses MAC addresses (although most are admittedly obsolete).
    – Ron Trunk
    Commented Jul 8 at 12:17
  • 1
    They are both in the tables because ARP and routing are two separate functions. The fact that Ethernet has become the dominant protocol was just a matter of luck.
    – Ron Trunk
    Commented Jul 8 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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