OSPF GR

NOTEs:

  • PICOS supports Graceful Restart (GR) for both OSPFv2 and OSPFv3.

  • Before configuring OSPF GR, you must enable OSPF's Opaque LSA capability by using the following command.

For OSPFv2, using command set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] capability opaque.

For OSPFv3, using command set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] capability opaque.

  • Be cautious: After executing the run graceful-restart prepare ospf or run graceful-restart prepare ospf6 command, the system will be in a waiting state for the OSPF protocol to restart. Users are not allowed to perform any OSPF configuration until the OSPF protocol restart is completed, or unpredictable results can occur.

  • Before restarting the OSPF process, the device needs to use the command run graceful-restart prepare ospf (for OSPFv2) or run graceful-restart prepare ospf6 (for OSPFv3) to send Type 9 LSAs for GR capability negotiation. After the negotiation, the OSPF process must be restarted within the negotiated grace-period; otherwise, it will timeout and exit the GR state.

Overview

OSPF GR (Graceful Restart) is a feature that allows a router to temporarily suspend OSPF routing operations without impacting the forwarding of data traffic. During a graceful restart, the router remains operational and continues forwarding packets using the routing information it had before OSPF protocol restarting process began.

In essence, OSPF GR allows a OSPF process to gracefully restart by preserving its OSPF neighbor relationships and forwarding state during the restart process.

Graceful restart is disabled by default. You can either globally enable graceful restart for all OSPF instances, or you can enable graceful restart for specific OSPF instance.

For a PICOS device, OSPF Graceful Restart involves the following operations:

Device as a restarting device

  • In OSPF Graceful Restart (GR), a router that undergoes a restart process is referred to as the restarting router or restarting device. Here's a detailed description of its role and behavior during the GR process:

  • Restarting Process Initiation: When a router undergoes a restart, it enters a restarting state. This can occur due to a planned restart (where the router voluntarily initiates the restart process) or an unplanned restart (such as a software upgrade or hardware failure).

    1. Neighbor State Maintenance: During the restarting process, the router continues to maintain its OSPF neighbor adjacencies. It sends hello packets to its OSPF neighbors, indicating its restarting capability. These hello packets contain the Restart State (RS) bit, indicating that the router is in the process of restarting.

    2. Graceful Restart LSAs: The restarting router advertises Graceful Restart (GR) LSAs into the OSPF domain, informing its neighbors about its restarting process and the estimated time for the restart to complete. These LSAs are Type 9 LSAs and are flooded throughout the OSPF domain.

    3. State Retention: Despite undergoing a restart, the restarting router retains its OSPF link-state database (LSDB) and continues forwarding traffic based on the pre-restart OSPF topology. This helps prevent service disruptions and maintains network stability during the restart process.

    4. Neighbor Acknowledgment: OSPF neighbors of the restarting router acknowledge the reception of GR LSAs and adjust their behavior accordingly. They continue forwarding traffic through the restarting router, considering it as a transit router, until it completes the restart process and reestablishes full adjacency.

    5. Restart Completion: Once the restarting router completes its restart process and is ready to resume normal operation, it sends OSPF hello packets without the RS bit set, indicating that it has completed the restart. It then reestablishes OSPF adjacencies with its neighbors and begins exchanging OSPF routing information.

  • The restarting router in OSPF GR ensures seamless network operation during the restart process by maintaining adjacency with OSPF neighbors, advertising its restarting capability, and retaining its OSPF LSDB to continue forwarding traffic without disruption.

Device as a Graceful Restart Helper

  • In OSPF Graceful Restart (GR), a router that assists a restarting router during its restart process is known as a Graceful Restart Helper. Here's a detailed description of its role and behavior:

  • Neighbor Detection: When a router undergoing restart sends OSPF hello packets with the Restart State (RS) bit set, indicating its restarting status, neighboring routers detect this and voluntarily become Graceful Restart Helpers. They recognize the need to assist the restarting router to maintain network stability during the restart process.

    1. LSDB Synchronization: Graceful Restart Helpers maintain a synchronized copy of the restarting router's Link-State Database (LSDB). They ensure that they have the same set of OSPF LSAs as the restarting router before the restart process began.

    2. Forwarding Continuity: During the restart process, Graceful Restart Helpers continue to forward traffic through the restarting router as if it were still operational. They do this based on the pre-restart OSPF topology information stored in their LSDB. This ensures that network traffic flows smoothly without interruptions.

    3. Designated Router Election: In OSPF broadcast and non-broadcast networks, Graceful Restart Helpers participate in the election of Designated Routers (DR) and Backup Designated Routers (BDR). They help maintain the integrity of the OSPF network topology by ensuring that DR and BDR elections are conducted correctly even during the restarting router's downtime.

    4. Monitoring Restart Progress: Graceful Restart Helpers continuously monitor the progress of the restarting router's restart process. They keep track of the receipt of Graceful Restart (GR) Link-State Advertisements (LSAs) from the restarting router and maintain synchronization with its restart state.

    5. Adjacency Retention: Helpers maintain OSPF adjacencies with the restarting router throughout the restart process. They acknowledge the receipt of GR LSAs from the restarting router and adjust their behavior to accommodate its restarting status, ensuring seamless traffic forwarding.

    6. Restart Completion Acknowledgment: Once the restarting router completes its restart process and resumes normal operation, it sends OSPF hello packets without the RS bit set. Graceful Restart Helpers recognize this and acknowledge the completion of the restart. They then transition back to normal OSPF operation mode.

Graceful Restart Helpers play a critical role in assisting a restarting router to maintain network stability and continuity during the restart process. They synchronize LSDBs, ensure traffic forwarding, participate in DR/BDR elections, monitor restart progress, retain adjacencies, and acknowledge restart completion, contributing to the overall resilience and reliability of the OSPF network.

Configuring OSPFv2 GR

Procedure

Step 1         Enable the capability to generate Opaque LSAs in the OSPF process to support OSPF GR through Type9 LSA.

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] capability opaque

Step 2         Enable OSPFv2 GR on the Restarting Router. By default, OSPFv2 GR is disabled.

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart enable <true | false>

Step 3         (Optional) Specify the GR restart interval on the Restarting Router. This determines the duration for which the restarting router remains in the Graceful Restart state. The default grace period is 120 seconds.

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] grace-period <grace-period

Step 4         Configure GR Helper Mode on Neighboring Routers.

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper [router-id <ipv4>] enable <true | false>

Step 5         (Optional) Configure Graceful Restart Helper parameters.

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper planned-only

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper strict-lsa-checking enable <true | false>

set protocols ospf [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper supported-grace-time <supported-grace-time

Step 6         Configure to let the restarting router advertises Graceful Restart (GR) LSAs into the OSPF domain.

  • Be cautious: After executing the run graceful-restart prepare ospf or run graceful-restart prepare ospf6 command, the system will be in a waiting state for the OSPF protocol to restart. Users are not allowed to perform any OSPF configuration until the OSPF protocol restart is completed, or unpredictable results can occur.

  • Before restarting the OSPF process, the device needs to use the command run graceful-restart prepare ospf (for OSPFv2) or run graceful-restart prepare ospf6 (for OSPFv3) to send Type 9 LSAs for GR capability negotiation. After the negotiation, the OSPF process must be restarted within the negotiated grace-period; otherwise, it will timeout and exit the GR state.

run graceful-restart prepare ospf

Step 7         Commit the configuration.   

commit

Step 8         Verify the configuration.

After the configuration is complete, run run show ospf [instance-id <instance-id>][vrf<vrf-name>] graceful-restart helper [detail] command to display the Graceful Restart Helper details including helper config changes.

By following these steps, you can configure OSPFv2 Graceful Restart to enhance network resilience and minimize service disruptions during router restarts.

Configuring OSPFv3 GR

Procedure

Step 1         Enable the capability to generate Opaque LSAs in the OSPF process to support OSPF GR through Type9 LSA.

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] capability opaque

Step 2         Enable OSPFv3 GR on the Restarting Router. By default, OSPFv3 GR is disabled.

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart enable <true | false>

Step 3         (Optional) Specify the GR restart interval on the Restarting Router. This determines the duration for which the restarting router remains in the Graceful Restart state. The default grace period is 120 seconds.

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] grace-period <grace-period

Step 4         Configure GR Helper Mode on Neighboring Routers.

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper [router-id <ipv4>] enable <true | false>

Step 5         (Optional) Configure Graceful Restart Helper parameters.

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper planned-only

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper lsa-checking-disable

set protocols ospf6 [instance-id <instance-id>] [vrf<vrf-name>] graceful-restart helper supported-grace-time <supported-grace-time

Step 6         Configure to let the restarting router advertises Graceful Restart (GR) LSAs into the OSPFv3 domain.

  • Be cautious: After executing the run graceful-restart prepare ospf or run graceful-restart prepare ospf6 command, the system will be in a waiting state for the OSPF protocol to restart. Users are not allowed to perform any OSPF configuration until the OSPF protocol restart is completed, or unpredictable results can occur.

  • Before restarting the OSPF process, the device needs to use the command run graceful-restart prepare ospf (for OSPFv2) or run graceful-restart prepare ospf6 (for OSPFv3) to send Type 9 LSAs for GR capability negotiation. After the negotiation, the OSPF process must be restarted within the negotiated grace-period; otherwise, it will timeout and exit the GR state.

run graceful-restart prepare ospf6

Step 7         Commit the configuration.   

commit

Step 8         Verify the configuration.

After the configuration is complete, run run show ospf6 [instance-id <instance-id>][vrf<vrf-name>] graceful-restart helper [detail] command to display the Graceful Restart Helper details including helper config changes.

By following these steps, you can configure OSPFv3 Graceful Restart to enhance network resilience and minimize service disruptions during router restarts.

Configuration Example

Networking Requirements

Figure 1. Network of Configuring OSPFv2 GR

ospf gr example.jpg

As shown in Figure 1, the OSPF network is divided into two areas, Area 0 and Area 1, among the three devices running the OSPF protocol: Switch A, Switch B, and Switch C. It is now required that restarting the OSPF protocol on Switch A should not affect the normal data forwarding during the restart process.

The configuration approach is as follows:

  1. Configure basic OSPF functions on each switch to achieve basic interoperability of OSPF networks.

  2. Enable Opaque LSA function on Switch A and Switch B to enable OSPF to support OSPF GR through Type9 LSA.

  3. Configure GR function on Switch A and Switch B to ensure normal data forwarding when OSPF protocol restarts.

Procedure

Switch A

Step 1         Configure the VLAN.

admin@SwitchA# set vlans vlan-id 10 admin@SwitchA# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 10 admin@SwitchA# set l3-interface vlan-interface vlan10 address 172.10.10.11 prefix-length 24 admin@SwitchA# set vlans vlan-id 10 l3-interface vlan10  

Step 2         Configure the OSPF protocol to advertise the network segments connected to each node.

admin@SwitchA# set protocols ospf router-id 1.1.1.1 admin@SwitchA# set protocols ospf network 172.10.10.0/24 area 1

Step 3         Enable the capability to generate Opaque LSAs in the OSPF process to support OSPF GR through Type9 LSA.

admin@SwitchA# set protocols ospf capability opaque

Step 4         Enable OSPF GR on Switch A. By default, OSPF GR is disabled.

Step 5         Commit the configuration.  

Switch B

Step 1  Configure VLAN.

Step 2         Configure the OSPF protocol to advertise the network segments connected to each node.

Step 3       Enable the capability to generate Opaque LSAs in the OSPF process to support OSPF GR through Type9 LSA.

Step 4         Configure GR Helper Mode on Switch B.

Step 5         Commit the configuration.  

Switch C

Step 1         Configure VLAN.

Step 2         Configure the OSPF protocol to advertise the network segments connected to each node.

Step 3       Commit the configuration.  

Verify the Configuration

  • After the configuration is complete, use command run show ospf neighbor to check the OSPF neighbor information. From the result, we can see that the neighbor state of Switch A and Switch B is Full.

  • On Switch B, use command run show ospf graceful-restart helper detail to check the information of OSPF graceful restart helper. From the result, we can see that the negotiated OSPF GR information, including Grace period, Remaining GraceTime, etc.

  • On Switch A, use the following Linux command to terminate the OSPF process. Then, the system will automatically restart the OSPF process.

  • On Switch B, check the GR status. From the result, we can see that during the restart of ospfd on Switch A, the neighbor relationship between B and A remains in the FULL state, unaffected by the graceful restart of Switch A's OSPF process.

 

 

Copyright © 2024 Pica8 Inc. All Rights Reserved.