Network Implementation

A router's table holds 10.0.0.0/8 via R3, 10.1.0.0/16 via R1, 10.1.4.0/22 via R2 and 0.0.0.0/0 via R4. Which next hop forwards a packet addressed to 10.1.5.20?

Show the answer

Correct answerC. R2

AWhy not this: The default route matches every address, but at /0 it is used only when nothing more specific matches.

BWhy not this: The /16 route also contains the address, but its prefix is shorter than the /22, so it is less specific.

CWhy this is right: The /22 route contains the address and has the longest prefix length of the matching routes, so it wins.

DWhy not this: The /8 route matches, but it has the shortest prefix of the matching routes and is the least specific.

10.1.4.0/22 covers 10.1.4.0 to 10.1.7.255, so it contains 10.1.5.20. Its /22 prefix length is longer than the /16 and /8, so it is the most specific match. The /16 also matches, but a shorter prefix is less specific.