Question

Difficulty: Very hardRouting Table Components

An engineer is troubleshooting IPv4 packet forwarding on a Cisco IOS-XE router. The router receives a packet with a destination IP address of 172.16.100.70. Refer to the routing table output below:

text
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is 10.0.0.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 10.0.0.1
S 172.16.100.0/24 [1/0] via 10.1.1.1
O 172.16.100.64/27 [110/50] via 10.2.2.2
D 172.16.100.64/28 [90/2170112] via 10.3.3.3
C 172.16.100.64/30 is directly connected, GigabitEthernet0/0/0

Which next-hop IP address or outgoing interface will the router select to forward this packet?

  1. 10.3.3.3Answer
  2. B
    10.1.1.1
  3. C
    10.2.2.2
  4. D
    GigabitEthernet0/0/0

Answer

The router will forward the packet to next-hop IP address 10.3.3.3.
The router follows the Longest Prefix Match (LPM) algorithm for packet forwarding. For destination 172.16.100.70, the matching routes in the table are 0.0.0.0/0, 172.16.100.0/24, 172.16.100.64/27 (range 172.16.100.64–172.16.100.95), and 172.16.100.64/28 (range 172.16.100.64–172.16.100.79). Among these valid matches, /28 is the most specific mask (longest prefix length). Administrative Distance and metric are only compared when two routes have the exact same prefix length. Therefore, the router chooses the /28 route with next-hop 10.3.3.3.

Step-by-Step Solution

1
Evaluate all candidate routes in the routing table that encompass destination IP address 172.16.100.70.
The candidate matching routes are 0.0.0.0/0, 172.16.100.0/24, 172.16.100.64/27 (range .64-.95), and 172.16.100.64/28 (range .64-.79). The directly connected 172.16.100.64/30 route covers .64-.67, so it does not match.
Before comparing administrative distance or metric, a router must identify all valid matching prefixes.
2
Apply the Longest Prefix Match (LPM) rule to select the best matching route.
Comparing the prefix lengths of matching routes: /0 < /24 < /27 < /28. The route 172.16.100.64/28 is the longest matching prefix (28 bits).
Cisco routers always prefer the most specific matching prefix (/28 over /27, /24, or /0), regardless of Administrative Distance or routing protocol metric.
3
Identify the next-hop address associated with the winning prefix 172.16.100.64/28.
The route entry for 172.16.100.64/28 specifies 'via 10.3.3.3'.
Packet forwarding uses the next-hop specified by the specific prefix selected by the LPM decision process.

Key Concept

Longest Prefix Match (LPM) Rule in Cisco IPv4 Forwarding Logic
Rate this question