OSPF general operations

Two routers in one area hold identical link-state databases and still have different routing tables, and neither is wrong. OSPF distributes topology, not routes: every router in an area keeps the same LSDB and runs its own calculation from where it sits. An LSA is one router's statement about one piece of the topology, and who originates each type tells you where it can go.

In Daveth Pro (Network)4 min video · lab: OSPF v2/v3

By , founder of Daveth · Updated

Opening frame of the video walkthrough of OSPF general operations

Watch this lesson

4 min · Video walkthrough

In Daveth Pro (Network)

The full 4 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C6: OSPF v2/v3

What the lab covers

What this page answers

Why do OSPF routers in the same area have different routing tables?

They share an identical link-state database, but each runs its own calculation from its own position, so next hops and costs differ. The database is topology, not routes. Read it in “The thing every router agrees on”

What are the OSPF LSA types?

Type 1 router, from every router, within its area; Type 2 network, from the DR; Type 3 summary, from ABRs to other areas; Type 4 ASBR summary, from ABRs; Type 5 AS external, from an ASBR; and Type 7, the external that exists inside an NSSA. Read it in “The six things a database is made of”

Does an NSSA ABR generate a default route?

Not by default. An NSSA blocks Types 4 and 5, so its routers know inter-area prefixes but nothing about outside externals, and by default the NSSA ABR does not generate a default summary route. Read it in “Now read the area rules as LSA rules”

Two routers, one database, two routing tables

Two routers in the same area. You dump the link-state database on both and it's identical: the same LSAs, the same sequence numbers.

Then you dump the routing tables, and they're different. Different next hops, different costs. Which router is wrong?

Here are R1 and R2 side by side:

This course's reading: R1 and R2, side by side. No device prints it.

                              R1      R2
LSAs in area 0                9       9
OSPF routes                   4       5

compared                      R1 with R2
same LSAs, same Seq#?         yes
prefixes that differ          4
missing from R1               nothing

Decide which, and keep your answer. It depends on what a database actually holds and what a router does with it, so those come first.

The thing every router agrees on

A database that stores information about the network topology, built from the LSAs received from neighboring devices. Each device in an OSPF area maintains an identical LSDB. The agreement of the database information among the routers in the area is called convergence.

Identical. Every router in an area holds the same set of LSAs, and the adjacency machinery, the DR, flooding and acknowledgements exist to keep it that way.

And notice what is being distributed. Not routes: topology. A router running EIGRP is told I can reach this prefix at this cost. A router running OSPF is told this router has these links, at these costs, and works out the rest itself.

The six things a database is made of

An LSA is one router's statement about one piece of the topology. Here's the trick for holding six of them: who originates it tells you where it can go.

TypeOriginated byReaches
1 · Routerevery routerwithin an area only: quoted
2 · Networkthe DRwithin the area
3 · SummaryABRs onlyother areas, including NSSAs
4 · ASBR summaryABRsother areas, not NSSAs
5 · AS externalan ASBR, or the NSSA ABR translating a Type 7the AS, not NSSAs
7 · NSSA externalan ASBR inside an NSSAthroughout the NSSA: quoted

Where that table comes from. The type definitions below are quoted from an IOS XR guide for the ASR 9000; LSA types are defined by the protocol, not the platform. The NSSA rules and the translation are from Cisco's NSSA document. Within the area for Type 2 and other areas for Types 3 and 4 are this course reading the originators and those rules, not a quotation.

Describes the links that the router has within a single area, and the cost of each link. These LSAs are flooded within an area only.

Every router originates a Type 1: here is what I'm connected to, and what it costs me.

Describes the link state and cost information for all routers attached to a multiaccess network segment. This LSA lists all the routers that have interfaces attached to the network segment. It is the job of the designated router of a network segment to generate and track the contents of this LSA.

The DR. Being DR isn't a status; it's a job, and the job is the Type 2. A point-to-point link has no Type 2, because there's no segment to describe.

Advertises internal networks to routers in other areas (interarea routes). Type 3 LSAs may represent a single network or a set of networks aggregated into one prefix. Only ABRs generate summary LSAs.

Only ABRs. Type 1 and Type 2 stop at the area boundary; the ABR restates each network as a prefix and a cost. An inter-area route carries no topology: you can't compute a path through the far area, only trust the ABR's number.

Now go back to the rule from earlier, and read its qualifier: every router in an area holds the same database. One kind of router breaks the picture people build from that. An ABR sits in two, so it keeps two sets, one per area, each matching the other routers in its own area and differing from the set it keeps for the other one. Nothing is being synchronised across the boundary; that is what the boundary is.

So when you go comparing databases, compare within one area. Two routers in the same area should match exactly. An ABR and a router on the far side of it have no reason to, and the difference between them is the design working rather than a fault.

Redistributes routes from another autonomous system, usually from a different routing protocol into OSPF. Advertises an ASBR and the cost to reach it. Routers that are trying to reach an external network use these advertisements to determine the best path to the next hop. ABRs generate Type 4 LSAs.

Type 4 is the one people can never place, so anchor it to what it's for. A Type 5 names a destination and the ASBR that originated it. From another area you have no path to that ASBR. The Type 4 is that path. So what does R6, in area 2, actually hold for R5's external?

This course's output on R6, computed from the scenario in the layout Cisco's samples print.

R6# show ip ospf database
       OSPF Router with ID (10.0.0.6) (Process ID 1)

                Router Link States (Area 2)

Link ID         ADV Router      Age    Seq#         Checksum   Link count
10.0.0.3        10.0.0.3        1076   0x80000002   0x7C6C     2
10.0.0.6        10.0.0.6        590    0x80000002   0xA9FE     2

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age    Seq#         Checksum
10.1.0.0        10.0.0.3        1136   0x80000002   0x19D0
10.1.13.0       10.0.0.3        548    0x80000002   0xD473
10.2.34.0       10.0.0.3        780    0x80000006   0xAAB4

                Summary ASB Link States (Area 2)

Link ID         ADV Router      Age    Seq#         Checksum
10.0.0.5        10.0.0.3        471    0x80000003   0x3B3F
! The ABR (10.0.0.3) advertising where R5 (10.0.0.5) is.

                Type-5 AS External Link States
              ! The Type 5s, listed once for the whole AS, not per area.

Link ID         ADV Router      Age    Seq#         Checksum   Tag
198.51.100.0    10.0.0.5        827    0x80000005   0xD614     0
203.0.113.0     10.0.0.3        802    0x80000004   0x5865     0
Provides for carrying external route information within an NSSA. Type 7 LSAs may be originated by and advertised throughout an NSSA. NSSAs do not receive or originate Type 5 LSAs. There are NSSAs that block type 5 and type 4 LSAs, but allow type 3 LSAs, and there are NSSA totally stub areas, which allow only summary default routes and filters everything else.

Area 1 is an NSSA. Which of these types does R4, inside it, actually hold?

This course's output on R4, computed from the scenario in the layout Cisco's samples print.

R4# show ip ospf database
       OSPF Router with ID (10.0.0.4) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age    Seq#         Checksum   Link count
10.0.0.3        10.0.0.3        544    0x80000003   0x0EE1     2
10.0.0.4        10.0.0.4        1030   0x80000003   0xB897     2

                Summary Net Link States (Area 1)
! Type 3s arrive. There is no Summary ASB section and no Type-5 section: the NSSA blocks both.

Link ID         ADV Router      Age    Seq#         Checksum
10.1.0.0        10.0.0.3        548    0x80000001   0x91C7
10.1.13.0       10.0.0.3        1126   0x80000003   0xC998
10.3.36.0       10.0.0.3        1251   0x80000002   0x9D52

                Type-7 AS External Link States (Area 1)

Link ID         ADV Router      Age    Seq#         Checksum   Tag
203.0.113.0     10.0.0.4        1237   0x80000006   0x31B7     0
! R4's own external, as a Type 7.
All type 7 LSAs are translated into type 5 LSAs by the NSSA ABR and are leaked into the OSPF domain as type 5 LSAs.

So R6's database above already had it: 203.0.113.0/24 as a Type 5, advertised by the ABR, 10.0.0.3.

So across this network's three areas, where does each type end up?

This course's reading: which areas of this network hold each type. No device prints it.

type    held in
Type 1  area 0, 1, 2
Type 2  area 0
Type 3  area 0, 1, 2
Type 4  area 2
Type 5  area 0, 2
Type 7  area 1

Now read the area rules as LSA rules

An NSSA's restriction and its database are the same fact. It blocks Types 4 and 5, so its routers know every inter-area prefix and nothing about externals from outside the NSSA. R4 has no route to 198.51.100.0/24 at all, and nothing supplies a default:

When you configure an area as NSSA, by default the NSSA ABR does not generate a default summary route.

And an NSSA totally stub area, in the NSSA document's words, allows only summary default routes: the Type 3s for other areas are replaced by a default.

Now read the area-types lesson's table the same way. A stub area takes no Type 4 or 5: every inter-area prefix, no external destination and no ASBR location. A totally stubby area takes no Type 3, 4 or 5 except the default summary route: its own area, and a default. Each restriction is a list of LSA types the area never holds.