Soru

Zorluk: OrtaRouting Table Components

A core router receives a packet destined for IP address 172.16.42.95. The router's IPv4 routing table contains four candidate paths to reach this destination:

text O 172.16.40.0/21 [110/65] via 10.1.1.1, 00:14:22, GigabitEthernet0/0/0 D 172.16.42.0/24 [90/307200] via 10.2.2.2, 01:05:10, GigabitEthernet0/0/1 S 172.16.42.64/26 [1/0] via 10.3.3.3 O 172.16.42.80/28 [110/30] via 10.4.4.4, 00:02:45, GigabitEthernet0/0/2

Which next-hop IP address will the router use to forward the packet?

  1. 10.4.4.4Cevap
  2. B
    10.3.3.3
  3. C
    10.2.2.2
  4. D
    10.1.1.1

Cevap

The router will forward the packet to next-hop IP address 10.4.4.4 via GigabitEthernet0/0/2 because it has the longest prefix match (/28) containing the destination address 172.16.42.95.
When a router makes a forwarding decision, it evaluates all routing table entries that match the destination IP address and selects the entry with the longest prefix mask (the most specific route). For destination 172.16.42.95, the route 172.16.42.80/28 has a 28-bit mask, which is more specific than /26, /24, or /21. Therefore, the router forwards the packet to next-hop 10.4.4.4.

Adım Adım Çözüm

1
Determine which prefixes in the routing table actually match the destination IP address 172.16.42.95.
172.16.40.0/21 covers 172.16.40.0 to 172.16.47.255 (Match). 172.16.42.0/24 covers 172.16.42.0 to 172.16.42.255 (Match). 172.16.42.64/26 covers 172.16.42.64 to 172.16.42.127 (Match). 172.16.42.80/28 covers 172.16.42.80 to 172.16.42.95 (Match).
Before comparing metrics or administrative distances, the router identifies all valid matching routes.
2
Compare the prefix lengths (subnet masks) of all matching routes to apply the Longest Prefix Match rule.
Prefix lengths are /21, /24, /26, and /28. The /28 prefix length is the longest (most specific).
The Cisco IOS forwarding decision always uses the longest prefix match first, regardless of routing source or administrative distance.
3
Identify the next-hop IP address associated with the longest matching route (172.16.42.80/28).
The next-hop address associated with 172.16.42.80/28 is 10.4.4.4.
The router forwards the packet out the exit interface towards 10.4.4.4.

Anahtar Kavram

Longest Prefix Match Rule in Routing Table Lookups
Bu soruyu puanla