A router has two entries: 10.0.0.0/8 (metric 5, via Router A) and 10.10.0.0/16 (metric 100, via Router B). A packet arrives for destination 10.10.5.3. Which route does the router use?
A10.0.0.0/8 via Router A, because it has a lower metric (5 < 100)
B10.10.0.0/16 via Router B, because it is the longest matching prefix
CBoth routes are used — the router load-balances across both
DThe default route, since neither entry is an exact match for 10.10.5.3
Longest-prefix match always takes priority over metric comparison. Both entries match 10.10.5.3 (/8 covers all 10.x.x.x, /16 covers 10.10.x.x), but the /16 is more specific. The router selects the longest prefix regardless of metric — metrics only matter when comparing routes of the same prefix length from different sources. Option A is the classic misconception: students often apply metrics as the primary decision criterion, but prefix length takes absolute priority.
Question 2 Multiple Choice
What is the role of the default route (0.0.0.0/0) in a routing table?
AIt routes traffic to the local subnet when no other match exists
BIt matches all destination addresses and is selected only when no more specific route exists
CIt overrides all other routes because 0.0.0.0/0 has the highest administrative priority
DIt is only used for multicast traffic and does not affect unicast routing decisions
0.0.0.0/0 has the shortest possible prefix (zero bits must match), so it matches every possible destination address. But because longest-prefix match always selects the most specific entry, the default route loses to any more specific entry and is only used as a last resort when no other match exists. This is the opposite of how students often imagine it: longer (more specific) prefixes always win, so the very shortest prefix always loses in competition.
Question 3 True / False
A router generally selects the route with the lowest metric when multiple entries match a destination address.
TTrue
FFalse
Answer: False
False — the primary selection criterion is prefix length (specificity), not metric. The router first applies longest-prefix match: among all entries whose network address and mask match the destination, it selects the one with the most bits matching. Metrics are only consulted to break ties among routes with equal prefix lengths from different sources. A route with a higher metric but a longer prefix will always win over a shorter-prefix route with a lower metric.
Question 4 True / False
Directly connected routes are automatically added to a routing table when a router interface is configured with an IP address.
TTrue
FFalse
Answer: True
True. When a router interface is assigned an IP address (e.g., 192.168.1.1/24), the router automatically creates a routing table entry for the directly connected network (192.168.1.0/24) via that interface. These entries require no static configuration or routing protocol — the router simply knows its own subnets. This is why directly connected routes have the lowest administrative distance: the router has direct, first-hand knowledge of their reachability.
Question 5 Short Answer
Explain why longest-prefix match is used in routing tables rather than simply selecting the first matching entry or the route with the best metric.
Think about your answer, then reveal below.
Model answer: Longest-prefix match ensures the most specific available route is used, corresponding to the most precise knowledge about where traffic should go. A broad route like 10.0.0.0/8 might be a general fallback, while 10.10.0.0/16 represents more specific information about a particular subnet — perhaps a direct path. Selecting the 'first match' would make routing dependent on entry insertion order, which is arbitrary. Selecting by metric alone would ignore the critical distinction between specific and general routes, potentially misrouting traffic to a less accurate path even when a better-targeted route exists.
The routing table encodes knowledge at multiple levels of specificity. A /24 entry represents more specific knowledge than a /8 entry — knowledge about a particular subnet rather than a broad address block. Longest-prefix match operationalizes the principle that more specific knowledge should take precedence. This allows general summary routes (aggregates) to coexist with specific subnet routes in the same table, enabling scalable hierarchical routing architecture.