Skip to content

Introduce non-AFI-SAFI aggregate prefix limit at global, neighbor, and peer-group levels#1490

Open
mukherso wants to merge 2 commits into
openconfig:masterfrom
mukherso:feature-prefixLimit
Open

Introduce non-AFI-SAFI aggregate prefix limit at global, neighbor, and peer-group levels#1490
mukherso wants to merge 2 commits into
openconfig:masterfrom
mukherso:feature-prefixLimit

Conversation

@mukherso
Copy link
Copy Markdown
Contributor

@mukherso mukherso commented May 7, 2026

Files changed:

  • (M) release/models/bgp/openconfig-bgp-common-multiprotocol.yang
  • (M) release/models/bgp/openconfig-bgp-common-structure.yang
  • (M) release/models/bgp/openconfig-bgp-global.yang
  • (M) release/models/bgp/openconfig-bgp-neighbor.yang
  • (M) release/models/bgp/openconfig-bgp-peer-group.yang

Change Scope:

This change introduces a non-AFI-SAFI aggregate prefix-limit for accepted routes and prefix-limit-received for received routes at the BGP global, neighbor, and peer-group levels, and renames one internal grouping to reflect its broadened scope.

  1. Grouping rename (openconfig-bgp-common-multiprotocol.yang):
  • bgp-common-mp-all-afi-safi-common-prefix-limit-config → bgp-common-prefix-limit-config

The original name implied this grouping was scoped exclusively to AFI-SAFI contexts. Since it is now reused outside that context, the name has been shortened accordingly. bgp-common-mp-all-afi-safi-common-prefix-limit-state is unchanged as it remains AFI-SAFI specific. All existing uses statements within the AFI-SAFI prefix-limit containers are updated accordingly. There is no functional change to the existing per-AFI-SAFI prefix-limit behaviour.

  1. New structural grouping (openconfig-bgp-common-structure.yang):

A new grouping bgp-common-structure-prefix-limit is added, following the existing OpenConfig config/state container pattern. It is applied at the global, neighbor, and peer-group levels via openconfig-bgp-global.yang, openconfig-bgp-neighbor.yang, and openconfig-bgp-peer-group.yang respectively.

This allows operators to set a single aggregate prefix-limit across all address families for a session, complementing the existing per-AFI-SAFI prefix-limit. Note that prefix-limit-exceeded is intentionally not included in the state container at these levels, as exceeded-state tracking is only modelled at the AFI-SAFI granularity.

Relevant pyang tree output:

module: openconfig-bgp
    +--rw bgp
       +--rw global
       |  +--rw prefix-limit-received
       |     +--rw config
       |     |  +--rw max-prefixes?            uint32
       |     |  +--rw prevent-teardown?        boolean
       |     |  +--rw warning-threshold-pct?   oc-types:percentage
       |     +--ro state
       |        +--ro max-prefixes?            uint32
       |        +--ro prevent-teardown?        boolean
       |        +--ro warning-threshold-pct?   oc-types:percentage
       +--rw neighbors
       |  +--rw neighbor* [neighbor-address]
       |     +--rw prefix-limit
       |        +--rw config
       |        |  +--rw max-prefixes?            uint32
       |        |  +--rw prevent-teardown?        boolean
       |        |  +--rw warning-threshold-pct?   oc-types:percentage
       |        +--ro state
       |           +--ro max-prefixes?            uint32
       |           +--ro prevent-teardown?        boolean
       |           +--ro warning-threshold-pct?   oc-types:percentage
       +--rw peer-groups
          +--rw peer-group* [peer-group-name]
             +--rw prefix-limit
                +--rw config
                |  +--rw max-prefixes?            uint32
                |  +--rw prevent-teardown?        boolean
                |  +--rw warning-threshold-pct?   oc-types:percentage
                +--ro state
                   +--ro max-prefixes?            uint32
                   +--ro prevent-teardown?        boolean
                   +--ro warning-threshold-pct?   oc-types:percentage

Platform Implementations

Arista EOS User Guide implements BGP prefix-limit-received using the neighbor maximum-routes command, which enforces a per-session prefix threshold and may terminate the BGP session upon exceedance.

@mukherso mukherso requested a review from a team as a code owner May 7, 2026 23:57
Copy link
Copy Markdown
Contributor

@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

This pull request implements an aggregate prefix limit across BGP global, neighbor, and peer-group contexts by generalizing existing groupings and introducing a new structural grouping. The review feedback suggests correcting the container description to use "accepted" instead of "received" to align with OpenConfig conventions and recommends adding a state leaf to track when the aggregate limit is exceeded for better operational visibility.

Comment thread release/models/bgp/openconfig-bgp-common-structure.yang
Comment thread release/models/bgp/openconfig-bgp-common-structure.yang
@mukherso mukherso force-pushed the feature-prefixLimit branch from 76b9875 to b781965 Compare May 12, 2026 13:37
@mukherso mukherso changed the title Introduce non-AFI-SAFI aggregate prefix-limit at global, neighbor, and peer-group levels Introduce non-AFI-SAFI aggregate prefix limit at global, neighbor, and peer-group levels May 12, 2026
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