Question

Difficulty: EasyRouter Forwarding Decision Logic

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

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

Gateway of last resort is not set

172.16.0.0/16 is subnetted, 3 subnets
S 172.16.0.0/16 [1/0] via 10.1.1.1
O 172.16.32.0/24 [110/20] via 10.2.2.2
D 172.16.32.32/27 [90/307200] via 10.3.3.3

If the router receives an IP packet destined for 172.16.32.45172.16.32.45, to which next-hop IP address will the packet be forwarded?

  1. 10.3.3.3Answer
  2. B
    10.1.1.1
  3. C
    10.2.2.2
  4. D
    The packet will be dropped because no default route or host route exists.

Answer

The router will forward the packet to next-hop IP address 10.3.3.3 because 172.16.32.32/27 is the longest matching prefix for destination IP 172.16.32.45.
When a router performs a forwarding lookup for destination IP address 172.16.32.45, it checks all matching entries in its routing table. The destination address 172.16.32.45 matches 172.16.0.0/16, 172.16.32.0/24, and 172.16.32.32/27 (which covers host IP addresses from 172.16.32.33 through 172.16.32.62). The /27 route matches 27 continuous network bits, which is the longest prefix match compared to /24 or /16. Therefore, the router forwards the packet to 10.3.3.3.

Step-by-Step Solution

1
Evaluate all routes in the routing table against destination IP 172.16.32.45
Three routes match: 172.16.0.0/16, 172.16.32.0/24, and 172.16.32.32/27 (since range .32 to .63 contains .45).
Routing decision logic requires identifying all candidate routes that encompass the destination IP.
2
Compare subnet mask lengths to determine the Longest Prefix Match (LPM)
The prefix length /27 (27 bits) is greater than /24 (24 bits) and /16 (16 bits).
The router always prefers the most specific route (longest subnet mask / highest number of matching network bits) regardless of Administrative Distance or metric.
3
Identify the next-hop address associated with the longest matching route
The route 172.16.32.32/27 specifies next-hop 10.3.3.3.
Packet forwarding uses the next-hop associated with the route selected by LPM.

Key Concept

Router Forwarding Decision Logic & Longest Prefix Match (LPM)
Rate this question