How does OSPF decide an LSA is newer, and how are LSAs refreshed and removed?
Show the answer
Say this first
Each LSA has a 32-bit sequence number that starts at 0x80000001 and increases with every new copy. Higher sequence wins, then higher checksum, then an age of MaxAge. The originator refreshes every 30 minutes, and an LSA that reaches MaxAge, 3600 seconds, is flushed. To withdraw early, the originator floods it at MaxAge.
Go deeper
Constants from RFC 2328
| Name | Value |
|---|---|
| LSRefreshTime | 1800 s |
| MaxAge | 3600 s |
| MaxAgeDiff | 900 s |
| InitialSequenceNumber | 0x80000001 |
| MaxSequenceNumber | 0x7FFFFFFF |
Which copy is newer
- Higher sequence number.
- If equal, higher checksum.
- If equal, a copy at MaxAge is newer.
- If ages differ by more than MaxAgeDiff, the younger copy is newer. Otherwise they are the same.
Reading it in the database
Age counts up from 0. Seq# shows the sequence. An LSA with a high and rising sequence number on a stable
network means it is being re-originated again and again: a flapping link or a duplicate router ID.
Withdrawal
When a router removes a prefix it originated, such as a stopped redistribution, it sets the LSA age to 3600 and floods it. Every router removes it after acknowledging it. That is "premature aging".
They will ask next
What happens when the sequence number reaches 0x7FFFFFFF?
The originator flushes the LSA by flooding it at MaxAge, waits for it to be acknowledged, and then originates it again at 0x80000001. At one refresh every 30 minutes, nobody will see it on a real network.
Traps
- Saying LSAs time out after 30 minutes. 30 minutes is the refresh. MaxAge is 60 minutes.