Routing

Routing is how a packet finds its way across a series of networks from source to destination. No single device knows the full path; instead, each router along the way makes one local decision, choosing the next hop that moves the packet closer to its destination. The authoritative description of what a router must do is RFC 1812, “Requirements for IP Version 4 Routers,” edited by F. Baker of Cisco Systems and published in June 1995. It consolidated years of accumulated practice into a single statement of correct router behavior.

The decision is driven by a routing table. RFC 1812 describes a “route database,” also called a “routing table” or “forwarding table,” that the router consults to determine the next hop for each packet. This database “should be maintained dynamically to reflect the current topology of the Internet system,” meaning routers do not rely on static, hand-entered routes alone but instead update their tables as the network changes. They do so by “participating in distributed routing and reachability algorithms with other routers,” exchanging information about which destinations they can reach and how.

A central rule of IP forwarding is longest-prefix match. RFC 1812 requires that “routers must use the most specific matching route (the longest matching network prefix) when forwarding traffic.” When several entries in the table could apply to a destination address, the router picks the one with the longest, most specific network prefix. This single rule is what makes classless addressing and route aggregation work: a router can carry one broad route for a whole region while still honoring a more specific route to a particular sub-network when one exists.

The protocols that fill the routing table fall into two families, a distinction RFC 1812 draws clearly. Interior Gateway Protocols (IGPs) handle “distributed routing and reachability algorithms with the other routers in the same autonomous system,” computing paths inside a single administrative domain. Exterior Gateway Protocols (EGPs) let routers “exchange topological information with other autonomous systems,” carrying reachability across administrative boundaries. The document treats OSPF as a primary interior protocol and BGP as the primary exterior protocol, while relegating older designs such as RIP and the original EGP to appendices.

This two-level structure is why the internet scales. Each autonomous system can choose and run whatever interior protocol it likes, optimizing for its own topology, while a common exterior protocol glues the systems together without forcing every router on earth to know the internal details of every network. A packet’s journey is therefore a chain of independent next-hop decisions, each made by consulting a routing table built from interior knowledge within networks and exterior knowledge between them, exactly the model RFC 1812 codified in 1995.

Sources

Last verified June 8, 2026