Networking
Spot it
Spot the Mistake: Longest Prefix Match
Can you spot the routing mistake before the router does?
Quick check · tap an answer to continue
Lesson notes
Explain how routers use routing tables and longest-prefix match to forward packets
Key points
- Check 10.0.0.0/8: the first 8 bits match 10, so this route matches.
- Check 10.1.0.0/16: the first 16 bits match 10.1, so this route matches too.
- Check 10.1.2.0/24: 10.1.5 does not match 10.1.2, so this route fails.
- The longest matching route is 10.1.0.0/16, so the packet goes to R3. The default route 0.0.0.0/0…
Takeaway: Only matching routes count; then the longest prefix wins.
Quick check: Which step is wrong?
- Step 1
- Step 2
- Step 3
10.1.5 is not 10.1.2, so the /24 does not match at all.
routing tabledefault gatewaylongest prefix matchTTL
Lessons like this, for your syllabus.
Short narrated study videos written for your course, level and exam. Free to start.
Get lessons for your own syllabus