This section described the related concepts and the implementation process of OSPF GR.
OSPF graceful restart (GR) allows packets to be forwarded during OSPF restart. OSPF GR ensures service continuity and improves network reliability.
When the router restarts or performs a master/slave main control board switchover, it immediately ages all routing entries in the forwarding information base (FIB), which causes route interruptions. An adjacent router deletes the router from its neighbor list and notifies other routers of the restart or switchover. As a result, shortest path first (SPF) calculations are performed on the entire network again. If the router recovers in a short time, a neighbor relationship is reestablished. Frequent neighbor relationship changes cause route flapping.
To resolve this issue and avoid unnecessary SPF calculations, enable OSPF GR. After you enable OSPF GR on the router, the router restarts OSPF in GR mode and notifies an adjacent router that it will recover immediately. In this situation, the adjacent router does not delete the OSPF GR-enabled router from its neighbor list and other routers do not detect that the OSPF GR-enabled router is restarting. OSPF GR prevents route flapping caused by neighbor relationship changes. As shown in Figure 1, router A, router B, router C, and router D run OSPF, and router A and router B have OSPF GR enabled. When router A restarts in GR mode, router B helps router A perform a GR without notifying router C or router D of the GR. This process ensures service continuity.
GR
GR is one of high availability (HA) technologies, which comprise a set of comprehensive technologies, such as fault-tolerant redundancy, link protection, faulty node recovery, and traffic engineering. GR, a fault-tolerant redundancy technology, has been widely used for router upgrades and master/slave main control board switchovers. GR ensures proper traffic forwarding and service continuity during a routing protocol restart.
GR is classified into the following types by status:
GR is classified into the following types based on the implementation mode:
Grace LSA
When the router enters or leaves the GR state, it sends grace LSAs to notify its neighbors of the GR period, cause, and interface address.
Restarter
A restarter is a restarting router that can be configured to support totally or partly GR.
Helper
A helper helps a restarter maintain routing information and can be configured to support planned or unplanned GR. A policy can also be configured to enable the helper to selectively support GR.
GR period
A GR period is the time during which a GR is performed. The GR period cannot exceed 1800 seconds. A router can leave the GR state without waiting for GR to expire.
Table 1 describes differences between master/slave main control board switchovers with OSPF GR enabled and disabled.
Item |
Master/Slave Main Control Board Switchover with OSPF GR Disabled |
Master/Slave Main Control Board Switchover with OSPF GR Enabled |
|---|---|---|
Neighbor establishment |
OSPF neighbor relationships are reestablished. |
OSPF neighbor relationships are reestablished. |
Route calculation |
Routes are recalculated. |
Routes are recalculated. |
FIB |
FIBs change. |
FIBs remain unchanged. |
Route flapping |
The entire network detects route changes, and route flapping occurs for a short period of time. |
Except the neighbors of the router on which a master/slave main control board switchover occurred, other routers do not detect route changes. |
Impact on services |
Packets are lost during forwarding, and services are interrupted. |
No packets are lost during forwarding, and services are not affected. |
Figure 2 shows an OSPF GR process.
An OSPF GR process includes the following procedures:The restarter (router A) enters the GR state.
The restarter performs a master/slave main control board switchover.
When the slave main control board goes Up, the restarter immediately sends a grace LSA to notify the helper (router B) of the GR start, period, and cause. Then, the restarter sends five consecutive grace LSAs to the helper to ensure that the helper can receive a grace LSA.
During the GR, the helper retains a neighbor relationship with the restarter. Other routers do not detect the master/slave main control board switchover performed by the restarter.
The restarter stays in the GR state.
A master/slave main control board switchover or restarter restart can be manually performed or automatically triggered by faults. During the master/slave main control board switchover or restarter restart, the restarter does not delete the routing information from its routing table or FIB or reset its interface boards. This process ensures service continuity.
The restarter leaves the GR state.
If the GR is successful, the restarter reestablishes a neighbor relationship with the helper before the GR period expires. After the helper receives a grace LSA with an aging time of 3600 seconds from the restarter, the status of the neighbor relationship between the helper and restarter changes to Full.
If the GR fails, several cases occur on the restarter and helper.
The following conditions occur on the restarter:The GR expires, and the neighbor relationship does not recover completely.
Type 1 or Type 2 LSAs sent by the helper cause the restarter to fail to perform a bidirectional check.
The status of the interface that functions as the restarter changes.
The restarter receives 1-way Hello packets from the helper.
The restarter receives grace LSAs generated by another router on the same network segment.
Different designated routers (DRs) or backup designated routers (BDRs) are elected among the restarter and neighbors on the same network segment due to topology changes.
The following conditions occur on the helper:
The helper does not receive grace LSAs from the restarter before the neighbor relationship expires.
The status of the interface that functions as the helper changes.
The helper receives LSAs, which are different from the LSAs in its own link state database (LSDB), from other routers. You can configure the helper not to perform a strict LSA check to avoid this issue.
The helper receives grace LSAs from two routers on the same network segment at the same time.
The neighbor relationships between the helper and other routers change.