3.0 CCNA - IP Connectivity
3.2. Determining how a router makes a forwarding decision by default
1. Longest match
2. Administrative distance
3. Routing protocol metric
A router makes a forwarding decision by default based on the Longest Matching Prefix in its routing table. The router selects the route that has the most specific match with the destination address of a packet. If two or more routes have the same prefix length, the router will choose the one with the lowest administrative distance, which represents the reliability of the source of the route information.
1. Longest Match: Longest match refers to the process of selecting the most specific route for a given destination IP address in a router's routing table. A routing table contains multiple entries for different subnets, and the Longest Match rule ensures that a packet is forwarded to the most specific route that matches its destination IP address.
2. Administrative Distance: Administrative distance is a value assigned by a router to indicate the reliability of a route source. It ranges from 0 to 255, with a lower value indicating a more trustworthy source. When a router has multiple routes to the same destination, it will choose the route with the lowest administrative distance.
3. Routing Protocol Metric: Routing protocol metric is a value used by routing protocols to evaluate the best path to a destination network. Routing protocols like OSPF, BGP, and EIGRP use metrics to determine the cost of reaching a destination network. The cost is often represented as a value such as hop count, bandwidth, delay, or reliability. The routing protocol metric is used to select the best path, and if two or more paths have the same metric, administrative distance is used as a tiebreaker.