Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
4.2.1. Longest Prefix Match
The router always prefers the most specific route (longest prefix). For each packet it strips the incoming frame to read the destination IP, collects every route whose prefix contains that address, picks the longest, and then builds a new Layer 2 frame (new source and destination MAC) for the chosen next hop.
Example: Destination 192.168.1.50
- Route A: 192.168.0.0/16 (covers .50 ✓)
- Route B: 192.168.1.0/24 (covers .50 ✓) ← Selected (more specific)
- Route C: 10.0.0.0/8 (doesn't cover .50 ✗)
Enroll to unlock the 5 practice questions written for this section, so you can test what you just read while it is fresh.
Enroll to unlock the 1 flashcard for this section and review them on a spaced-repetition schedule.
Written byAlvin Varughese
Founder•20 professional certifications