How exactly does OSPF fill the LSDB? Let’s zoom in on the operation of how OSPF keeps its link-state database up-to-date:
Each LSA has an aging timer that carries the link-state age field. By default, each OSPF LSA is only valid for 30 minutes. If the LSA expires then the router that created the LSA will resend the LSA and increase the sequence number.
Let’s walk through this flowchart together. In this example, a new LSA is arriving at the router, and OSPF has to decide what to do with it:
- If the LSA isn’t already in the LSDB it will be added, and an LSAck (acknowledgment) will be sent to the OSPF neighbor. The LSA will be flooded to all other OSPF neighbors, and we have to run SPF to update our routing table.
- If the LSA is already in the LSDB and the sequence number is the same, then we will ignore the LSA.
- If the LSA is already in the LSDB and the sequence number is different, then we have to take action:
- If the sequence number is higher it means this information is newer and we have to add it to our LSDB.
- If the sequence number is lower it means our OSPF neighbor has an old LSA and we should help them. We will send a LSU (Link state update) including the newer LSA to our OSPF neighbor. The LSU is an envelope that can carry multiple LSAs in it.
It’s not just the sequence number that OSPF will look at to determine if an LSA is more recent. It will consider the LSA to be more recent if it has the following: