I. Time
1. LSRefreshTime (interval for updating LSAs): 1800s
To ensure database accuracy, OSPF updates each LSA every 30 minutes and increases the sequence number by 1 each time an LSA is updated. After receiving a new LSA, the LSA resets the timer and recalculates the time. If the LSA is not refreshed within one hour, the LSA is deleted from the database.
Sometimes, the sequence number needs to be looped back to the original value. In this case, the LSA is discarded in advance (the maximum service life timer is set to 1 immediately) and is deleted. Then, the LSA uses the sequence number 0X800001.
2. MaxAge (LSA aging time): 3600s
The OSPF periodically updates the LSA every 1800s. If the LSA is not updated in the 3600s, the LSA is deleted from the database. That is, the LSA is aged out.
3. RxmtInterval (interval for retransmitting LSAs): 5s
Indicates the length of the waiting time for retransmitting the OSPF packet when no acknowledgment is obtained. The default value is 5 seconds.
4. Hello time
(1) HelloInterval (interval for sending Hello packets): 10s/30s
Interval for sending Hello packets on a router interface.
(2) RouterDeadInterval (time when the router is disabled after the Hello message is received) 40s/120s
If no new Hello packet is received from the neighbor within 40 seconds or 120 seconds, the neighbor is declared invalid (dead).
5. WaitTimer (DR election waiting time): 40s
The router that starts the OSPF process waits for a period of time. If you do not start the OSPF process of other routes within this period, the first route considers itself as the DR and cannot be elected again, this wait time is called WaitTimer timer, and Cisco WaitTimer is 40 seconds. During this period, the routes that you started are involved in the election. Therefore, in the actual working environment, you only start two s in 40 seconds. The DR is generated in the routes that are started on the first two s. After a period of time, the longest route is most likely to be a DR.
II. LSA Aging Mechanism
1. The LSA is identified by the LS type, LS identifier, and advertising router. The LSA is identified by the sequence number, checksum, and aging time.
The Seq: sequence number (Seq) ranges from 0x80000001 to 0x7fffffff. The larger the value is, the larger the value is.
The Checksum: checksum calculates all fields except the Age field and checks the fields every 5 minutes.
The value of Age: ranges from 0 to 3600s and is 16 bits long. When a router sends an LSA, it sets the Age to 0. When the LSA passes through one router, the Age increases. When one LSA is saved in the LSDB, the aging time also increases.
When multiple instances of the same LSA (LS type, LS ID, and advertising router) are received, the following method is used to determine which LSA is the latest:
(1) Compare the sequence number of the LSA instance. A larger value indicates a higher sequence number.
(2) If the serial numbers are the same, the checksum is compared. The larger the sequence number is, the more new the checksum is.
(3) If the checksum is the same, the aging time is compared. If only one LSA has the aging time of MaxAge (3600 seconds), the aging time is the latest.
(4) If the aging time of LSAs is longer than 15 minutes (called MaxAgeDiff), the shorter the aging time is, the later the aging time is.
(5) If the two LSAs cannot be distinguished, the two LSAs are the same.
2. Sequence number, checksum, and aging time
Each LSA contains the three values. OSPFv2 uses linear space (note 1). The sequence number ranges from 0x80000001 to 0x7fffffff.
The checksum is used to calculate the fields except the Age field. The Age field increases (InfTransDelay) every time a node passes through a node. If the Age field is contained, each node must recalculate the checksum. Each LSA in the LSDB needs to recalculate the checksum every 5 minutes to ensure that the LSA is not damaged in the database.
The aging time is the lifetime (16 bits) of the LSA, and the range is 0-3600 seconds. When the LSA is flooded, a InfTransDelay time needs to be added to a router. By default, the time is 1s on the Cisco device, which can be changed by running the ip ospf transimit-delay command.