Question

Difficulty: HardRouter Forwarding Decision Logic

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

text
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.1.1
10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
O 10.150.0.0/16 [110/20] via 172.16.1.1, 00:10:22, GigabitEthernet0/0/1
D 10.150.45.128/25 [90/307200] via 172.16.2.1, 00:05:12, GigabitEthernet0/0/2
S 10.150.45.136/29 [1/0] via 172.16.3.1
O 10.150.45.136/30 [110/50] via 172.16.4.1, 00:01:45, GigabitEthernet0/0/3

The router receives an IPv4 packet destined for 10.150.45.13810.150.45.138. Which next-hop IP address will the router select to forward this packet?

  1. 172.16.4.1Answer
  2. B
    172.16.3.1
  3. C
    172.16.2.1
  4. D
    172.16.1.1

Answer

The router forwards the packet to next-hop IP address 172.16.4.1.
When a router receives a packet, it compares the destination IP address against all entries in its routing table. The rule of Longest Prefix Match (LPM) dictates that the route with the most specific (longest) subnet mask is selected. The target IP address 10.150.45.138 matches multiple routes, but 10.150.45.136/30 has the longest prefix mask (/30 vs /29, /25, /16, /0). The next-hop IP for 10.150.45.136/30 is 172.16.4.1.

Step-by-Step Solution

1
Identify all candidate routes matching the destination IP address 10.150.45.138.
Matching routes in table: 0.0.0.0/0, 10.150.0.0/16, 10.150.45.128/25, 10.150.45.136/29, and 10.150.45.136/30.
The IP address 10.150.45.138 falls within the address range of all listed subnets.
2
Compare the prefix lengths (subnet masks) of all matching routes to determine the Longest Prefix Match (LPM).
Prefix lengths are /0, /16, /25, /29, and /30. The /30 prefix is the longest and most specific match.
Cisco IP forwarding logic evaluates subnet mask length first before checking Administrative Distance or metric.
3
Determine the next-hop IP address associated with the winning /30 route.
Route 10.150.45.136/30 points to next-hop IP 172.16.4.1.
The router selects the next-hop tied directly to the route entry with the longest prefix match.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match Rule)
Estimated Time:1m 30s
Rate this question