NETWORKING / A CONCEPT NOTE
Routing
how packets find their way
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Routers inspect the destination IP of incoming packets and consult routing tables to determine the next hop. BGP handles internet-level routing; OSPF handles internal networks.
02 / FOLLOW THE MECHANISM
How a hops lookup flows
Host
sends a packet. If destination is external, it goes to the default gateway router.
Router
checks destination IP against its routing table for the longest prefix match.
Next Hop
router forwards the packet to the next adjacent router interface.
Hop count
TTL is decremented by 1 at each hop. If TTL hits 0, the packet is dropped.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
view the system routing table
route -ntrace the hops packets take to Google
traceroute 8.8.8.805 / CHECK YOURSELF
Could you explain Routing to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in NetworkingReverse Proxythe middleman in front of your app