OSPF - Database Example
Here is an example of the output resulting from the show ip ospf database
command on a Cisco router. This will include various LSA types, like Router LSAs, Network LSAs, and Summary LSAs, to show the structure of OSPF information.
Example Output of show ip ospf database
Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1.1 1.1.1.1 1200 0x80000005 0x0027A3 3 2.2.2.2 2.2.2.2 850 0x80000007 0x0045B1 4 3.3.3.3 3.3.3.3 1300 0x80000003 0x0031A2 2 Network Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.1.1 1.1.1.1 600 0x80000002 0x001BC3 10.1.1.1 2.2.2.2 800 0x80000003 0x002FD1 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum Metric 192.168.2.0 1.1.1.1 1200 0x80000001 0x001A12 20 10.2.2.0 3.3.3.3 950 0x80000004 0x001C45 10 ASBR Summary Link States (Area 0) Link ID ADV Router Age Seq# Checksum Metric 4.4.4.4 3.3.3.3 950 0x80000002 0x001D88 30 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Route Tag 172.16.10.0 4.4.4.4 1200 0x80000001 0x0045CD 0 192.168.50.0 4.4.4.4 1100 0x80000002 0x0029F1 0
Breakdown of Each Section
-
Router Link States (Type 1 LSAs):
- Lists all Router LSAs in Area 0.
- Each LSA is identified by its
Link ID
, which in this case is the Router ID of the advertising router. - The
ADV Router
field is the same asLink ID
because a Router LSA advertises its own information. Age
is the time (in seconds) since the LSA was generated.Seq#
is the LSA sequence number, which is used to ensure the latest version is in the database.Link count
shows how many links (interfaces) are included in this LSA.
-
Network Link States (Type 2 LSAs):
- Generated by the Designated Router (DR) on a multi-access network.
Link ID
is the IP address of the DR on the shared segment.ADV Router
is the Router ID of the DR.
-
Summary Net Link States (Type 3 LSAs):
- Generated by Area Border Routers (ABRs) to advertise inter-area routes.
Link ID
is the destination network's IP prefix.ADV Router
is the Router ID of the ABR originating the LSA.Metric
represents the OSPF cost to reach this network.
-
ASBR Summary Link States (Type 4 LSAs):
- Advertises the presence of an Autonomous System Boundary Router (ASBR) to the rest of the OSPF area.
Link ID
is the Router ID of the ASBR.ADV Router
is the Router ID of the ABR advertising this ASBR.Metric
represents the cost to reach the ASBR.
-
Type-5 AS External Link States (Type 5 LSAs):
- Generated by ASBRs to advertise external routes learned from outside the OSPF domain.
Link ID
is the external network being advertised.ADV Router
is the Router ID of the ASBR.Route Tag
can be used to identify specific routes.
How to Interpret Each Field
-
Link ID:
- Identifies the router or network that the LSA is describing.
- For Type 1 LSAs, it’s the Router ID.
- For Type 2 LSAs, it’s the IP address of the DR.
- For Type 3 and 4 LSAs, it’s the network IP prefix.
- For Type 5 LSAs, it’s the external network being advertised.
-
ADV Router:
- The Router ID of the router that generated this LSA.
- Helps you determine the source of the LSA.
-
Age:
- Indicates how long ago (in seconds) the LSA was created or last refreshed.
-
Seq# (Sequence Number):
- Used for LSA version control.
- Higher sequence numbers indicate newer LSAs.
-
Checksum:
- Ensures the integrity of the LSA.
- Used to detect corrupted LSAs.
-
Link Count / Metric / Route Tag:
- Link Count: Number of links described in a Router LSA.
- Metric: OSPF cost to reach the advertised destination.
- Route Tag: Used in External LSAs to add extra information.
This example provides a snapshot of a typical OSPF database, showing how different LSAs are organized and identified within an OSPF area. You can use this as a reference to understand the show ip ospf database
output on your own Cisco devices.
Links
https://networklessons.com/ospf/how-to-read-the-ospf-database
Links to this page:
- OSPF - LSA checksum
- OSPF - Link ID and ADV Router in the OSPF database
- OSPF - Link ID in the OSPF database
- OSPF Do Not Age (DNA) Flag
- OSPF LSA Persistence with DNA flag
- OSPF Packet Types and Their Transmission Methods
- OSPF Summarization Restrictions Within an Area
- OSPF Understanding LSA Aging and Refreshing