OSPF neighborship, database and routing table

OSPF sometimes can be a confusing protocol. For example if you turn on a light switch, you simply get the immediate result: Light is on. What if when you turn on the light switch but you see the shining light bulb after 40 seconds then it is more difficult to understand the result of your actions. This was a small introduction to this post which I will try to write about he link between OSPF neighborship, OSPF database and routing table. All tests are done on a virtual SRX firewall in packet mode. I have cropped a section of my OSPF topology to simplify this post.

ospf-neighborship-database-lsa

We simply have two routers connected via a point to point link and they both run OSPF. FF31 router is an ABR and J204 is an internal router (which is actually a routing instance on another router but we can ignore this detail)

On this setup following are the OSPF details

J204: Router ID=10.1.1.204, Interface IP: 200.1.2.2
J31: Router ID=10.1.1.31, Interface IP: 200.1.2.1

Question #1: What happens to the LSAs advertised by J204 and routes if the neighborship goes down?

At this point of time J31 has a healthy relationship with its neighbor J204 i.e neighborship is in FULL state and it has received Router LSA(1) from this single neighbor. As an example, we also display the route 173.1.1.0/24 advertised by the neighbor 10.1.1.204 in the routing table

Now we bring down neighborship by deactivating the routing instance J204. Now from this point, J204 router is dead. Let’s see how J31 sees this.

Now if we check the neighbor status, we can see that OSPF Dead timer goes to zero and neighbor disappears. When we check the route 173.1.1.0/24, we also see that it is gone.

but let’s check the LSA.

Yes we J31 router, although it has lost the neighborship, it didn’t remove the LSA from its database. I believe if we don’t do anything, it will take ~3000 seconds more to reach its MaxAge 3600 to remove this LSA from the database.

Question #2: What happens if we bring the same J204 router back into OSPF domain?

J31 establishes adjacency with J204 again and LSA is refreshed with a new sequence number but up until we receive the new LSA we continue to keep the old one.

If we check the wire when these events occur, we can see the LSA sent from the newly joined J204.

In a nutshell,

  • If neighborship is down, routes associated with that neighbor will be removed from routing table
  • LSAs will stay if neighborship goes down abruptly till their MaxAge
  • Having an LSA in the database doesn’t mean we should install it on the routing table

You have a feedback?