Networking
Explainer
How a Router Decides Where Packets Go
A router never knows the whole path. So how does your packet arrive?
Quick check · tap an answer to continue
Lesson notes
Key points
- A router forwards each packet one hop at a time, using a routing table of destination networks and next hops.
- When several entries match a destination, the router picks the most specific one, called the longest prefix match.
- If nothing specific matches, the default route 0.0.0.0/0 catches everything and sends it toward the internet.
- Each hop repeats this lookup and decrements the TTL, so lost packets eventually die instead of looping forever.
Definitions
- Routing table
- A list of destination networks, each with a next-hop address or outgoing interface the router uses to forward packets.
Takeaway: Routers forward hop by hop using the longest matching prefix.
Quick check: A packet matches both a /16 and a /24 route. Which route does the router use?
- The /16 route
- The /24 route
- The default route
Longest prefix match chooses the most specific route, the /24.
Routing tableLongest prefix matchDefault routeTTL
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