Question

Difficulty: MediumRouter Forwarding Decision Logic

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

text
Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 4 subnets, 4 masks
O 172.16.10.0/24 [110/20] via 192.168.1.1, 00:05:12, GigabitEthernet0/0
D 172.16.10.0/25 [90/307200] via 192.168.1.2, 00:12:44, GigabitEthernet0/1
S 172.16.10.128/26 [1/0] via 192.168.1.3, 01:15:00, GigabitEthernet0/2
C 172.16.10.128/30 is directly connected, GigabitEthernet0/3

The router receives a packet destined for IP address 172.16.10.130. Which interface or next-hop IP address will the router select to forward this packet?

  1. GigabitEthernet0/3Answer
  2. B
    192.168.1.3 via GigabitEthernet0/2
  3. C
    192.168.1.2 via GigabitEthernet0/1
  4. D
    192.168.1.1 via GigabitEthernet0/0

Answer

The router will forward the packet out interface GigabitEthernet0/3 because the directly connected route 172.16.10.128/30 provides the longest prefix match for destination 172.16.10.130.
The destination host 172.16.10.130 matches three entries in the routing table: 172.16.10.0/24, 172.16.10.128/26, and 172.16.10.128/30. According to Cisco router forwarding logic, the router evaluates Longest Prefix Match (LPM) first. Because /30 has 30 matching network bits, it is the most specific route and will be used to forward the packet out GigabitEthernet0/3.

Step-by-Step Solution

1
Evaluate all routes in the routing table against the destination IP address 172.16.10.130 to identify matching subnets.
Matching subnets are 172.16.10.0/24, 172.16.10.128/26, and 172.16.10.128/30. The subnet 172.16.10.0/25 covers addresses .0 through .127 and is not a match.
Routing lookup requires identifying all candidate routes that encompass the target destination host address.
2
Compare the prefix lengths of all matching candidate routes.
Prefix lengths are /24, /26, and /30. The longest prefix length is /30.
Cisco routers use the Longest Prefix Match (LPM) rule as the primary criteria for forwarding decisions before considering Administrative Distance.
3
Select the route corresponding to the longest prefix match.
The route 172.16.10.128/30 is selected, which directs traffic to the directly connected interface GigabitEthernet0/3.
The most specific route (/30) always wins the forwarding decision regardless of administrative distance or metric.

Key Concept

Longest Prefix Match (LPM) is the fundamental rule routers use to select a route from the routing table when forwarding a packet. The router selects the route with the highest number of matching network bits (longest prefix length), regardless of administrative distance.
Estimated Time:1m 30s
Rate this question