Router Packet Handling – Do Routers Discard Packets if They Don’t Know Where to Forward Them?

arpipipv4routerrouting

If a router receives a packet whose IP destination address is not in its routing table, I believe it will send it to its default port.

Suppose that we erase that entry from the table. Now, I think that the router will send an ARP request in order to find where to forward it. I have two questions regarding this process:

  • If there is no ARP response (i.e. there is no route from the router to the destination address), will it discard it and send an ICMP message to the origin stating that the destination was unreachable?
  • Will in any case a router discard a packet just because the destination address is not in its routing table (assuming there is no 'default' entry)? Or will it always check if it is possible to reach the destination via ARP requests?

Best Answer

ARP is a LAN protocol that resolves a layer-3 to a layer-2 address. A router, like any host will use ARP for a host that is on a LAN to which it is directly connected.

Routers will look at the destination address on a packet, and try to find a match in its routing table. If it cannot find a match it will drop the packet and send an ICMP message to the source to tell it that is has no route to the destination network.

The default IPv4 network, 0.0.0.0/0, or default IPv6 network, ::/0, encompasses every IP address for the protocol, and every address for the protocol will match a route to the default network. Having a default route in the routing table prevents the router from dropping packets with unknown destinations.