From d595ed0d07aa464befecf4058ccb23093036f9b4 Mon Sep 17 00:00:00 2001 From: dplore Date: Mon, 5 Jun 2023 19:56:05 -0700 Subject: [PATCH 01/27] add bgp linkbw ext community --- release/models/bgp/openconfig-bgp-types.yang | 32 ++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index d3117f7d6..ebcc3dba4 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -25,7 +25,13 @@ module openconfig-bgp-types { policy. It can be imported by modules that make use of BGP attributes"; - oc-ext:openconfig-version "5.3.1"; + oc-ext:openconfig-version "5.4.0"; + + revision "2022-06-05" { + description + "Add link bandwidth extended community type"; + reference "5.4.0"; + } revision "2021-08-06" { description @@ -569,6 +575,24 @@ module openconfig-bgp-types { '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9])$'; } + type string { + // Extended Link Bandwidth Community + pattern 'bandwidth:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])'; + oc-ext:posix-pattern '^bandwidth:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + } description "Type definition for extended community attributes. In the case that @@ -582,11 +606,13 @@ module openconfig-bgp-types { - route-origin:<2b ASN>:<4b value> per RFC4360 section 5 - route-origin:<4b IPv4>:<2b value> per RFC4360 section 5 - color::<4b value> per draft-ietf-idr-segment-routing-te-policy - section 3"; + section 3 + - Link Bandwidth "; reference "RFC 4360 - BGP Extended Communities Attribute RFC 5668 - 4-Octet AS Specific BGP Extended Community - draft-ietf-idr-segment-routing-te-policy"; + draft-ietf-idr-segment-routing-te-policy + draft-ietf-idr-link-bandwidth-07 "; } typedef bgp-ext-community-recv-type { From 09013a050c384b41108e460afbdb86b1547cecf9 Mon Sep 17 00:00:00 2001 From: dplore Date: Mon, 5 Jun 2023 20:21:49 -0700 Subject: [PATCH 02/27] update versions --- release/models/bgp/openconfig-bgp-errors.yang | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/release/models/bgp/openconfig-bgp-errors.yang b/release/models/bgp/openconfig-bgp-errors.yang index cbcb53501..71cf0569a 100644 --- a/release/models/bgp/openconfig-bgp-errors.yang +++ b/release/models/bgp/openconfig-bgp-errors.yang @@ -18,7 +18,13 @@ submodule openconfig-bgp-errors { "This module defines BGP NOTIFICATION message error codes and subcodes"; - oc-ext:openconfig-version "5.3.1"; + oc-ext:openconfig-version "5.4.0"; + + revision "2022-06-05" { + description + "Add link bandwidth extended community type"; + reference "5.4.0"; + } revision "2021-08-06" { description From e41608241fa056abaac6a5eaebd631e9e4341ced Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 6 Jun 2023 11:12:29 -0700 Subject: [PATCH 03/27] add 4byte asn version --- release/models/bgp/openconfig-bgp-types.yang | 38 ++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index ebcc3dba4..01656b240 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -577,20 +577,44 @@ module openconfig-bgp-types { } type string { // Extended Link Bandwidth Community - pattern 'bandwidth:' + + // bandwidth:<2 byte asn>: + pattern 'bandwidth:' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])'; + oc-ext:posix-pattern '^bandwidth:' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])'; + + } + type string { + // Extended Link Bandwidth Community with 4 byte ASN + // bandwidth:<4 byte asn>: + pattern 'bandwidth:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])'; + oc-ext:posix-pattern '^bandwidth:' + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9]):' + - '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + - '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])'; - oc-ext:posix-pattern '^bandwidth:' + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9]):' + - '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + - '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + '[1-9][0-9]{1,8}|[0-9])$'; } } From 99edeb6b9346b6e84aa0d3065e93e9b277a18d11 Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 6 Jun 2023 11:15:48 -0700 Subject: [PATCH 04/27] fix whitespace --- release/models/bgp/openconfig-bgp-types.yang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 01656b240..12fa09fcb 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -592,7 +592,7 @@ module openconfig-bgp-types { '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9])'; - + } type string { // Extended Link Bandwidth Community with 4 byte ASN @@ -606,13 +606,13 @@ module openconfig-bgp-types { '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9])'; - oc-ext:posix-pattern '^bandwidth:' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + oc-ext:posix-pattern '^bandwidth:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9]):' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9])$'; } From 1bd2d5521dcf3a3d333f4b5ccf1deeb90042a178 Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 2 Aug 2023 18:48:29 -0700 Subject: [PATCH 05/27] add extended community containers --- release/models/bgp/openconfig-bgp-policy.yang | 160 +++++++++++++++++- release/models/bgp/openconfig-bgp-types.yang | 27 +++ 2 files changed, 186 insertions(+), 1 deletion(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 05ae1bacb..21c00e6e2 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -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 "6.1.1"; + oc-ext:openconfig-version "6.2.0"; + + revision "2023-08-03" { + description + "Add strongly typed bgp extended communities. Deprecate + string typed extended bgp communities."; + reference "6.2.0"; + } revision "2023-03-27" { description @@ -530,6 +537,7 @@ module openconfig-bgp-policy { } leaf-list ext-community-member { + status deprecated; type union { type oc-bgp-types:bgp-ext-community-type; type oc-bgp-types:bgp-community-regexp-type; @@ -544,9 +552,159 @@ module openconfig-bgp-policy { removed."; } + container members { + description + "Container for the list of extended community members."; + list member { + key "id"; + description + ""; + + leaf id { + type uint16; + description + "Represents an index of a member entry."; + } + container config { + description + "Extended community member configuration."; + + uses typed-ext-community-config; + } + + } + } + uses oc-rpol:match-set-options-group; } + grouping typed-ext-community-config { + description + "Configuration data for strongly typed BGP extended communities."; + + container asn-type { + description + "RFC4360 section 3.1 or 3.2 BGP extended community."; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container ip-type { + description + "RFC5668 section 2 BGP extended community."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container link-bw { + description "draft-ietf-idr-link-bandwidth-07"; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf bps { + type uint64; + description "Bandwidth in bits per second."; + } + } + + container route-target { + description "RFC4360 section 4 BGP extended community."; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-target-ip { + description "RFC4360 section 4 using IP address as BGP extended + community."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-origin { + description + "RFC4360 section 5 BGP extended community using an ASN."; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-origin-ip { + description + "RFC4360 section 5 BGP extended community using an IP + address."; + + leaf match-type { + type oc-bgp-types:bgp-color-match-type; + description "Specifies the match criteria between BGP NH and + SR policy endpoint"; + } + + leaf value { + type uint32; + description "Assigned value for this community."; + } + } + + container color { + description + "RFC9012 BGP color extended community and + draft-ietf-idr-segment-routing-te-policy."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + } + grouping ext-community-set-state { description "Operational state data for extended BGP community sets"; diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index a55212318..49c88c6f7 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -688,6 +688,33 @@ module openconfig-bgp-types { expression patterns"; } + typedef bgp-color-match-type { + type enumeration { + enum SPECIFIC { + description + "Type 0: Specific Endpoint Match: Request match for the + endpoint that is the BGP NH"; + } + enum SPECIFIC_OR_NULL { + description + "Type 1: Specific or Null Endpoint Match: Request match + for either the endpoint that is the BGP NH or a null + endpoint (e.g., like a default gateway)"; + } + enum ANY { + description + "Type 2: Specific, Null, or Any Endpoint Match: Request + match for either the endpoint that is the BGP NH or with + a null or any endpoint"; + } + } + description + "Type definition for BGP color extended community types."; + reference + "RFC9012 and draft-ietf-idr-segment-routing-te-policy-23."; + } + + typedef bgp-origin-attr-type { type enumeration { enum IGP { From 5f225219b4ddca7aca9ca6603facf789456a35a1 Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 2 Aug 2023 19:07:14 -0700 Subject: [PATCH 06/27] trim whitespace --- release/models/bgp/openconfig-bgp-policy.yang | 2 +- release/models/bgp/openconfig-bgp-types.yang | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 21c00e6e2..20ae924d0 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -32,7 +32,7 @@ module openconfig-bgp-policy { revision "2023-08-03" { description - "Add strongly typed bgp extended communities. Deprecate + "Add strongly typed bgp extended communities. Deprecate string typed extended bgp communities."; reference "6.2.0"; } diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 49c88c6f7..9f173637f 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -692,7 +692,7 @@ module openconfig-bgp-types { type enumeration { enum SPECIFIC { description - "Type 0: Specific Endpoint Match: Request match for the + "Type 0: Specific Endpoint Match: Request match for the endpoint that is the BGP NH"; } enum SPECIFIC_OR_NULL { @@ -710,7 +710,7 @@ module openconfig-bgp-types { } description "Type definition for BGP color extended community types."; - reference + reference "RFC9012 and draft-ietf-idr-segment-routing-te-policy-23."; } From 03a864cd34bc0915ec6c69e0693aff93240fab3a Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Aug 2023 18:12:26 -0700 Subject: [PATCH 07/27] add state container --- release/models/bgp/openconfig-bgp-policy.yang | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 20ae924d0..6c628b0d9 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -566,11 +566,16 @@ module openconfig-bgp-policy { "Represents an index of a member entry."; } container config { - description - "Extended community member configuration."; + description "Extended community member configuration."; uses typed-ext-community-config; } + container state { + description ""; + config false; + + uses typed-ext-community-config; + } } } @@ -598,8 +603,7 @@ module openconfig-bgp-policy { } container ip-type { - description - "RFC5668 section 2 BGP extended community."; + description "RFC5668 section 2 BGP extended community."; leaf ip-address { type oc-inet:ip-address; From dc45e5c44de85b349f32249b774e96808e4108b4 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Aug 2023 18:20:46 -0700 Subject: [PATCH 08/27] rename community set groupings --- release/models/bgp/openconfig-bgp-policy.yang | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 6c628b0d9..e2e12fa6f 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -568,13 +568,15 @@ module openconfig-bgp-policy { container config { description "Extended community member configuration."; - uses typed-ext-community-config; + uses ext-community-set-member-config; } container state { - description ""; config false; - - uses typed-ext-community-config; + + description "State for BGP extended community set members"; + + uses ext-community-set-member-config; + uses ext-community-set-member-state; } } @@ -583,7 +585,7 @@ module openconfig-bgp-policy { uses oc-rpol:match-set-options-group; } - grouping typed-ext-community-config { + grouping ext-community-set-member-config { description "Configuration data for strongly typed BGP extended communities."; @@ -708,6 +710,10 @@ module openconfig-bgp-policy { } } + grouping ext-community-set-member-state { + description + "Operational state data for strongly typed BGP extended community sets."; + } grouping ext-community-set-state { description From 966e4342538fe9e7c67597a6b712b5011eb586e4 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Aug 2023 20:23:04 -0700 Subject: [PATCH 09/27] fix list key id --- release/models/bgp/openconfig-bgp-policy.yang | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index e2e12fa6f..09dd333cb 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -561,13 +561,22 @@ module openconfig-bgp-policy { ""; leaf id { - type uint16; + type leafref { + path "../config/id"; + } description - "Represents an index of a member entry."; + "Reference to list key"; } + container config { description "Extended community member configuration."; + leaf id { + type uint16; + description + "Represents an index of a member entry."; + } + uses ext-community-set-member-config; } container state { From 6563a797e00283df2125fc4820e2f263ebce81ef Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 4 Aug 2023 12:27:00 -0700 Subject: [PATCH 10/27] correct use of id key --- release/models/bgp/openconfig-bgp-policy.yang | 86 +++++++++++-------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 09dd333cb..0b4f8ae5e 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -552,43 +552,19 @@ module openconfig-bgp-policy { removed."; } - container members { - description - "Container for the list of extended community members."; - list member { - key "id"; - description - ""; - - leaf id { - type leafref { - path "../config/id"; - } - description - "Reference to list key"; + leaf-list ext-community-member-id { + leaf { + type leafref { + path "../members/member/id"; } - - container config { - description "Extended community member configuration."; - - leaf id { - type uint16; - description - "Represents an index of a member entry."; - } - - uses ext-community-set-member-config; - } - container state { - config false; - - description "State for BGP extended community set members"; - - uses ext-community-set-member-config; - uses ext-community-set-member-state; - } - } + description + "Members of the extended community set. + For an ADD operation these are the communities that will be added; + For REMOVE or REPLACE operations then matching communities will + be removed unless match-set-options is INVERT which will + reverse this to mean that anything that does not match will be + removed."; } uses oc-rpol:match-set-options-group; @@ -598,6 +574,12 @@ module openconfig-bgp-policy { description "Configuration data for strongly typed BGP extended communities."; + leaf id { + type uint16; + description + "Represents an index of a member entry."; + } + container asn-type { description "RFC4360 section 3.1 or 3.2 BGP extended community."; @@ -768,6 +750,40 @@ module openconfig-bgp-policy { uses ext-community-set-config; uses ext-community-set-state; } + + container members { + description + "Container for the list of extended community members."; + list member { + key "id"; + description + ""; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to list key"; + } + + container config { + description "Extended community member configuration."; + + uses ext-community-set-member-config; + } + container state { + config false; + + description "State for BGP extended community set members"; + + uses ext-community-set-member-config; + uses ext-community-set-member-state; + } + + } + } + } } } From 9cd3c90e7d169a44d339e6875dc4a543c5704b8e Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 4 Aug 2023 12:31:17 -0700 Subject: [PATCH 11/27] correct use of id key --- release/models/bgp/openconfig-bgp-policy.yang | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 0b4f8ae5e..bf6f7342e 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -553,10 +553,8 @@ module openconfig-bgp-policy { } leaf-list ext-community-member-id { - leaf { - type leafref { - path "../members/member/id"; - } + type leafref { + path "../members/member/config/id"; } description "Members of the extended community set. From 8fada369104c5d401872856ba895f4dbc32b37e0 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 4 Aug 2023 16:20:54 -0700 Subject: [PATCH 12/27] restructure list --- release/models/bgp/openconfig-bgp-policy.yang | 381 +++++++++--------- 1 file changed, 197 insertions(+), 184 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index bf6f7342e..d35c43706 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -552,157 +552,9 @@ module openconfig-bgp-policy { removed."; } - leaf-list ext-community-member-id { - type leafref { - path "../members/member/config/id"; - } - description - "Members of the extended community set. - For an ADD operation these are the communities that will be added; - For REMOVE or REPLACE operations then matching communities will - be removed unless match-set-options is INVERT which will - reverse this to mean that anything that does not match will be - removed."; - } - uses oc-rpol:match-set-options-group; } - grouping ext-community-set-member-config { - description - "Configuration data for strongly typed BGP extended communities."; - - leaf id { - type uint16; - description - "Represents an index of a member entry."; - } - - container asn-type { - description - "RFC4360 section 3.1 or 3.2 BGP extended community."; - - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - container ip-type { - description "RFC5668 section 2 BGP extended community."; - - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - container link-bw { - description "draft-ietf-idr-link-bandwidth-07"; - - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; - } - - leaf bps { - type uint64; - description "Bandwidth in bits per second."; - } - } - - container route-target { - description "RFC4360 section 4 BGP extended community."; - - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - container route-target-ip { - description "RFC4360 section 4 using IP address as BGP extended - community."; - - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - container route-origin { - description - "RFC4360 section 5 BGP extended community using an ASN."; - - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - container route-origin-ip { - description - "RFC4360 section 5 BGP extended community using an IP - address."; - - leaf match-type { - type oc-bgp-types:bgp-color-match-type; - description "Specifies the match criteria between BGP NH and - SR policy endpoint"; - } - - leaf value { - type uint32; - description "Assigned value for this community."; - } - } - - container color { - description - "RFC9012 BGP color extended community and - draft-ietf-idr-segment-routing-te-policy."; - - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; - } - - leaf value { - type uint16; - description "Assigned value for this community."; - } - } - - } - grouping ext-community-set-member-state { - description - "Operational state data for strongly typed BGP extended community sets."; - } grouping ext-community-set-state { description @@ -715,8 +567,7 @@ module openconfig-bgp-policy { container ext-community-sets { description - "Enclosing container for list of extended BGP community - sets"; + "Enclosing container for list of extended BGP community sets"; list ext-community-set { key "ext-community-set-name"; @@ -739,9 +590,7 @@ module openconfig-bgp-policy { } container state { - config false; - description "Operational state data for extended BGP community sets"; @@ -749,38 +598,7 @@ module openconfig-bgp-policy { uses ext-community-set-state; } - container members { - description - "Container for the list of extended community members."; - list member { - key "id"; - description - ""; - - leaf id { - type leafref { - path "../config/id"; - } - description - "Reference to list key"; - } - - container config { - description "Extended community member configuration."; - - uses ext-community-set-member-config; - } - container state { - config false; - - description "State for BGP extended community set members"; - - uses ext-community-set-member-config; - uses ext-community-set-member-state; - } - - } - } + uses ext-community-members-top; } } @@ -852,6 +670,201 @@ module openconfig-bgp-policy { } } + grouping ext-community-members-top { + description + "Top-level grouping for members of an external community set"; + + container members { + description + "Enclosing container for list of extended community members"; + + list member { + key "id"; + description + "List of members"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Members of the extended community set. + For an ADD operation these are the communities that will be added; + For REMOVE or REPLACE operations then matching communities will + be removed unless match-set-options is INVERT which will + reverse this to mean that anything that does not match will be + removed."; + } + + container config { + description "Extended community member configuration."; + + uses ext-community-member-config; + } + + container state { + config false; + description "State for BGP extended community set members"; + + uses ext-community-member-config; + uses ext-community-member-state; + } + + container asn-type { + description + "RFC4360 section 3.1 or 3.2 BGP extended community."; + + container config { + uses ext-community-asn-value-config; + } + container state { + config false; + uses ext-community-asn-value-config; + } + + } + + container ip-type { + description "RFC5668 section 2 BGP extended community."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container link-bw { + description "draft-ietf-idr-link-bandwidth-07"; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf bps { + type uint64; + description "Bandwidth in bits per second."; + } + } + + container route-target { + description "RFC4360 section 4 BGP extended community."; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-target-ip { + description "RFC4360 section 4 using IP address as BGP extended + community."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-origin { + description + "RFC4360 section 5 BGP extended community using an ASN."; + + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + + container route-origin-ip { + description + "RFC4360 section 5 BGP extended community using an IP + address."; + + leaf match-type { + type oc-bgp-types:bgp-color-match-type; + description "Specifies the match criteria between BGP NH and + SR policy endpoint"; + } + + leaf value { + type uint32; + description "Assigned value for this community."; + } + } + + container color { + description + "RFC9012 BGP color extended community and + draft-ietf-idr-segment-routing-te-policy."; + + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } + } + } + } + uses oc-rpol:match-set-options-group; + + } + +grouping ext-community-asn-value-config { + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + + grouping ext-community-member-config { + description + "Configuration data for strongly typed BGP extended communities."; + + leaf id { + type uint16; + mandatory true; + description + "Represents an index of a member entry."; + } + } + + grouping ext-community-member-state { + description + "Operational state data for strongly typed BGP extended community sets."; + } + + + // augment statements augment "/oc-rpol:routing-policy/oc-rpol:defined-sets" { From 91d799377b5eaa5a782d0d0fab508ff6cffebe41 Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 8 Aug 2023 17:25:43 -0700 Subject: [PATCH 13/27] rm index ref, add container cfg/state --- release/models/bgp/openconfig-bgp-policy.yang | 202 ++++++++++++------ release/models/bgp/openconfig-bgp-types.yang | 29 +-- 2 files changed, 136 insertions(+), 95 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index d35c43706..2a0c005e7 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -679,21 +679,18 @@ module openconfig-bgp-policy { "Enclosing container for list of extended community members"; list member { - key "id"; - description - "List of members"; + key "index"; + description + "List of members in an external community set. Each entry + is identified by an index."; - leaf id { + leaf index { type leafref { - path "../config/id"; + path "../config/index"; } description - "Members of the extended community set. - For an ADD operation these are the communities that will be added; - For REMOVE or REPLACE operations then matching communities will - be removed unless match-set-options is INVERT which will - reverse this to mean that anything that does not match will be - removed."; + "Reference to the index for the member of an extended + community set."; } container config { @@ -715,54 +712,47 @@ module openconfig-bgp-policy { "RFC4360 section 3.1 or 3.2 BGP extended community."; container config { - uses ext-community-asn-value-config; + uses ext-community-asn-type-config; } container state { config false; - uses ext-community-asn-value-config; + uses ext-community-asn-type-config; } - } container ip-type { description "RFC5668 section 2 BGP extended community."; - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; + container config { + uses ext-community-ip-type-config; } - - leaf value { - type uint16; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-ip-type-config; } } container link-bw { description "draft-ietf-idr-link-bandwidth-07"; - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; + container config { + uses ext-community-link-bw-config; } - - leaf bps { - type uint64; - description "Bandwidth in bits per second."; + container state { + config false; + uses ext-community-link-bw-config; } } container route-target { description "RFC4360 section 4 BGP extended community."; - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; + container config { + uses ext-community-route-target-config; } - - leaf value { - type uint16; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-route-target-config; } } @@ -770,14 +760,12 @@ module openconfig-bgp-policy { description "RFC4360 section 4 using IP address as BGP extended community."; - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; + container config { + uses ext-community-route-target-ip-config; } - - leaf value { - type uint16; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-route-target-ip-config; } } @@ -785,14 +773,12 @@ module openconfig-bgp-policy { description "RFC4360 section 5 BGP extended community using an ASN."; - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; + container config { + uses ext-community-route-origin-config; } - - leaf value { - type uint16; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-route-origin-config; } } @@ -801,15 +787,12 @@ module openconfig-bgp-policy { "RFC4360 section 5 BGP extended community using an IP address."; - leaf match-type { - type oc-bgp-types:bgp-color-match-type; - description "Specifies the match criteria between BGP NH and - SR policy endpoint"; + container config { + uses ext-community-route-origin-ip-config; } - - leaf value { - type uint32; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-route-origin-ip-config; } } @@ -818,14 +801,12 @@ module openconfig-bgp-policy { "RFC9012 BGP color extended community and draft-ietf-idr-segment-routing-te-policy."; - leaf ip-address { - type oc-inet:ip-address; - description "IPv4 address."; + container config { + uses ext-community-color-config; } - - leaf value { - type uint16; - description "Assigned value for this community."; + container state { + config false; + uses ext-community-color-config; } } } @@ -834,7 +815,7 @@ module openconfig-bgp-policy { } -grouping ext-community-asn-value-config { +grouping ext-community-asn-type-config { leaf asn { type oc-inet:as-number; description "Autonomous system number."; @@ -846,11 +827,96 @@ grouping ext-community-asn-value-config { } } +grouping ext-community-ip-type-config { + leaf asn { + type oc-inet:ip-address; + description "IPv4 Address for the community."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + +grouping ext-community-link-bw-config { + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf bps { + type uint64; + description "Bandwidth in bits per second."; + } +} + +grouping ext-community-route-target-config { + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + +grouping ext-community-route-target-ip-config { + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + +grouping ext-community-route-origin-config { + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + +grouping ext-community-route-origin-ip-config { + leaf ip-address { + type oc-inet:ip-address; + description "IPv4 address."; + } + + leaf value { + type uint16; + description "Assigned value for this community."; + } +} + +grouping ext-community-color-config { + leaf match-type { + type oc-bgp-types:bgp-color-match-type; + description "Specifies the match criteria between BGP NH and + SR policy endpoint"; + } + + leaf value { + type uint32; + description "Assigned value for this community."; + } +} + grouping ext-community-member-config { description - "Configuration data for strongly typed BGP extended communities."; + "Configuration data for typed BGP extended communities."; - leaf id { + leaf index { type uint16; mandatory true; description @@ -860,7 +926,7 @@ grouping ext-community-asn-value-config { grouping ext-community-member-state { description - "Operational state data for strongly typed BGP extended community sets."; + "Operational state data for typed BGP extended community sets."; } diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 9f173637f..825a01d9f 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -604,29 +604,6 @@ module openconfig-bgp-types { '[1-9][0-9]{1,8}|[0-9])'; } - type string { - // Extended Link Bandwidth Community with 4 byte ASN - // bandwidth:<4 byte asn>: - pattern 'bandwidth:' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9]):' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9])'; - oc-ext:posix-pattern '^bandwidth:' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9]):' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9])$'; - } - } description "Type definition for extended community attributes. In the case that @@ -640,13 +617,11 @@ module openconfig-bgp-types { - route-origin:<2b ASN>:<4b value> per RFC4360 section 5 - route-origin:<4b IPv4>:<2b value> per RFC4360 section 5 - color::<4b value> per draft-ietf-idr-segment-routing-te-policy - section 3 - - Link Bandwidth "; + section 3"; reference "RFC 4360 - BGP Extended Communities Attribute RFC 5668 - 4-Octet AS Specific BGP Extended Community - draft-ietf-idr-segment-routing-te-policy - draft-ietf-idr-link-bandwidth-07 "; + draft-ietf-idr-segment-routing-te-policy"; } typedef bgp-ext-community-recv-type { From ac478b64bdea4f54ad83f458906e08a612aa0685 Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 8 Aug 2023 17:52:55 -0700 Subject: [PATCH 14/27] remove extra match-set group, fix indent --- release/models/bgp/openconfig-bgp-policy.yang | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 2a0c005e7..16594f8fb 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -670,7 +670,7 @@ module openconfig-bgp-policy { } } - grouping ext-community-members-top { + grouping ext-community-members-top { description "Top-level grouping for members of an external community set"; @@ -811,8 +811,6 @@ module openconfig-bgp-policy { } } } - uses oc-rpol:match-set-options-group; - } grouping ext-community-asn-type-config { From 0322d47c8f48896ddc8d3cff9915b80ce75d5bd7 Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 8 Aug 2023 18:04:13 -0700 Subject: [PATCH 15/27] add all container descriptions --- release/models/bgp/openconfig-bgp-policy.yang | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 16594f8fb..9a2595448 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -712,9 +712,11 @@ module openconfig-bgp-policy { "RFC4360 section 3.1 or 3.2 BGP extended community."; container config { + description "Config for asn-type extended community."; uses ext-community-asn-type-config; } container state { + description "State for asn-type extended community."; config false; uses ext-community-asn-type-config; } @@ -724,21 +726,26 @@ module openconfig-bgp-policy { description "RFC5668 section 2 BGP extended community."; container config { + description "Config for ip-type extended community."; uses ext-community-ip-type-config; } container state { + description "State for ip-type extended community."; config false; uses ext-community-ip-type-config; } } container link-bw { - description "draft-ietf-idr-link-bandwidth-07"; + description "Container for link bandwidth extended community + as defined by draft-ietf-idr-link-bandwidth-07"; container config { + description "Config for link bandwidth extended community."; uses ext-community-link-bw-config; } container state { + description "State for link bandwidth extended community."; config false; uses ext-community-link-bw-config; } @@ -748,9 +755,11 @@ module openconfig-bgp-policy { description "RFC4360 section 4 BGP extended community."; container config { + description "Config for route target extended community."; uses ext-community-route-target-config; } container state { + description "State for route target extended community."; config false; uses ext-community-route-target-config; } @@ -761,9 +770,13 @@ module openconfig-bgp-policy { community."; container config { + description "Config for route target extended community + using an IP address."; uses ext-community-route-target-ip-config; } container state { + description "State for route target extended community + using an IP address."; config false; uses ext-community-route-target-ip-config; } @@ -774,9 +787,11 @@ module openconfig-bgp-policy { "RFC4360 section 5 BGP extended community using an ASN."; container config { + description "Config for route origin extended community"; uses ext-community-route-origin-config; } container state { + description "State for route origin extended community"; config false; uses ext-community-route-origin-config; } @@ -788,9 +803,13 @@ module openconfig-bgp-policy { address."; container config { + description "Config for route origin extended + community using an IP address"; uses ext-community-route-origin-ip-config; } container state { + description "State for route origin extended + community using an IP address"; config false; uses ext-community-route-origin-ip-config; } @@ -798,13 +817,17 @@ module openconfig-bgp-policy { container color { description - "RFC9012 BGP color extended community and + "BGP color extended community defined by RFC9012 and draft-ietf-idr-segment-routing-te-policy."; container config { + description "Config for BGP color extended community + defined by RFC9012"; uses ext-community-color-config; } container state { + description "State for BGP color extended community + defined by RFC9012"; config false; uses ext-community-color-config; } From f8f0ee32c32268d2276f27bd6bcff69742954bba Mon Sep 17 00:00:00 2001 From: dplore Date: Tue, 8 Aug 2023 18:16:59 -0700 Subject: [PATCH 16/27] add grouping descriptions --- release/models/bgp/openconfig-bgp-policy.yang | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 9a2595448..ab07cbdd4 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -837,30 +837,33 @@ module openconfig-bgp-policy { } grouping ext-community-asn-type-config { - leaf asn { - type oc-inet:as-number; - description "Autonomous system number."; - } + description "Grouping for asn-type extended community config."; + leaf asn { + type oc-inet:as-number; + description "Autonomous system number."; + } - leaf value { - type uint16; - description "Assigned value for this community."; - } + leaf value { + type uint16; + description "Assigned value for this community."; + } } grouping ext-community-ip-type-config { - leaf asn { - type oc-inet:ip-address; - description "IPv4 Address for the community."; - } + description "Grouping for ip-type extended community config."; + leaf asn { + type oc-inet:ip-address; + description "IPv4 Address for the community."; + } - leaf value { - type uint16; - description "Assigned value for this community."; - } + leaf value { + type uint16; + description "Assigned value for this community."; + } } grouping ext-community-link-bw-config { + description "Grouping for link bandwidth extended community config."; leaf asn { type oc-inet:as-number; description "Autonomous system number."; @@ -873,6 +876,7 @@ grouping ext-community-link-bw-config { } grouping ext-community-route-target-config { + description "Grouping for route-target extended community config."; leaf asn { type oc-inet:as-number; description "Autonomous system number."; @@ -885,6 +889,8 @@ grouping ext-community-route-target-config { } grouping ext-community-route-target-ip-config { + description "Grouping for route-target-ip extended community + config."; leaf ip-address { type oc-inet:ip-address; description "IPv4 address."; @@ -897,6 +903,7 @@ grouping ext-community-route-target-ip-config { } grouping ext-community-route-origin-config { + description "Grouping for origin extended community config."; leaf asn { type oc-inet:as-number; description "Autonomous system number."; @@ -909,6 +916,7 @@ grouping ext-community-route-origin-config { } grouping ext-community-route-origin-ip-config { + description "Grouping for route-origin-ip extended community config."; leaf ip-address { type oc-inet:ip-address; description "IPv4 address."; @@ -921,6 +929,7 @@ grouping ext-community-route-origin-ip-config { } grouping ext-community-color-config { + description "Grouping for color extended community config."; leaf match-type { type oc-bgp-types:bgp-color-match-type; description "Specifies the match criteria between BGP NH and From 87d9cdc3b9bf217a9ffc9cae3a46495ee9ae8dcf Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 10 Aug 2023 11:33:29 -0700 Subject: [PATCH 17/27] remove mandatory for member index leaf --- release/models/bgp/openconfig-bgp-policy.yang | 1 - 1 file changed, 1 deletion(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index ab07cbdd4..7a995b939 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -948,7 +948,6 @@ grouping ext-community-color-config { leaf index { type uint16; - mandatory true; description "Represents an index of a member entry."; } From 1e6c495e8775acf629d6b0ee1aa07033e1a7162a Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Wed, 27 Dec 2023 02:25:21 +0000 Subject: [PATCH 18/27] Add asn4 container for 4byte asn4. Address comments. --- release/models/bgp/openconfig-bgp-policy.yang | 54 ++++++++++++++----- release/models/bgp/openconfig-bgp-types.yang | 19 ------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 7a995b939..96ad349e3 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -8,13 +8,13 @@ module openconfig-bgp-policy { prefix "oc-bgp-pol"; // import some basic types + import openconfig-types { prefix "oc-types"; } import openconfig-inet-types { prefix oc-inet; } import openconfig-routing-policy {prefix oc-rpol; } import openconfig-policy-types { prefix oc-pol-types; } import openconfig-bgp-types { prefix oc-bgp-types; } import openconfig-extensions { prefix oc-ext; } - // meta organization "OpenConfig working group"; @@ -672,7 +672,7 @@ module openconfig-bgp-policy { grouping ext-community-members-top { description - "Top-level grouping for members of an external community set"; + "Top-level grouping for members of an extended community set"; container members { description @@ -681,7 +681,7 @@ module openconfig-bgp-policy { list member { key "index"; description - "List of members in an external community set. Each entry + "List of members in an extended community set. Each entry is identified by an index."; leaf index { @@ -709,7 +709,7 @@ module openconfig-bgp-policy { container asn-type { description - "RFC4360 section 3.1 or 3.2 BGP extended community."; + "RFC4360 section 3.1 or 3.2 BGP extended community with 2 byte ASN."; container config { description "Config for asn-type extended community."; @@ -722,6 +722,21 @@ module openconfig-bgp-policy { } } + container asn4-type { + description + "RFC4360 section 3.1 or 3.2 BGP extended community with 4 byte ASN."; + + container config { + description "Config for asn-type extended community."; + uses ext-community-asn4-type-config; + } + container state { + description "State for asn-type extended community."; + config false; + uses ext-community-asn4-type-config; + } + } + container ip-type { description "RFC5668 section 2 BGP extended community."; @@ -840,24 +855,37 @@ grouping ext-community-asn-type-config { description "Grouping for asn-type extended community config."; leaf asn { type oc-inet:as-number; - description "Autonomous system number."; + description "2 byte Autonomous system number."; + } + + leaf value { + type uint32; + description "Assigned value for this community."; + } +} + +grouping ext-community-asn4-type-config { + description "Grouping for asn4-type extended community config."; + leaf asn { + type oc-inet:as-number; + description "4 Byte autonomous system number."; } leaf value { - type uint16; + type uint16; description "Assigned value for this community."; } } grouping ext-community-ip-type-config { description "Grouping for ip-type extended community config."; - leaf asn { + leaf ip-address { type oc-inet:ip-address; description "IPv4 Address for the community."; } leaf value { - type uint16; + type uint16; description "Assigned value for this community."; } } @@ -870,7 +898,7 @@ grouping ext-community-link-bw-config { } leaf bps { - type uint64; + type oc-types:ieeefloat32; description "Bandwidth in bits per second."; } } @@ -891,8 +919,8 @@ grouping ext-community-route-target-config { grouping ext-community-route-target-ip-config { description "Grouping for route-target-ip extended community config."; - leaf ip-address { - type oc-inet:ip-address; + leaf ipv4-address { + type oc-inet:ipv4-address; description "IPv4 address."; } @@ -917,8 +945,8 @@ grouping ext-community-route-origin-config { grouping ext-community-route-origin-ip-config { description "Grouping for route-origin-ip extended community config."; - leaf ip-address { - type oc-inet:ip-address; + leaf ipv4-address { + type oc-inet:ipv4-address; description "IPv4 address."; } diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 825a01d9f..b453f57b2 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -585,25 +585,6 @@ module openconfig-bgp-types { '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + '[1-9][0-9]{1,8}|[0-9])$'; } - type string { - // Extended Link Bandwidth Community - // bandwidth:<2 byte asn>: - pattern 'bandwidth:' + - '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + - '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9])'; - oc-ext:posix-pattern '^bandwidth:' + - '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' + - '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$' + - '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + - '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + - '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' + - '[1-9][0-9]{1,8}|[0-9])'; - - } } description "Type definition for extended community attributes. In the case that From 7c4b1b8dd9b8da8fa8421d257bfc26a5ebbe8169 Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Wed, 27 Dec 2023 02:42:04 +0000 Subject: [PATCH 19/27] update bps to bandwidth --- release/models/bgp/openconfig-bgp-policy.yang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 8d6f809f0..313d361f4 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -1032,9 +1032,9 @@ grouping ext-community-link-bw-config { description "Autonomous system number."; } - leaf bps { + leaf bandwidth { type oc-types:ieeefloat32; - description "Bandwidth in bits per second."; + description "Bandwidth in bytes per second."; } } From 0fdea9eb68e9bc60bc2ee538652216cac54855cd Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Wed, 27 Dec 2023 02:44:41 +0000 Subject: [PATCH 20/27] update bgp-types version --- release/models/bgp/openconfig-bgp-types.yang | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 99cc390fc..16e712aa2 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -25,7 +25,13 @@ module openconfig-bgp-types { policy. It can be imported by modules that make use of BGP attributes"; - oc-ext:openconfig-version "5.5.0"; + oc-ext:openconfig-version "5.6.0"; + + revision "2023-12-26" { + description + "Add link bandwidth extended community type"; + reference "5.6.0"; + } revision "2023-09-06" { description From fb2ffc37c04cea12967246f4f0fbf71f8dc93dd3 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 12 Jan 2024 19:29:05 -0800 Subject: [PATCH 21/27] use ip4 for bgp community ip-type --- release/models/bgp/openconfig-bgp-policy.yang | 10 +++++----- release/models/bgp/openconfig-bgp-types.yang | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 313d361f4..cf8727208 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -30,10 +30,10 @@ module openconfig-bgp-policy { oc-ext:openconfig-version "6.4.0"; - revision "2023-12-26" { + revision "2024-01-12" { description - "Add strongly typed bgp extended communities. Deprecate - string typed extended bgp communities."; + "Introduce structured BGP communities and add link bandwidth extended + community type. Deprecate string based community types."; reference "6.4.0"; } @@ -1014,8 +1014,8 @@ grouping ext-community-asn4-type-config { grouping ext-community-ip-type-config { description "Grouping for ip-type extended community config."; - leaf ip-address { - type oc-inet:ip-address; + leaf ipv4-address { + type oc-inet:ipv4-address; description "IPv4 Address for the community."; } diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index 16e712aa2..bf502880c 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -27,9 +27,10 @@ module openconfig-bgp-types { oc-ext:openconfig-version "5.6.0"; - revision "2023-12-26" { + revision "2024-01-12" { description - "Add link bandwidth extended community type"; + "Introduce structured BGP communities and add link bandwidth extended + community type. Deprecate string based community types."; reference "5.6.0"; } @@ -411,10 +412,7 @@ module openconfig-bgp-types { typedef bgp-std-community-type { - // TODO: further refine restrictions and allowed patterns - // 4-octet value: - // 2 octets - // 2 octets + status deprecated; type union { type uint32 { // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - @@ -439,6 +437,7 @@ module openconfig-bgp-types { } typedef bgp-ext-community-type { + status deprecated; type union { type string { // Type 1: 2-octet global and 4-octet local From bccd54f3ec2e63cf41f5951175ac6e8107bb9cee Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 17 Jan 2024 09:03:50 -0800 Subject: [PATCH 22/27] update --- release/models/bgp/openconfig-bgp-policy.yang | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index cf8727208..8ad7dcb21 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -1103,6 +1103,30 @@ grouping ext-community-color-config { type uint32; description "Assigned value for this community."; } + + leaf flags { + type enumeration { + enum MATCH_BGP_NH { + description "Type 0: Specific Endpoint Match. Requests match for + the endpoint that is the BGP NH."; + } + enum MATCH_BGP_NH_OR_NULL { + description "Type 1: Specific or Null Endpoint Match. Requests + match for either the endpoint that is the BGP NH or a null endpoint + (e.g., like a default gateway)."; + } + enum MATCH_ANY { + description "Type 2: Specific, Null, or Any Endpoint Match. Requests + match for either the endpoint that is the BGP NH or with a null or + any endpoint."; + } + } + description "Flags represents the Color-Only Type field which indicates + matching criteria between BGP NH and SR Policy endpoint in addition to + the matching of the color value."; + + reference "https://datatracker.ietf.org/doc/html/draft-ietf-idr-segment-routing-te-policy-26#name-color-extended-community"; + } } grouping ext-community-member-config { From c17b767eef8dda5d82062c95865f2fe5bf45a161 Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 17 Jan 2024 21:07:25 -0800 Subject: [PATCH 23/27] add std community container --- release/models/bgp/openconfig-bgp-policy.yang | 114 +++++++++++++----- 1 file changed, 86 insertions(+), 28 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index 8ad7dcb21..f98de3997 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -583,6 +583,7 @@ module openconfig-bgp-policy { } leaf-list community-member { + status deprecated; type union { type oc-bgp-types:bgp-std-community-type; type oc-bgp-types:bgp-community-regexp-type; @@ -651,6 +652,7 @@ module openconfig-bgp-policy { uses community-set-state; } } + uses community-members-top; } } @@ -805,6 +807,90 @@ module openconfig-bgp-policy { } } + grouping community-members-top { + description + "Top-level grouping for members of a standard community set"; + + container members { + description + "Enclosing container for list of standard community members"; + + list member { + key "index"; + description + "List of members in an extended community set. Each entry + is identified by an index."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index for the member of an standard + community set."; + } + + container config { + description "Standard community member configuration."; + + uses community-member-config; + } + + container state { + config false; + description "State for BGP standard community set members"; + + uses community-member-config; + uses community-member-state; + } + + container asn-type { + description + "RFC4360 section 3.1 or 3.2 BGP extended community with 2 byte ASN."; + + container config { + description "Config for asn-type extended community."; + uses community-asn-type-config; + } + container state { + description "State for asn-type extended community."; + config false; + uses community-asn-type-config; + } + } + } + } + } + + grouping community-member-config { + description + "Configuration data for BGP standard communities."; + + leaf index { + type uint16; + description + "Represents an index of a member entry."; + } + } + + grouping community-member-state { + description + "Operational state data for BGP standard community sets."; + } + + grouping community-asn-type-config { + description "Grouping for asn-type standard community config."; + leaf asn { + type oc-inet:as-number; + description "2 byte Autonomous system number."; + } + + leaf value { + type uint32; + description "Assigned value for this community."; + } + } + grouping ext-community-members-top { description "Top-level grouping for members of an extended community set"; @@ -842,21 +928,6 @@ module openconfig-bgp-policy { uses ext-community-member-state; } - container asn-type { - description - "RFC4360 section 3.1 or 3.2 BGP extended community with 2 byte ASN."; - - container config { - description "Config for asn-type extended community."; - uses ext-community-asn-type-config; - } - container state { - description "State for asn-type extended community."; - config false; - uses ext-community-asn-type-config; - } - } - container asn4-type { description "RFC4360 section 3.1 or 3.2 BGP extended community with 4 byte ASN."; @@ -986,19 +1057,6 @@ module openconfig-bgp-policy { } } -grouping ext-community-asn-type-config { - description "Grouping for asn-type extended community config."; - leaf asn { - type oc-inet:as-number; - description "2 byte Autonomous system number."; - } - - leaf value { - type uint32; - description "Assigned value for this community."; - } -} - grouping ext-community-asn4-type-config { description "Grouping for asn4-type extended community config."; leaf asn { From 5043148f75ce226be2b69c25e292a39b7ab0cc25 Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 17 Jan 2024 21:16:55 -0800 Subject: [PATCH 24/27] fix std community grouping --- release/models/bgp/openconfig-bgp-policy.yang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index f98de3997..ca13c8cbf 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -642,17 +642,17 @@ module openconfig-bgp-policy { } container state { - config false; - description "Operational state data for BGP community sets"; uses community-set-config; uses community-set-state; } + + uses community-members-top; } - uses community-members-top; + } } From 30bad692b0a37a3bc93113aa80010ab686915cab Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 19 Jan 2024 12:56:01 -0800 Subject: [PATCH 25/27] add posix-regex type --- release/models/types/openconfig-types.yang | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/release/models/types/openconfig-types.yang b/release/models/types/openconfig-types.yang index 89e32d515..57fe6ca49 100644 --- a/release/models/types/openconfig-types.yang +++ b/release/models/types/openconfig-types.yang @@ -21,7 +21,13 @@ module openconfig-types { are used across OpenConfig models. It can be imported by modules that make use of these types."; - oc-ext:openconfig-version "0.6.0"; + oc-ext:openconfig-version "0.7.0"; + + revision "2024-01-19" { + description + "Add posix-regex type."; + reference "0.7.0"; + } revision "2019-04-16" { description @@ -101,6 +107,14 @@ module openconfig-types { supported. An initial proposal is POSIX compatible."; } + typedef posix-eregexp { + type string; + description + "This is a string which represents an extended POSIX + regular expression."; + reference "IEEE Std 1003.1-2017"; + } + typedef timeticks64 { type uint64; units "nanoseconds"; From 31c47bc47099ebb2d7a057a91195e1fe9e3076df Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 19 Jan 2024 12:56:41 -0800 Subject: [PATCH 26/27] add posix-eregex type --- release/models/types/openconfig-types.yang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/models/types/openconfig-types.yang b/release/models/types/openconfig-types.yang index 57fe6ca49..29cd2ba5e 100644 --- a/release/models/types/openconfig-types.yang +++ b/release/models/types/openconfig-types.yang @@ -25,7 +25,7 @@ module openconfig-types { revision "2024-01-19" { description - "Add posix-regex type."; + "Add posix-eregex type."; reference "0.7.0"; } From 5f6999bc3fb55cdda9a803b8b97f6c2c2c97fbb7 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 19 Jan 2024 13:32:07 -0800 Subject: [PATCH 27/27] add config for regex community --- release/models/bgp/openconfig-bgp-policy.yang | 49 ++++++++++++++++++- release/models/bgp/openconfig-bgp-types.yang | 3 +- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/release/models/bgp/openconfig-bgp-policy.yang b/release/models/bgp/openconfig-bgp-policy.yang index ca13c8cbf..f40ee62ca 100644 --- a/release/models/bgp/openconfig-bgp-policy.yang +++ b/release/models/bgp/openconfig-bgp-policy.yang @@ -846,7 +846,7 @@ module openconfig-bgp-policy { container asn-type { description - "RFC4360 section 3.1 or 3.2 BGP extended community with 2 byte ASN."; + "RFC4360 section 3.1 BGP community with 2 byte ASN."; container config { description "Config for asn-type extended community."; @@ -858,6 +858,22 @@ module openconfig-bgp-policy { uses community-asn-type-config; } } + + container asn-regex-type { + description + "A regex used to match RFC4360 section 3.1 BGP community with 2 byte ASN."; + + container config { + description "Config for asn-regex-type community."; + uses community-regex-type-config; + } + container state { + description "State for asn-regex-type community."; + config false; + uses community-regex-type-config; + } + } + } } } @@ -880,6 +896,7 @@ module openconfig-bgp-policy { grouping community-asn-type-config { description "Grouping for asn-type standard community config."; + leaf asn { type oc-inet:as-number; description "2 byte Autonomous system number."; @@ -891,6 +908,18 @@ module openconfig-bgp-policy { } } + grouping community-regex-type-config { + description "Grouping for community regular expression config."; + + leaf regex { + type oc-types:posix-eregexp; + description "A regex string used to match BGP communities. A single + regex string should be matched against a list of BGP communities + each represented as [0-9]+:[0-9]+ and space separated. The community + entries are not order dependent."; + } + } + grouping ext-community-members-top { description "Top-level grouping for members of an extended community set"; @@ -930,7 +959,7 @@ module openconfig-bgp-policy { container asn4-type { description - "RFC4360 section 3.1 or 3.2 BGP extended community with 4 byte ASN."; + "RFC4360 section 3.2 BGP extended community with 4 byte ASN."; container config { description "Config for asn-type extended community."; @@ -943,6 +972,22 @@ module openconfig-bgp-policy { } } + container asn4-regex-type { + description + "A regular expression used to match RFC4360 section 3.2 BGP + extended community with 4 byte ASN."; + + container config { + description "Config for asn4-regex-type extended community."; + uses community-regex-type-config; + } + container state { + description "State for asn4-regex-type extended community."; + config false; + uses community-regex-type-config; + } + } + container ip-type { description "RFC5668 section 2 BGP extended community."; diff --git a/release/models/bgp/openconfig-bgp-types.yang b/release/models/bgp/openconfig-bgp-types.yang index bf502880c..80048ccf3 100644 --- a/release/models/bgp/openconfig-bgp-types.yang +++ b/release/models/bgp/openconfig-bgp-types.yang @@ -651,8 +651,7 @@ module openconfig-bgp-types { } typedef bgp-community-regexp-type { - // TODO: needs more work to decide what format these regexps can - // take. + status deprecated; type oc-types:std-regexp; description "Type definition for communities specified as regular