Soru

Zorluk: KolayRouter Forwarding Decision Logic

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

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP
Gateway of last resort is not set

D 172.16.10.0/24 [90/2172416] via 10.1.1.1, 00:05:12, GigabitEthernet0/0
O 172.16.10.0/26 [110/20] via 10.1.1.2, 00:12:45, GigabitEthernet0/1
S 172.16.0.0/16 [1/0] via 10.1.1.3
C 172.16.10.128/27 is directly connected, GigabitEthernet0/2

When the router receives an IP packet destined for host 172.16.10.33, which next-hop IP address or interface will be selected to forward the packet?

  1. 10.1.1.2Cevap
  2. B
    10.1.1.3
  3. C
    10.1.1.1
  4. D
    GigabitEthernet0/2

Cevap

10.1.1.2 via GigabitEthernet0/1 based on Longest Prefix Match (/26).
When forwarding IP packets, a router always evaluates candidate routes using Longest Prefix Match (LPM) first. For the target IP address 172.16.10.33, three candidate routes match: 172.16.0.0/16, 172.16.10.0/24, and 172.16.10.0/26. The OSPF route 172.16.10.0/26 provides the longest matching prefix mask (/26), so the router forwards the packet to next-hop IP 10.1.1.2.

Adım Adım Çözüm

1
Identify all candidate routes that match destination IP 172.16.10.33.
Three matching routes exist: 172.16.0.0/16, 172.16.10.0/24, and 172.16.10.0/26. The route 172.16.10.128/27 covers range 172.16.10.128 to 172.16.10.159 and does not match.
Routing decision logic only evaluates routes whose network address and subnet mask encompass the target IP.
2
Compare prefix lengths among all matching candidate routes.
172.16.10.0/26 has a 26-bit prefix match, which is longer (more specific) than /24 and /16.
Longest Prefix Match (LPM) is always the primary criterion used by a router when selecting a route from the routing table.
3
Determine the next-hop associated with the longest prefix match route.
The route 172.16.10.0/26 points to next-hop IP 10.1.1.2.
Administrative Distance and Metric are only evaluated when comparing routes with identical prefix lengths from different sources.

Anahtar Kavram

Router Forwarding Decision Logic (Longest Prefix Match Precedence)
Bu soruyu puanla