Question

Difficulty: MediumRouter Forwarding Decision Logic

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

text
Gateway of last resort is 10.0.0.1 to network 0.0.0.0

O 192.168.1.0/24 [110/20] via 10.1.1.1, GigabitEthernet0/0
D 192.168.1.128/26 [90/307200] via 10.2.2.2, GigabitEthernet0/1
S 192.168.1.136/29 [1/0] via 10.3.3.3, GigabitEthernet0/2
S* 0.0.0.0/0 [1/0] via 10.0.0.1, GigabitEthernet0/3

When the router receives an IP packet destined for 192.168.1.138192.168.1.138, which next-hop IP address and exit interface will the router select to forward the packet?

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

Answer

10.3.3.3 via GigabitEthernet0/2
When a router makes a forwarding decision, it evaluates all matching routes in its routing table and selects the one with the longest prefix mask length (most specific route). The destination IP address 192.168.1.138 is contained within 192.168.1.0/24, 192.168.1.128/26, 192.168.1.136/29, and 0.0.0.0/0. Among these matching entries, 192.168.1.136/29 has the longest subnet mask (/29). Therefore, the packet is forwarded to next-hop 10.3.3.3 out of GigabitEthernet0/2.

Step-by-Step Solution

1
Evaluate all routes in the routing table against destination IP 192.168.1.138192.168.1.138.
Matching routes are 192.168.1.0/24192.168.1.0/24, 192.168.1.128/26192.168.1.128/26 (range 192.168.1.128192.168.1.191192.168.1.128 - 192.168.1.191), 192.168.1.136/29192.168.1.136/29 (range 192.168.1.136192.168.1.143192.168.1.136 - 192.168.1.143), and 0.0.0.0/00.0.0.0/0.
The destination address must fall within the subnet range of a candidate route.
2
Apply the Longest Prefix Match (LPM) rule to select the best matching route.
The route 192.168.1.136/29192.168.1.136/29 has a mask length of /29/29, which is longer (more specific) than /26/26, /24/24, and /0/0.
Routers always prioritize the route with the longest matching subnet mask length regardless of Administrative Distance or metric.
3
Identify the next-hop IP and exit interface associated with the chosen LPM route.
The route 192.168.1.136/29192.168.1.136/29 specifies next-hop 10.3.3.310.3.3.3 via interface `GigabitEthernet0/2`.
The forwarding engine uses the egress parameters defined by the winning route entry.

Key Concept

Longest Prefix Match Rule in Router Forwarding Decisions
Estimated Time:1m 0s
Rate this question