Skip to content

Add BGP Monitoring Protocol (BMP) support #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ihebboubaker
Copy link

Add BGP Monitoring Protocol (BMP) Model

Change Scope

• This PR adds a new YANG model for BGP Monitoring Protocol (BMP) as defined in RFC 7854. The model provides configuration and operational state for BMP at global, neighbor, and peer-group levels with support for AFI-SAFI granularity.

• This change is backwards compatible as it only adds new nodes through augmentation of the existing BGP model without modifying any existing structures.

Platform Implementations

Implementation output:

  routing-options {
      bmp {
           tcp-keepalive {
              idle-time-before-probe 5;
              probe-count 1;
              probe-interval 5;
          }
          station collector1 {
              connection-mode active;
              local-address 192.0.2.1;
              station-address 203.0.113.5;
              station-port 7039;
              route-monitoring pre-policy;
          }
      }
  }

Implementation output:

router bgp 65000
 monitoring station collector1
   update-source Loopback0
   connection mode active port 7039
   connection address 203.0.113.5
   connection keepalive 5 1 5
   statistics 60

Additional Information

The BMP model includes support for:

  • Global BMP configuration
  • BMP monitoring stations with AFI-SAFI granularity
  • Station groups for managing multiple collectors
  • TCP keepalive settings
  • Route monitoring policy configuration
  • Message counters for operational state
  • Per-neighbor and per-peer-group BMP configuration

"This module defines configuration and operational state data for
BGP Monitoring Protocol (BMP) as defined in RFC 7854.";

oc-ext:openconfig-version "9.9.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is a new module proposed here (which is not a submodule) thus start the versioning at 0.1.0


leaf idle-time {
type uint16;
description
Copy link
Contributor

Choose a reason for hiding this comment

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

units seconds;

leaf probe-interval {
type uint16;
description
"The time in seconds between TCP keepalive probes";
Copy link
Contributor

Choose a reason for hiding this comment

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

units seconds;

}
}

grouping bmp-tcp-keepalive-state {
Copy link
Contributor

Choose a reason for hiding this comment

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

The same grouping can be reused for config/state (reflection) vs. redefining each node again

description
"Operational state parameters for BMP monitoring of specific AFI-SAFIs";

leaf afi-safi-name {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above re: duplication.


leaf uptime {
type uint64;
description
Copy link
Contributor

Choose a reason for hiding this comment

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

units seconds;

Copy link
Member

Choose a reason for hiding this comment

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

Recommend using this type for all the timestamp leaves:

      type oc-types:timeticks64;

}

leaf flap-count {
type uint32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type uint32;
type uint32;
type oc-yang:counter32;

Likely colocate under a counters container

Copy link
Member

Choose a reason for hiding this comment

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

+1 please use a state/counters container whenever there are counters present. For example:

       +--rw stations
       |  +--rw station* [name]
       |     +--rw name         string
       |     +--ro state
       |     |  +--ro counters
       |     |  |  +--ro total?              oc-yang:counter64
       |     |  |  +--ro statistics?         oc-yang:counter64
       |     |  |  +--ro route-monitoring?   oc-yang:counter64
       |     |  |  +--ro peer-monitoring?    oc-yang:counter64
       |     |  |  +--ro route-mirroring?    oc-yang:counter64
       |     +--rw afi-safis
       |        +--rw afi-safi* [afi-safi-name]
       |           +--rw afi-safi-name    -> ../config/afi-safi-name
       |           +--rw config
       |           |  +--rw afi-safi-name?   identityref
       |           |  +--rw enabled?         boolean
       |           +--ro state
       |              +--ro afi-safi-name?                    identityref
       |              +--ro enabled?                          boolean
       |              +--ro counters
       |                 +--ro route-monitoring-messages-sent?   uint64

"Total number of BMP messages sent to this station";
}

leaf statistics {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest better name as this indicates "sent" messages

@@ -68,7 +68,14 @@ module openconfig-bgp {
whereas leaf not present inherits its value from the leaf present
at the next higher level in the hierarchy.";

oc-ext:openconfig-version "9.8.0";
oc-ext:openconfig-version "9.9.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

This model doesn't appear to need any edits at all - no version increment is needed

Copy link
Contributor

@earies earies left a comment

Choose a reason for hiding this comment

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

After minor adjustments, the tree view looks as follows:

module: openconfig-bgp-bmp

  augment /oc-netinst:network-instances/oc-netinst:network-instance/oc-netinst:protocols/oc-netinst:protocol/oc-netinst:bgp/oc-netinst:global:
    +--rw bmp
       +--rw config
       |  +--rw enabled?              boolean
       |  +--rw connection-mode?      connection-mode-type
       |  +--rw local-address?        oc-inet:ip-address
       |  +--rw statistics-timeout?   uint16
       |  +--rw idle-time?            uint16
       |  +--rw probe-count?          uint8
       |  +--rw probe-interval?       uint16
       +--ro state
       |  +--ro enabled?              boolean
       |  +--ro connection-mode?      connection-mode-type
       |  +--ro local-address?        oc-inet:ip-address
       |  +--ro statistics-timeout?   uint16
       |  +--ro idle-time?            uint16
       |  +--ro probe-count?          uint8
       |  +--ro probe-interval?       uint16
       +--rw tcp-keepalive
       |  +--rw config
       |  |  +--rw idle-time?        uint16
       |  |  +--rw probe-count?      uint8
       |  |  +--rw probe-interval?   uint16
       |  +--ro state
       |     +--ro idle-time?        uint16
       |     +--ro probe-count?      uint8
       |     +--ro probe-interval?   uint16
       +--rw stations
       |  +--rw station* [name]
       |     +--rw name         string
       |     +--rw config
       |     |  +--rw address                 oc-inet:ip-address
       |     |  +--rw port?                   oc-inet:port-number
       |     |  +--rw policy-type?            route-monitoring-policy-type
       |     |  +--rw exclude-non-eligible?   boolean
       |     +--ro state
       |     |  +--ro address?                oc-inet:ip-address
       |     |  +--ro port?                   oc-inet:port-number
       |     |  +--ro connection-status?      connection-status-type
       |     |  +--ro uptime?                 uint64
       |     |  +--ro flap-count?             uint32
       |     |  +--ro message-counters
       |     |  |  +--ro total?              oc-yang:counter64
       |     |  |  +--ro statistics?         oc-yang:counter64
       |     |  |  +--ro route-monitoring?   oc-yang:counter64
       |     |  |  +--ro peer-monitoring?    oc-yang:counter64
       |     |  |  +--ro route-mirroring?    oc-yang:counter64
       |     |  +--ro policy-type?            route-monitoring-policy-type
       |     |  +--ro exclude-non-eligible?   boolean
       |     +--rw afi-safis
       |        +--rw afi-safi* [afi-safi-name]
       |           +--rw afi-safi-name    -> ../config/afi-safi-name
       |           +--rw config
       |           |  +--rw afi-safi-name?   identityref
       |           |  +--rw enabled?         boolean
       |           +--ro state
       |              +--ro afi-safi-name?                    identityref
       |              +--ro enabled?                          boolean
       |              +--ro route-monitoring-messages-sent?   uint64
       +--rw station-groups
       |  +--rw station-group* [name]
       |     +--rw name      string
       |     +--rw config
       |     |  +--rw station-names*   string
       |     +--ro state
       |        +--ro station-names*   string
       +--rw afi-safis
          +--rw afi-safi* [afi-safi-name]
             +--rw afi-safi-name    -> ../config/afi-safi-name
             +--rw config
             |  +--rw afi-safi-name?   identityref
             |  +--rw enabled?         boolean
             +--ro state
                +--ro afi-safi-name?                    identityref
                +--ro enabled?                          boolean
                +--ro route-monitoring-messages-sent?   uint64
  augment /oc-netinst:network-instances/oc-netinst:network-instance/oc-netinst:protocols/oc-netinst:protocol/oc-netinst:bgp/oc-netinst:neighbors/oc-netinst:neighbor:
    +--rw bmp
       +--rw config
       |  +--rw enabled?   boolean
       +--ro state
       |  +--ro enabled?   boolean
       +--rw afi-safis
          +--rw afi-safi* [afi-safi-name]
             +--rw afi-safi-name    -> ../config/afi-safi-name
             +--rw config
             |  +--rw afi-safi-name?   identityref
             |  +--rw enabled?         boolean
             +--ro state
                +--ro afi-safi-name?                    identityref
                +--ro enabled?                          boolean
                +--ro route-monitoring-messages-sent?   uint64
  augment /oc-netinst:network-instances/oc-netinst:network-instance/oc-netinst:protocols/oc-netinst:protocol/oc-netinst:bgp/oc-netinst:peer-groups/oc-netinst:peer-group:
    +--rw bmp
       +--rw config
       |  +--rw enabled?   boolean
       +--ro state
       |  +--ro enabled?   boolean
       +--rw afi-safis
          +--rw afi-safi* [afi-safi-name]
             +--rw afi-safi-name    -> ../config/afi-safi-name
             +--rw config
             |  +--rw afi-safi-name?   identityref
             |  +--rw enabled?         boolean
             +--ro state
                +--ro afi-safi-name?                    identityref
                +--ro enabled?                          boolean
                +--ro route-monitoring-messages-sent?   uint64

Some overall comments:

  • You are anchoring global BMP config/state inside a BGP protocol instance within a network-instance. I would question the association to a "protocol instance" here if this is necessary and also the NI anchor point vs. NI reference as seen in other "service" definitions (e.g. dial-out similar technologies)
  • List keys must be a leafref to subsequent ../config/ or ../state/ nodes (e.g. stations/station/name)
  • Am I missing where station-groups is of use? I believe I only see a definition but no reference/use


prefix "oc-bgp-bmp";

import openconfig-bgp { prefix oc-bgp; }
Copy link
Contributor

Choose a reason for hiding this comment

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

This import is unused


leaf-list station-names {
type leafref {
path "../../../stations/station/config/name";
Copy link
Contributor

Choose a reason for hiding this comment

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

leafref does not resolve


leaf-list station-names {
type leafref {
path "../../../stations/station/config/name";
Copy link
Contributor

Choose a reason for hiding this comment

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

leafref does not resolve (do not duplicate groupings)

uses bmp-route-monitoring-state;
}

grouping bmp-station-group-config {
Copy link
Contributor

Choose a reason for hiding this comment

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

You are defining a relative path leafref within a grouping. If the grouping is intended for reuse then it is subject to dependency hiearchies that sit at the same level anchor points


leaf uptime {
type uint64;
description
Copy link
Member

Choose a reason for hiding this comment

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

Recommend using this type for all the timestamp leaves:

      type oc-types:timeticks64;

}

leaf flap-count {
type uint32;
Copy link
Member

Choose a reason for hiding this comment

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

+1 please use a state/counters container whenever there are counters present. For example:

       +--rw stations
       |  +--rw station* [name]
       |     +--rw name         string
       |     +--ro state
       |     |  +--ro counters
       |     |  |  +--ro total?              oc-yang:counter64
       |     |  |  +--ro statistics?         oc-yang:counter64
       |     |  |  +--ro route-monitoring?   oc-yang:counter64
       |     |  |  +--ro peer-monitoring?    oc-yang:counter64
       |     |  |  +--ro route-mirroring?    oc-yang:counter64
       |     +--rw afi-safis
       |        +--rw afi-safi* [afi-safi-name]
       |           +--rw afi-safi-name    -> ../config/afi-safi-name
       |           +--rw config
       |           |  +--rw afi-safi-name?   identityref
       |           |  +--rw enabled?         boolean
       |           +--ro state
       |              +--ro afi-safi-name?                    identityref
       |              +--ro enabled?                          boolean
       |              +--ro counters
       |                 +--ro route-monitoring-messages-sent?   uint64

@dplore dplore moved this to Ready to discuss in OC Operator Review Apr 25, 2025
to BMP servers or passively listens for connections";
}

leaf local-address {
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit: In most OC models, we use 'source-address' for this leaf.

}
}

grouping bmp-afi-safi-config {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see examples in the referenced implementations of being able to enable/disable BMP per afi/safi. Is this really needed? We should only model OC for the features we are actually using (or have an open, active feature request to use).

}
}

grouping bmp-station-config {
Copy link
Member

Choose a reason for hiding this comment

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

I think we probably need to have some support for the BMP station to be in a different network-instance than the BGP protocol. For example, we might have BGP in the DEFAULT network instance and a BMP station in a management network instance. This could be modeled by adding a 'network-instance' leaf to this grouping.

}
}

container station-groups {
Copy link
Member

Choose a reason for hiding this comment

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

In concept this seems ok, but is this really needed? For example, are we using this in production already? I don't see any example of this in the quoted implementation references?

uses bmp-tcp-keepalive-config;
}

grouping bmp-state {
Copy link
Member

Choose a reason for hiding this comment

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

as noted elsewhere, you can reuse the bmp-config grouping instead of defining an identical bmp-state grouping.

Comment on lines +639 to +649
augment "/oc-netinst:network-instances/oc-netinst:network-instance/oc-netinst:protocols/oc-netinst:protocol/oc-netinst:bgp/oc-netinst:neighbors/oc-netinst:neighbor" {
description
"Augments BGP neighbor configuration with BMP parameters";
uses bmp-neighbor-top;
}

augment "/oc-netinst:network-instances/oc-netinst:network-instance/oc-netinst:protocols/oc-netinst:protocol/oc-netinst:bgp/oc-netinst:peer-groups/oc-netinst:peer-group" {
description
"Augments BGP peer-group configuration with BMP parameters";
uses bmp-neighbor-top;
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't see peer-group and neighbor defined in the referenced implementations. How important is this?

@dplore
Copy link
Member

dplore commented May 13, 2025

/gcbrun

@dplore
Copy link
Member

dplore commented May 13, 2025

@ihebboubaker reviewed in May 13, 2025 OC operators meeting. Looking forward to your responses to the comments here.

@dplore dplore moved this from Ready to discuss to Waiting for author in OC Operator Review May 13, 2025
@OpenConfigBot
Copy link

No major YANG version changes in commit 4c4f1f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

4 participants