ospf link state advertisement

How OSPF Link State Advertisement works

OSPF link state advertisements are advertisements the router floods to other routers when neighbors are becoming adjacent. An OSPF router adds or removes directly connected links to or from its LSDB during this phase. The OSPF link state advertisement contains a list of networks advertised from the adjacent router.

OSPF uses six different link state advertisement types for ipv4 routing:

  • Type 1 router link state advertisement
  • Type 2 network link state advertisement
  • Type 3 summary link state advertisement
  • Type 4 ASBR summary link state advertisement
  • Type 5 AS external link state advertisement
  • Type 7 NSSA external link state advertisement

In this guide we will discuss the first three types which are used to build the shortest path first tree for Intra-area and Inter-area routes. We will be using the below network diagram. Visit our multi area ospf lab to learn how to configure and follow along.

multi area ospf configuration

What is the purpose of link state advertisements

Link state advertisements contain important components for the attached router to understand what networks is trying to advertise with it. When analyzing a packet there are 3 main components we can focus on to gain the best knowledge of what’s going on.

  • LSA Sequences
  • LSA Age and Flooding
  • LSA Type

Link state advertisement sequence

OSPF uses sequence numbers to remove problems caused by delays. The link state advertisement (LSA) sequence is a 32 bit number used for versioning. First the original router sends out a LSA. Then the number is incremented if the router receives a sequence that’s greater than the one in the Link state advertisement database.

The router discards the advertisement if the number is lower. A wireshark packet of the packet show below.

link state advertisement sequence number

Link state advertisement age and flooding

OSPF has a safety measure to make sure all routers maintain a consistent database within an area. An age is entered into the database every 1 second. Once the LSA age reaches 1800 seconds, the originating router sends a new LSA with the age set to 0.

link state advertisement age and flooding

OSPF link state advertisement types

Routers within an OSPF area have the same set of LSAs for that area. The cisco routers ospf link state advertisement database can be seen with the command show ip ospf database.

router ospf database
router ospf database

Link state advertisement type 1: Router Link

Every OSPF router advertises a type 1 LSA. Type 1 LSAs are not advertised outside of its area. The type 1 LSA correlates the neighbor router identification to help build those connections in the same area.

type 1 lsa packet
type 1 lsa packet

This packet shows the following important attributes:

  • First ospf link state advertisement type
  • Then the advertising router id
  • And then the number of links associated with that router. Stubs are links that talk to end devices and transit are links that can communicate with other routers

Link state advertisement type 2: Network Link

The DR or designated router always advertises the type 2 link state advertisement. This identifies all of the routers attached to the network. Just like Type 1 LSAs, Type 2 LSAs are not advertised outside of the area. Using the command show ip ospf neighbor can identify the DR in the area.

When the DR changes a new LSA is created causing SPF to run again. The Designated router can be altered by changing the ospf priority.

type 2 lsa packet
type 2 LSA packet

Link state advertisement type 3: Summary Link

When dealing with ospf link state advertisements from other areas, a type 3 LSA packet gets sent. OSPF ABRs (area border routers) participate in multiple areas. These routers make sure type 1 LSAs are reachable in other areas. The type 1 LSAs are not forwarded but a type 3 LSA is created.

Type 3 LSA packet

The above is a picture of what R3 receives from R4. These types of updates help determine the metric and path to reach a destined network.


Comments are closed.