A router’s main responsibility is to receive packets and forward them to the right destination. But how does a router think and what is the process of deciding the best route to forward a packet to? This post describes this decision process and preference order based on examples.
1. Longest prefix length – When multiple routes with different prefix length
A destination IP address can belong to various subnets that exist in the routing table. When there are multiple routes with different prefix lengths to a destination, then the longest match is always preferred regardless of the routing protocol used. For example, if the routing table contains the prefixes: Continue reading