Soru

Zorluk: OrtaRouting Table Components

A network device attempts to forward an IP packet toward the target address 172.31.25.140. The routing table contains four matching prefix entries:

- 172.31.25.0/24 [1/0] via 10.1.1.1
- 172.31.25.128/26 [90/307200] via 10.2.2.2
- 172.31.25.128/27 [110/40] via 10.3.3.3
- 172.31.25.136/29 [120/4] via 10.4.4.4

Which next-hop IP address will the device select to forward this packet?

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

Cevap

The router forwards the packet to next-hop address 10.4.4.4 because 172.31.25.136/29 has the longest matching prefix length (/29).
When a router receives a packet, it compares the destination IP address against all entries in its routing table and selects the route with the longest matching prefix length (the most specific subnet mask). Here, 172.31.25.136/29 matches 172.31.25.140 with a 29-bit prefix length, which is longer than /27, /26, or /24. The next-hop associated with this route is 10.4.4.4.

Adım Adım Çözüm

1
Determine which routing entries match destination IP 172.31.25.140.
All four routes (172.31.25.0/24, 172.31.25.128/26, 172.31.25.128/27, and 172.31.25.136/29) contain the IP address 172.31.25.140 within their range.
For 172.31.25.136/29, the usable IP host range spans 172.31.25.137 through 172.31.25.142, which includes 172.31.25.140.
2
Compare the prefix lengths of all matching routes.
The prefix lengths are /24, /26, /27, and /29.
Routers use the Longest Prefix Match (LPM) rule to select the forwarding route regardless of Administrative Distance.
3
Select the route with the highest prefix length (most specific mask).
/29 is the longest prefix match, corresponding to route 172.31.25.136/29 via 10.4.4.4.
Administrative distance is only evaluated when comparing identical prefixes from different routing sources. For different prefix lengths, LPM always governs.

Anahtar Kavram

Longest Prefix Match (LPM)
Bu soruyu puanla