Question

Difficulty: Very hardRouter Forwarding Decision Logic

Refer to the following partial routing table output from router R1:

text
Codes: C - connected, S - static, R - RIP, B - BGP, O - OSPF, D - EIGRP

Gateway of last resort is 192.168.5.2 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.5.2
B 10.140.0.0/16 [20/0] via 192.168.4.2, 01:22:00, GigabitEthernet0/0/0
S 10.140.24.0/24 [1/0] via 192.168.3.2
O 10.140.24.0/25 [110/20] via 192.168.1.2, 00:14:22, GigabitEthernet0/0/1
D 10.140.24.64/28 [90/307200] via 192.168.2.2, 00:05:10, GigabitEthernet0/0/2

Router R1 receives an IP packet addressed to 10.140.24.6710.140.24.67. Which egress interface and next-hop IP address will R1 use to forward this packet?

  1. Interface GigabitEthernet0/0/2 with next-hop IP address 192.168.2.2Answer
  2. B
    Interface GigabitEthernet0/0/1 with next-hop IP address 192.168.1.2
  3. C
    Next-hop IP address 192.168.3.2
  4. D
    Interface GigabitEthernet0/0/0 with next-hop IP address 192.168.4.2

Answer

Interface GigabitEthernet0/0/2 with next-hop IP address 192.168.2.2
When a router makes a packet forwarding decision, it evaluates all matching routing table entries using the Longest Prefix Match (LPM) rule first. For destination IP 10.140.24.6710.140.24.67, the matching prefixes are /0/0, /16/16, /24/24, /25/25, and /28/28. The /28/28 prefix (10.140.24.64/2810.140.24.64/28) is the most specific match. Therefore, R1 forwards the packet to next-hop 192.168.2.2192.168.2.2 out interface GigabitEthernet0/0/2.

Step-by-Step Solution

1
Evaluate all candidate routes in the routing table to find which subnets contain the target IP 10.140.24.6710.140.24.67.
Candidate matching routes are: 0.0.0.0/00.0.0.0/0, 10.140.0.0/1610.140.0.0/16, 10.140.24.0/2410.140.24.0/24, 10.140.24.0/2510.140.24.0/25 (range .0–.127), and 10.140.24.64/2810.140.24.64/28 (range .64–.79).
Before comparing administrative distance or metric, a router determines all routes that mathematically match the destination address.
2
Determine the prefix length (number of subnet mask bits) for each matching candidate route.
0.0.0.0/00.0.0.0/0 has prefix length /0; 10.140.0.0/1610.140.0.0/16 has prefix length /16; 10.140.24.0/2410.140.24.0/24 has /24; 10.140.24.0/2510.140.24.0/25 has /25; 10.140.24.64/2810.140.24.64/28 has /28.
The fundamental forwarding rule (Longest Prefix Match) dictates that the route with the highest number of matching network bits is chosen.
3
Select the route with the longest prefix match.
The route 10.140.24.64/2810.140.24.64/28 has the longest prefix length (/28 > /25 > /24 > /16 > /0).
The router selects 10.140.24.64/2810.140.24.64/28 pointing to next-hop 192.168.2.2192.168.2.2 via exit interface GigabitEthernet0/0/2. Administrative distance is not evaluated across routes with different prefix lengths.

Key Concept

Longest Prefix Match Rule
Estimated Time:1m 30s
Rate this question