NETWORKING / A CONCEPT NOTE

Routing

how packets find their way

~60 sec read

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

  1. Host

    sends a packet. If destination is external, it goes to the default gateway router.

  2. Router

    checks destination IP against its routing table for the longest prefix match.

  3. Next Hop

    router forwards the packet to the next adjacent router interface.

  4. 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.

EXAMPLE 01 · REFERENCE

view the system routing table

route -n

EXAMPLE 02 · REFERENCE

trace the hops packets take to Google

traceroute 8.8.8.8

Explore command anatomy in the CLI lab