Soru

Zorluk: ZorRouter Forwarding Decision Logic

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

text
Codes: C - connected, S - static, R - RIP, D - EIGRP, O - OSPF, B - BGP

S 192.168.1.0/24 [1/0] via 10.0.0.3, GigabitEthernet0/0/3
D 192.168.1.128/25 [90/307200] via 10.0.0.2, GigabitEthernet0/0/2
O 192.168.1.128/26 [110/20] via 10.0.0.1, GigabitEthernet0/0/1
B 192.168.1.136/29 [20/0] via 10.0.0.4, GigabitEthernet0/0/4

The router receives a packet destined for host IPv4 address 192.168.1.138. Which next-hop IPv address and exit interface will the router select to forward this packet?

  1. 10.0.0.4 via GigabitEthernet0/0/4, because the /29 prefix provides the longest prefix match for the destination IP address.Cevap
  2. B
    10.0.0.3 via GigabitEthernet0/0/3, because the static route has the lowest administrative distance of 1.
  3. C
    10.0.0.2 via GigabitEthernet0/0/2, because EIGRP routes take precedence over OSPF and BGP routes regardless of prefix length.
  4. D
    10.0.0.1 via GigabitEthernet0/0/1, because 192.168.1.138 falls outside the usable host range of the /29 subnet.

Cevap

10.0.0.4 via GigabitEthernet0/0/4, because the /29 prefix provides the longest prefix match for the destination IP address.
When a router receives a packet, it compares the destination IP against all entries in its routing table. The fundamental rule for packet forwarding is Longest Prefix Match (LPM). Among all matching routes for 192.168.1.138, the route 192.168.1.136/29 has the longest subnet mask (/29 vs /26, /25, /24). Therefore, administrative distance and metrics are ignored, and the router selects next-hop 10.0.0.4 via GigabitEthernet0/0/4.

Adım Adım Çözüm

1
Identify all matching routes for destination IP 192.168.1.138 in the routing table.
Routes 192.168.1.0/24, 192.168.1.128/25, 192.168.1.128/26, and 192.168.1.136/29 all encompass 192.168.1.138.
Before comparing routing metrics or administrative distance, candidate matching routes must be identified.
2
Compare the prefix lengths (subnet masks) of all matching routes.
The prefix lengths are /24, /25, /26, and /29. /29 is the longest (most specific) match.
Cisco routers use the Longest Prefix Match (LPM) rule as the primary decision criterion when selecting a route from the routing table to forward a packet.
3
Determine the next-hop IP and exit interface associated with the longest prefix match route.
The route for 192.168.1.136/29 points to next-hop 10.0.0.4 out exit interface GigabitEthernet0/0/4.
The router forwards the packet to the next-hop specified by the winning route.

Anahtar Kavram

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