Card 10/ 10

RecapDifficulty: Intermediate1 min

Recap: Routing Packets Between Networks

The longest matching prefix chooses the next hop, and TTL is how a path is seen.

Routing moves a packet one hop at a time, each router deciding on its own from its table.

  • A routing table lists ranges, a next hop and an interface for each. The default route, 0.0.0.0/0, catches everything else.
  • Longest prefix match: of all rows that contain the destination, the longest prefix wins. Row order does not matter.
  • The TTL drops by one at each router. traceroute exploits it to make each router reply in turn; ping asks whether a host answers at all.
  • OSPF finds the shortest path inside one organisation; BGP chooses between organisations by policy.
  • Anycast announces one address from many sites, and routing sends each user to the nearest.
  • A cloud route table is a routing table, with the same rule.
  • A ping reply proves layer 3 reachability, not that a port is open or a service is running.
Where does a router send a packet?
  1. When One or more specific routes contain the destination

    , choose

    The route with the longest prefix.

  2. When Only the default route contains it

    , choose

    The default route's next hop.

Otherwise No route and no default; the packet is dropped and the sender is told the destination is unreachable.