Skip to content

Add ospf nsr - #1547

Draft
ky-teramae wants to merge 3 commits into
openconfig:masterfrom
ky-teramae:add_ospf-nsr
Draft

ky-teramae wants to merge 3 commits into
openconfig:masterfrom
ky-teramae:add_ospf-nsr

Conversation

@ky-teramae

@ky-teramae ky-teramae commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Change Scope

  • Add nsr container to OSPF global structure, equivalent to that of
    ISIS global config.
  • Backward compatible: Yes (new optional container only).

Platform Implementations

  • Implementation A: Cisco IOS XR — nsr (OSPFv3: same command under router ospfv3)
router ospf 1
 nsr disable

router ospfv3 1
 nsr disable
  • Implementation B: DriveNets DNOS — nsr
protocols ospf nsr enabled

protocols ospfv3 nsr enabled

Tree View

 module: openconfig-ospfv2
   +--rw network-instances
      +--rw network-instance* [name]
         +--rw protocols
            +--rw protocol* [identifier name]
               +--rw ospfv2
                  +--rw global
                     +--rw inter-area-propagation-policies
                        ...
+                    +--rw nsr
+                       +--rw config
+                          +--rw enabled?   boolean
 module: openconfig-ospf (OSPFv3, shares the ospf-global submodule)
   +--rw network-instances
      +--rw network-instance* [name]
         +--rw protocols
            +--rw protocol* [identifier name]
               +--rw ospfv3
                  +--rw global
                     +--rw inter-area-propagation-policies
                        ...
+                    +--rw nsr
+                       +--rw config
+                          +--rw enabled?   boolean

OpenConfig's ISIS model has a dedicated nsr container (distinct from
graceful-restart) to enable Non-Stop Routing, but neither OSPF (v3)
nor OSPFv2 has an equivalent, despite NSR being a distinct failover
mechanism from GR (no protocol restart/signalling with neighbours).
Add an nsr container with a single enabled leaf to both, matching
the ISIS admin-config pattern. LDP NSR support is out of scope for
this change.
The nsr-specific grouping only ever contained a single "enabled"
leaf, but its description was phrased as if it were a re-usable
grouping (copied from the ISIS admin-config pattern) despite being
used by nothing else. Replace it with an actual re-usable
admin-config-style grouping (ospf(v2)-global-admin-config), mirroring
ISIS's admin-config exactly, and have the nsr container use that;
the nsr-specific context now lives only in the nsr container's own
description, not in the grouping. Also move the new grouping to
after inter-areapp-config, and the new nsr container to after
inter-area-propagation-policies, so the diff appends rather than
inserting into the middle of the existing order. No schema change.
Also replace the placeholder "Align revisions across modules." text
on unmodified sibling submodules with the same revision description
used on the files that actually changed, per reviewer request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds Non-Stop Routing (NSR) configuration and state containers to the global structures of both OSPF and OSPFv2 models, aligning them with the ISIS global configuration. The feedback recommends removing the default false; statement from the enabled leaves in the newly introduced admin-config groupings. This change aligns with OpenConfig design patterns to prevent platform-dependent compatibility issues.

Comment on lines +223 to +230
leaf enabled {
type boolean;
default false;
description
"When set to true, the functionality within which this leaf
is defined is enabled; when set to false it is explicitly
disabled.";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In OpenConfig models, it is a standard design pattern to omit default values for boolean enabled leaves. Specifying default false; can cause issues on platforms where the feature is enabled by default or where the default behavior is platform-dependent. Removing the default statement ensures better platform compatibility and aligns with other enabled leaves in the OSPF models (such as graceful-restart and BFD).

    leaf enabled {
      type boolean;
      description
        "When set to true, the functionality within which this leaf
        is defined is enabled; when set to false it is explicitly
        disabled.";
    }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — applying this. doc/openconfig_style_guide.md says defaults should be avoided unless required by a feature specification, and NSR has no such spec. The existing enabled leaves for graceful-restart in both OSPF modules also carry no default.

The platform default varies — IOS XR documents NSR as enabled by default for OSPF (nsr disable to turn it off), while classic IOS/IOS-XE has it disabled by default. Baking default false into the model would contradict at least one of them.

Note this intentionally diverges from ISIS admin-config, which does specify default false.

Comment on lines +347 to +354
leaf enabled {
type boolean;
default false;
description
"When set to true, the functionality within which this leaf
is defined is enabled; when set to false it is explicitly
disabled.";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In OpenConfig models, it is a standard design pattern to omit default values for boolean enabled leaves. Specifying default false; can cause issues on platforms where the feature is enabled by default or where the default behavior is platform-dependent. Removing the default statement ensures better platform compatibility and aligns with other enabled leaves in the OSPF models (such as graceful-restart and BFD).

    leaf enabled {
      type boolean;
      description
        "When set to true, the functionality within which this leaf
        is defined is enabled; when set to false it is explicitly
        disabled.";
    }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — applying this. doc/openconfig_style_guide.md says defaults should be avoided unless required by a feature specification, and NSR has no such spec. The existing enabled leaves for graceful-restart in both OSPF modules also carry no default.

The platform default varies — IOS XR documents NSR as enabled by default for OSPF (nsr disable to turn it off), while classic IOS/IOS-XE has it disabled by default. Baking default false into the model would contradict at least one of them.

Note this intentionally diverges from ISIS admin-config, which does specify default false.

Boolean enabled leafs in OpenConfig conventionally have no default,
to avoid constraining platform behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant