feat: Extend BGPPeer and enable path modifiers#414
Open
nikatza wants to merge 1 commit into
Open
Conversation
c9cef81 to
05ede10
Compare
b755da1 to
a16a41a
Compare
e70ac9c to
977e9cf
Compare
977e9cf to
60294e0
Compare
The field LocalASNumber enables a router to appear as a member of another AS in addition to its real AS. Most vendors support mechanisms to specify how the device should use this number. This is, however, not specified in OpenConfig[1]. This commit removes LocalASNumber and adds LocalAS, which specifies the local AS number and how this number factors into eBGP announcements. Specifically, we add three independent boolean flags: - PrependLocalAS: prepend local-as to inbound routes (default: true) - PrependGlobalAS: prepend global-as to outbound routes (default: true) - AcceptEitherAS: accept connections using either AS (default: false) We opt to follow the Nokia implementation [2,7], as it allows us to cover most of the vendors we checked, i.e., Cisco, Juniper, and Arista. This implies that the provider must ensure that the parameter combinations are valid, and reject them with an apistatus error that the controller can wrap into a TerminalError. Vendor mappings: Cisco NX-OS/IOS-XR [3,4]: - PrependLocalAS=false → no-prepend - PrependLocalAS=false, PrependGlobalAS=false → no-prepend replace-as - Above + AcceptEitherAS=true → no-prepend replace-as dual-as Juniper [5]: - PrependLocalAS=false → no-prepend-global-as - PrependGlobalAS=false → private - AcceptEitherAS=true → alias Arista [6]: - PrependLocalAS=false → no-prepend - PrependLocalAS=false, PrependGlobalAS=false → no-prepend replace-as - Above + AcceptEitherAS=true → no-prepend replace-as fallback Nokia SR Linux [7]: - PrependLocalAS → prepend-local-as - PrependGlobalAS → prepend-global-as - AcceptEitherAS → not supported [1] https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-network-instance.html#network-instances-network- instance-protocols-protocol-bgp-neighbors-neighbor-config-local-as [2] https://yangbrowser.nokia.com/srlinux/24.10.7/tree?path=%2Fnetwork-instance%5Bname%3D*%5D%2Fprotocols%2Fbgp%2Fneighbo r%5Bpeer-address%3D*%5D%2Flocal-as [3] https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/106x/configuration/unicast-routing-configuration/cisco-nexu s-9000-series-nx-os-unicast-routing-configuration-guide/configuring-bgp.html [4] https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/routing/configuration/guide/rcg-asr9000/rcg-bgp.html [5] https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/statement/local-as-edit-protocols-bgp.html [6] https://www.arista.com/en/um-eos/eos-border-gateway-protocol-bgp [7] https://documentation.nokia.com/srlinux/24-10/books/routing-protocols/bgp.html BREAKING CHANGE: LocalASNumber field removed, replaced with LocalAS struct containing ASNumber, PrependLocalAS, PrependGlobalAS, and AcceptEitherAS fields. Signed-off-by: Pujol <enric.pujol@sap.com>
60294e0 to
2a83df8
Compare
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: this is a breaking change in the API.
The field
LocalASNumberenables a router to appear as a member of another AS in addition to its real AS. Most vendors support mechanisms to specify how the device should use this number. This is, however, not specified inOpenConfig[1].This commit removes
LocalASNumberand addsLocalAS, which specifies the local AS number and how this number factors into eBGP announcements.Specifically, we add three independent boolean flags:
PrependLocalAS: prepend local-as to inbound routes (default: true)PrependGlobalAS: prepend global-as to outbound routes (default: true)AcceptEitherAS: accept connections using either AS (default: false)We opt to follow the Nokia YANG model [2], as it allows us tocover most of the vendors we checked, i.e., Cisco, Juniper, and Arista. This implies that the provider must ensure that the parameter combinations are valid, and reject them with an apistatus error that the controller can wrap into a TerminalError.
Vendor mappings:
Cisco NX-OS/IOS-XR[3,4]:Juniper[5]:Arista[6]:Nokia SR[7]:[1] https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-network-instance.html#network-instances-network-instance-protocols-protocol-bgp-neighbors-neighbor-config-local-as
[2] https://yangbrowser.nokia.com/srlinux/24.10.7/tree?path=%2Fnetworkinstance%5Bname%3D*%5D%2Fprotocols%2Fbgp%2Fneighbor%5Bpeer-address%3D*%5D%2Flocal-as
[3] https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/106x/configuration/unicast-routing-configuration/cisco-nexus-9000-series-nx-os-unicast-routing-configuration-guide/configuring-bgp.html
[4] https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/routing/configuration/guide/rcg-asr9000/rcg-bgp.html
[5] https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/statement/local-as-edit-protocols-bgp.html
[6] https://www.arista.com/en/um-eos/eos-border-gateway-protocol-bgp
[7] https://documentation.nokia.com/srlinux/24-10/books/routing-protocols/bgp.html
BREAKING CHANGE: LocalASNumber field removed, replaced with LocalAS
struct containing ASNumber, PrependLocalAS, PrependGlobalAS, and
AcceptEitherAS fields.