Menu

Routing

Routing is how routers guide packets across the Internet. Every router keeps a routing table, a list of the networks it knows about and the best next router to send a packet to for each one.

When a packet reaches a router, the router reads the destination IP address in the packet header. It looks that address up in its routing table. The table gives the next router along a path to that destination. The router forwards the packet to that next router. The next router does the same, and so on, until the packet reaches the network where the destination device sits. A routing table might look like this:

Destination networkNext routerMetric
Network ARouter 22 hops
Network ARouter 55 hops
Network BRouter 11 hop

Choosing the best route

A routing table can hold more than one possible route to the same destination. Each route has a metric, a score such as the number of hops (routers crossed). A lower metric usually means a faster route. For example, a packet might be able to go through Router M (3 hops) or Router N (1 hop). The router picks Router N because it uses the fewest hops. But if Router N's link is busy with lots of video streaming, the router can choose Router M instead, even though it has more hops, because it is less congested. So the "best" route is often the fastest or least congested one, not just the shortest.

Sharing information

Routers do not work alone. They share information with other routers about which networks they can reach and how busy or reliable those links are. If a cable fails, this sharing lets routers update their tables and find a new path around the problem. This happens automatically and continuously, so the Internet keeps working even when parts of it go down.

Practise this