Why does an OSPF router re-originate its LSAs every 30 minutes without any change, and how is an LSA flushed from every database?
answer
- every copy keeps ageing
- LSRefreshTime versus MaxAge
- new sequence number, same body
- premature ageing, originator only
basics
~20 sOSPF LSAs age in every database, so each originator re-floods every LSA with a new sequence number every 30 minutes, keeping it short of MaxAge (1 hour). An LSA is flushed by setting its age to MaxAge and reflooding it.
solid answer
~50 sEvery OSPF LSA carries an `LS age` that grows by one each second in every router's database. An LSA that reaches `MaxAge` (1 hour) is no longer used for routing and is flooded out of the domain. To keep live LSAs alive, the originator re-originates each one when its age reaches `LSRefreshTime` (30 minutes): a new sequence number, the same body. RFC 2328 calls this periodic origination a source of robustness — it repairs any copy lost or corrupted along the way, and a router that disappears without withdrawing its LSAs leaves copies that expire on their own. Because only the sequence number and checksum change, a refresh does not trigger a routing recalculation. To withdraw an LSA on purpose, the originator uses **premature ageing**: it sets the age to `MaxAge`, keeps the sequence number and refloods it. Only the originator may do this.
go deeper
Recall that OSPF re-floods every LSA every 30 minutes and that an LSA reaching one hour of age is removed from every database.
Explain how age grows in the database and per hop, why refresh keeps LSAs below MaxAge, and how premature ageing flushes an LSA.
Explain what happens to a vanished router's LSAs, why a refresh does not trigger recalculation, and why only the originator may flush an LSA.
Discuss periodic refresh as a robustness design: the steady flooding it costs in a large area against the self-repair and garbage collection it buys.
## How LS age works The `LS age` field in an OSPF LSA header counts seconds since the LSA was originated. - It is set to **0** when the originator creates the instance. - It grows by **one per second** while the LSA sits in any router's database. - It grows by **`InfTransDelay`** (configured per interface, always above zero) each time the LSA is copied into a Link State Update. - It never passes **`MaxAge`**, 1 hour (3,600 s). - It is **excluded from the LS checksum**, so ageing never forces a checksum recomputation. - Each time the age crosses a multiple of **`CheckAge`** (5 minutes), the router re-verifies the checksum; a failure there means a memory or software fault, and RFC 2328 says the router should at least be restarted. ## The constants involved | RFC 2328 constant | Value | Role | |---|---|---| | `LSRefreshTime` | 30 minutes | age at which an originator re-originates its LSA | | `MaxAge` | 1 hour | age at which an LSA is unusable and flushed | | `MinLSInterval` | 5 seconds | minimum gap between two originations of one LSA | | `CheckAge` | 5 minutes | interval for re-verifying a stored checksum | These are **architectural constants** in RFC 2328 Appendix B, not configuration defaults: the specification fixes them for every OSPFv2 router, which is what lets routers agree on when an LSA expires. ## Why refresh at all A refresh is a new instance with an incremented sequence number and an unchanged body. RFC 2328 lists it as the first of the events that cause an origination and says it adds robustness to the link-state algorithm: - **Self-repair**: a copy that was lost or corrupted somewhere is replaced within 30 minutes, without anyone having to detect the fault. - **Garbage collection**: if a router disappears without withdrawing its LSAs, nobody refreshes them, and every copy reaches `MaxAge` within about an hour of its last refresh and is flushed. - **No recalculation**: when installing a new instance, a router compares contents; differences in sequence number and checksum alone are not differences, so a refresh does not trigger a routing table calculation. The 30-minute margin below `MaxAge` gives the refreshed instance ample time to reach every router before the old one could expire. LSAs that only describe unreachable destinations are not refreshed; they are flushed instead. ## Flushing: MaxAge and premature ageing An LSA leaves the domain the same way whether its age reached `MaxAge` naturally or was set there on purpose: 1. The router floods the `MaxAge` instance like a newly originated LSA. 2. Receivers accept it: with equal sequence number and checksum, an instance at `MaxAge` counts as more recent. 3. Every router stops using the LSA for routing and floods it on. 4. Each router deletes it once it is on no neighbour's retransmission list and no neighbour is in the Exchange or Loading state of the database exchange. Setting the age to `MaxAge` deliberately is **premature ageing**. RFC 2328 uses it: - when a sequence number reaches `0x7fffffff` and must start again at `0x80000001`; - to withdraw an AS-external route that is no longer reachable — preferred over re-advertising it with the metric `LSInfinity`; - when a router is no longer the designated router and must withdraw the network-LSA it originated; - when a router receives a stale copy of its own LSA that it no longer wants to originate. ## Who may flush **A router may prematurely age only its own LSAs** — those whose `Advertising Router` is its Router ID, or network-LSAs whose `Link State ID` is one of its interface addresses. A router that finds a stale LSA from another router leaves it to age out. This keeps every LSA under the authority of the one router that describes those links first-hand. ## Putting a timeline on it Suppose R10 in a ten-router area is powered off at 10:00, having last refreshed its router-LSA at 09:50. - Once the Hello protocol declares R10 dead, its neighbours re-originate their own router-LSAs without the link to it, and the computed routes change. - R10's own router-LSA remains in every database, but routes through R10 are already gone because no live router still advertises a link to it. - At about 10:50 the stale LSA reaches `MaxAge` and is flushed; nobody had to withdraw it.
- Does a 30-minute OSPF refresh with an unchanged body make routers rerun the routing calculation?No. When installing a new instance, RFC 2328 §13.2 compares contents: Options, the length, a change to or from `MaxAge`, and the body. A change in only the sequence number and checksum is not a difference, so a plain refresh is installed and flooded without scheduling a recalculation.
- Why may an OSPF router not prematurely age an LSA that another router originated?RFC 2328 §14.1 forbids it: only the originator speaks for the links an LSA describes. Letting third parties flush LSAs would let one faulty router erase another's topology. A stale LSA from a vanished router is left to reach `MaxAge` naturally, which takes at most about an hour after its last refresh.
- How does an OSPF router withdraw an AS-external route that is no longer reachable?It prematurely ages its AS-external-LSA: sets `LS age` to `MaxAge` and refloods it, so every router drops the route. RFC 2328 prefers this to the alternative of originating a new instance with the metric `LSInfinity` (`0xffffff`), which would keep a useless LSA in every database.
saying these in an interview costs you the question
- OSPF refreshes each LSA every 30 seconds, like a periodic routing update.
- A refreshed OSPF LSA with unchanged contents makes every router rerun SPF.
- Any OSPF router can flush a stale LSA by setting its age to MaxAge.
- An OSPF LSA at MaxAge is deleted from the database the moment it reaches that age.
- OSPF's 30-minute refresh and 1-hour MaxAge are configuration defaults, not protocol constants.