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?
- 10.4.4.4Cevap
- B10.1.1.1
- C10.2.2.2
- D10.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
Anahtar Kavram
Longest Prefix Match (LPM)