This article provides information on how the OSPF route is deleted from the routing table, when the route becomes unreachable.
There is a field called 'age', which is an unsigned 16-bit integer that indicates the age of the LSA in seconds. The range is 0 to 3600 (one hour, known as MaxAge). When a router originates an LSA, the router sets the age to 0. As the flooded LSA transits a router, the age is incremented by a number of seconds specified by
InfTransDelay. The age is also incremented as it resides in the database. When an LSA reaches MaxAge, the LSA is re-flooded and then flushed from the database.
When a router needs to flush an LSA from all databases, it prematurely sets the age to MaxAge which is 3600 and re-floods it. Only the router that originated the LSA can prematurely age it and not the other routers.
The same happens when a route becomes inactive in the originating router and then an LSA with MaxAge is flooded to the neighbors. See the below output of
get vr trust protocol ospf database detail
and
debug ospf all
.
Age: 57
Seq Number: 0x80000001
Checksum: 0x1b5b
Advertising Router: 172.27.201.186
Link State ID: 172.27.201.131
Length: 32
Options: Extern DC
Network mask: 255.255.255.0
Attached Routers = 2
172.27.201.186
172.27.201.132
## 2011-07-21 03:46:57 : ospf: recv pkt on ethernet0/2, 172.27.201.131->224.0.0.5
## 2011-07-21 03:46:57 : ospf: recv LSU from 172.27.201.186 on ethernet0/2 in area 0.0.0.0
## 2011-07-21 03:46:57 : ospf: recv LSA in area 0.0.0.0 from nbr 172.27.201.186 ..
type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 age 3600 checksum 0x1b5b
## 2011-07-21 03:46:57 : ospf: compare age with existing LSA, result newer
## 2011-07-21 03:46:57 : ospf: Update LSA in area 0.0.0.0 type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 age 3600 supressed 0
## 2011-07-21 03:46:57 : ospf: check flood LSA on loopback.1
[area 0.0.0.0 type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 age 3600 checksum 0x1b5b]
## 2011-07-21 03:46:57 : ospf: lsa content changed? no reduce flooding? yes bumped? no
## 2011-07-21 03:46:57 : ospf: check flood LSA on ethernet0/2
[area 0.0.0.0 type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 age 3600 checksum 0x1b5b]
## 2011-07-21 03:46:57 : ospf: lsa content changed? no reduce flooding? yes bumped? no
## 2011-07-21 03:46:57 : ospf: Delete LSA in area 0.0.0.0 type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 age 3600
## 2011-07-21 03:46:57 : ospf: Queue delayed ACK for LSA ..
type 2 id 172.27.201.131 adv-rtr 172.27.201.186 seq 0x80000001 to nbr 172.27.201.186
In the above debug, we can see that the LSA with sequence number
0x80000001 is received from the neighbor 172.27.201.186 with age being set to Maxage. And the same LSA is being removed from the OSPF database of the neighbor.