Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.2. Router Forwarding Decisions

💡 First Principle: When a router receives a packet, it checks the destination IP against its routing table using three rules in sequence: longest prefix match (most specific route wins), administrative distance (if multiple protocols provide the route), and metric (if the same protocol has multiple paths). This sequence is deterministic—if you know the rules, you can predict exactly which path any packet will take.

Consider this exam scenario: You have an OSPF route to 10.0.0.0/8 (AD 110) and a static route to 10.1.1.0/24 (AD 1). A packet arrives for 10.1.1.50. Which route wins? The static route—not because of its better AD (1 vs 110), but because /24 is more specific than /8. Longest prefix match happens before administrative distance. Getting this order wrong means getting exam questions wrong.

What happens when you misunderstand forwarding decisions: You configure a static route as a backup, expecting OSPF to be preferred because it has a lower metric. Traffic takes the static route anyway because it's more specific. Or you add a summary route that accidentally attracts traffic you wanted to go elsewhere. Routing behavior isn't magic—it follows these rules exactly.

The decision sequence (memorize this):
  1. Longest prefix match — Always first. A /30 beats a /24, which beats a /16. More specific always wins.
  2. Administrative distance — Only checked if prefixes are identical length. Determines which routing source to trust.
  3. Metric — Only checked if same protocol provides multiple routes. Determines which path within that protocol.