OSPF is a complex protocol. Understanding how it works is very important for any network engineer. For CCIE candidates, knowing how to effectively get and understand the information in OSPF database is even more so important. This is the first in series of articles about reading information from OSPF database.
We will explore Router LSA first.
Router LSA (Type 1) is possibly the most important LSA type in OSPF. Without it pretty much nothing else makes sense. The purpose of this LSA type is to describe router’s links (interfaces) in such a way that other routers in the same area can understand it and build their SPF trees based on that information. This information travels through the area unchanged and it’s very important to be able to interpret information in the database for effective and correct troubleshooting.
Network Layout
In order to explore this information, we need a very simple network. Even two-router setup will do, but I opted for three routers. here is the initial configuration of the network we’ll use today.

Along with that, here’s the relevant initial configuration of those three routers. We’ll be dealing with the very basics here, so configurations are really simple.
R2:
interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Serial0/1/0 no ip address encapsulation frame-relay no frame-relay inverse-arp ! interface Serial0/1/0.24 point-to-point ip address 24.24.24.2 255.255.255.0 frame-relay interface-dlci 204 ! router ospf 1 network 0.0.0.0 255.255.255.255 area 0 !
R4:
interface Loopback0 ip address 4.4.4.4 255.255.255.255 ! interface Serial0/0/0 no ip address encapsulation frame-relay no frame-relay inverse-arp ! interface Serial0/0/0.24 point-to-point ip address 24.24.24.4 255.255.255.0 frame-relay interface-dlci 402 ! interface Serial0/0/0.45 point-to-point ip address 45.45.45.4 255.255.255.0 frame-relay interface-dlci 405 ! router ospf 1 network 0.0.0.0 255.255.255.255 area 0 !
R5:
interface Loopback0 ip address 5.5.5.5 255.255.255.255 ! interface Serial0/1/0 no ip address encapsulation frame-relay no frame-relay inverse-arp ! interface Serial0/1/0.45 point-to-point ip address 45.45.45.5 255.255.255.0 frame-relay interface-dlci 504 ! router ospf 1 network 0.0.0.0 255.255.255.255 area 0 !
Exploring the Database
Before we can effectively explore the database, let’s take a look at what options we have available to us. We’ll focus on R2 for now and all commands I run below will be on R2, unless otherwise noted.
R2#show ip ospf database ? adv-router Advertising Router link states asbr-summary ASBR summary link states database-summary Summary of database external External link states network Network link states nssa-external NSSA External link states opaque-area Opaque Area link states opaque-as Opaque AS link states opaque-link Opaque Link-Local link states router Router link states self-originate Self-originated link states summary Network summary link states | Output modifiers <cr>
We can see that we have plenty of options available to use, but today we’re focusing only on the highlighted one. We want to see only Type 1 LSAs – also known as “Router LSAs”. Let’s take a look at what’s there.
R2#show ip ospf database router OSPF Router with ID (2.2.2.2) (Process ID 1) Router Link States (Area 0) LS age: 19 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 2.2.2.2 Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0xD206 Length: 60 Number of Links: 3 Link connected to: a Stub Network (Link ID) Network/subnet number: 2.2.2.2 (Link Data) Network Mask: 255.255.255.255 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 4.4.4.4 (Link Data) Router Interface address: 24.24.24.2 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: a Stub Network (Link ID) Network/subnet number: 24.24.24.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 64 LS age: 20 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 4.4.4.4 Advertising Router: 4.4.4.4 LS Seq Number: 80000001 Checksum: 0xB14F Length: 84 Number of Links: 5 Link connected to: a Stub Network (Link ID) Network/subnet number: 4.4.4.4 (Link Data) Network Mask: 255.255.255.255 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 5.5.5.5 (Link Data) Router Interface address: 45.45.45.4 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: a Stub Network (Link ID) Network/subnet number: 45.45.45.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 2.2.2.2 (Link Data) Router Interface address: 24.24.24.4 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: a Stub Network (Link ID) Network/subnet number: 24.24.24.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 64 LS age: 24 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 5.5.5.5 Advertising Router: 5.5.5.5 LS Seq Number: 80000001 Checksum: 0x78BA Length: 60 Number of Links: 3 Link connected to: a Stub Network (Link ID) Network/subnet number: 5.5.5.5 (Link Data) Network Mask: 255.255.255.255 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 4.4.4.4 (Link Data) Router Interface address: 45.45.45.5 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: a Stub Network (Link ID) Network/subnet number: 45.45.45.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 64
Wow, that’s a quite a bit of information for a simple network like ours! Don’t be alarmed, everything makes perfect sense there. Let’s look at few things. First of all, examine red bits. These fields can be effectively visually indicate “the start of new router” in the output. What I mean by this is that when you see something like “LS age”, it means you are reading LSA originated by some router in the network. When you encounter another line like that, it means you are reading about information coming from a different device than before. Which device are you reading about -that’s shown in green. Remember that the information here is NOT an IP address, but OSPF Router-ID of the advertising router, which may or may not be a valid and reachable IP in the network. To illustrate this, I will change Router-ID on R5 manually and we’ll see the difference later on.
R5:
router ospf 1 router-id 55.55.55.55 !
Dissecting the Database
Given enough time, we can sift through the previous output looking for what we need in any particular situation, but even by one glance at it, we can be certain that for any larger network, this output will get very, very long, real quick. It’s a good idea to learn couple of options available to us when using “show ip ospf database router” command. Let’s take a look at them and what they do.
R2#show ip ospf database router ?
A.B.C.D Link state ID (as an IP address)
adv-router Advertising Router link states
internal Internal LSA information
self-originate Self-originated link states
| Output modifiers
<cr>
First of all we should learn about “self-originate” option. Each router will advertise to its neighbors descriptions of its own links. We can examine this information about each router using the command “show ip ospf database router self-originate”. Let’s examine R2.
R2#show ip ospf data router self-originate
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 193
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000002
Checksum: 0xD007
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 2.2.2.2
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 4.4.4.4
(Link Data) Router Interface address: 24.24.24.2
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 24.24.24.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Now, this is much more manageable for reading. Note: You can use several different commands to get the exact same information. In our case, “show ip ospf database router self-originate”, “show ip ospf database router 2.2.2.2″ and “show ip ospf database adv-router 2.2.2.2″ produce exact same information. Essentially, those commands are synonym for each other. Options “adv-router” and “A.B.C.D” behave differently depending on LSA type being examined, but for Type 1 they are identical.
Armed with that, let’s examine what R5 is sending us.
R2#show ip ospf data router 5.5.5.5
OSPF Router with ID (2.2.2.2) (Process ID 1)
Now, this is not what I expected to see… Remember I changed OSPF Router-ID of R5 to 55.55.55.55 just before? It’s easy to correct our mistake when we know this, but let’s use the database to see if we can see new information by ourselves.
R2#show ip ospf database OSPF Router with ID (2.2.2.2) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 1858 0x80000002 0x00D007 3 4.4.4.4 4.4.4.4 1858 0x80000002 0x00C373 5 55.55.55.55 55.55.55.55 1860 0x80000002 0x008F11 3
That one was easy, so let’s take a look at what R5 is sending us. Again, we can use two commands to get the exact same information – “show ip ospf database router 55.55.55.55″ and “show ip ospf database router adv-router 55.55.55.55″
R2#show ip ospf database router 55.55.55.55
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 41
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 55.55.55.55
Advertising Router: 55.55.55.55
LS Seq Number: 80000003
Checksum: 0x8D12
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 5.5.5.5
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 4.4.4.4
(Link Data) Router Interface address: 45.45.45.5
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 45.45.45.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
For the end of this article, I would just like to illustrate one of the most important concepts in OSPF – the fact that routers share identical databases. We see above Type 1 LSA from R5 on R2. Let’s examine the same LSA on R5 itself, as well as R4.
R5:
R5#show ip ospf database router self-originate
OSPF Router with ID (55.55.55.55) (Process ID 1)
Router Link States (Area 0)
LS age: 189
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 55.55.55.55
Advertising Router: 55.55.55.55
LS Seq Number: 80000003
Checksum: 0x8D12
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 5.5.5.5
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 4.4.4.4
(Link Data) Router Interface address: 45.45.45.5
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 45.45.45.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
R4:
R4#show ip ospf database router 55.55.55.55
OSPF Router with ID (4.4.4.4) (Process ID 1)
Router Link States (Area 0)
LS age: 220
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 55.55.55.55
Advertising Router: 55.55.55.55
LS Seq Number: 80000003
Checksum: 0x8D12
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 5.5.5.5
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 4.4.4.4
(Link Data) Router Interface address: 45.45.45.5
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 45.45.45.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
We can clearly see that apart from age, all information is exactly the same! For the very end, I would like to mention “internal” keyword, which is not documented. When using this option, you will see some additional internal IOS information about the LSA, but nothing of any real significance.
Next time, we’ll look into Type 2 LSAs and how to “fish” that information from the database. Enjoy your studies!
–
Marko Milivojevic – CCIE #18427
Senior Technical Instructor – IPexpert
Join our Online Study List






Hi Marko,
Great article, “show ip ospf database router self-originate”, “show ip ospf database router 2.2.2.2″ and “show ip ospf database adv-router 2.2.2.2 were always confusing. This article really will help everyone.
Thanks again
Sara
Thanks Marko. Good post, I will follow your next post about OSPF. I whonder how many people that have setup OSPF that don’t even know the different kinds of LSA types :)
Hey MArko,
really cool info presented. Waiting for all LSA 7 info. Nobody else hass explained this much in any course material. I am pursuing CCNP,CCIP & CCIE Voice
Dear Marko,
its really help me out.
Thanks,
Quisher Khan
Thanks for this blog. Is there a way to know from which interface LSA 1 is received?
Lets suppose we have two link (primary/backup) towards a destination network, can we determine whether we are getting LSA 1 from backup or not?