-
Notifications
You must be signed in to change notification settings - Fork 656
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 AS path. #1148
base: master
Are you sure you want to change the base?
Conversation
/gcbrun |
No major YANG version changes in commit bffc29b |
Removed the extra comma and rebased against master. |
/gcbrun |
@@ -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 { |
68a38ff
to
bffc29b
Compare
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!
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.
Regarding precedence, I am aware of as path prepending 'n' times, adding the "last-asn" to the list and replacing the originating asn with one's own asn (as-override) .
I'm not aware of existing implementations that allow arbitrary add/remove operations from an asn path.
Regarding "editing" an as-path set, practically in gNMI (although OC isn't gnmi only, netconf is also used), there is no 'list editing / insert' operation. To change an 'ordered-by-user' list in gnmi, the whole list must be replaced.
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.
Makes sense. Maybe we can remove the set-as-path-option
and set-as-path-method
altogether, since only replacing the whole list is supported. I also updated set-as-path
to be a leaf-list
under bgp-actions
as it does not require other input now. Let me know if this looks better (or worse).
/gcbrun |
set-as-path action"; | ||
|
||
leaf-list as-paths { | ||
type union { |
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 think this need to be ordered-by-user .
Is there precedence for this in existing implementations or is this intended to be a new feature request?
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.
Good call. Updated type with ordered-by user
.
IIUC, only Arista support replacing the entire AS path with [set as-path match all replacement] (https://www.arista.com/en/um-eos/eos-acls-and-route-maps#xx1313923). This is the recommended Arista implementation for the existing as-path-expand
in Juniper, which is also vendor specific unefortunately. I am not sure which one fits the model better (neither is ideal due to single-vendor support). set-as-path
might be slightly more generic based on our past discussions. Kindly share your thoughts please.
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.
Regarding precedence, I am aware of as path prepending 'n' times, adding the "last-asn" to the list and replacing the originating asn with one's own asn (as-override) .
I'm not aware of existing implementations that allow arbitrary add/remove operations from an asn path.
Regarding "editing" an as-path set, practically in gNMI (although OC isn't gnmi only, netconf is also used), there is no 'list editing / insert' operation. To change an 'ordered-by-user' list in gnmi, the whole list must be replaced.
b8f43f3
to
61d8291
Compare
@@ -28,7 +28,14 @@ module openconfig-bgp-policy { | |||
It augments the base routing-policy module with BGP-specific | |||
options for conditions and actions."; | |||
|
|||
oc-ext:openconfig-version "8.0.0"; | |||
oc-ext:openconfig-version "8.2.0"; |
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.
Split the change for last-as support to #1221 as discussed offline, which takes version 8.1.0
. This change is expected to merge after that PR, so we use version 8.2.0
after that.
Change Scope
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path
(a list of ASNs or last-as)oc-bgp-pol
instead ofoc-bgp-types
.New paths after the model update:
Platform Implementations