Skip to content

Add BGP group/neighbor level and policy support for AIGP#1451

Open
jenna-mccampbell wants to merge 6 commits intoopenconfig:masterfrom
jenna-mccampbell:aigp
Open

Add BGP group/neighbor level and policy support for AIGP#1451
jenna-mccampbell wants to merge 6 commits intoopenconfig:masterfrom
jenna-mccampbell:aigp

Conversation

@jenna-mccampbell
Copy link
Copy Markdown

Change Scope

  • This change adds the ability to enable BGP AIGP exchange between peers at
    the group and neighbor level for IPv4 and IPv6 unicast address families.
    It also adds the ability to set an arbitrary AIGP value in a BGP policy.
  • This change is backwards compatible.

Platform Implementations

Note: Implementation A and Implementation B align well with the paths added
here. Implementation C does not allow setting an arbitrary AIGP value in
policy. AIGP value can instead be originated and adjusted via addition,
subtraction, multiplication, or division. Implementation D supports AIGP
enablement only in the base router BGP instance (not per group or
neighbor) and does not support AIGP manipulation in route policies.

Tree View

 module: openconfig-network-instance
   +--rw network-instances
      +--rw network-instance* [name]
         +--rw protocols
         |  +--rw protocol* [identifier name]
         |     +--rw bgp
         |     |  +--rw neighbors
         |     |  |  +--rw neighbor* [neighbor-address]
         |     |  |     +--rw afi-safis
         |     |  |     |  +--rw afi-safi* [afi-safi-name]
         |     |  |     |     +--rw ipv4-unicast
         |     |  |     |     |  +--rw prefix-limit
         |     |  |     |     |  +--rw prefix-limit-received
         |     |  |     |     |  +--rw config
         |     |  |     |     |  |  +--rw send-default-route?           boolean
         |     |  |     |     |  |  +--rw extended-next-hop-encoding?   boolean
+        |     |  |     |     |  |  +--rw enable-aigp?                  boolean
         |     |  |     |     |  +--ro state
         |     |  |     |     |     +--ro send-default-route?           boolean
         |     |  |     |     |     +--ro extended-next-hop-encoding?   boolean
+        |     |  |     |     |     +--ro enable-aigp?                  boolean
         |     |  |     |     +--rw ipv6-unicast
         |     |  |     |     |  +--rw prefix-limit
         |     |  |     |     |  +--rw prefix-limit-received
         |     |  |     |     |  +--rw config
         |     |  |     |     |  |  +--rw send-default-route?   boolean
+        |     |  |     |     |  |  +--rw enable-aigp?          boolean
         |     |  |     |     |  +--ro state
         |     |  |     |     |     +--ro send-default-route?   boolean
+        |     |  |     |     |     +--ro enable-aigp?          boolean
         |     |  |     |     +--rw ipv4-labeled-unicast
         |     |  +--rw peer-groups
         |     |  |  +--rw peer-group* [peer-group-name]
         |     |  |     +--rw afi-safis
         |     |  |     |  +--rw afi-safi* [afi-safi-name]
         |     |  |     |     +--rw ipv4-unicast
         |     |  |     |     |  +--rw prefix-limit
         |     |  |     |     |  +--rw prefix-limit-received
         |     |  |     |     |  +--rw config
         |     |  |     |     |  |  +--rw send-default-route?           boolean
         |     |  |     |     |  |  +--rw extended-next-hop-encoding?   boolean
+        |     |  |     |     |  |  +--rw enable-aigp?                  boolean
         |     |  |     |     |  +--ro state
         |     |  |     |     |     +--ro send-default-route?           boolean
         |     |  |     |     |     +--ro extended-next-hop-encoding?   boolean
+        |     |  |     |     |     +--ro enable-aigp?                  boolean
         |     |  |     |     +--rw ipv6-unicast
         |     |  |     |     |  +--rw prefix-limit
         |     |  |     |     +--rw ipv4-labeled-unicast

module: openconfig-routing-policy
  +--rw routing-policy
     +--rw policy-definitions
        +--rw policy-definition* [name]
           +--rw statements
              +--rw statement* [name]
                  +--rw actions
                     +--rw oc-bgp-pol:bgp-actions
                     |  +--rw oc-bgp-pol:config
                     |  |  +--rw oc-bgp-pol:set-route-origin?   oc-bgp-types:bgp-origin-attr-type
                     |  |  +--rw oc-bgp-pol:set-local-pref?     uint64
                     |  |  +--rw oc-bgp-pol:set-next-hop?       bgp-next-hop-type
                     |  |  +--rw oc-bgp-pol:set-med?            bgp-set-med-type
                     |  |  +--rw oc-bgp-pol:set-med-action?     bgp-set-med-action
+                    |  |  +--rw oc-bgp-pol:set-aigp?           uint64
                     |  +--ro oc-bgp-pol:state
                     |  |  +--ro oc-bgp-pol:set-route-origin?   oc-bgp-types:bgp-origin-attr-type
                     |  |  +--ro oc-bgp-pol:set-local-pref?     uint64
                     |  |  +--ro oc-bgp-pol:set-next-hop?       bgp-next-hop-type
                     |  |  +--ro oc-bgp-pol:set-med?            bgp-set-med-type
                     |  |  +--ro oc-bgp-pol:set-med-action?     bgp-set-med-action
+                    |  |  +--ro oc-bgp-pol:set-aigp?           uint64

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances BGP functionality by integrating support for Accumulated IGP (AIGP) metrics. It provides network operators with the flexibility to enable AIGP at various granularities within their BGP configurations and to manipulate AIGP values through routing policies. This expansion allows for more sophisticated traffic engineering and path selection based on internal network costs, aligning the models with advanced routing capabilities found in modern network devices.

Highlights

  • BGP AIGP Exchange: Added the capability to enable BGP Accumulated IGP (AIGP) metric exchange between peers at both the group and individual neighbor levels for IPv4 and IPv6 unicast address families.
  • BGP Policy Support for AIGP: Introduced the ability to configure an arbitrary AIGP value within a BGP routing policy, allowing for more granular control over route metrics.
  • Backwards Compatibility: Ensured that all changes are fully backwards compatible with existing configurations and implementations.
  • YANG Model Updates: Updated the openconfig-bgp-policy.yang and openconfig-network-instance.yang models to include the new AIGP configuration options and version increments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Code Review

The pull request successfully introduces BGP AIGP support at both the group/neighbor level and within routing policies. The changes include adding an enable-aigp boolean flag for address families in neighbors and peer-groups, and a set-aigp leaf for policy actions. The overall structure and integration of these new features into the existing YANG models are well-executed. The use of a dedicated grouping for enable-aigp ensures reusability and consistency.

@dplore
Copy link
Copy Markdown
Member

dplore commented Mar 19, 2026

/gcbrun

@dplore dplore moved this to Ready to discuss in OC Operator Review Mar 19, 2026
@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Mar 19, 2026

No major YANG version changes in commit bb42bae

Copy link
Copy Markdown
Member

@dplore dplore left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Please consider moving the leaf into this bgp model file:

grouping bgp-common-mp-afi-safi-config {

}
}

grouping ni-bgp-afi-aigp-config {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

instead of adding a new group in the network-instance.yang and augmenting, this leaf can probably be added to this grouping for a more simple addition.

grouping bgp-common-mp-afi-safi-config {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried this first, but it caused some additional diffs. It enabled the same leaf in the global afi-safis as well, which is outside the scope of this augment. It seems to me that AIGP enablement at the global afi-safi level already exists here: https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-network-instance.html#network-instances-network-instance-protocols-protocol-bgp-global-afi-safis-afi-safi-route-selection-options-config-enable-aigp

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have re-analyzed grouping usage:

If we use bgp-common-mp-afi-safi-config, enable-aigp becomes available in all address families, which causes unintended scope creep beyond just the use case (the use case requires only ipv4 and ipv6 unicast).

We could instead use bgp-common-mp-ipv4-ipv6-unicast-common-config, however that configuration also causes unintended scope creep because it applies the config to all ipv4 and ipv6 unicast address families including those under the global configuration (the use case requires the configuration only at the group and neighbor level)

Although it is less clean, I think going with the original implementation here best preserves the intended scope of the change.

@earies
Copy link
Copy Markdown
Contributor

earies commented Mar 24, 2026

Should we cover other AFI/SAFI as well in this PR to not have to add later? ipv4-labeled-unicast and ipv6-labeled-unicast

@jhaas-pfrc
Copy link
Copy Markdown

Should we cover other AFI/SAFI as well in this PR to not have to add later? ipv4-labeled-unicast and ipv6-labeled-unicast

HPE/Juniper's implementation limits the afi/safi it can be used for to ipv4/ipv6 unicast/labeled unicast.

@jenna-mccampbell
Copy link
Copy Markdown
Author

Should we cover other AFI/SAFI as well in this PR to not have to add later? ipv4-labeled-unicast and ipv6-labeled-unicast

Adding AIGP for these additional address families is outside of the scope of the use case that motivates this change. The change here does not preclude adding this capability to additional address families should a use case for that functionality come up. For now, I don't want to boil the ocean.

@dplore
Copy link
Copy Markdown
Member

dplore commented Mar 25, 2026

/gcbrun

Copy link
Copy Markdown

@danielbarney danielbarney left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready to discuss

Development

Successfully merging this pull request may close these issues.

6 participants