Mastering OSPF.
Chapter 05 · Link-State Routing · CCIE
Macro photograph of an integrated circuit die

OSPF Cost Calculation: How a Summary LSA Becomes a Routing Table Entry

CCIE OSPF Type-3 LSA ABR O IA Metric

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 reason: the metric inside a Type-3 Summary LSA is never installed as-is. The receiving router adds its own cost to reach the router that advertised it, the ABR. That extra step is why OSPF behaves a little like a distance-vector protocol between areas, even though it is fundamentally link-state.
01

The Example

Assume a router in Area 10 holds the following Summary Network LSA:

show ip ospf database summary 10.10.10.10
            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:

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.

02

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

show ip route ospf
O IA     10.10.10.10/32 [110/1002] via 172.16.45.5, 00:04:12, GigabitEthernet0/1
Where you lookMetricMeaning
Summary LSA1001The ABR's cost to the destination
Routing table1002Your 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.

03

Where OSPF Gets Each Number

Inter-area route calculation
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

show ip ospf border-routers
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.

04

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.

Same prefix, two ABRs
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).

05

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:

"I can reach 10.10.10.10 at cost 1001."

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.

06

Why OSPF Is Still Not a Distance-Vector Protocol

  1. Within each area, routing is link-state. Every router holds the full LSDB for its own area and runs SPF over it.
  2. ABRs build Summary LSAs from SPF results, not from routes heard hop by hop from neighbors.
  3. 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.
CCIE Tip: that backbone rule is why a non-backbone area cannot pass inter-area routes on to another non-backbone area, and why a disconnected area needs a virtual link through a transit area. Without it, the distance-vector-like Type-3 exchange could loop.

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.

07

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."

← Back to Overview