Link-State Routing: How Routers Share a Changing Map
A router's own connections can be working while a route farther along has failed. Link-state routing spreads news of those changes so routers can update their network maps and work out which paths remain usable.
Link-state describes a way of learning routes from a shared map of network connections. Open Shortest Path First, or OSPF, is one protocol that uses this approach.
Each router contributes information about its connections. Together, those reports describe the network's topology: what connects to what. Every participating router can then calculate routes from its own position on the map.
How Routers Learn the Way on Their Own
How the news spreads
In OSPF, a router sends information about its local links in messages called link-state advertisements. Other routers pass the information onward through the relevant part of the network.
This process is called flooding. Here, the word means distributing routing information so routers can bring their databases into agreement.
After a detected change, new advertisements update the map. Routers recalculate paths using that information. They take time to reach a consistent view and usable set of routes, a process called convergence. Traffic may be interrupted while this happens.
The OSPF version 2 specification describes the shared database and the calculation each router performs. The starting point matters: two routers can agree on the map while choosing different first steps toward the same destination.
“Shortest” is a score
Routers need a way to compare possible paths. In OSPF, each link has a cost, and the route calculation adds those costs. For paths within one OSPF area, the winning path has the lowest total, which need not mean the fewest connections.
Consider these invented costs for three routers:
| Route from A to C | Link costs | Total cost |
|---|---|---|
| Directly from A to C | 12 | 12 |
| From A through B to C | 3, then 4 | 7 |
The two-link route wins because 7 is less than 12. If its B-to-C connection fails, the direct connection could carry traffic instead, provided it is still working. Learning about a failure helps routers use an available alternative; it cannot create a missing connection.
- Get five gigabit ports and a fast ARM processor for the price of a basic home router.
- Practice real routing at your desk on gear that network pros also deploy.
- Tuck it beside your modem: it takes up almost no room.
Where do the numbers come from? Cisco's OSPF documentation describes turning a connection's bandwidth setting into a cost, which an administrator can override. Bandwidth represents the connection's capacity. This cost scores a route; it does not measure how busy the connection is at that moment.
Once selected, routes supply the information used to forward traffic. Juniper's routing documentation describes active routes being installed in a forwarding table. IP forwarding uses that result to send a packet to its next hop—the next device along the path. The router does not need to calculate a fresh route for every arriving packet.
Keeping the map a manageable size
Storing connection information, sharing changes and recalculating routes all take resources. OSPF can divide a routing system into areas, each with its own link-state database.
Routers share the detailed topology within the relevant area. Other areas do not receive that entire internal map, which limits how much information their routers need to store and process.
OSPF: The Route With More Steps Can Be Shorter

Distance-Vector Routing: How Routers Learn the Way

Dynamic Routing Protocols: How Networks Find Another Way

QUOTE:
"Amateurs hack systems, professionals hack people."
