Soru

Zorluk: OrtaRouter Forwarding Decision Logic

Refer to the following excerpt from a Cisco router's IPv4 routing table:

text
Codes: C - connected, S - static, D - EIGRP, O - OSPF
Gateway of last resort is 172.16.1.1 to network 0.0.0.0

D 10.140.0.0/16 [90/2172416] via 10.1.1.1, 00:04:12, GigabitEthernet0/0
O 10.140.32.0/19 [110/20] via 10.2.2.2, 00:12:35, GigabitEthernet0/1
S 10.140.32.0/24 [1/0] via 10.3.3.3
C 10.140.32.128/25 is directly connected, GigabitEthernet0/2

The router receives an IP packet addressed to 10.140.32.13510.140.32.135. Which path or next hop will the router select to forward this traffic?

  1. Interface GigabitEthernet0/2Cevap
  2. B
    Next-hop IP address 10.3.3.3
  3. C
    Next-hop IP address 10.2.2.2
  4. D
    Next-hop IP address 10.1.1.1

Cevap

The router will forward the packet out interface GigabitEthernet0/2 because the route 10.140.32.128/25 has the longest matching prefix for destination host 10.140.32.135.
When an IPv4 router receives a packet, it compares the destination IPv4 address against all routes in its routing table. When multiple routes match the destination host, the router always selects the route with the longest prefix length (the most specific subnet mask). Destination 10.140.32.13510.140.32.135 falls within 10.140.32.128/2510.140.32.128/25 (usable range 10.140.32.12910.140.32.129 to 10.140.32.25410.140.32.254). Since /25/25 is more specific than /24/24, /19/19, and /16/16, the router forwards traffic out GigabitEthernet0/2.

Adım Adım Çözüm

1
Identify all matching routes for the destination address 10.140.32.135.
Matches found: 10.140.0.0/16, 10.140.32.0/19, 10.140.32.0/24, and 10.140.32.128/25.
The destination address falls within the address range of all four listed subnets.
2
Compare prefix lengths among the candidate routes.
Prefix lengths are /16, /19, /24, and /25.
Router forwarding logic relies on the Longest Prefix Match (LPM) rule prior to evaluating Administrative Distance or Metric.
3
Select the most specific route (/25 prefix).
The route 10.140.32.128/25 connected to GigabitEthernet0/2 is chosen.
A /25 subnet mask matches 25 continuous network bits, which is more specific than /24, /19, or /16.

Anahtar Kavram

Longest Prefix Match (LPM) Precedence
Bu soruyu puanla