Question

Difficulty: EasyRouter Forwarding Decision Logic

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

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

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
O 10.1.0.0/16 [110/20] via 192.168.1.2, 00:05:12, GigabitEthernet0/0
D 10.1.4.0/22 [90/307200] via 192.168.1.6, 00:12:33, GigabitEthernet0/1
S 10.1.4.0/24 [1/0] via 192.168.1.10, 01:45:00, GigabitEthernet0/2
O 10.1.4.128/25 [110/10] via 192.168.1.14, 00:02:15, GigabitEthernet0/3

A packet arrives at the router with a destination IP address of 10.1.4.13010.1.4.130. Which exit interface will the router use to forward this packet?

  1. GigabitEthernet0/3, because the route to 10.1.4.128/25 has the longest matching prefix length for the destination IP address.Answer
  2. B
    GigabitEthernet0/2, because the static route has the lowest administrative distance among all candidate routes.
  3. C
    GigabitEthernet0/1, because EIGRP has a lower administrative distance than OSPF and matches the destination IP network.
  4. D
    GigabitEthernet0/0, because the route to 10.1.0.0/16 covers the largest range of IP addresses in the 10.0.0.0/8 network.

Answer

The router forwards the packet out interface GigabitEthernet0/3 because 10.1.4.128/25 is the longest prefix match for destination 10.1.4.130.
When a router receives an IP packet, it compares the destination IP address against all entries in its routing table. The fundamental rule of IP route selection is Longest Prefix Match (LPM). Since 10.1.4.130 matches 10.1.4.128/25 (/25 bit match), 10.1.4.0/24 (/24 bit match), 10.1.4.0/22 (/22 bit match), and 10.1.0.0/16 (/16 bit match), the router selects 10.1.4.128/25 because /25 is the longest (most specific) prefix length. Consequently, traffic is forwarded via GigabitEthernet0/3.

Step-by-Step Solution

1
Identify candidate routes matching destination IP 10.1.4.130.
The candidate routes are: 10.1.0.0/16, 10.1.4.0/22, 10.1.4.0/24, and 10.1.4.128/25.
All four routes contain IP address 10.1.4.130 within their range.
2
Determine the prefix length for each matching candidate route.
Prefix lengths are /16, /22, /24, and /25.
Longest Prefix Match (LPM) rule dictates that the route with the most specific subnet mask (highest prefix number) is selected first.
3
Select the route with the longest prefix match.
10.1.4.128/25 (/25) is the longest match, which forwards out GigabitEthernet0/3.
Administrative Distance (AD) and metric are ignored when prefix lengths differ among candidate routes.

Key Concept

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