OSPF Cost Calculation: How a Summary LSA Becomes a Routing Table Entry
One of the most misunderstood OSPF behaviors is how an inter-area route's metric ends up in the routing table. Engineers often notice that the metric carried inside a Summary LSA is not the metric that gets installed.
The Example
Assume a router in Area 10 holds the following Summary Network LSA:
Summary Net Link States (Area 10) Link State ID: 10.10.10.10 (summary Network Number) Advertising Router: 172.16.5.5 Network Mask: /32 TOS: 0 Metric: 1001
The important fields are:
- Destination: 10.10.10.10/32. The network comes from the Link State ID; the prefix length comes from the Network Mask field.
- Advertising Router: 172.16.5.5, the ABR that originated this LSA into Area 10.
- Metric: 1001, the ABR's own best cost to reach the destination.
The ABR has already run SPF in the area where 10.10.10.10 lives (or learned the route over the backbone) and advertises only the final result. The receiving router never sees the topology behind that number.
What Happens Next
After reading the Summary LSA, the receiving router has one question left: how far away is the ABR?
It doesn't run a separate SPF to find out. The ABR is a router in its own area, so it already sits in the router's intra-area SPF tree, flagged as an ABR by the B-bit in its Router LSA. The cost is already known. Suppose it is 1.
Final route metric = cost to reach the ABR + metric in the Summary LSA
1 + 1001 = 1002
Routing table installation
O IA 10.10.10.10/32 [110/1002] via 172.16.45.5, 00:04:12, GigabitEthernet0/1
| Where you look | Metric | Meaning |
|---|---|---|
| Summary LSA | 1001 | The ABR's cost to the destination |
| Routing table | 1002 | Your cost to the ABR plus the ABR's cost |
The routing table metric is larger because the local router has included its own path to the ABR.
Where OSPF Gets Each Number
LSDB
└─ Type-3 Summary LSA -> destination + ABR's metric (1001)
└─ Advertising Router -> which ABR (172.16.5.5)
└─ Intra-area SPF -> my cost to that ABR (1)
└─ Add them -> 1 + 1001 = 1002
└─ Install -> O IA 10.10.10.10/32 [110/1002]
If this pattern looks familiar, it's the same split as Chapter 04: one LSA describes the destination, and the path to the router that advertised it comes from somewhere else. For a Type-5 the router resolves the ASBR; for a Type-3 it resolves the ABR.
Verify it on the router
OSPF Router with ID (172.16.4.4) (Process ID 1)
Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 172.16.5.5 [1] via 172.16.45.5, GigabitEthernet0/1, ABR, Area 10, SPF 7
The number in brackets, [1], is your cost to the ABR. Add it to the metric from show ip ospf database summary and you get the metric in show ip route.
Two ABRs: The Total Wins, Not the LSA
When two ABRs advertise the same prefix, the router does not pick the lower LSA metric. It compares the totals.
ABR-1: LSA metric 1001 + my cost to ABR-1 50 = 1051 ABR-2: LSA metric 1010 + my cost to ABR-2 1 = 1011 <-- installed
ABR-2 advertises the worse metric but wins, because it is much closer. If the totals tie, both paths are installed as equal-cost routes (ECMP).
Why This Looks Like Distance Vector
Inside an area, OSPF is pure link-state. Every router knows every router, every link and every interface cost, so SPF can calculate each path independently.
Between areas, that changes. The receiving router does not get the remote area's routers, links or SPF tree. The ABR simply says:
The receiving router accepts that number as fact. It can't check how the ABR arrived at 1001. That is exactly how a distance-vector protocol works: a neighbor advertises a destination and a distance, and you add your cost to that neighbor. OSPF inter-area routing has been described as "distance vector between areas" for exactly this reason.
Why OSPF Is Still Not a Distance-Vector Protocol
- Within each area, routing is link-state. Every router holds the full LSDB for its own area and runs SPF over it.
- ABRs build Summary LSAs from SPF results, not from routes heard hop by hop from neighbors.
- The inter-area part is kept loop-free by design, not by timers. Distance-vector protocols need split horizon, hold-downs and counting to infinity. OSPF instead forces a hub-and-spoke shape: every area must attach to Area 0, and an ABR only uses Summary LSAs it receives over the backbone when calculating inter-area routes.
A better description: OSPF is a link-state protocol that uses distance-vector-like advertisement between areas, kept loop-free by the Area 0 hub-and-spoke rule.
CCIE Exam Takeaway
O IA installed metric = metric advertised by the ABR in the Type-3 LSA + local cost to reach the ABR
LSA says 1001, cost to ABR is 1 → install 1002
The extra cost isn't hidden recursion. It's the normal OSPF inter-area calculation: the router adds its own shortest-path cost to the ABR before installing the route. That single detail explains why the metric in a Summary LSA so often differs from the one in the routing table.
- "The Type-3 metric is the ABR's cost; the routing table metric is my cost to the ABR plus that."
- "With two ABRs, the lowest total wins, not the lowest LSA metric."
- "OSPF is distance vector between areas, and the backbone rule keeps it loop-free."