Soru

Zorluk: KolayRouter Forwarding Decision Logic

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

Codes: C - connected, S - static, R - RIP, O - OSPF
Gateway of last resort is not set

10.0.0.0/8 is subnetted, 4 subnets
O 10.1.1.0/24 [110/20] via 192.168.1.2, 00:04:12, GigabitEthernet0/0
S 10.1.0.0/16 [1/0] via 192.168.1.1, GigabitEthernet0/1
O 10.1.1.128/25 [110/30] via 192.168.1.3, 00:02:15, GigabitEthernet0/2
S* 0.0.0.0/0 [1/0] via 192.168.1.254

When the router receives a packet destined for host 10.1.1.130, which next-hop IP address will the router use to forward the packet?

  1. A
    192.168.1.1
  2. B
    192.168.1.2
  3. 192.168.1.3Cevap
  4. D
    192.168.1.254

Cevap

The router will forward the packet to next-hop 192.168.1.3.
When a router makes a forwarding decision, it evaluates all routes in the routing table that cover the destination address and selects the one with the longest prefix mask (most specific match). Destination host 10.1.1.130 matches 10.1.0.0/16, 10.1.1.0/24, and 10.1.1.128/25. The route 10.1.1.128/25 is the most specific match with 25 matching bits, so the router forwards the packet to its next-hop IP address, 192.168.1.3.

Adım Adım Çözüm

1
Identify all matching routes for destination IP address 10.1.1.130.
Matching routes are 10.1.0.0/16, 10.1.1.0/24, 10.1.1.128/25, and 0.0.0.0/0.
10.1.1.130 falls within the range of 10.1.0.0–10.1.255.255 (/16), 10.1.1.0–10.1.1.255 (/24), 10.1.1.128–10.1.1.255 (/25), and default route.
2
Compare prefix lengths of all matching routes to determine the Longest Prefix Match (LPM).
10.1.1.128/25 has a 25-bit subnet mask, which is longer than /24, /16, and /0.
The router always prefers the route with the most specific (longest) prefix match before considering Administrative Distance or Metric.
3
Identify the next-hop address associated with the longest prefix match route.
The route 10.1.1.128/25 uses next-hop 192.168.1.3.
The forwarding table specifies via 192.168.1.3 for 10.1.1.128/25.

Anahtar Kavram

Longest Prefix Match (LPM) Rule
Tahmini Süre:1m 0s
Bu soruyu puanla