Question

Difficulty: MediumRouter Forwarding Decision Logic

Refer to the following partial IPv4 routing table output from a Cisco router:

text
Codes: C - connected, S - static, D - EIGRP, O - OSPF

Gateway of last resort is 192.168.40.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.40.1
S 172.20.0.0/16 [1/0] via 192.168.30.1
D 172.20.100.0/24 [90/2170112] via 192.168.20.1
O 172.20.100.64/26 [110/20] via 192.168.10.1

The router receives a packet destined for IP address 172.20.100.85. Which next-hop IP address will the router choose to forward this packet?

  1. 192.168.10.1Answer
  2. B
    192.168.30.1
  3. C
    192.168.20.1
  4. D
    192.168.40.1

Answer

192.168.10.1
When a router makes a packet forwarding decision, it evaluates matching routes using the Longest Prefix Match (LPM) rule. The destination address 172.20.100.85 matches the route 172.20.100.64/26 because the range of valid hosts for 172.20.100.64/26 spans from 172.20.100.65 to 172.20.100.126. Because /26 is more specific than /24, /16, or /0, the router chooses the next-hop address 192.168.10.1 regardless of Administrative Distance.

Step-by-Step Solution

1
Identify all matching routes in the routing table for the destination IP address 172.20.100.85.
The IP address 172.20.100.85 matches 0.0.0.0/0, 172.20.0.0/16, 172.20.100.0/24, and 172.20.100.64/26 (usable range 172.20.100.65 - 172.20.100.126).
Before comparing routing metrics or administrative distance, the router identifies all routes whose network addresses encompass the destination host IP.
2
Determine the prefix length for each matching route.
Prefix lengths are /0 (Default), /16 (Static), /24 (EIGRP), and /26 (OSPF).
Cisco forwarding logic strictly adheres to the Longest Prefix Match rule above all other criteria.
3
Select the route with the most specific (longest) subnet mask.
172.20.100.64/26 has the longest prefix (/26). The next-hop IP associated with this route is 192.168.10.1.
Administrative Distance is only evaluated when comparing identical prefix lengths learned from different routing protocols, not when comparing routes of different prefix lengths.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match precedence over Administrative Distance)
Rate this question