-
Notifications
You must be signed in to change notification settings - Fork 654
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
New set-as-path BGP action, and support last AS for for setting and updating AS path. #1148
base: master
Are you sure you want to change the base?
Conversation
/gcbrun |
No major YANG version changes in commit 9b86431 |
Removed the extra comma and rebased against master. |
/gcbrun |
leaf mode { | ||
type bgp-as-mode-type; | ||
description | ||
"Use a special AS number, e.g. last AS, to prepend to the | ||
AS path. If neither leaf nor asn leaf is specified but | ||
repeat-n is set, then the local AS number will be used for | ||
prepending."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is only one enum and no clear use cases for expanding this, maybe it makes sense to sense to just make this leaf use-last-as
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the leaf to use-last-as
as a boolean. Let me know if this looks better.
@@ -229,6 +236,19 @@ module openconfig-bgp-policy { | |||
the IGP cost using the enum (predefined value)."; | |||
} | |||
|
|||
typedef bgp-as-mode-type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the term 'builtin' in other parts of OC to refer to special values or logic that is defined by the device.
typedef bgp-as-mode-type { | |
typedef bgp-as-builtin-type { |
5af3102
to
99c5637
Compare
…repend/use-last-as to support last AS for setting and updating AS path.
typedef bgp-set-as-path-option-type { | ||
type enumeration { | ||
// TODO(xqm): maybe use prepend instead? | ||
enum ADD { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not so sure about certain behaviors after thinking about this a little more. Unlike communities, as-path is ordered and therefore could be a bit tricky.
- I wonder what would the expected behavior for
add as-path "1 2 3"
. Do we prepend "1 2 3" to the AS path? How about `delete as-path "1 2 3"? Do we delete 1) every AS1, AS2 and AS3 from the path 2) all "1 2 3" sub-paths from the as-path? - Using as-path-set reference as input might complicate things further. For instance, an as-path-set can have multiple members such as
["1 2", "3 4 5"]
. Afterreplace as-path-set
, will the AS path become"1 2 3 4 5"
? If there are regex in as-path-set, maybe it works for delete, but it's more like invalid input for add/replace.
Would like to have your thoughts to better define the semantics in these cases. Thanks Darren!
Change Scope
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path/config/method
(INLINE or REFERENCE)/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path/inline/config/as-paths
(a list of ASNs or last-as)/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path/reference/config/as-path-set-ref
(reference to a single as-path-set, do we still need this leaf since it has been deprecated in set-community and set-ext-community)/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path/reference/config/as-path-set-refs
(reference to multiple as-path-sets)oc-bgp-pol
instead ofoc-bgp-types
.oc-bgp-pol:bgp-as-mode-type
, to allow prepending last AS to the path.New paths after the model update:
Platform Implementations