Soru

Zorluk: KolayRouter Forwarding Decision Logic

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

text
Gateway of last resort is 10.0.0.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 10.0.0.1
S 192.168.0.0/16 [1/0] via 10.1.1.1
O 192.168.10.0/24 [110/20] via 10.2.2.2, 00:05:12, GigabitEthernet0/1
D 192.168.10.32/28 [90/2170112] via 10.3.3.3, 00:12:45, GigabitEthernet0/2

When a packet destined for 192.168.10.45192.168.10.45 arrives at the router, which next-hop IP address will be selected to forward the packet?

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

Cevap

10.3.3.3
When forwarding an IP packet, a router first checks all entries in its routing table to find routes that match the destination IP address. If multiple matching routes exist, the router always selects the route with the longest prefix mask (most specific match). The destination 192.168.10.45 falls into the range 192.168.10.32 through 192.168.10.47 provided by the /28 route. Because /28 is longer than /24, /16, and /0, the next-hop IP 10.3.3.3 is chosen.

Adım Adım Çözüm

1
Identify all matching routes for destination IP 192.168.10.45
Matching routes are 0.0.0.0/0, 192.168.0.0/16, 192.168.10.0/24, and 192.168.10.32/28.
The destination IP address falls within the network range of all four route entries.
2
Apply the Longest Prefix Match (LPM) rule to compare prefix lengths
Prefix lengths are /0, /16, /24, and /28. The /28 prefix is the longest (most specific).
Routers always evaluate prefix length first before comparing Administrative Distance or Metric.
3
Determine the next-hop IP associated with the longest prefix match route
The route 192.168.10.32/28 specifies next-hop IP 10.3.3.3.
The packet is forwarded to the next-hop IP associated with the winning prefix route.

Anahtar Kavram

Longest Prefix Match (LPM) rule in router forwarding decision logic
Bu soruyu puanla