[yang] Extended sonic-bmp.yang YANG model to include BMP collector(s) and policies #24965
[yang] Extended sonic-bmp.yang YANG model to include BMP collector(s) and policies #24965kalash-nexthop wants to merge 17 commits into
Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
935a389 to
6db007d
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6db007d to
97eab6c
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
97eab6c to
7c47bfa
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
7c47bfa to
0dc9ea0
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ially multiple collectors) configuration parameters: IP, port, stats interval, retry intervals, monitor policies. - Updated unified/separated mode templates (bgpd.conf.db.j2 and bgpd.main.conf.j2) to use BMP configuration from CONFIG_DB with fallback to default values - Added BMP handler in frrcfgd.py to dynamically convert CONFIG_DB BMP changes to vtysh commands for runtime configuration updates - Supports multiple configurable monitor policies per target: pre-policy, post-policy, loc-rib - Default collector IP is 127.0.0.1 when not specified to maintain backward compatibility Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
0dc9ea0 to
920abdc
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Brad's commit c833bde (sonic-net#26587) rephrased the BMP table-dump descriptions into the "BGP Monitoring Protocol (BMP) ... configuration." and "Enable or disable ..." voice. Keep the rest of the BMP YANG consistent with that style: - Replace "<CONTAINER> part of config_db.json" with proper "<purpose> configuration." descriptions for BMP_TARGET, BMP_TARGET_COLLECTOR, and BMP_TARGET_AFI_SAFI. - Reword boolean leaves (mirror, adj-rib-in-pre/post, loc-rib) to the "Enable or disable ..." pattern. - Tighten leafref / numeric leaves to describe purpose rather than just restating the field name. - Add trailing periods to enum descriptions and the 2026-01-02 revision note for consistency. - Expand the afi-safi-type typedef description to spell out AFI/SAFI. No functional/schema changes; descriptions only. Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @yijingyan2 , Done. |
|
/azpw ms_conflict |
1 similar comment
|
/azpw ms_conflict |
Replace the raw string type (length 1..64) with the canonical sonic-types interface_name typedef (length 1..15, per IFNAMSIZ from <net/if.h>). Matches the convention already used by sonic-loopback-interface.yang, sonic-vrf.yang, and sonic-smart-switch.yang. No frrcfgd / template / test changes: the CONFIG_DB key is still `source-interface` and any valid interface name that passed the old 1..64 bound also passes 1..15 (real interface names are at most 15 chars). Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw ms_conflict |
5 similar comments
|
/azpw ms_conflict |
|
/azpw ms_conflict |
|
/azpw ms_conflict |
|
/azpw ms_conflict |
|
/azpw ms_conflict |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
No failed(or canceled) jobs found in completed stages. Only failed(or canceled) jobs in completed stages can be retried. Stages in progress: Build, BuildVS. Please wait for the stages to complete and then retry again. |
…ection
The merge from upstream/master pulled in test_bgp_neighbor_description_injection
but its two decorator lines
@patch.dict('sys.modules', **mockmapping)
@patch('frrcfgd.frrcfgd.g_run_command')
were lost in the conflict resolution, so pytest collection failed with
"fixture 'run_cmd' not found". Add them back to match the master copy.
No functional change.
Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1107866: ✅Stage Test:
|
|
/azpw ms_conflict |
1 similar comment
|
/azpw ms_conflict |
Currently SONiC doesn't allow configuring external BMP collector, and instead relies on hard-coded local BMP collector config with only pre-policy support. Making this generic so that a user can set potentially multiple external collectors with multiple policies, as FRR already supports this.
Instead of just creating a PR with yang model, I added the vtysh cmd conversion stuff to this PR, so that I can demonstrate the model and corresponding vtysh config that's already supported in FRR.
fixes #24962
Link to HLD: sonic-net/SONiC#2366
Why I did it
Currently SONiC doesn't allow configuring external BMP collector, and instead relies on hard-coded local BMP collector config with only pre-policy support. But some customers want to use external collectors with both pre and post policy config.
Work item tracking
How I did it
1- Extended sonic-bmp.yang YANG model to include BMP collector (potentially multiple collectors) configuration parameters: IP, port, stats interval, retry intervals, monitor policies.
2- The new yang model is similar to FRR's bmp yang model, but instead of using nested lists, it does below (3) so that SONiC's yang parser doesn't complain.
3- The model to allow multiple targets and collectors is similar to how BGP_NEIGHBOR container block is used for defining the neighbors, and then another BGP_NEIGHBOR_AF container to define afi-safis on those neighbors. I've verified that yang validation works for this.
4- Updated unified/separated mode templates (bgpd.conf.db.j2 and bgpd.main.conf.j2) to use BMP configuration from CONFIG_DB with fallback to default values
5- Added BMP handler in frrcfgd.py to dynamically convert CONFIG_DB BMP changes to vtysh commands for runtime configuration updates
6- Supports multiple configurable monitor policies per target: pre-policy, post-policy, loc-rib
7- Default collector IP is 127.0.0.1 when not specified to maintain backward compatibility
A sample yang model based on the new changes, showing multiple targets, multiple collectors per target, multiple afi-safis per target and multiple policies per afi-safi:
And corresponding vtysh commands in
vtysh -c "show running-config"How to verify it
config reload.config reloadas well asconfig replacedon't complain of yang validation failure for above model.Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)