draft-ietf-idr-bgp-model-05.txt   draft-ietf-idr-bgp-model-06.txt 
Interdomain Routing M. Jethanandani Interdomain Routing M. Jethanandani
Internet-Draft VMware Internet-Draft VMware
Intended status: Standards Track K. Patel Intended status: Standards Track K. Patel
Expires: September 26, 2019 Arrcus Expires: December 15, 2019 Arrcus
S. Hares S. Hares
Huawei Huawei
March 25, 2019 June 13, 2019
BGP YANG Model for Service Provider Networks BGP YANG Model for Service Provider Networks
draft-ietf-idr-bgp-model-05 draft-ietf-idr-bgp-model-06
Abstract Abstract
This document defines a YANG data model for configuring and managing This document defines a YANG data model for configuring and managing
BGP, including protocol, policy, and operational aspects, such as BGP, including protocol, policy, and operational aspects, such as
RIB, based on data center, carrier and content provider operational RIB, based on data center, carrier and content provider operational
requirements. requirements.
Status of This Memo Status of This Memo
skipping to change at page 1, line 36 skipping to change at page 1, line 36
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 26, 2019. This Internet-Draft will expire on December 15, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 12 skipping to change at page 2, line 12
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3
1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4 1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4
1.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 4 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
1.4. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 5
2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 5 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 5
2.1. BGP protocol configuration . . . . . . . . . . . . . . . 6 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 6
2.2. Policy configuration overview . . . . . . . . . . . . . . 9 2.2. Policy configuration overview . . . . . . . . . . . . . . 8
2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 10 2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 9
2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 12 2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 11
2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 12 2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 11
2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 12 2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 11
2.3.4. Pre route advertisements per-neighbor . . . . . . . . 12 2.3.4. Pre route advertisements per-neighbor . . . . . . . . 11
2.3.5. Post route advertisements per-neighbor . . . . . . . 12 2.3.5. Post route advertisements per-neighbor . . . . . . . 11
3. Relation to other YANG data models . . . . . . . . . . . . . 13 3. Relation to other YANG data models . . . . . . . . . . . . . 11
4. Security Considerations . . . . . . . . . . . . . . . . . . . 13 4. Security Considerations . . . . . . . . . . . . . . . . . . . 11
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 13 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 12
5.2. YANG Module Name Registration . . . . . . . . . . . . . . 14 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 12
6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 14 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 13
7. Structure of the YANG modules . . . . . . . . . . . . . . . . 15 7. Structure of the YANG modules . . . . . . . . . . . . . . . . 14
7.1. Main module and submodules for base items . . . . . . . . 15 7.1. Main module and submodules for base items . . . . . . . . 14
7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 55 7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 58
7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 66 7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 69
7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 77 7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 80
8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 126 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 126 8.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 113
8.2. Neighbor Address Family Configuration . . . . . . . . . . 127 8.2. Neighbor Address Family Configuration . . . . . . . . . . 114
9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 129 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 116
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 129 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 116
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 129 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 116
11.1. Normative references . . . . . . . . . . . . . . . . . . 129 11.1. Normative references . . . . . . . . . . . . . . . . . . 116
11.2. Informative references . . . . . . . . . . . . . . . . . 131 11.2. Informative references . . . . . . . . . . . . . . . . . 118
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 131 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 119
1. Introduction 1. Introduction
This document describes a YANG [RFC7950] data model for the BGP This document describes a YANG [RFC7950] data model for the BGP-4
[RFC4271] protocol, including various protocol extensions, policy [RFC4271] protocol, including various protocol extensions, policy
configuration, as well as defining key operational state data, configuration, as well as defining key operational state data,
including Routing Information Base (RIB). The model is intended to including Routing Information Base (RIB). The model is intended to
be vendor-neutral, in order to allow operators to manage BGP be vendor-neutral, in order to allow operators to manage BGP
configuration in heterogeneous environments with routers supplied by configuration in heterogeneous environments with routers supplied by
multiple vendors. The model is also intended to be readily mapped to multiple vendors. The model is also intended to be readily mapped to
existing implementations to facilitate support from as large a set of existing implementations to facilitate support from as large a set of
routing hardware and software vendors as possible. routing hardware and software vendors as possible. This module does
not support previous versions of BGP, and cannot support establishing
and maintaining state information of neighbors with previous versions
of BGP.
1.1. Goals and approach 1.1. Goals and approach
The model covers the base BGP features that are deployed across major The model covers the base BGP features that are deployed across major
implementations and the common BGP configurations in use across a implementations and the common BGP configurations in use across a
number of operator network deployments. In particular, this model number of operator network deployments. In particular, this model
attempts to cover BGP features defined in BGP [RFC4271], BGP attempts to cover BGP features defined in BGP [RFC4271], BGP
Communities Attribute [RFC1997], BGP Route Reflection [RFC4456], Communities Attribute [RFC1997], BGP Route Reflection [RFC4456],
Multiprotocol Extensions for BGP-4 [RFC4760], Autonomous System Multiprotocol Extensions for BGP-4 [RFC4760], Autonomous System
Confederations for BGP [RFC5065], BGP Route Flap Damping [RFC2439], Confederations for BGP [RFC5065], BGP Route Flap Damping [RFC2439],
skipping to change at page 4, line 27 skipping to change at page 4, line 30
1.2. Note to RFC Editor 1.2. Note to RFC Editor
This document uses several placeholder values throughout the This document uses several placeholder values throughout the
document. Please replace them as follows and remove this note before document. Please replace them as follows and remove this note before
publication. publication.
RFC XXXX, where XXXX is the number assigned to this document at the RFC XXXX, where XXXX is the number assigned to this document at the
time of publication. time of publication.
2019-03-21 with the actual date of the publication of this document. 2019-06-13 with the actual date of the publication of this document.
RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for
Routing Policy Management [I-D.ietf-rtgwg-policy-model]. Routing Policy Management [I-D.ietf-rtgwg-policy-model].
RFC AAAA, where AAAA is the number assigned to BGP Monitoring RFC AAAA, where AAAA is the number assigned to BGP Monitoring
Protocol [I-D.ietf-grow-bmp]. Protocol [RFC7854].
RFC BBBB, where BBBB is the number assigned to YANG Data Model for RFC BBBB, where BBBB is the number assigned to YANG Data Model for
Bidirectional Forward Detection [I-D.ietf-bfd-yang]. Bidirectional Forward Detection [I-D.ietf-bfd-yang].
1.3. Abbreviations 1.3. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
1.4. Abbreviations
+--------------+-------------------------------------------+ +--------------+-------------------------------------------+
| Abbreviation | | | Abbreviation | |
+--------------+-------------------------------------------+ +--------------+-------------------------------------------+
| AFI | Address Family Identifier | | AFI | Address Family Identifier |
| | | | | |
| BFD | Bidirectional Forward Detection | | BFD | Bidirectional Forward Detection |
| | | | | |
| NLRI | Network Layer Reachability Information | | NLRI | Network Layer Reachability Information |
| | | | | |
| NMDA | Network Management Datastore Architecture | | NMDA | Network Management Datastore Architecture |
skipping to change at page 7, line 5 skipping to change at page 6, line 16
addresses and prefixes, autonomous system numbers, etc., defined in addresses and prefixes, autonomous system numbers, etc., defined in
Common YANG Data Types [RFC6991]. Common YANG Data Types [RFC6991].
2.1. BGP protocol configuration 2.1. BGP protocol configuration
The BGP protocol configuration model is organized hierarchically, The BGP protocol configuration model is organized hierarchically,
much like the majority of router implementations. That is, much like the majority of router implementations. That is,
configuration items can be specified at multiple levels, as shown configuration items can be specified at multiple levels, as shown
below. below.
module: ietf-bgp module: ietf-bgp
augment /rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol: augment /rt:routing/rt:control-plane-protocols/rt:control-plane-proto
+--rw bgp col:
+--rw global! +--rw bgp
| +--rw as inet:as-number +--rw global!
| +--rw router-id? yang:dotted-quad | +--rw as inet:as-number
| +--ro total-paths? uint32 | +--rw identifier? yang:dotted-quad
| +--ro total-prefixes? uint32 | +--rw default-route-distance
| +--rw default-route-distance | +--rw confederation
| | ... | +--rw graceful-restart
| +--rw confederation | +--rw use-multiple-paths
| | ... | +--rw route-selection-options
| +--rw graceful-restart | +--rw afi-safis
| | ... | +--rw apply-policy
| +--rw use-multiple-paths | +--ro total-paths? uint32
| | ... | +--ro total-prefixes? uint32
| +--rw route-selection-options +--rw neighbors
| | ... | +--rw neighbor* [remote-address]
| +--rw afi-safis | +---n established
| | ... | +---n backward-transition
| +--rw apply-policy | +--rw clear-neighbors {clear-neighbors}?
| ... +--rw peer-groups
+--rw neighbors | +--rw peer-group* [peer-group-name]
| +--rw neighbor* [neighbor-address] +--rw interfaces
| ... | +--rw interface* [name]
+--rw peer-groups +--ro rib
| +--rw peer-group* [peer-group-name] +--ro attr-sets
| ... +--ro communities
+--rw interfaces +--ro ext-communities
| +--rw interface* [name] +--ro afi-safis
| ...
+--ro rib
+--ro attr-sets
| ...
+--ro communities
| ...
+--ro ext-communities
| ...
+--ro afi-safis
...
Users may specify configuration at a higher level and have it apply Users may specify configuration at a higher level and have it apply
to all lower-level items, or provide overriding configuration at a to all lower-level items, or provide overriding configuration at a
lower level of the hierarchy. Overriding configuration items are lower level of the hierarchy. Overriding configuration items are
optional, with neighbor specific configuration being the most optional, with neighbor specific configuration being the most
specific or lowest level, followed by peer-group, and finally global. specific or lowest level, followed by peer-group, and finally global.
Global configuration options reflect a subset of the peer-group or Global configuration options reflect a subset of the peer-group or
neighbor specific configuration options which are relevant to the neighbor specific configuration options which are relevant to the
entire BGP instance. entire BGP instance.
The model makes the simplifying assumption that most of the The model makes the simplifying assumption that most of the
configuration items are available at all levels of the hierarchy. configuration items are available at all levels of the hierarchy.
That is, very little configuration is specific to a particular level That is, very little configuration is specific to a particular level
in the hierarchy, other than obvious items such as "group-name" only in the hierarchy, other than obvious items such as "group-name" only
being available for the peer group-level config. A notable exception being available for the peer group-level config. A notable exception
is for sub-address family configuration where some items are only is for sub-address family configuration where some items are only
skipping to change at page 10, line 43 skipping to change at page 10, line 12
A abridged version of the tree shows the RIB portion of the tree A abridged version of the tree shows the RIB portion of the tree
diagram. diagram.
module: ietf-bgp module: ietf-bgp
augment /rt:routing/rt:control-plane-protocols augment /rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol: /rt:control-plane-protocol:
+--rw bgp +--rw bgp
+--ro rib +--ro rib
+--ro afi-safis +--ro afi-safis
+--ro afi-safi* [afi-safi-name] +--ro afi-safi* [afi-safi-name]
+--ro afi-safi-name identityref +--ro afi-safi-name identityref
+--ro ipv4-unicast +--ro ipv4-unicast
| +--ro loc-rib | +--ro loc-rib
| | +--ro routes | | +--ro routes
| | +--ro route* [prefix origin path-id] | | +--ro route* [prefix origin path-id]
| | | ...
| | +--ro clear-routes {clear-routes}?
| | ... | | ...
| +--ro neighbors | +--ro neighbors
| +--ro neighbor* [neighbor-address] | +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address | +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre | +--ro adj-rib-in-pre
| | ... | | ...
| +--ro adj-rib-in-post | +--ro adj-rib-in-post
| | ... | | ...
| +--ro adj-rib-out-pre | +--ro adj-rib-out-pre
| | ... | | ...
| +--ro adj-rib-out-post | +--ro adj-rib-out-post
| ... | ...
+--ro ipv6-unicast +--ro ipv6-unicast
| +--ro loc-rib
| | +--ro routes
| | +--ro route* [prefix origin path-id]
| | ...
| +--ro neighbors
| +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre
| | ...
| +--ro adj-rib-in-post
| | ...
| +--ro adj-rib-out-pre
| | ...
| +--ro adj-rib-out-post
| ...
+--ro ipv4-srte-policy
| +--ro loc-rib
| | +--ro routes
| | +--ro route* [path-id endpoint color]
| | ...
| +--ro neighbors
| +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre
| | ...
| +--ro adj-rib-in-post
| | ...
| +--ro adj-rib-out-pre
| | ...
| +--ro adj-rib-out-post
| ...
+--ro ipv6-srte-policy
+--ro loc-rib +--ro loc-rib
| +--ro routes | +--ro routes
| +--ro route* [path-id endpoint color] | +--ro route* [prefix origin path-id]
| | ...
| +--ro clear-routes {clear-routes}?
| ... | ...
+--ro neighbors +--ro neighbors
+--ro neighbor* [neighbor-address] +--ro neighbor* [neighbor-address]
+--ro neighbor-address inet:ip-address +--ro neighbor-address inet:ip-address
+--ro adj-rib-in-pre +--ro adj-rib-in-pre
| ... | ...
+--ro adj-rib-in-post +--ro adj-rib-in-post
| ... | ...
+--ro adj-rib-out-pre +--ro adj-rib-out-pre
| ... | ...
skipping to change at page 15, line 32 skipping to change at page 14, line 19
with [I-D.ietf-rtgwg-policy-model] (described in more detail with [I-D.ietf-rtgwg-policy-model] (described in more detail
Section 2.2) Section 2.2)
7. Structure of the YANG modules 7. Structure of the YANG modules
The YANG model can be subdivided between the main module for base The YANG model can be subdivided between the main module for base
items, types, policy data, and the RIB module. items, types, policy data, and the RIB module.
7.1. Main module and submodules for base items 7.1. Main module and submodules for base items
<CODE BEGINS> file "ietf-bgp@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp@2019-06-13.yang"
module ietf-bgp { module ietf-bgp {
yang-version "1.1"; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp"; namespace "urn:ietf:params:xml:ns:yang:ietf-bgp";
prefix "bgp"; prefix bgp;
/* /*
* Import and Include * Import and Include
*/ */
import ietf-routing { import ietf-routing {
prefix "rt"; prefix rt;
reference reference
"RFC 8349, A YANG Data Model for Routing Management "RFC 8349, A YANG Data Model for Routing Management
(NMDA Version)"; (NMDA Version)";
} }
import ietf-routing-policy { import ietf-routing-policy {
prefix rpol; prefix rpol;
reference reference
"RFC ZZZZ, A YANG Data Model for Routing Policy Management"; "RFC ZZZZ, A YANG Data Model for Routing Policy Management";
} }
import ietf-interfaces { import ietf-interfaces {
prefix if; prefix if;
reference reference
"RFC 8343, A YANG Data Model for Interface Management."; "RFC 8343, A YANG Data Model for Interface Management.";
} }
skipping to change at page 16, line 9 skipping to change at page 14, line 45
import ietf-routing-policy { import ietf-routing-policy {
prefix rpol; prefix rpol;
reference reference
"RFC ZZZZ, A YANG Data Model for Routing Policy Management"; "RFC ZZZZ, A YANG Data Model for Routing Policy Management";
} }
import ietf-interfaces { import ietf-interfaces {
prefix if; prefix if;
reference reference
"RFC 8343, A YANG Data Model for Interface Management."; "RFC 8343, A YANG Data Model for Interface Management.";
} }
import ietf-bgp-types { import ietf-bgp-types {
prefix bt; prefix bt;
reference reference
"RFC XXXX, BGP YANG Model for Service Provider Network."; "RFC XXXX, BGP YANG Model for Service Provider Network.";
} }
import ietf-bfd-types { import ietf-bfd-types {
prefix bfd; prefix bfd;
reference reference
"RFC BBBB, YANG Data Model for Bidirectional Forward Detection."; "RFC BBBB, YANG Data Model for Bidirectional Forward Detection.";
} }
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types.";
}
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types.";
}
include ietf-bgp-common; include ietf-bgp-common;
include ietf-bgp-common-multiprotocol; include ietf-bgp-common-multiprotocol;
include ietf-bgp-common-structure; include ietf-bgp-common-structure;
include ietf-bgp-neighbor; include ietf-bgp-neighbor;
include ietf-bgp-global;
include ietf-bgp-peer-group; include ietf-bgp-peer-group;
include ietf-bgp-rib-types; include ietf-bgp-rib-types;
include ietf-bgp-rib; include ietf-bgp-rib;
include ietf-bgp-rib-ext; include ietf-bgp-rib-ext;
include ietf-bgp-rib-shared-attributes;
include ietf-bgp-rib-attributes; include ietf-bgp-rib-attributes;
include ietf-bgp-rib-table-attributes; include ietf-bgp-rib-table-attributes;
include ietf-bgp-rib-tables; include ietf-bgp-rib-tables;
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com";
description description
"This module describes a YANG model for BGP protocol "This module describes a YANG model for BGP protocol
configuration. It is a limited subset of all of the configuration configuration. It is a limited subset of all of the configuration
parameters available in the variety of vendor implementations, parameters available in the variety of vendor implementations,
hence it is expected that it would be augmented with vendor- hence it is expected that it would be augmented with vendor-
specific configuration data as needed. Additional modules or specific configuration data as needed. Additional modules or
submodules to handle other aspects of BGP configuration, submodules to handle other aspects of BGP configuration,
including policy, VRFs, VPNs, and additional address families including policy, VRFs, VPNs, and additional address families
are also expected. are also expected.
skipping to change at page 17, line 24 skipping to change at page 16, line 17
+-> [ global BGP configuration ] +-> [ global BGP configuration ]
+-> AFI / SAFI global +-> AFI / SAFI global
+-> peer group +-> peer group
+-> [ peer group config ] +-> [ peer group config ]
+-> AFI / SAFI [ per-AFI overrides ] +-> AFI / SAFI [ per-AFI overrides ]
+-> neighbor +-> neighbor
+-> [ neighbor config ] +-> [ neighbor config ]
+-> [ optional pointer to peer-group ] +-> [ optional pointer to peer-group ]
+-> AFI / SAFI [ per-AFI overrides ]"; +-> AFI / SAFI [ per-AFI overrides ]";
revision "2019-03-21" { revision 2019-06-13 {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXXX, BGP Model for Service Provider Network "; "RFC XXXX, BGP Model for Service Provider Network ";
} }
/* /*
* Identity * Identity
*/ */
identity bgp { identity bgp {
base "rt:routing-protocol"; base rt:routing-protocol;
description description
"BGP protocol."; "BGP protocol.";
} }
/* /*
* Feature(s)
*/
feature clear-routes {
description
"Clearing of BGP routes is supported.";
}
feature clear-neighbors {
description
"Clearing of BGP neighbors is supported.";
}
feature clear-statistics {
description
"Clearing of BGP statistics is supported.";
}
/*
* Containers * Containers
*/ */
augment "/rt:routing/rt:control-plane-protocols/" +
"rt:control-plane-protocol" { augment "/rt:routing/rt:control-plane-protocols/"
+ "rt:control-plane-protocol" {
when "derived-from-or-self(rt:type, 'bgp')" { when "derived-from-or-self(rt:type, 'bgp')" {
description description
"This augmentation is valid for a routing protocol "This augmentation is valid for a routing protocol
instance of BGP."; instance of BGP.";
} }
description description
"BGP protocol augmentation of ietf-routing module "BGP protocol augmentation of ietf-routing module
control-plane-protocol."; control-plane-protocol.";
container bgp { container bgp {
skipping to change at page 18, line 9 skipping to change at page 17, line 21
"This augmentation is valid for a routing protocol "This augmentation is valid for a routing protocol
instance of BGP."; instance of BGP.";
} }
description description
"BGP protocol augmentation of ietf-routing module "BGP protocol augmentation of ietf-routing module
control-plane-protocol."; control-plane-protocol.";
container bgp { container bgp {
description description
"Top-level configuration for the BGP router"; "Top-level configuration for the BGP router";
container global { container global {
presence "Enables global configuration of BGP"; presence "Enables global configuration of BGP";
description description
"Global configuration for the BGP router"; "Global configuration for the BGP router";
uses bgp-global-base;
leaf as {
type inet:as-number;
mandatory true;
description
"Local autonomous system number of the router. Uses
the 32-bit as-number type from the model in RFC 6991.";
}
leaf identifier {
type yang:dotted-quad;
description
"BGP Identifier of the router - an unsigned 32-bit,
non-zero integer that should be unique within an AS.
The value of the BGP Identifier for a BGP speaker is
determined upon startup and is the same for every local
interface and BGP peer.";
reference
"RFC 6286: AS-Wide Unique BGP ID for BGP-4. Section 2.1";
}
container default-route-distance {
description
"Administrative distance (or preference) assigned to
routes received from different sources
(external, internal, and local).";
leaf external-route-distance {
type uint8 {
range "1..255";
}
description
"Administrative distance for routes learned from
external BGP (eBGP).";
}
leaf internal-route-distance {
type uint8 {
range "1..255";
}
description
"Administrative distance for routes learned from
internal BGP (iBGP).";
}
}
container confederation {
description
"Configuration options specifying parameters when the
local router is within an autonomous system which is
part of a BGP confederation.";
leaf enabled {
type boolean;
description
"When this leaf is set to true it indicates that
the local-AS is part of a BGP confederation";
}
leaf identifier {
type inet:as-number;
description
"Confederation identifier for the autonomous system.";
}
leaf-list member-as {
type inet:as-number;
description
"Remote autonomous systems that are to be treated
as part of the local confederation.";
}
}
container graceful-restart {
description
"Parameters relating the graceful restart mechanism for
BGP";
uses graceful-restart-config;
}
uses global-group-use-multiple-paths;
uses route-selection-options;
container afi-safis {
description
"List of address-families associated with the BGP
instance";
list afi-safi {
key "afi-safi-name";
description
"AFI,SAFI configuration available for the
neighbour or group";
uses mp-afi-safi-config;
uses state;
container graceful-restart {
description
"Parameters relating to BGP graceful-restart";
uses mp-afi-safi-graceful-restart-config;
}
uses route-selection-options;
uses global-group-use-multiple-paths;
uses mp-all-afi-safi-list-contents;
}
}
uses rpol:apply-policy-group; uses rpol:apply-policy-group;
uses state;
} }
container neighbors { container neighbors {
description description
"Configuration for BGP neighbors"; "Configuration for BGP neighbors";
uses bgp-neighbor-list;
list neighbor {
key "remote-address";
description
"List of BGP neighbors configured on the local system,
uniquely identified by remote IPv[46] address";
leaf local-address {
type inet:ip-address;
config false;
description
"The local IP address of this entry's BGP connection.";
}
leaf local-port {
type inet:port-number {
range "0..65535";
}
config false;
description
"The local port for the TCP connection between
the BGP peers.";
}
leaf peer-group {
type leafref {
path "../../../peer-groups/peer-group/peer-group-name";
}
description
"The peer-group with which this neighbor is associated";
}
leaf identifier {
type yang:dotted-quad;
config false;
description
"The BGP Identifier of this entry's BGP peer.
This entry MUST be 0.0.0.0 unless the
sessionstate is in the openconfirm or the
established state.";
reference
"RFC 4271, Section 4.2, 'BGP Identifier'.";
}
leaf remote-address {
type inet:ip-address;
description
"The remote IP address of this entry's BGP peer.";
}
leaf remote-port {
type inet:port-number {
range "0..65535";
}
config false;
description
"The remote port for the TCP connection
between the BGP peers. Note that the
objects local-addr, local-port, remote-addr, and
reemote-port provide the appropriate
reference to the standard MIB TCP
connection table.";
}
leaf remote-as {
type inet:as-number;
config false;
description
"The remote autonomous system number received in
the BGP OPEN message.";
reference
"RFC 4271, Section 4.2.";
}
leaf enabled {
type boolean;
default "true";
description
"Whether the BGP peer is enabled. In cases where the
enabled leaf is set to false, the local system should
not initiate connections to the neighbor, and should
not respond to TCP connections attempts from the
neighbor. If the state of the BGP session is
ESTABLISHED at the time that this leaf is set to false,
the BGP session should be ceased.
A transition from 'false' to 'true' will cause
the BGP Manual Start Event to be generated.
A transition from 'true' to 'false' will cause
the BGP Manual Stop Event to be generated.
This parameter can be used to restart BGP peer
connections. Care should be used in providing
write access to this object without adequate
authentication.";
reference
"RFC 4271, Section 8.1.2.";
}
uses neighbor-group-config;
leaf session-state {
type enumeration {
enum idle {
description
"Neighbor is down, and in the Idle state of the FSM";
}
enum connect {
description
"Neighbor is down, and the session is waiting for the
underlying transport session to be established";
}
enum active {
description
"Neighbor is down, and the local system is awaiting a
connection from the remote peer";
}
enum opensent {
description
"Neighbor is in the process of being established. The
local system has sent an OPEN message";
}
enum openconfirm {
description
"Neighbor is in the process of being established.
The local system is awaiting a NOTIFICATION or
KEEPALIVE message";
}
enum established {
description
"Neighbor is up - the BGP session with the peer is
established";
}
}
// notification does not like a non-config statement.
// config false;
description
"The BGP peer connection state.";
reference
"RFC 4271, Section 8.1.2.";
}
leaf last-established {
type uint64;
config false;
description
"This timestamp indicates the time that the BGP session
last transitioned in or out of the Established state.
The value is the timestamp in seconds relative to the
Unix Epoch (Jan 1, 1970 00:00:00 UTC).
The BGP session uptime can be computed by clients as
the difference between this value and the current time
in UTC (assuming the session is in the ESTABLISHED
state, per the session-state leaf).";
}
leaf-list supported-capabilities {
type identityref {
base bt:bgp-capability;
}
config false;
description
"BGP capabilities negotiated as supported with the peer";
}
leaf negotiated-hold-time {
type decimal64 {
fraction-digits 2;
}
config false;
description
"The negotiated hold-time for the BGP session";
}
leaf last-error {
type binary {
length "2";
}
// notification does not like non-config statement.
// config false;
description
"The last error code and subcode seen by this
peer on this connection. If no error has
occurred, this field is zero. Otherwise, the
first byte of this two byte OCTET STRING
contains the error code, and the second byte
contains the subcode.";
reference
"RFC 4271, Section 4.5.";
}
leaf fsm-established-time {
type yang:gauge32;
units "seconds";
config false;
description
"This timer indicates how long (in
seconds) this peer has been in the
established state or how long
since this peer was last in the
established state. It is set to zero when
a new peer is configured or when the router is
booted.";
reference
"RFC 4271, Section 8.";
}
container timers {
description
"Timers related to a BGP neighbor";
uses neighbor-group-timers-config;
}
container transport {
description
"Transport session parameters for the BGP neighbor";
uses neighbor-group-transport-config;
}
leaf erroneous-update-messages {
type uint32;
config false;
description
"The number of BGP UPDATE messages for which the
treat-as-withdraw mechanism has been applied based on
erroneous message contents";
}
container graceful-restart {
description
"Parameters relating the graceful restart mechanism for
BGP";
uses graceful-restart-config;
leaf peer-restart-time {
type uint16 {
range "0..4096";
}
config false;
description
"The period of time (advertised by the peer) that the
peer expects a restart of a BGP session to take";
}
leaf peer-restarting {
type boolean;
config false;
description
"This flag indicates whether the remote neighbor is
currently in the process of restarting, and hence
received routes are currently stale";
}
leaf local-restarting {
type boolean;
config false;
description
"This flag indicates whether the local neighbor is
currently restarting. The flag is unset after all NLRI
have been advertised to the peer, and the End-of-RIB
(EOR) marker has been unset";
}
leaf mode {
type enumeration {
enum HELPER_ONLY {
description
"The local router is operating in helper-only
mode, and hence will not retain forwarding state
during a local session restart, but will do so
during a restart of the remote peer";
}
enum BILATERAL {
description
"The local router is operating in both helper
mode, and hence retains forwarding state during
a remote restart, and also maintains forwarding
state during local session restart";
}
enum REMOTE_HELPER {
description
"The local system is able to retain routes during
restart but the remote system is only able to
act as a helper";
}
}
config false;
description
"This leaf indicates the mode of operation of BGP
graceful restart with the peer";
}
}
uses structure-neighbor-group-ebgp-multihop;
uses structure-neighbor-group-route-reflector;
uses structure-neighbor-group-as-path-options;
uses structure-neighbor-group-add-paths;
uses bgp-neighbor-use-multiple-paths;
uses rpol:apply-policy-group;
container afi-safis {
description
"Per-address-family configuration parameters associated
with the neighbor";
uses bgp-neighbor-afi-safi-list;
}
container statistics {
leaf established-transitions {
type yang:counter64;
config false;
description
"Number of transitions to the Established state for the
neighbor session. This value is analogous to the
bgpPeerFsmEstablishedTransitions object from the standard
BGP-4 MIB";
reference
"RFC 4273 - Definitions of Managed Objects for BGP-4";
}
leaf fsm-established-transitions {
type yang:counter32;
config false;
description
"The total number of times the BGP FSM
transitioned into the established state
for this peer.";
reference
"RFC 4271, Section 8.";
}
container messages {
config false;
description
"Counters for BGP messages sent and received from the
neighbor";
leaf in-total-messages {
type yang:counter32;
config false;
description
"The total number of messages received
from the remote peer on this connection.";
reference
"RFC 4271, Section 4.";
}
leaf out-total-messages {
type yang:counter32;
config false;
description
"The total number of messages transmitted to
the remote peer on this connection.";
reference
"RFC 4271, Section 4.";
}
leaf in-update-elapsed-time {
type yang:gauge32;
units "seconds";
config false;
description
"Elapsed time (in seconds) since the last BGP
UPDATE message was received from the peer.
Each time in-updates is incremented,
the value of this object is set to zero (0).";
reference
"RFC 4271, Section 4.3.
RFC 4271, Section 8.2.2, Established state.";
}
container sent {
description
"Counters relating to BGP messages sent to the
neighbor";
uses bgp-neighbor-counters-message-types-state;
}
container received {
description
"Counters for BGP messages received from the
neighbor";
uses bgp-neighbor-counters-message-types-state;
}
}
container queues {
config false;
description
"Counters related to queued messages associated with
the BGP neighbor";
leaf input {
type uint32;
description
"The number of messages received from the peer
currently queued";
}
leaf output {
type uint32;
description
"The number of messages queued to be sent to the
peer";
}
}
container clear-statistics {
if-feature "clear-statistics";
action clear {
input {
leaf clear-at {
type yang:date-and-time;
description
"Time when the clear action needs to be
executed.";
}
}
output {
leaf clear-finished-at {
type yang:date-and-time;
description
"Time when the clear action command completed.";
}
}
}
description
"Clear statistics action command.";
}
description
"Statistics per neighbor.";
}
}
notification established {
description
"The established event is generated
when the BGP FSM enters the established state.";
leaf remote-address {
type leafref {
path "../../neighbor/remote-address";
}
description
"IP address of the neighbor that went into established
state.";
}
leaf last-error {
type leafref {
path "../../neighbor/last-error";
}
description
"The last error code and subcode seen by this
peer on this connection. If no error has
occurred, this field is zero. Otherwise, the
first byte of this two byte OCTET STRING
contains the error code, and the second byte
contains the subcode.";
reference
"RFC 4271, Section 4.5.";
}
leaf session-state {
type leafref {
path "../../neighbor/session-state";
}
description
"The BGP peer connection state.";
reference
"RFC 4271, Section 8.2.2.";
}
}
notification backward-transition {
description
"The backward-transition event is
generated when the BGP FSM moves from a higher
numbered state to a lower numbered state.";
leaf remote-addr {
type leafref {
path "../../neighbor/remote-address";
}
description
"IP address of the neighbor that went away from
established state.";
}
leaf last-error {
type leafref {
path "../../neighbor/last-error";
}
description
"The last error code and subcode seen by this
peer on this connection. If no error has
occurred, this field is zero. Otherwise, the
first byte of this two byte OCTET STRING
contains the error code, and the second byte
contains the subcode.";
reference
"RFC 4271, Section 4.5.";
}
leaf session-state {
type leafref {
path "../../neighbor/session-state";
}
description
"The BGP peer connection state.";
reference
"RFC 4271, Section 8.2.2.";
}
}
container clear-neighbors {
if-feature "clear-neighbors";
action clear {
input {
leaf clear-at {
type yang:date-and-time;
description
"Time when the clear action command needs to be
executed.";
}
}
output {
leaf clear-finished-at {
type yang:date-and-time;
description
"Time when the clear action command completed.";
}
}
}
description
"Clear neighbors action.";
}
} }
container peer-groups { container peer-groups {
description description
"Configuration for BGP peer-groups"; "Configuration for BGP peer-groups";
uses bgp-peer-group-list; uses bgp-peer-group-list;
} }
container interfaces { container interfaces {
list interface { list interface {
key "name"; key "name";
leaf name { leaf name {
type if:interface-ref; type if:interface-ref;
description description
"Reference to the interface within the routing instance."; "Reference to the interface within the routing instance.";
} }
container bfd { container bfd {
if-feature bt:bfd; if-feature "bt:bfd";
uses bfd:client-cfg-parms; uses bfd:client-cfg-parms;
description description
"BFD client configuration."; "BFD client configuration.";
reference reference
"RFC BBBB - YANG Data Model for Bidirectional Forwarding "RFC BBBB - YANG Data Model for Bidirectional Forwarding
Detection."; Detection.";
} }
description description
"List of interfaces within the routing instance."; "List of interfaces within the routing instance.";
} }
description description
"Interface specific parameters."; "Interface specific parameters.";
} }
uses rib; uses rib;
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-common@2019-06-13.yang"
<CODE BEGINS> file "ietf-bgp-common@2019-03-21.yang"
submodule ietf-bgp-common { submodule ietf-bgp-common {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bgp"; prefix "bgp";
} }
import ietf-bgp-types { import ietf-bgp-types {
prefix bt; prefix bt;
} }
import ietf-inet-types { import ietf-inet-types {
skipping to change at page 19, line 44 skipping to change at page 32, line 35
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com";
description description
"This sub-module contains common groupings that are common across "This sub-module contains common groupings that are common across
multiple contexts within the BGP module. That is to say that multiple contexts within the BGP module. That is to say that
they may be application to a subset of global, peer-group or they may be application to a subset of global, peer-group or
neighbor contexts."; neighbor contexts.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXXX, BGP Model for Service Provider Network."; "RFC XXXX, BGP Model for Service Provider Network.";
} }
grouping neighbor-group-timers-config { grouping neighbor-group-timers-config {
description description
"Config parameters related to timers associated with the BGP "Config parameters related to timers associated with the BGP
peer"; peer";
leaf connect-retry { leaf connect-retry-interval {
type decimal64 { type uint32 {
fraction-digits 2; range "1..65535";
} }
default 30; units "seconds";
description description
"Time interval in seconds between attempts to establish a "Time interval (in seconds) for the
session with the peer."; ConnectRetryTimer. The suggested value
for this timer is 120 seconds.";
reference
"RFC 4271, Section 8.2.2. This is the value used
to initialize the 'ConnectRetryTimer'.";
} }
leaf hold-time { leaf hold-time {
type decimal64 { type uint32 {
fraction-digits 2; range "0 | 3..65535";
} }
default 90; units "seconds";
description description
"Time interval in seconds that a BGP session will be "Time interval (in seconds) for the HoldTimer
considered active in the absence of keepalive or other established with the peer. The
messages from the peer. The hold-time is typically set to value of this object is calculated by this
3x the keepalive-interval."; BGP speaker, using the smaller of the
values in hold-time-configured and the
Hold Time received in the OPEN message.
This value must be at least three seconds
if it is not zero (0).
If the Hold Timer has not been established
with the peer this object MUST have a value
of zero (0).
If the hold-time-configured object has
a value of (0), then this object MUST have a
value of (0).";
reference reference
"RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; "RFC 4271, Section 4.2.";
} }
leaf keepalive-interval { leaf keepalive-interval {
type decimal64 { type uint32 {
fraction-digits 2; range "0..21845";
} }
units "seconds";
default 30; default 30;
description description
"Time interval in seconds between transmission of keepalive "Time interval (in seconds) for the KeepAlive
messages to the neighbor. Typically set to 1/3 the timer established with the peer. The value
hold-time."; of this object is calculated by this BGP
speaker such that, when compared with
hold-time, it has the same proportion
that keep-alive-configured has,
compared with hold-time-configured.
If the KeepAlive timer has not been established
with the peer, this object MUST have a value
of zero (0).
If the of keep-alive-configured object
has a value of (0), then this object MUST have
a value of (0).";
reference
"RFC 4271, Section 4.4.";
} }
leaf minimum-advertisement-interval { leaf hold-time-configured {
type decimal64 { type uint32 {
fraction-digits 2; range "0 | 3..65535";
} }
default 30; units "seconds";
description description
"Minimum time which must elapse between subsequent UPDATE "Time interval (in seconds) for the Hold Time
messages relating to a common set of NLRI being transmitted configured for this BGP speaker with this
to a peer. This timer is referred to as peer. This value is placed in an OPEN
MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to message sent to this peer by this BGP
reduce the number of UPDATE messages transmitted when a speaker, and is compared with the Hold
particular set of NLRI exhibit instability."; Time field in an OPEN message received
from the peer when determining the Hold
Time (hold-time) with the peer.
This value must not be less than three
seconds if it is not zero (0). If it is
zero (0), the Hold Time is NOT to be
established with the peer. The suggested
value for this timer is 90 seconds.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; "RFC 4271, Section 4.2.
RFC 4271, Section 10.";
}
leaf keep-alive-configured {
type uint32 {
range "0..21845";
}
units "seconds";
description
"Time interval (in seconds) for the
KeepAlive timer configured for this BGP
speaker with this peer. The value of this
object will only determine the
KEEPALIVE messages' frequency relative to
the value specified in
hold-time-configured; the actual
time interval for the KEEPALIVE messages is
indicated by keep-alive. A
reasonable maximum value for this timer
would be one third of that of
hold-time-configured.
If the value of this object is zero (0),
no periodical KEEPALIVE messages are sent
to the peer after the BGP connection has
been established. The suggested value for
this timer is 30 seconds.";
reference
"RFC 4271, Section 4.4.
RFC 4271, Section 10.";
}
leaf min-as-origination-interval {
type uint32 {
range "0..65535";
}
units "seconds";
description
"Time interval (in seconds) for the
MinASOriginationInterval timer.
The suggested value for this timer is 15
seconds.";
reference
"RFC 4271, Section 9.2.1.2.
RFC 4271, Section 10.";
}
leaf min-route-advertisement-interval {
type uint32 {
range "0..65535";
}
units "seconds";
description
"Time interval (in seconds) for the
MinRouteAdvertisementInterval timer.
The suggested value for this timer is 30
seconds for EBGP connections and 5
seconds for IBGP connections.";
reference
"RFC 4271, Section 9.2.1.1.
RFC 4271, Section 10.";
} }
} }
grouping neighbor-group-config { grouping neighbor-group-config {
description description
"Neighbor level configuration items."; "Neighbor level configuration items.";
leaf peer-as { leaf peer-as {
type inet:as-number; type inet:as-number;
description description
"AS number of the peer."; "AS number of the peer.";
skipping to change at page 22, line 9 skipping to change at page 36, line 51
// could also make this a container with a flag to enable // could also make this a container with a flag to enable
// remove-private and separate option. here, option implies // remove-private and separate option. here, option implies
// remove-private is enabled. // remove-private is enabled.
type bt:remove-private-as-option; type bt:remove-private-as-option;
description description
"Remove private AS numbers from updates sent to peers - when "Remove private AS numbers from updates sent to peers - when
this leaf is not specified, the AS_PATH attribute should be this leaf is not specified, the AS_PATH attribute should be
sent to the peer unchanged"; sent to the peer unchanged";
} }
leaf route-flap-damping {
type boolean;
default false;
description
"Enable route flap damping.";
}
leaf send-community {
type bt:community-type;
default "NONE";
description
"Specify which types of community should be sent to the
neighbor or group. The default is to not send the community
attribute";
}
leaf description { leaf description {
type string; type string;
description description
"An optional textual description (intended primarily for use "An optional textual description (intended primarily for use
with a peer or group"; with a peer or group";
} }
} }
grouping neighbor-group-transport-config { grouping neighbor-group-transport-config {
description description
skipping to change at page 23, line 26 skipping to change at page 38, line 4
path "../../../../interfaces/interface/name"; path "../../../../interfaces/interface/name";
} }
} }
description description
"Set the local IP (either IPv4 or IPv6) address to use for "Set the local IP (either IPv4 or IPv6) address to use for
the session when sending BGP update messages. This may be the session when sending BGP update messages. This may be
expressed as either an IP address or reference to the name expressed as either an IP address or reference to the name
of an interface."; of an interface.";
} }
} }
grouping neighbor-group-error-handling-config {
description
"Configuration parameters relating to enhanced error handling
behaviors for BGP";
leaf treat-as-withdraw {
type boolean;
default "false";
description
"Specify whether erroneous UPDATE messages for which the NLRI
can be extracted are treated as though the NLRI is withdrawn
- avoiding session reset";
reference "draft-ietf-idr-error-handling-16";
}
}
grouping graceful-restart-config { grouping graceful-restart-config {
description description
"Configuration parameters relating to BGP graceful restart."; "Configuration parameters relating to BGP graceful restart.";
leaf enabled { leaf enabled {
type boolean; type boolean;
description description
"Enable or disable the graceful-restart capability."; "Enable or disable the graceful-restart capability.";
} }
leaf restart-time { leaf restart-time {
type uint16 { type uint16 {
range 0..4096; range 0..4096;
} }
description description
"Estimated time (in seconds) for the local BGP speaker to "Estimated time (in seconds) for the local BGP speaker to
restart a session. This value is advertise in the graceful restart a session. This value is advertise in the graceful
restart BGP capability. This is a 12-bit value, referred to restart BGP capability. This is a 12-bit value, referred to
as Restart Time in RFC4724. Per RFC4724, the suggested as Restart Time in RFC4724. Per RFC4724, the suggested
default value is <= the hold-time value."; default value is <= the hold-time value.";
skipping to change at page 24, line 17 skipping to change at page 38, line 27
} }
description description
"Estimated time (in seconds) for the local BGP speaker to "Estimated time (in seconds) for the local BGP speaker to
restart a session. This value is advertise in the graceful restart a session. This value is advertise in the graceful
restart BGP capability. This is a 12-bit value, referred to restart BGP capability. This is a 12-bit value, referred to
as Restart Time in RFC4724. Per RFC4724, the suggested as Restart Time in RFC4724. Per RFC4724, the suggested
default value is <= the hold-time value."; default value is <= the hold-time value.";
} }
leaf stale-routes-time { leaf stale-routes-time {
type decimal64 { type uint32;
fraction-digits 2;
}
description description
"An upper-bound on the time that stale routes will be "An upper-bound on the time that stale routes will be
retained by a router after a session is restarted. If an retained by a router after a session is restarted. If an
End-of-RIB (EOR) marker is received prior to this timer End-of-RIB (EOR) marker is received prior to this timer
expiring stale-routes will be flushed upon its receipt - if expiring stale-routes will be flushed upon its receipt - if
no EOR is received, then when this timer expires stale paths no EOR is received, then when this timer expires stale paths
will be purged. This timer is referred to as the will be purged. This timer is referred to as the
Selection_Deferral_Timer in RFC4724"; Selection_Deferral_Timer in RFC4724";
} }
leaf helper-only { leaf helper-only {
type boolean; type boolean;
default true;
description description
"Enable graceful-restart in helper mode only. When this leaf "Enable graceful-restart in helper mode only. When this leaf
is set, the local system does not retain forwarding its own is set, the local system does not retain forwarding its own
state during a restart, but supports procedures for the state during a restart, but supports procedures for the
receiving speaker, as defined in RFC4724."; receiving speaker, as defined in RFC4724.";
} }
} }
grouping use-multiple-paths-config { grouping use-multiple-paths-config {
description description
skipping to change at page 26, line 32 skipping to change at page 40, line 41
} }
grouping route-selection-options { grouping route-selection-options {
description description
"Configuration and state relating to route selection options"; "Configuration and state relating to route selection options";
container route-selection-options { container route-selection-options {
description description
"Parameters relating to options for route selection"; "Parameters relating to options for route selection";
leaf always-compare-med {
type boolean;
default "false";
description
"Compare multi-exit discriminator (MED) value from
different ASes when selecting the best route. The default
behavior is to only compare MEDs for paths received from
the same AS.";
}
leaf ignore-as-path-length {
type boolean;
default "false";
description
"Ignore the AS path length when selecting the best path.
The default is to use the AS path length and prefer paths
with shorter length.";
}
leaf external-compare-router-id {
type boolean;
default "true";
description
"When comparing similar routes received from external BGP
peers, use the router-id as a criterion to select the
active path.";
}
leaf advertise-inactive-routes {
type boolean;
default "false";
description
"Advertise inactive routes to external peers. The default
is to only advertise active routes.";
}
leaf enable-aigp { leaf enable-aigp {
type boolean; type boolean;
default false; default false;
description description
"Flag to enable sending / receiving accumulated IGP "Flag to enable sending / receiving accumulated IGP
attribute in routing updates"; attribute in routing updates";
} }
leaf ignore-next-hop-igp-metric {
type boolean;
default "false";
description
"Ignore the IGP metric to the next-hop when calculating BGP
best-path. The default is to select the route for which
the metric to the next-hop is lowest";
}
} }
} }
grouping state { grouping state {
description description
"Grouping containing common counters relating to prefixes and "Grouping containing common counters relating to prefixes and
paths"; paths";
leaf total-paths { leaf total-paths {
type uint32; type uint32;
skipping to change at page 28, line 13 skipping to change at page 41, line 25
leaf total-prefixes { leaf total-prefixes {
type uint32; type uint32;
config false; config false;
description description
"Total number of BGP prefixes received within the context"; "Total number of BGP prefixes received within the context";
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-common-multiprotocol@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-common-multiprotocol@2019-06-13.yang"
submodule ietf-bgp-common-multiprotocol { submodule ietf-bgp-common-multiprotocol {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bgp"; prefix "bgp";
} }
import ietf-bgp-types { import ietf-bgp-types {
prefix bt; prefix bt;
} }
import ietf-routing-policy { import ietf-routing-policy {
skipping to change at page 28, line 39 skipping to change at page 42, line 4
// meta // meta
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This sub-module contains groupings that are related to support "This sub-module contains groupings that are related to support
for multiple protocols in BGP. The groupings are common across for multiple protocols in BGP. The groupings are common across
multiple contexts."; multiple contexts.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
grouping mp-afi-safi-graceful-restart-config { grouping mp-afi-safi-graceful-restart-config {
description description
"BGP graceful restart parameters that apply on a per-AFI-SAFI "BGP graceful restart parameters that apply on a per-AFI-SAFI
basis"; basis";
leaf enabled { leaf enabled {
type boolean; type boolean;
default false; default false;
skipping to change at page 29, line 40 skipping to change at page 43, line 4
} }
leaf enabled { leaf enabled {
type boolean; type boolean;
default false; default false;
description description
"This leaf indicates whether the IPv4 Unicast AFI,SAFI is "This leaf indicates whether the IPv4 Unicast AFI,SAFI is
enabled for the neighbour or group"; enabled for the neighbour or group";
} }
} }
grouping mp-all-afi-safi-list-contents { grouping mp-all-afi-safi-list-contents {
description description
"A common grouping used for contents of the list that is used "A common grouping used for contents of the list that is used
for AFI-SAFI entries"; for AFI-SAFI entries";
// import and export policy included for the afi/safi // import and export policy included for the afi/safi
uses rpol:apply-policy-group; uses rpol:apply-policy-group;
container ipv4-unicast { container ipv4-unicast {
when "../afi-safi-name = 'bt:IPV4_UNICAST'" { when "../afi-safi-name = 'bt:ipv4-unicast'" {
description description
"Include this container for IPv4 Unicast specific "Include this container for IPv4 Unicast specific
configuration"; configuration";
} }
description description
"IPv4 unicast configuration options"; "IPv4 unicast configuration options";
// include common IPv[46] unicast options // include common IPv[46] unicast options
uses mp-ipv4-ipv6-unicast-common; uses mp-ipv4-ipv6-unicast-common;
// placeholder for IPv4 unicast specific configuration // placeholder for IPv4 unicast specific configuration
} }
container ipv6-unicast { container ipv6-unicast {
when "../afi-safi-name = 'bt:IPV6_UNICAST'" { when "../afi-safi-name = 'bt:ipv6-unicast'" {
description description
"Include this container for IPv6 Unicast specific "Include this container for IPv6 Unicast specific
configuration"; configuration";
} }
description description
"IPv6 unicast configuration options"; "IPv6 unicast configuration options";
// include common IPv[46] unicast options // include common IPv[46] unicast options
uses mp-ipv4-ipv6-unicast-common; uses mp-ipv4-ipv6-unicast-common;
// placeholder for IPv6 unicast specific configuration // placeholder for IPv6 unicast specific configuration
// options // options
} }
container ipv4-labeled-unicast { container ipv4-labeled-unicast {
when "../afi-safi-name = 'bt:IPV4_LABELED_UNICAST'" { when "../afi-safi-name = 'bt:ipv4-labeled-unicast'" {
description description
"Include this container for IPv4 Labeled Unicast specific "Include this container for IPv4 Labeled Unicast specific
configuration"; configuration";
} }
description description
"IPv4 Labeled Unicast configuration options"; "IPv4 Labeled Unicast configuration options";
uses mp-all-afi-safi-common; uses mp-all-afi-safi-common;
// placeholder for IPv4 Labeled Unicast specific config // placeholder for IPv4 Labeled Unicast specific config
// options // options
} }
container ipv6-labeled-unicast { container ipv6-labeled-unicast {
skipping to change at page 30, line 50 skipping to change at page 44, line 14
description description
"IPv4 Labeled Unicast configuration options"; "IPv4 Labeled Unicast configuration options";
uses mp-all-afi-safi-common; uses mp-all-afi-safi-common;
// placeholder for IPv4 Labeled Unicast specific config // placeholder for IPv4 Labeled Unicast specific config
// options // options
} }
container ipv6-labeled-unicast { container ipv6-labeled-unicast {
when "../afi-safi-name = 'bt:IPV6_LABELED_UNICAST'" { when "../afi-safi-name = 'bt:ipv6-labeled-unicast'" {
description description
"Include this container for IPv6 Labeled Unicast specific "Include this container for IPv6 Labeled Unicast specific
configuration"; configuration";
} }
description description
"IPv6 Labeled Unicast configuration options"; "IPv6 Labeled Unicast configuration options";
uses mp-all-afi-safi-common; uses mp-all-afi-safi-common;
// placeholder for IPv6 Labeled Unicast specific config // placeholder for IPv6 Labeled Unicast specific config
// options. // options.
} }
container l3vpn-ipv4-unicast { container l3vpn-ipv4-unicast {
when "../afi-safi-name = 'bt:L3VPN_IPV4_UNICAST'" { when "../afi-safi-name = 'bt:l3vpn-ipv4-unicast'" {
description description
"Include this container for IPv4 Unicast L3VPN specific "Include this container for IPv4 Unicast L3VPN specific
configuration"; configuration";
} }
description description
"Unicast IPv4 L3VPN configuration options"; "Unicast IPv4 L3VPN configuration options";
// include common L3VPN configuration options // include common L3VPN configuration options
uses mp-l3vpn-ipv4-ipv6-unicast-common; uses mp-l3vpn-ipv4-ipv6-unicast-common;
// placeholder for IPv4 Unicast L3VPN specific config options. // placeholder for IPv4 Unicast L3VPN specific config options.
} }
container l3vpn-ipv6-unicast { container l3vpn-ipv6-unicast {
when "../afi-safi-name = 'bt:L3VPN_IPV6_UNICAST'" { when "../afi-safi-name = 'bt:l3vpn-ipv6-unicast'" {
description description
"Include this container for unicast IPv6 L3VPN specific "Include this container for unicast IPv6 L3VPN specific
configuration"; configuration";
} }
description description
"Unicast IPv6 L3VPN configuration options"; "Unicast IPv6 L3VPN configuration options";
// include common L3VPN configuration options // include common L3VPN configuration options
uses mp-l3vpn-ipv4-ipv6-unicast-common; uses mp-l3vpn-ipv4-ipv6-unicast-common;
// placeholder for IPv6 Unicast L3VPN specific configuration // placeholder for IPv6 Unicast L3VPN specific configuration
// options // options
} }
skipping to change at page 31, line 51 skipping to change at page 45, line 15
"Unicast IPv6 L3VPN configuration options"; "Unicast IPv6 L3VPN configuration options";
// include common L3VPN configuration options // include common L3VPN configuration options
uses mp-l3vpn-ipv4-ipv6-unicast-common; uses mp-l3vpn-ipv4-ipv6-unicast-common;
// placeholder for IPv6 Unicast L3VPN specific configuration // placeholder for IPv6 Unicast L3VPN specific configuration
// options // options
} }
container l3vpn-ipv4-multicast { container l3vpn-ipv4-multicast {
when "../afi-safi-name = 'bt:L3VPN_IPV4_MULTICAST'" { when "../afi-safi-name = 'bt:l3vpn-ipv4-multicast'" {
description description
"Include this container for multicast IPv6 L3VPN specific "Include this container for multicast IPv6 L3VPN specific
configuration"; configuration";
} }
description description
"Multicast IPv4 L3VPN configuration options"; "Multicast IPv4 L3VPN configuration options";
// include common L3VPN multicast options // include common L3VPN multicast options
uses mp-l3vpn-ipv4-ipv6-multicast-common; uses mp-l3vpn-ipv4-ipv6-multicast-common;
// placeholder for IPv4 Multicast L3VPN specific configuration // placeholder for IPv4 Multicast L3VPN specific configuration
// options // options
} }
container l3vpn-ipv6-multicast { container l3vpn-ipv6-multicast {
when "../afi-safi-name = 'bt:L3VPN_IPV6_MULTICAST'" { when "../afi-safi-name = 'bt:l3vpn-ipv6-multicast'" {
description description
"Include this container for multicast IPv6 L3VPN specific "Include this container for multicast IPv6 L3VPN specific
configuration"; configuration";
} }
description description
"Multicast IPv6 L3VPN configuration options"; "Multicast IPv6 L3VPN configuration options";
// include common L3VPN multicast options // include common L3VPN multicast options
uses mp-l3vpn-ipv4-ipv6-multicast-common; uses mp-l3vpn-ipv4-ipv6-multicast-common;
// placeholder for IPv6 Multicast L3VPN specific configuration // placeholder for IPv6 Multicast L3VPN specific configuration
// options // options
} }
container l2vpn-vpls { container l2vpn-vpls {
when "../afi-safi-name = 'bt:L2VPN_VPLS'" { when "../afi-safi-name = 'bt:l2vpn-vpls'" {
description description
"Include this container for BGP-signalled VPLS specific "Include this container for BGP-signalled VPLS specific
configuration"; configuration";
} }
description description
"BGP-signalled VPLS configuration options"; "BGP-signalled VPLS configuration options";
// include common L2VPN options // include common L2VPN options
uses mp-l2vpn-common; uses mp-l2vpn-common;
// placeholder for BGP-signalled VPLS specific configuration // placeholder for BGP-signalled VPLS specific configuration
// options // options
skipping to change at page 33, line 4 skipping to change at page 46, line 16
description description
"BGP-signalled VPLS configuration options"; "BGP-signalled VPLS configuration options";
// include common L2VPN options // include common L2VPN options
uses mp-l2vpn-common; uses mp-l2vpn-common;
// placeholder for BGP-signalled VPLS specific configuration // placeholder for BGP-signalled VPLS specific configuration
// options // options
} }
container l2vpn-evpn { container l2vpn-evpn {
when "../afi-safi-name = 'bt:L2VPN_EVPN'" { when "../afi-safi-name = 'bt:l2vpn-evpn'" {
description description
"Include this container for BGP EVPN specific "Include this container for BGP EVPN specific
configuration"; configuration";
} }
description description
"BGP EVPN configuration options"; "BGP EVPN configuration options";
// include common L2VPN options // include common L2VPN options
uses mp-l2vpn-common; uses mp-l2vpn-common;
skipping to change at page 35, line 17 skipping to change at page 48, line 30
// Config groupings for common groups // Config groupings for common groups
grouping mp-all-afi-safi-common-prefix-limit-config { grouping mp-all-afi-safi-common-prefix-limit-config {
description description
"Configuration parameters relating to prefix-limits for an "Configuration parameters relating to prefix-limits for an
AFI-SAFI"; AFI-SAFI";
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-common-structure@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-common-structure@2019-06-13.yang"
submodule ietf-bgp-common-structure { submodule ietf-bgp-common-structure {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bgp"; prefix "bgp";
} }
import ietf-bgp-types { prefix bt; } import ietf-bgp-types { prefix bt; }
import ietf-routing-policy { prefix rpol; } import ietf-routing-policy { prefix rpol; }
include ietf-bgp-common-multiprotocol; include ietf-bgp-common-multiprotocol;
include ietf-bgp-common; include ietf-bgp-common;
skipping to change at page 35, line 39 skipping to change at page 49, line 4
// meta // meta
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This sub-module contains groupings that are common across "This sub-module contains groupings that are common across
multiple BGP contexts and provide structure around other multiple BGP contexts and provide structure around other
primitive groupings."; primitive groupings.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
grouping structure-neighbor-group-logging-options {
description
"Structural grouping used to include error handling
configuration and state for both BGP neighbors and groups";
container logging-options {
description
"Logging options for events related to the BGP neighbor or
group";
leaf log-neighbor-state-changes {
type boolean;
default "true";
description
"Configure logging of peer state changes. Default is to
enable logging of peer state changes.";
}
}
}
grouping structure-neighbor-group-ebgp-multihop { grouping structure-neighbor-group-ebgp-multihop {
description description
"Structural grouping used to include eBGP multi-hop "Structural grouping used to include eBGP multi-hop
configuration and state for both BGP neighbors and peer configuration and state for both BGP neighbors and peer
groups"; groups";
container ebgp-multihop { container ebgp-multihop {
description description
"eBGP multi-hop parameters for the BGPgroup"; "eBGP multi-hop parameters for the BGPgroup";
skipping to change at page 37, line 17 skipping to change at page 50, line 9
grouping structure-neighbor-group-route-reflector { grouping structure-neighbor-group-route-reflector {
description description
"Structural grouping used to include route reflector "Structural grouping used to include route reflector
configuration and state for both BGP neighbors and peer configuration and state for both BGP neighbors and peer
groups"; groups";
container route-reflector { container route-reflector {
description description
"Route reflector parameters for the BGPgroup"; "Route reflector parameters for the BGPgroup";
reference
"RFC 4456: BGP Route Reflection.";
leaf route-reflector-cluster-id { leaf route-reflector-cluster-id {
type bt:rr-cluster-id-type; type bt:rr-cluster-id-type;
description description
"route-reflector cluster id to use when local router is "route-reflector cluster id to use when local router is
configured as a route reflector. Commonly set at the configured as a route reflector. Commonly set at the
group level, but allows a different cluster id to be set group level, but allows a different cluster id to be set
for each neighbor."; for each neighbor.";
} }
skipping to change at page 39, line 6 skipping to change at page 51, line 49
} }
description description
"A reference to a routing policy which can be used to "A reference to a routing policy which can be used to
restrict the prefixes for which add-paths is enabled"; restrict the prefixes for which add-paths is enabled";
} }
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-peer-group@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-peer-group@2019-06-13.yang"
submodule ietf-bgp-peer-group { submodule ietf-bgp-peer-group {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bgp"; prefix "bgp";
} }
import ietf-routing-policy { import ietf-routing-policy {
prefix rpol; prefix rpol;
} }
// Include the common submodule // Include the common submodule
include ietf-bgp-common; include ietf-bgp-common;
include ietf-bgp-common-multiprotocol; include ietf-bgp-common-multiprotocol;
include ietf-bgp-common-structure; include ietf-bgp-common-structure;
// meta // meta
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This sub-module contains groupings that are specific to the "This sub-module contains groupings that are specific to the
peer-group context of the OpenConfig BGP module."; peer-group context of the OpenConfig BGP module.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
grouping bgp-peer-group-config { grouping bgp-peer-group-config {
description description
"Configuration parameters relating to a base BGP peer group "Configuration parameters relating to a base BGP peer group
that are not also applicable to any other context (e.g., that are not also applicable to any other context (e.g.,
neighbor)"; neighbor)";
leaf peer-group-name { leaf peer-group-name {
type string; type string;
description description
"Name of the BGP peer-group"; "Name of the BGP peer-group";
} }
} }
grouping bgp-peer-group-afi-safi-list { grouping bgp-peer-group-afi-safi-list {
description description
"List of address-families associated with the BGP peer-group"; "List of address-families associated with the BGP peer-group";
list afi-safi { list afi-safi {
key "afi-safi-name"; key "afi-safi-name";
description description
"AFI,SAFI configuration available for the "AFI, SAFI configuration available for the
neighbour or group"; neighbour or group";
uses mp-afi-safi-config; uses mp-afi-safi-config;
container graceful-restart {
description
"Parameters relating to BGP graceful-restart";
uses mp-afi-safi-graceful-restart-config; container graceful-restart {
} description
"Parameters relating to BGP graceful-restart";
uses route-selection-options; uses mp-afi-safi-graceful-restart-config;
uses global-group-use-multiple-paths; }
uses mp-all-afi-safi-list-contents;
}
}
grouping bgp-peer-group-base { uses route-selection-options;
description uses global-group-use-multiple-paths;
"Parameters related to a BGP group"; uses mp-all-afi-safi-list-contents;
}
}
uses bgp-peer-group-config; grouping bgp-peer-group-base {
uses neighbor-group-config; description
uses state; "Parameters related to a BGP group.";
container timers { uses bgp-peer-group-config;
description uses neighbor-group-config;
"Timers related to a BGP peer-group"; uses state;
uses neighbor-group-timers-config; container timers {
} description
container transport { "Timers related to a BGP peer-group.";
description
"Transport session parameters for the BGP peer-group";
uses neighbor-group-transport-config; uses neighbor-group-timers-config;
} }
container error-handling { container transport {
description description
"Error handling parameters used for the BGP peer-group"; "Transport session parameters for the BGP peer-group.";
uses neighbor-group-error-handling-config; uses neighbor-group-transport-config;
}
container graceful-restart { }
description
"Parameters relating the graceful restart mechanism for BGP";
uses graceful-restart-config; container graceful-restart {
} description
"Parameters relating the graceful restart mechanism for BGP.";
uses structure-neighbor-group-logging-options; uses graceful-restart-config;
uses structure-neighbor-group-ebgp-multihop; }
uses structure-neighbor-group-route-reflector;
uses structure-neighbor-group-as-path-options;
uses structure-neighbor-group-add-paths;
uses global-group-use-multiple-paths;
uses rpol:apply-policy-group;
container afi-safis { uses structure-neighbor-group-ebgp-multihop;
description uses structure-neighbor-group-route-reflector;
"Per-address-family configuration parameters associated with uses structure-neighbor-group-as-path-options;
thegroup"; uses structure-neighbor-group-add-paths;
uses bgp-peer-group-afi-safi-list; uses global-group-use-multiple-paths;
} uses rpol:apply-policy-group;
}
grouping bgp-peer-group-list { container afi-safis {
description description
"The list of BGP peer groups"; "Per-address-family configuration parameters associated with
the group.";
uses bgp-peer-group-afi-safi-list;
}
}
list peer-group { grouping bgp-peer-group-list {
key "peer-group-name"; description
description "The list of BGP peer groups";
"List of BGP peer-groups configured on the local system -
uniquely identified by peer-group name";
uses bgp-peer-group-base; list peer-group {
key "peer-group-name";
description
"List of BGP peer-groups configured on the local system -
uniquely identified by peer-group name";
} uses bgp-peer-group-base;
} }
} }
<CODE ENDS> }
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-neighbor@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-neighbor@2019-06-13.yang"
submodule ietf-bgp-neighbor { submodule ietf-bgp-neighbor {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bgp"; prefix "bgp";
} }
import ietf-routing-policy {
prefix rpol;
}
import ietf-bgp-types {
prefix bt;
}
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
// Include the common submodule // Include the common submodule
include ietf-bgp-common; include ietf-bgp-common;
include ietf-bgp-common-multiprotocol; include ietf-bgp-common-multiprotocol;
include ietf-bgp-peer-group; include ietf-bgp-peer-group;
include ietf-bgp-common-structure; include ietf-bgp-common-structure;
// meta // meta
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This sub-module contains groupings that are specific to the "This sub-module contains groupings that are specific to the
neighbor context of the OpenConfig BGP module."; neighbor context of the BGP module.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
grouping bgp-neighbor-use-multiple-paths { grouping bgp-neighbor-use-multiple-paths {
description description
"Multi-path configuration and state applicable to a BGP "Multi-path configuration and state applicable to a BGP
neighbor"; neighbor";
skipping to change at page 43, line 31 skipping to change at page 56, line 4
uses use-multiple-paths-config; uses use-multiple-paths-config;
container ebgp { container ebgp {
description description
"Multi-path configuration for eBGP"; "Multi-path configuration for eBGP";
uses use-multiple-paths-ebgp-as-options-config; uses use-multiple-paths-ebgp-as-options-config;
} }
} }
} }
grouping bgp-neighbor-counters-message-types-state { grouping bgp-neighbor-counters-message-types-state {
description description
"Grouping of BGP message types, included for re-use across "Grouping of BGP message types, included for re-use across
counters"; counters";
leaf UPDATE { leaf updates-received {
type uint64; type uint64;
description description
"Number of BGP UPDATE messages announcing, withdrawing or "Number of BGP UPDATE messages received from this neighbor.";
modifying paths exchanged."; reference
"RFC 4273: bgpPeerInUpdates.";
} }
leaf NOTIFICATION { leaf updates-sent {
type uint64;
description
"Number of BGP UPDATE messages sent to this neighbor";
reference
"RFC 4273 - bgpPeerOutUpdates";
}
leaf messages-received {
type uint64;
description
"Number of BGP messages received from thsi neighbor";
reference
"RFC 4273 - bgpPeerInTotalMessages";
}
leaf messages-sent {
type uint64;
description
"Number of BGP messages received from thsi neighbor";
reference
"RFC 4273 - bgpPeerOutTotalMessages";
}
leaf notification {
type uint64; type uint64;
description description
"Number of BGP NOTIFICATION messages indicating an error "Number of BGP NOTIFICATION messages indicating an error
condition has occurred exchanged."; condition has occurred exchanged.";
} }
} }
grouping bgp-neighbor-afi-safi-list { grouping bgp-neighbor-afi-safi-list {
description description
"List of address-families associated with the BGP neighbor"; "List of address-families associated with the BGP neighbor";
list afi-safi { list afi-safi {
key "afi-safi-name"; key "afi-safi-name";
description description
"AFI,SAFI configuration available for the neighbour or "AFI, SAFI configuration available for the neighbor or
group"; group";
uses mp-afi-safi-config; uses mp-afi-safi-config;
leaf active { leaf active {
type boolean; type boolean;
config false; config false;
description description
"This value indicates whether a particular AFI-SAFI has "This value indicates whether a particular AFI-SAFI has
been successfully negotiated with the peer. An AFI-SAFI may been successfully negotiated with the peer. An AFI-SAFI may
be enabled in the current running configuration, but a be enabled in the current running configuration, but a
session restart may be required in order to negotiate the session restart may be required in order to negotiate the
new capability."; new capability.";
} }
container prefixes { container prefixes {
config false; config false;
description "Prefix counters for the BGP session"; description
"Prefix counters for the BGP session";
leaf received { leaf received {
type uint32; type uint32;
description description
"The number of prefixes received from the neighbor"; "The number of prefixes received from the neighbor";
} }
leaf sent { leaf sent {
type uint32; type uint32;
description description
"The number of prefixes advertised to the neighbor"; "The number of prefixes advertised to the neighbor";
skipping to change at page 45, line 29 skipping to change at page 58, line 28
description description
"This leaf indicates whether the ability to support "This leaf indicates whether the ability to support
graceful-restart has been advertised to the peer"; graceful-restart has been advertised to the peer";
} }
} }
uses mp-all-afi-safi-list-contents; uses mp-all-afi-safi-list-contents;
uses bgp-neighbor-use-multiple-paths; uses bgp-neighbor-use-multiple-paths;
} }
} }
grouping bgp-neighbor-base {
description
"Parameters related to a BGP neighbor";
leaf peer-group {
type leafref {
path "../../../peer-groups/peer-group/peer-group-name";
}
description
"The peer-group with which this neighbor is associated";
}
leaf neighbor-address {
type inet:ip-address;
description
"Address of the BGP peer, either in IPv4 or IPv6";
}
leaf enabled {
type boolean;
default true;
description
"Whether the BGP peer is enabled. In cases where the enabled
leaf is set to false, the local system should not initiate
connections to the neighbor, and should not respond to TCP
connections attempts from the neighbor. If the state of the
BGP session is ESTABLISHED at the time that this leaf is set
to false, the BGP session should be ceased.";
}
uses neighbor-group-config;
leaf session-state {
type enumeration {
enum IDLE {
description
"neighbor is down, and in the Idle state of the FSM";
}
enum CONNECT {
description
"neighbor is down, and the session is waiting for the
underlying transport session to be established";
}
enum ACTIVE {
description
"neighbor is down, and the local system is awaiting a
connection from the remote peer";
}
enum OPENSENT {
description
"neighbor is in the process of being established. The
local system has sent an OPEN message";
}
enum OPENCONFIRM {
description
"neighbor is in the process of being established. The
local system is awaiting a NOTIFICATION or KEEPALIVE
message";
}
enum ESTABLISHED {
description
"neighbor is up - the BGP session with the peer is
established";
}
}
config false;
description
"Operational state of the BGP peer";
}
leaf last-established {
// Was oc-types:timeticks64
type uint64;
config false;
description
"This timestamp indicates the time that the BGP session last
transitioned in or out of the Established state. The value
is the timestamp in seconds relative to the Unix Epoch (Jan
1, 1970 00:00:00 UTC).
The BGP session uptime can be computed by clients as the
difference between this value and the current time in UTC
(assuming the session is in the ESTABLISHED state, per the
session-state leaf).";
}
leaf established-transitions {
type yang:counter64;
config false;
description
"Number of transitions to the Established state for the
neighbor session. This value is analogous to the
bgpPeerFsmEstablishedTransitions object from the standard
BGP-4 MIB";
reference
"RFC 4273 - Definitions of Managed Objects for BGP-4";
}
leaf-list supported-capabilities {
type identityref {
base bt:BGP_CAPABILITY;
}
config false;
description
"BGP capabilities negotiated as supported with the peer";
}
container messages {
config false;
description
"Counters for BGP messages sent and received from the
neighbor";
container sent {
description
"Counters relating to BGP messages sent to the neighbor";
uses bgp-neighbor-counters-message-types-state;
}
container received {
description
"Counters for BGP messages received from the neighbor";
uses bgp-neighbor-counters-message-types-state;
}
}
container queues {
config false;
description
"Counters related to queued messages associated with the BGP
neighbor";
leaf input {
type uint32;
description
"The number of messages received from the peer currently
queued";
}
leaf output {
type uint32;
description
"The number of messages queued to be sent to the peer";
}
}
container timers {
description
"Timers related to a BGP neighbor";
uses neighbor-group-timers-config;
leaf negotiated-hold-time {
type decimal64 {
fraction-digits 2;
}
config false;
description
"The negotiated hold-time for the BGP session";
}
}
container transport {
description
"Transport session parameters for the BGP neighbor";
uses neighbor-group-transport-config;
leaf local-port {
type inet:port-number;
config false;
description
"Local TCP port being used for the TCP session supporting
the BGP session";
}
leaf remote-address {
type inet:ip-address;
config false;
description
"Remote address to which the BGP session has been
established";
}
leaf remote-port {
type inet:port-number;
config false;
description
"Remote port being used by the peer for the TCP session
supporting the BGP session";
}
}
container error-handling {
description
"Error handling parameters used for the BGP neighbor or
group";
uses neighbor-group-error-handling-config;
leaf erroneous-update-messages {
type uint32;
config false;
description
"The number of BGP UPDATE messages for which the
treat-as-withdraw mechanism has been applied based on
erroneous message contents";
}
}
container graceful-restart {
description
"Parameters relating the graceful restart mechanism for BGP";
uses graceful-restart-config;
leaf peer-restart-time {
type uint16 {
range 0..4096;
}
config false;
description
"The period of time (advertised by the peer) that the peer
expects a restart of a BGP session to take";
}
leaf peer-restarting {
type boolean;
config false;
description
"This flag indicates whether the remote neighbor is
currently in the process of restarting, and hence received
routes are currently stale";
}
leaf local-restarting {
type boolean;
config false;
description
"This flag indicates whether the local neighbor is
currently restarting. The flag is unset after all NLRI
have been advertised to the peer, and the End-of-RIB (EOR)
marker has been unset";
}
leaf mode {
type enumeration {
enum HELPER_ONLY {
description
"The local router is operating in helper-only mode, and
hence will not retain forwarding state during a local
session restart, but will do so during a restart of
the remote peer";
}
enum BILATERAL {
description
"The local router is operating in both helper mode, and
hence retains forwarding state during a remote
restart, and also maintains forwarding state during
local session restart";
}
enum REMOTE_HELPER {
description
"The local system is able to retain routes during
restart but the remote system is only able to act as a
helper";
}
}
config false;
description
"This leaf indicates the mode of operation of BGP graceful
restart with the peer";
}
}
uses structure-neighbor-group-logging-options;
uses structure-neighbor-group-ebgp-multihop;
uses structure-neighbor-group-route-reflector;
uses structure-neighbor-group-as-path-options;
uses structure-neighbor-group-add-paths;
uses bgp-neighbor-use-multiple-paths;
uses rpol:apply-policy-group;
container afi-safis {
description
"Per-address-family configuration parameters associated with
the neighbor";
uses bgp-neighbor-afi-safi-list;
}
}
grouping bgp-neighbor-list {
description
"The list of BGP neighbors";
list neighbor {
key "neighbor-address";
description
"List of BGP neighbors configured on the local system,
uniquely identified by peer IPv[46] address";
uses bgp-neighbor-base;
}
}
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-global@2019-03-21.yang"
submodule ietf-bgp-global {
yang-version "1.1";
belongs-to ietf-bgp {
prefix bgp;
}
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
include ietf-bgp-common;
include ietf-bgp-common-multiprotocol;
organization
"IETF IDR Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com";
description
"This sub-module contains groupings that are specific to the
global context of the BGP module";
revision "2019-03-21" {
description
"Initial Version";
reference
"RFC XXX, BGP Model for Service Provider Network.";
}
grouping bgp-global-config {
description
"Global configuration options for the BGP router.";
leaf as {
type inet:as-number;
mandatory true;
description
"Local autonomous system number of the router. Uses
the 32-bit as-number type from the model in RFC 6991.";
}
leaf router-id {
type yang:dotted-quad;
description
"Router id of the router - an unsigned 32-bit integer
expressed in dotted quad notation.";
reference
"RFC4271 - A Border Gateway Protocol 4 (BGP-4),
Section 4.2";
}
}
grouping bgp-global-state {
description
"Operational state parameters for the BGP neighbor";
uses state;
}
grouping bgp-global-default-route-distance-config {
description
"Configuration options relating to the administrative distance
(or preference) assigned to routes received from different
sources (external, internal, and local).";
leaf external-route-distance {
type uint8 {
range "1..255";
}
description
"Administrative distance for routes learned from external
BGP (eBGP).";
}
leaf internal-route-distance {
type uint8 {
range "1..255";
}
description
"Administrative distance for routes learned from internal
BGP (iBGP).";
}
}
grouping bgp-global-confederation-config {
description
"Configuration options specifying parameters when the local
router is within an autonomous system which is part of a BGP
confederation.";
leaf enabled {
type boolean;
description
"When this leaf is set to true it indicates that
the local-AS is part of a BGP confederation";
}
leaf identifier {
type inet:as-number;
description
"Confederation identifier for the autonomous system.";
}
leaf-list member-as {
type inet:as-number;
description
"Remote autonomous systems that are to be treated
as part of the local confederation.";
}
}
grouping bgp-global-afi-safi-list {
description
"List of address-families associated with the BGP instance";
list afi-safi {
key "afi-safi-name";
description
"AFI,SAFI configuration available for the
neighbour or group";
uses mp-afi-safi-config;
uses state;
container graceful-restart {
description
"Parameters relating to BGP graceful-restart";
uses mp-afi-safi-graceful-restart-config;
}
uses route-selection-options;
uses global-group-use-multiple-paths;
uses mp-all-afi-safi-list-contents;
}
}
// Structural groupings
grouping bgp-global-base {
description
"Global configuration parameters for the BGP router";
uses bgp-global-config;
uses bgp-global-state;
container default-route-distance {
description
"Administrative distance (or preference) assigned to
routes received from different sources
(external, internal, and local).";
uses bgp-global-default-route-distance-config;
}
container confederation {
description
"Parameters indicating whether the local system acts as part
of a BGP confederation";
uses bgp-global-confederation-config;
}
container graceful-restart {
description
"Parameters relating the graceful restart mechanism for BGP";
uses graceful-restart-config;
}
uses global-group-use-multiple-paths;
uses route-selection-options;
container afi-safis {
description
"Address family specific configuration";
uses bgp-global-afi-safi-list;
}
}
}
<CODE ENDS>
7.2. BGP types 7.2. BGP types
<CODE BEGINS> file "ietf-bgp-types@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-types@2019-06-13.yang"
module ietf-bgp-types { module ietf-bgp-types {
yang-version "1.1"; yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types"; namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types";
prefix "bt";
import ietf-inet-types { prefix "bt";
prefix inet;
}
// meta import ietf-inet-types {
organization prefix inet;
"IETF IDR Working Group"; }
contact // meta
"WG Web: <http://tools.ietf.org/wg/idr> organization
WG List: <idr@ietf.org> "IETF IDR Working Group";
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), contact
Keyur Patel (keyur at arrcus.com), "WG Web: <http://tools.ietf.org/wg/idr>
Susan Hares (shares at ndzh.com"; WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com)";
description description
"This module contains general data definitions for use in BGP "This module contains general data definitions for use in BGP
policy. It can be imported by modules that make use of BGP policy. It can be imported by modules that make use of BGP
attributes"; attributes";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
identity BGP_CAPABILITY {
description "Base identity for a BGP capability";
}
identity MPBGP {
base BGP_CAPABILITY;
description
"Multi-protocol extensions to BGP";
reference "RFC2858";
}
identity ROUTE_REFRESH {
base BGP_CAPABILITY;
description
"The BGP route-refresh functionality";
reference "RFC2918";
} identity bgp-capability {
description "Base identity for a BGP capability";
}
identity ASN32 { identity mp-bgp {
base BGP_CAPABILITY; base bgp-capability;
description description
"4-byte (32-bit) AS number functionality"; "Multi-protocol extensions to BGP";
reference "RFC6793"; reference
} "RFC 4760";
}
identity GRACEFUL_RESTART { identity route-refresh {
base BGP_CAPABILITY; base bgp-capability;
description description
"Graceful restart functionality"; "The BGP route-refresh functionality";
reference "RFC4724"; reference
} "RFC2918";
}
identity ADD_PATHS { identity asn32 {
base BGP_CAPABILITY; base bgp-capability;
description description
"BGP add-paths"; "4-byte (32-bit) AS number functionality";
reference "draft-ietf-idr-add-paths"; reference
} "RFC6793";
}
identity afi-safi-type { identity graceful-restart {
description base bgp-capability;
"Base identity type for AFI,SAFI tuples for BGP-4"; description
reference "RFC4760 - multi-protocol extensions for BGP-4"; "Graceful restart functionality";
}
identity ipv4-unicast { reference
base afi-safi-type; "RFC4724";
description }
"IPv4 unicast (AFI,SAFI = 1,1)";
reference "RFC4760";
}
identity ipv6-unicast { identity add-paths {
base afi-safi-type; base bgp-capability;
description description
"IPv6 unicast (AFI,SAFI = 2,1)"; "BGP add-paths";
reference "RFC4760"; reference
} "RFC 7911.";
}
identity IPV4_LABELED_UNICAST { identity afi-safi-type {
base afi-safi-type; description
description "Base identity type for AFI,SAFI tuples for BGP-4";
"Labeled IPv4 unicast (AFI,SAFI = 1,4)"; reference
reference "RFC3107"; "RFC4760 - multi-protocol extensions for BGP-4";
}
} identity ipv4-unicast {
base afi-safi-type;
description
"IPv4 unicast (AFI,SAFI = 1,1)";
reference
"RFC4760";
}
identity IPV6_LABELED_UNICAST { identity ipv6-unicast {
base afi-safi-type; base afi-safi-type;
description description
"Labeled IPv6 unicast (AFI,SAFI = 2,4)"; "IPv6 unicast (AFI,SAFI = 2,1)";
reference "RFC3107"; reference
} "RFC4760";
}
identity L3VPN_IPV4_UNICAST { identity ipv4-labeled-unicast {
base afi-safi-type; base afi-safi-type;
description description
"Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; "Labeled IPv4 unicast (AFI,SAFI = 1,4)";
reference "RFC4364"; reference
} "RFC3107";
}
identity L3VPN_IPV6_UNICAST { identity ipv6-labeled-unicast {
base afi-safi-type; base afi-safi-type;
description description
"Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; "Labeled IPv6 unicast (AFI,SAFI = 2,4)";
reference "RFC4659"; reference
} "RFC3107";
}
identity L3VPN_IPV4_MULTICAST { identity l3vpn-ipv4-unicast {
base afi-safi-type; base afi-safi-type;
description description
"Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)";
reference "RFC6514"; reference
} "RFC4364";
}
identity L3VPN_IPV6_MULTICAST { identity l3vpn-ipv6-unicast {
base afi-safi-type; base afi-safi-type;
description description
"Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)";
reference "RFC6514"; reference
} "RFC4659";
}
identity L2VPN_VPLS { identity l3vpn-ipv4-multicast {
base afi-safi-type; base afi-safi-type;
description description
"BGP-signalled VPLS (AFI,SAFI = 25,65)"; "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)";
reference "RFC4761"; reference
} "RFC6514";
}
identity L2VPN_EVPN { identity l3vpn-ipv6-multicast {
base afi-safi-type; base afi-safi-type;
description description
"BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)";
reference
"RFC6514";
}
} identity l2vpn-vpls {
base afi-safi-type;
description
"BGP-signalled VPLS (AFI,SAFI = 25,65)";
reference
"RFC4761";
}
identity BGP_WELL_KNOWN_STD_COMMUNITY { identity l2vpn-evpn {
description base afi-safi-type;
"Reserved communities within the standard community space description
"BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)";
}
identity BGP_WELL_KNOWN_STD_COMMUNITY {
description
"Reserved communities within the standard community space
defined by RFC1997. These communities must fall within the defined by RFC1997. These communities must fall within the
range 0x00000000 to 0xFFFFFFFF"; range 0xFFFF0000 to 0xFFFFFFFF";
reference "RFC1997"; reference
} "RFC 1997";
}
identity NO_EXPORT { identity NO_EXPORT {
base BGP_WELL_KNOWN_STD_COMMUNITY; base BGP_WELL_KNOWN_STD_COMMUNITY;
description description
"Do not export NLRI received carrying this community outside "Do not export NLRI received carrying this community outside
the bounds of this autonomous system, or this confederation if the bounds of this autonomous system, or this confederation if
the local autonomous system is a confederation member AS. This the local autonomous system is a confederation member AS. This
community has a value of 0xFFFFFF01."; community has a value of 0xFFFFFF01.";
reference "RFC1997"; reference
} "RFC1997";
}
identity NO_ADVERTISE { identity NO_ADVERTISE {
base BGP_WELL_KNOWN_STD_COMMUNITY; base BGP_WELL_KNOWN_STD_COMMUNITY;
description description
"All NLRI received carrying this community must not be "All NLRI received carrying this community must not be
advertised to other BGP peers. This community has a value of advertised to other BGP peers. This community has a value of
0xFFFFFF02."; 0xFFFFFF02.";
reference "RFC1997"; reference
} "RFC1997";
}
identity NO_EXPORT_SUBCONFED { identity NO_EXPORT_SUBCONFED {
base BGP_WELL_KNOWN_STD_COMMUNITY; base BGP_WELL_KNOWN_STD_COMMUNITY;
description description
"All NLRI received carrying this community must not be "All NLRI received carrying this community must not be
advertised to external BGP peers - including over confederation advertised to external BGP peers - including over confederation
sub-AS boundaries. This community has a value of 0xFFFFFF03."; sub-AS boundaries. This community has a value of 0xFFFFFF03.";
reference "RFC1997"; reference
} "RFC1997";
}
identity NOPEER { identity NOPEER {
base BGP_WELL_KNOWN_STD_COMMUNITY; base BGP_WELL_KNOWN_STD_COMMUNITY;
description description
"An autonomous system receiving NLRI tagged with this community "An autonomous system receiving NLRI tagged with this community
is advised not to re-advertise the NLRI to external bi-lateral is advised not to re-advertise the NLRI to external bi-lateral
peer autonomous systems. An AS may also filter received NLRI peer autonomous systems. An AS may also filter received NLRI
from bilateral peer sessions when they are tagged with this from bilateral peer sessions when they are tagged with this
community value"; community value";
reference "RFC3765";
}
identity as-path-segment-type {
description
"Base AS Path Segment Type. In [BGP-4], the path segment type
is a 1-octet field with the following values defined.";
reference
"RFC 5065, Autonomous System Configuration for BGP.";
}
identity as-set {
base as-path-segment-type;
description
"Unordered set of autonomous systems that a route in the UPDATE
message has traversed.";
reference
"RFC 5065, Autonomous System Configuration for BGP.";
}
identity as-sequence { reference
base as-path-segment-type; "RFC3765";
description }
"Ordered set of autonomous systems that a route in the UPDATE
message has traversed.";
reference
"RFC 5065, Autonomous System Configuration for BGP.";
}
identity as-confed-sequence { identity as-path-segment-type {
base as-path-segment-type; description
description "Base AS Path Segment Type. In [BGP-4], the path segment type
"Ordered set of Member Autonomous Systems in the local is a 1-octet field with the following values defined.";
confederation that the UPDATE message has traversed."; reference
reference "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
"RFC 5065, Autonomous System Configuration for BGP."; }
}
identity as-confed-set { identity as-set {
base as-path-segment-type; base as-path-segment-type;
description description
"Unordered set of Member Autonomous Systems in the local "Unordered set of autonomous systems that a route in the UPDATE
confederation that the UPDATE message has traversed."; message has traversed.";
reference reference
"RFC 5065, Autonomous System Configuration for BGP."; "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
} }
/* identity as-sequence {
* Features. base as-path-segment-type;
*/ description
feature ttl-security { "Ordered set of autonomous systems that a route in the UPDATE
description message has traversed.";
"BGP Time To Live (TTL) security check support."; reference
reference "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
"RFC 5082, The Generalized TTL Security Mechanism (GTSM)"; }
}
feature bfd { identity as-confed-sequence {
description base as-path-segment-type;
"Support for BFD detection of BGP neighbor reachability."; description
reference "Ordered set of Member Autonomous Systems in the local
"RFC 5880, Bidirectional Forward Detection (BFD), confederation that the UPDATE message has traversed.";
RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6 reference
(Single Hop)."; "RFC 5065, Autonomous System Configuration for BGP.";
} }
typedef bgp-session-direction { identity as-confed-set {
type enumeration { base as-path-segment-type;
enum INBOUND { description
description "Unordered set of Member Autonomous Systems in the local
"Refers to all NLRI received from the BGP peer"; confederation that the UPDATE message has traversed.";
} reference
enum OUTBOUND { "RFC 5065, Autonomous System Configuration for BGP.";
description }
"Refers to all NLRI advertised to the BGP peer"; /*
} * Features.
} */
description feature ttl-security {
"Type to describe the direction of NLRI transmission"; description
} "BGP Time To Live (TTL) security check support.";
reference
"RFC 5082, The Generalized TTL Security Mechanism (GTSM)";
}
typedef bgp-well-known-community-type { feature bfd {
type identityref { description
base BGP_WELL_KNOWN_STD_COMMUNITY; "Support for BFD detection of BGP neighbor reachability.";
} reference
description "RFC 5880, Bidirectional Forward Detection (BFD),
"Type definition for well-known IETF community attribute RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6
values"; (Single Hop).
reference RFC 5883, Bidirectional Forwarding Detection (BFD) for Multihop
"IANA Border Gateway Protocol (BGP) Well Known Communities"; Paths";
} }
typedef bgp-std-community-type { typedef bgp-session-direction {
// TODO: further refine restrictions and allowed patterns type enumeration {
// 4-octet value: enum INBOUND {
// <as number> 2 octets description
// <community value> 2 octets "Refers to all NLRI received from the BGP peer";
type union { }
type uint32 { enum OUTBOUND {
// per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - description
// 0xFFFFFFFF are reserved "Refers to all NLRI advertised to the BGP peer";
range "65536..4294901759"; // 0x00010000..0xFFFEFFFF }
} }
type string { description
pattern '([0-9]+:[0-9]+)'; "Type to describe the direction of NLRI transmission";
} }
}
description
"Type definition for standard community attributes";
reference
"RFC 1997 - BGP Communities Attribute";
}
typedef bgp-ext-community-type { typedef bgp-well-known-community-type {
// TODO: needs more work to make this more precise given the type identityref {
// variability of extended community attribute specifications base BGP_WELL_KNOWN_STD_COMMUNITY;
// 8-octet value: }
// <type> 2 octects description
// <value> 6 octets "Type definition for well-known IETF community attribute
values";
reference
"IANA Border Gateway Protocol (BGP) Well Known Communities";
}
typedef bgp-std-community-type {
// TODO: further refine restrictions and allowed patterns
// 4-octet value:
// <as number> 2 octets
// <community value> 2 octets
type union {
type uint32 {
// per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 -
// 0xFFFFFFFF are reserved
range "65536..4294901759"; // 0x00010000..0xFFFEFFFF
}
type string {
pattern '([0-9]+:[0-9]+)';
}
}
description
"Type definition for standard community attributes";
reference
"RFC 1997 - BGP Communities Attribute";
}
type union { typedef bgp-ext-community-type {
type string { // TODO: needs more work to make this more precise given the
// Type 1: 2-octet global and 4-octet local // variability of extended community attribute specifications
// (AS number) (Integer) // 8-octet value:
pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + // <type> 2 octects
'[1-9][0-9]{1,4}|[0-9]):' + // <value> 6 octets
'(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
'[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// Type 2: 4-octet global and 2-octet local
// (ipv4-address) (integer)
pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
type string {
// route-target with Type 1
// route-target:(ASN):(local-part)
pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' +
'[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
'(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
'[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// route-target with Type 2
// route-target:(IPv4):(local-part)
pattern 'route\-target:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
type string {
// route-origin with Type 1
pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' +
'[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
'(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
'[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// route-origin with Type 2
pattern 'route\-origin:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
}
description
"Type definition for extended community attributes";
reference
"RFC 4360 - BGP Extended Communities Attribute";
}
typedef bgp-community-regexp-type { type union {
// TODO: needs more work to decide what format these regexps can type string {
// take. // Type 1: 2-octet global and 4-octet local
type string; // (AS number) (Integer)
description pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
"Type definition for communities specified as regular '[1-9][0-9]{1,4}|[0-9]):' +
expression patterns"; '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
} '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// Type 2: 4-octet global and 2-octet local
// (ipv4-address) (integer)
pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
type string {
// route-target with Type 1
// route-target:(ASN):(local-part)
pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' +
'[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
'(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
'[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// route-target with Type 2
// route-target:(IPv4):(local-part)
pattern 'route\-target:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
type string {
// route-origin with Type 1
pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' +
'[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
'(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
'[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
}
type string {
// route-origin with Type 2
pattern 'route\-origin:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
'[1-9][0-9]{1,4}|[0-9])';
}
}
description
"Type definition for extended community attributes";
reference
"RFC 4360 - BGP Extended Communities Attribute";
}
typedef bgp-origin-attr-type { typedef bgp-community-regexp-type {
type enumeration { // TODO: needs more work to decide what format these regexps can
enum IGP { // take.
description "Origin of the NLRI is internal"; type string;
} description
enum EGP { "Type definition for communities specified as regular
description "Origin of the NLRI is EGP"; expression patterns";
} }
enum INCOMPLETE { typedef bgp-origin-attr-type {
description "Origin of the NLRI is neither IGP or EGP"; type enumeration {
} enum IGP {
} description "Origin of the NLRI is internal";
description }
"Type definition for standard BGP origin attribute"; enum EGP {
reference description "Origin of the NLRI is EGP";
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3"; }
} enum INCOMPLETE {
description "Origin of the NLRI is neither IGP or EGP";
}
}
description
"Type definition for standard BGP origin attribute";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3";
}
typedef peer-type { typedef peer-type {
type enumeration { type enumeration {
enum INTERNAL { enum INTERNAL {
description "internal (iBGP) peer"; description "internal (iBGP) peer";
} }
enum EXTERNAL { enum EXTERNAL {
description "external (eBGP) peer"; description "external (eBGP) peer";
} }
} }
description description
"labels a peer or peer group as explicitly internal or "Labels a peer or peer group as explicitly internal or
external"; external";
} }
identity REMOVE_PRIVATE_AS_OPTION { identity REMOVE_PRIVATE_AS_OPTION {
description description
"Base identity for options for removing private autonomous "Base identity for options for removing private autonomous
system numbers from the AS_PATH attribute"; system numbers from the AS_PATH attribute";
} }
identity PRIVATE_AS_REMOVE_ALL { identity PRIVATE_AS_REMOVE_ALL {
base REMOVE_PRIVATE_AS_OPTION; base REMOVE_PRIVATE_AS_OPTION;
description description
"Strip all private autonomous system numbers from the AS_PATH. "Strip all private autonomous system numbers from the AS_PATH.
This action is performed regardless of the other content of the This action is performed regardless of the other content of the
AS_PATH attribute, and for all instances of private AS numbers AS_PATH attribute, and for all instances of private AS numbers
within that attribute."; within that attribute.";
} }
identity PRIVATE_AS_REPLACE_ALL { identity PRIVATE_AS_REPLACE_ALL {
base REMOVE_PRIVATE_AS_OPTION; base REMOVE_PRIVATE_AS_OPTION;
description description
"Replace all instances of private autonomous system numbers in "Replace all instances of private autonomous system numbers in
the AS_PATH with the local BGP speaker's autonomous system the AS_PATH with the local BGP speaker's autonomous system
number. This action is performed regardless of the other number. This action is performed regardless of the other
content of the AS_PATH attribute, and for all instances of content of the AS_PATH attribute, and for all instances of
private AS number within that attribute."; private AS number within that attribute.";
} }
typedef remove-private-as-option { typedef remove-private-as-option {
type identityref { type identityref {
base REMOVE_PRIVATE_AS_OPTION; base REMOVE_PRIVATE_AS_OPTION;
} }
description description
"set of options for configuring how private AS path numbers "Set of options for configuring how private AS path numbers
are removed from advertisements"; are removed from advertisements";
} }
typedef percentage { typedef percentage {
type uint8 { type uint8 {
range "0..100"; range "0..100";
} }
description description
"Integer indicating a percentage value"; "Integer indicating a percentage value";
} }
typedef rr-cluster-id-type { typedef rr-cluster-id-type {
type union { type union {
type uint32; type uint32;
type inet:ipv4-address; type inet:ipv4-address;
} }
description description
"union type for route reflector cluster ids: "Union type for route reflector cluster ids:
option 1: 4-byte number option 1: 4-byte number
option 2: IP address"; option 2: IP address";
} }
typedef community-type {
type enumeration {
enum STANDARD {
description "send only standard communities";
}
enum EXTENDED {
description "send only extended communities";
}
enum BOTH {
description "send both standard and extended communities";
}
enum NONE {
description "do not send any community attribute";
}
}
description
"type describing variations of community attributes:
typedef community-type {
type enumeration {
enum STANDARD {
description
"Send only standard communities";
}
enum EXTENDED {
description
"Send only extended communities";
}
enum BOTH {
description
"Send both standard and extended communities";
}
enum NONE {
description
"Do not send any community attribute";
}
}
description
"Type describing variations of community attributes:
STANDARD: standard BGP community [rfc1997] STANDARD: standard BGP community [rfc1997]
EXTENDED: extended BGP community [rfc4360] EXTENDED: extended BGP community [rfc4360]
BOTH: both standard and extended community"; BOTH: both standard and extended community";
} }
} }
<CODE ENDS> <CODE ENDS>
7.3. BGP policy data 7.3. BGP policy data
<CODE BEGINS> file "ietf-bgp-policy@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-policy@2019-06-13.yang"
module ietf-bgp-policy { module ietf-bgp-policy {
yang-version "1.1"; yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy";
prefix "bp"; prefix "bp";
// import some basic types // import some basic types
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
} }
import ietf-routing-policy { import ietf-routing-policy {
skipping to change at page 66, line 41 skipping to change at page 70, line 4
import ietf-routing-types { import ietf-routing-types {
prefix rt-types; prefix rt-types;
} }
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This module contains data definitions for BGP routing policy. "This module contains data definitions for BGP routing policy.
It augments the base routing-policy module with BGP-specific It augments the base routing-policy module with BGP-specific
options for conditions and actions."; options for conditions and actions.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXX, BGP Model for Service Provider Network.";
} }
// typedef statements // typedef statements
typedef bgp-set-community-option-type { typedef bgp-set-community-option-type {
type enumeration { type enumeration {
enum ADD { enum ADD {
description description
"add the specified communities to the existing "Add the specified communities to the existing
community attribute"; community attribute";
} }
enum REMOVE { enum REMOVE {
description description
"remove the specified communities from the "Remove the specified communities from the
existing community attribute"; existing community attribute";
} }
enum REPLACE { enum REPLACE {
description description
"replace the existing community attribute with "Replace the existing community attribute with
the specified communities. If an empty set is the specified communities. If an empty set is
specified, this removes the community attribute specified, this removes the community attribute
from the route."; from the route.";
} }
} }
description description
"Type definition for options when setting the community "Type definition for options when setting the community
attribute in a policy action"; attribute in a policy action";
} }
typedef bgp-next-hop-type { typedef bgp-next-hop-type {
type union { type union {
type inet:ip-address-no-zone; type inet:ip-address-no-zone;
type enumeration { type enumeration {
enum SELF { enum SELF {
description "special designation for local router's own description
address, i.e., next-hop-self"; "Special designation for local router's own
address, i.e., next-hop-self";
} }
} }
} }
description description
"type definition for specifying next-hop in policy actions"; "Type definition for specifying next-hop in policy actions";
} }
typedef bgp-set-med-type { typedef bgp-set-med-type {
type union { type union {
type uint32; type uint32;
type string { type string {
pattern "^[+-][0-9]+"; pattern "^[+-][0-9]+";
} }
type enumeration { type enumeration {
enum IGP { enum IGP {
description "set the MED value to the IGP cost toward the description
next hop for the route"; "Set the MED value to the IGP cost toward the
next hop for the route";
} }
} }
} }
description description
"Type definition for specifying how the BGP MED can "Type definition for specifying how the BGP MED can
be set in BGP policy actions. The three choices are to set be set in BGP policy actions. The three choices are to set
the MED directly, increment/decrement using +/- notation, the MED directly, increment/decrement using +/- notation,
and setting it to the IGP cost (predefined value)."; and setting it to the IGP cost (predefined value).";
} }
// augment statements // augment statements
augment "/rpol:routing-policy/rpol:defined-sets" { augment "/rpol:routing-policy/rpol:defined-sets" {
description description
"Adds BGP defined sets container to routing policy model."; "Adds BGP defined sets container to routing policy model.";
container bgp-defined-sets { container bgp-defined-sets {
description description
skipping to change at page 68, line 46 skipping to change at page 72, line 10
list community-set { list community-set {
key "community-set-name"; key "community-set-name";
description description
"List of defined BGP community sets"; "List of defined BGP community sets";
leaf community-set-name { leaf community-set-name {
type string; type string;
mandatory true; mandatory true;
description description
"name / label of the community set -- this is used to "Name / label of the community set -- this is used to
reference the set in match conditions"; reference the set in match conditions";
} }
leaf-list community-member { leaf-list community-member {
type union { type union {
type bt:bgp-std-community-type; type bt:bgp-std-community-type;
type bt:bgp-community-regexp-type; type bt:bgp-community-regexp-type;
type bt:bgp-well-known-community-type; type bt:bgp-well-known-community-type;
} }
description description
"members of the community set"; "Members of the community set";
} }
} }
} }
container ext-community-sets { container ext-community-sets {
description description
"Enclosing container for list of extended BGP community "Enclosing container for list of extended BGP community
sets"; sets";
list ext-community-set { list ext-community-set {
key "ext-community-set-name"; key "ext-community-set-name";
description description
"List of defined extended BGP community sets"; "List of defined extended BGP community sets";
leaf ext-community-set-name { leaf ext-community-set-name {
type string; type string;
description description
"name / label of the extended community set -- this is "Name / label of the extended community set -- this is
used to reference the set in match conditions"; used to reference the set in match conditions";
} }
leaf-list ext-community-member { leaf-list ext-community-member {
type union { type union {
type rt-types:route-target; type rt-types:route-target;
type bt:bgp-community-regexp-type; type bt:bgp-community-regexp-type;
} }
description description
"members of the extended community set"; "Members of the extended community set";
} }
} }
} }
container as-path-sets { container as-path-sets {
description description
"Enclosing container for list of define AS path sets"; "Enclosing container for list of define AS path sets";
list as-path-set { list as-path-set {
key "as-path-set-name"; key "as-path-set-name";
description description
"List of defined AS path sets"; "List of defined AS path sets";
leaf as-path-set-name { leaf as-path-set-name {
skipping to change at page 70, line 5 skipping to change at page 73, line 16
"Enclosing container for list of define AS path sets"; "Enclosing container for list of define AS path sets";
list as-path-set { list as-path-set {
key "as-path-set-name"; key "as-path-set-name";
description description
"List of defined AS path sets"; "List of defined AS path sets";
leaf as-path-set-name { leaf as-path-set-name {
type string; type string;
description description
"name of the AS path set -- this is used to reference the "Name of the AS path set -- this is used to reference the
set in match conditions"; set in match conditions";
} }
leaf-list as-path-set-member { leaf-list as-path-set-member {
// TODO: need to refine typedef for AS path expressions // TODO: need to refine typedef for AS path expressions
type string; type string;
description description
"AS path expression -- list of ASes in the set"; "AS path expression -- list of ASes in the set";
} }
} }
} }
} }
} }
grouping as-path-prepend-top {
description
"Top-level grouping for the AS path prepend action";
}
grouping set-community-action-common { grouping set-community-action-common {
description description
"Common leaves for set-community and set-ext-community "Common leaves for set-community and set-ext-community
actions"; actions";
leaf method { leaf method {
type enumeration { type enumeration {
enum INLINE { enum INLINE {
description description
"The extended communities are specified inline as a "The extended communities are specified inline as a
list"; list";
} }
enum REFERENCE { enum REFERENCE {
description description
"The extended communities are specified by referencing a "The extended communities are specified by referencing a
defined ext-community set"; defined ext-community set";
} }
} }
description description
"Indicates the method used to specify the extended "Indicates the method used to specify the extended
communities for the set-ext-community action"; communities for the set-ext-community action";
} }
leaf options { leaf options {
type bgp-set-community-option-type; type bgp-set-community-option-type;
description description
"Options for modifying the community attribute with "Options for modifying the community attribute with
the specified values. These options apply to both the specified values. These options apply to both
methods of setting the community attribute."; methods of setting the community attribute.";
} }
} }
augment "/rpol:routing-policy/rpol:policy-definitions/" + augment "/rpol:routing-policy/rpol:policy-definitions/" +
"rpol:policy-definition/rpol:statements/rpol:statement/" + "rpol:policy-definition/rpol:statements/rpol:statement/" +
"rpol:conditions" { "rpol:conditions" {
description description
"BGP policy conditions added to routing policy module"; "BGP policy conditions added to routing policy module";
container bgp-conditions { container bgp-conditions {
skipping to change at page 72, line 39 skipping to change at page 75, line 44
container as-path-length { container as-path-length {
description description
"Value and comparison operations for conditions based on the "Value and comparison operations for conditions based on the
length of the AS path in the route update"; length of the AS path in the route update";
} }
container match-community-set { container match-community-set {
description description
"Top-level container for match conditions on communities. "Top-level container for match conditions on communities.
Match a referenced community-set according to the logic Match a referenced community-set according to the logic
defined in the match-set-options leaf"; defined in the match-set-options leaf";
leaf community-set { leaf community-set {
type leafref { type leafref {
path path
"/rpol:routing-policy/rpol:defined-sets/" + "/rpol:routing-policy/rpol:defined-sets/" +
"bp:bgp-defined-sets/bp:community-sets/" + "bp:bgp-defined-sets/bp:community-sets/" +
"bp:community-set/bp:community-set-name"; "bp:community-set/bp:community-set-name";
} }
description description
"References a defined community set"; "References a defined community set";
} }
uses rpol:match-set-options-group; uses rpol:match-set-options-group;
} }
container match-ext-community-set { container match-ext-community-set {
description description
"Match a referenced extended community-set according to the "Match a referenced extended community-set according to the
logic defined in the match-set-options leaf"; logic defined in the match-set-options leaf";
leaf ext-community-set { leaf ext-community-set {
type leafref { type leafref {
path path
"/rpol:routing-policy/rpol:defined-sets/" + "/rpol:routing-policy/rpol:defined-sets/" +
"bp:bgp-defined-sets/bp:ext-community-sets/" + "bp:bgp-defined-sets/bp:ext-community-sets/" +
"bp:ext-community-set/" + "bp:ext-community-set/" +
"bp:ext-community-set-name"; "bp:ext-community-set-name";
} }
description "References a defined extended community set"; description "References a defined extended community set";
} }
uses rpol:match-set-options-group; uses rpol:match-set-options-group;
} }
container match-as-path-set { container match-as-path-set {
description description
"Match a referenced as-path set according to the logic "Match a referenced as-path set according to the logic
defined in the match-set-options leaf"; defined in the match-set-options leaf";
leaf as-path-set { leaf as-path-set {
type leafref { type leafref {
path "/rpol:routing-policy/rpol:defined-sets/" + path "/rpol:routing-policy/rpol:defined-sets/" +
"bp:bgp-defined-sets/bp:as-path-sets/" + "bp:bgp-defined-sets/bp:as-path-sets/" +
"bp:as-path-set/bp:as-path-set-name"; "bp:as-path-set/bp:as-path-set-name";
} }
description description
"References a defined AS path set"; "References a defined AS path set";
} }
skipping to change at page 74, line 10 skipping to change at page 77, line 15
description description
"BGP policy actions added to routing policy module."; "BGP policy actions added to routing policy module.";
container bgp-actions { container bgp-actions {
description description
"Top-level container for BGP-specific actions"; "Top-level container for BGP-specific actions";
leaf set-route-origin { leaf set-route-origin {
type bt:bgp-origin-attr-type; type bt:bgp-origin-attr-type;
description description
"set the origin attribute to the specified value"; "Set the origin attribute to the specified value";
} }
leaf set-local-pref { leaf set-local-pref {
type uint32; type uint32;
description description
"set the local pref attribute on the route update"; "Set the local pref attribute on the route update";
} }
leaf set-next-hop { leaf set-next-hop {
type bgp-next-hop-type; type bgp-next-hop-type;
description description
"set the next-hop attribute in the route update"; "Set the next-hop attribute in the route update";
} }
leaf set-med { leaf set-med {
type bgp-set-med-type; type bgp-set-med-type;
description description
"set the med metric attribute in the route update"; "Set the med metric attribute in the route update";
} }
container set-as-path-prepend { container set-as-path-prepend {
description description
"action to prepend local AS number to the AS-path a "Action to prepend local AS number to the AS-path a
specified number of times"; specified number of times";
leaf repeat-n { leaf repeat-n {
type uint8 { type uint8 {
range 1..max; range 1..max;
} }
description description
"Number of times to prepend the local AS number to the AS "Number of times to prepend the local AS number to the AS
path. The value should be between 1 and the maximum path. The value should be between 1 and the maximum
supported by the implementation."; supported by the implementation.";
skipping to change at page 74, line 46 skipping to change at page 78, line 4
leaf repeat-n { leaf repeat-n {
type uint8 { type uint8 {
range 1..max; range 1..max;
} }
description description
"Number of times to prepend the local AS number to the AS "Number of times to prepend the local AS number to the AS
path. The value should be between 1 and the maximum path. The value should be between 1 and the maximum
supported by the implementation."; supported by the implementation.";
} }
} }
container set-community { container set-community {
description description
"Action to set the community attributes of the route, along "Action to set the community attributes of the route, along
with options to modify how the community is modified. with options to modify how the community is modified.
Communities may be set using an inline list OR Communities may be set using an inline list OR
reference to an existing defined set (not both)."; reference to an existing defined set (not both).";
uses set-community-action-common; uses set-community-action-common;
container inline { container inline {
when "../config/method=INLINE" { when "../method = 'INLINE'" {
description description
"Active only when the set-community method is INLINE"; "Active only when the set-community method is INLINE";
} }
description description
"Set the community values for the action inline with "Set the community values for the action inline with
a list."; a list.";
leaf-list communities { leaf-list communities {
type union { type union {
type bt:bgp-std-community-type; type bt:bgp-std-community-type;
type bt:bgp-well-known-community-type; type bt:bgp-well-known-community-type;
} }
description description
"Set the community values for the update inline with a "Set the community values for the update inline with a
list."; list.";
} }
} }
container reference { container reference {
when "../config/method=REFERENCE" { when "../method = 'REFERENCE'" {
description description
"Active only when the set-community method is REFERENCE"; "Active only when the set-community method is REFERENCE";
} }
description description
"Provide a reference to a defined community set for the "Provide a reference to a defined community set for the
set-community action"; set-community action";
leaf community-set-ref { leaf community-set-ref {
type leafref { type leafref {
path "/rpol:routing-policy/rpol:defined-sets/" + path "/rpol:routing-policy/rpol:defined-sets/" +
skipping to change at page 76, line 11 skipping to change at page 79, line 17
container set-ext-community { container set-ext-community {
description description
"Action to set the extended community attributes of the "Action to set the extended community attributes of the
route, along with options to modify how the community is route, along with options to modify how the community is
modified. Extended communities may be set using an inline modified. Extended communities may be set using an inline
list OR a reference to an existing defined set (but not list OR a reference to an existing defined set (but not
both)."; both).";
uses set-community-action-common; uses set-community-action-common;
container inline { container inline {
when "../config/method=INLINE" { when "../method = 'INLINE'" {
description description
"Active only when the set-community method is INLINE"; "Active only when the set-community method is INLINE";
} }
description description
"Set the extended community values for the action inline "Set the extended community values for the action inline
with a list."; with a list.";
leaf-list communities { leaf-list communities {
type union { type union {
type rt-types:route-target; type rt-types:route-target;
type bt:bgp-well-known-community-type; type bt:bgp-well-known-community-type;
} }
description description
"Set the extended community values for the update inline "Set the extended community values for the update inline
with a list."; with a list.";
} }
} }
container reference { container reference {
when "../config/method=REFERENCE" { when "../method = 'REFERENCE'" {
description description
"Active only when the set-community method is REFERENCE"; "Active only when the set-community method is REFERENCE";
} }
description description
"Provide a reference to an extended community set for the "Provide a reference to an extended community set for the
set-ext-community action"; set-ext-community action";
leaf ext-community-set-ref { leaf ext-community-set-ref {
type leafref { type leafref {
path path
skipping to change at page 77, line 16 skipping to change at page 80, line 20
} }
// rpc statements // rpc statements
// notification statements // notification statements
} }
<CODE ENDS> <CODE ENDS>
7.4. RIB modules 7.4. RIB modules
<CODE BEGINS> file "ietf-bgp-rib@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-rib@2019-06-13.yang"
submodule ietf-bgp-rib { submodule ietf-bgp-rib {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "br"; prefix "br";
} }
/* /*
* Import and Include * Import and Include
*/ */
import ietf-bgp-types { import ietf-bgp-types {
prefix "bt"; prefix "bt";
reference reference
"RFC XXXX: BGP YANG Model for Service Provider Networks."; "RFC XXXX: BGP YANG Model for Service Provider Networks.";
} }
include ietf-bgp-rib-types; import ietf-inet-types {
include ietf-bgp-rib-tables; prefix inet;
include ietf-bgp-rib-shared-attributes; reference
"RFC 6991: Common YANG Types.";
}
// groupings of attributes in three categories: import ietf-yang-types {
// - shared across multiple routes prefix yang;
// - common to LOC-RIB and Adj-RIB, but not shared across routes reference
// - specific to LOC-RIB or Adj-RIB "RFC 6991: Common YANG Types.";
include ietf-bgp-rib-attributes; }
// groupings of annotations for each route or table import ietf-routing-types {
include ietf-bgp-rib-table-attributes; prefix "rt";
reference
"RFC 8294: Routing Area YANG Types.";
organization }
"IETF IDR Working Group";
contact include ietf-bgp-rib-types;
"WG Web: <http://tools.ietf.org/wg/idr> include ietf-bgp-rib-tables;
WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), // groupings of attributes in three categories:
Keyur Patel (keyur at arrcus.com), // - shared across multiple routes
Susan Hares (shares at ndzh.com"; // - common to LOC-RIB and Adj-RIB, but not shared across routes
// - specific to LOC-RIB or Adj-RIB
include ietf-bgp-rib-attributes;
description // groupings of annotations for each route or table
"Defines a submodule for representing BGP routing table (RIB) include ietf-bgp-rib-table-attributes;
contents. The submodule supports 5 logical RIBs per address
family:
loc-rib: This is the main BGP routing table for the local routing organization
instance, containing best-path selections for each prefix. The "IETF IDR Working Group";
loc-rib table may contain multiple routes for a given prefix,
with an attribute to indicate which was selected as the best
path. Note that multiple paths may be used or advertised even if
only one path is marked as best, e.g., when using BGP
add-paths. An implementation may choose to mark multiple
paths in the RIB as best path by setting the flag to true for
multiple entries.
adj-rib-in-pre: This is a per-neighbor table containing the NLRI contact
updates received from the neighbor before any local input policy "WG Web: <http://tools.ietf.org/wg/idr>
rules or filters have been applied. This can be considered the WG List: <idr@ietf.org>
'raw' updates from a given neighbor.
adj-rib-in-post: This is a per-neighbor table containing the Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
routes received from the neighbor that are eligible for Keyur Patel (keyur at arrcus.com),
best-path selection after local input policy rules have been Susan Hares (shares at ndzh.com)";
applied.
adj-rib-out-pre: This is a per-neighbor table containing routes description
eligible for sending (advertising) to the neighbor before output "Defines a submodule for representing BGP routing table (RIB)
policy rules have been applied. contents. The submodule supports 5 logical RIBs per address
family:
adj-rib-out-post: This is a per-neighbor table containing routes loc-rib: This is the main BGP routing table for the local routing
eligible for sending (advertising) to the neighbor after output instance, containing best-path selections for each prefix. The
policy rules have been applied."; loc-rib table may contain multiple routes for a given prefix,
with an attribute to indicate which was selected as the best
path. Note that multiple paths may be used or advertised even if
only one path is marked as best, e.g., when using BGP
add-paths. An implementation may choose to mark multiple
paths in the RIB as best path by setting the flag to true for
multiple entries.
revision "2019-03-21" { adj-rib-in-pre: This is a per-neighbor table containing the NLRI
description updates received from the neighbor before any local input policy
"Initial Version"; rules or filters have been applied. This can be considered the
reference 'raw' updates from a given neighbor.
"RFC XXXX, BGP YANG Model for Service Provider Network.";
}
grouping rib { adj-rib-in-post: This is a per-neighbor table containing the
description routes received from the neighbor that are eligible for
"Grouping for rib."; best-path selection after local input policy rules have been
applied.
container rib { adj-rib-out-pre: This is a per-neighbor table containing routes
config false; eligible for sending (advertising) to the neighbor before output
policy rules have been applied.
adj-rib-out-post: This is a per-neighbor table containing routes
eligible for sending (advertising) to the neighbor after output
policy rules have been applied.";
revision "2019-06-13" {
description
"Initial Version";
reference
"RFC XXXX, BGP YANG Model for Service Provider Network.";
}
grouping rib {
description
"Grouping for rib.";
container rib {
config false;
container attr-sets {
description description
"Top level container for BGP RIB"; "Enclosing container for the list of path attribute sets";
uses attribute-sets; list attr-set {
uses community-sets; key "index";
uses ext-community-sets;
container afi-safis {
config false;
description description
"Enclosing container for address family list"; "List of path attributes that may be in use by multiple
routes in the table";
list afi-safi { leaf index {
key "afi-safi-name"; type uint64;
description description
"List of afi-safi types."; "System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}
leaf afi-safi-name { leaf origin {
type identityref { type bt:bgp-origin-attr-type;
base bt:afi-safi-type; description
} "BGP attribute defining the origin of the path
description "AFI,SAFI name."; information.";
}
leaf atomic-aggregate {
type boolean;
description
"BGP attribute indicating that the prefix is an atomic
aggregate; i.e., the peer selected a less specific
route without selecting a more specific route that is
included in it.";
reference
"RFC 4271: Section 5.1.6.";
}
leaf next-hop {
type inet:ip-address;
description
"BGP next hop attribute defining the IP address of the
router that should be used as the next hop to the
destination";
reference
"RFC 4271: Section 5.1.3.";
}
leaf med {
type uint32;
description
"BGP multi-exit discriminator attribute used in BGP route
selection process";
reference
"RFC 4271: Section 5.1.4.";
}
leaf local-pref {
type uint32;
description
"BGP local preference attribute sent to internal peers to
indicate the degree of preference for externally learned
routes. The route with the highest local preference
value is preferred.";
reference
"RFC 4271: Section 5.1.5.";
}
leaf originator-id {
type yang:dotted-quad;
description
"BGP attribute that provides the id as an IPv4 address
of the originator of the announcement.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf-list cluster-list {
type yang:dotted-quad;
description
"Represents the reflection path that the route has
passed.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf aigp-metric {
type uint64;
description
"BGP path attribute representing the accumulated IGP
metric for the path";
reference
"RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
}
container aggregator {
config false;
description
"BGP attribute indicating the prefix has been
aggregated by the specified AS and router.";
reference
"RFC 4271: Section 5.1.7.";
leaf as {
type inet:as-number;
description
"AS number of the autonomous system that performed the
aggregation.";
} }
container ipv4-unicast { leaf as4 {
when "../afi-safi-name = 'bt:ipv4-unicast'" { type inet:as-number;
description
"Include this container for IPv4 unicast RIB";
}
description description
"Routing tables for IPv4 unicast -- active when the "AS number of the autonomous system that performed the
afi-safi name is ipv4-unicast"; aggregation (4-octet representation). This value is
populated if an upstream router is not 4-octet capable.
Its semantics are similar to the AS4_PATH optional
transitive attribute";
uses ipv4-loc-rib; reference
uses ipv4-adj-rib; "RFC 6793 - BGP Support for Four-octet AS Number Space";
} }
container ipv6-unicast { leaf address {
when "../afi-safi-name = 'bt:ipv6-unicast'" { type inet:ipv4-address;
description
"Include this container for IPv6 unicast RIB";
}
description description
"Routing tables for IPv6 unicast -- active when the "IP address of the router that performed the
afi-safi name is ipv6-unicast"; aggregation.";
}
}
container as-path {
description
"Enclosing container for the list of AS path segments.
uses ipv6-loc-rib; In the Adj-RIB-In or Adj-RIB-Out, this list should show
uses ipv6-adj-rib; the received or sent AS_PATH, respectively. For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.
In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)
RFC 6793 - BGP Support for Four-octet AS Number Space
RFC 5065 - Autonomous System Confederations for BGP";
list segment {
key "type";
config false;
uses bgp-as-path-attr;
description
"List of AS PATH segments";
} }
}
container as4-path {
description
"This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent
attribute in Adj-RIB-In or Adj-RIB-Out, respectively.
It should not be populated in Loc-RIB since the Loc-RIB
is expected to store the effective AS-Path in the
as-path leaf regardless of being 4-octet or 2-octet.";
reference
"RFC 6793 - BGP Support for Four-octet AS Number Space";
container ipv4-srte-policy { list segment {
when "../afi-safi-name = 'srte-policy-ipv4'" { key "type";
description
"Include this container only for the IPv4 AFI, SR-TE config false;
Policy SAFI."; uses bgp-as-path-attr;
}
description description
"Routing tables for the IPv4 Unicast, SR-TE Policy "List of AS PATH segments";
SAFI."; }
}
}
}
uses ipvX-srte-policy-locrib; container communities {
uses ipvX-srte-policy-adjrib; description
"Enclosing container for the list of community attribute
sets";
list community {
key "index";
config false;
description
"List of path attributes that may be in use by multiple
routes in the table";
leaf index {
type uint64;
description
"System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}
uses bgp-community-attr-state;
}
}
container ext-communities {
description
"Enclosing container for the list of extended community
attribute sets";
list ext-community {
key "index";
config false;
description
"List of path attributes that may be in use by multiple
routes in the table";
leaf index {
type uint64;
description
"System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}
leaf-list ext-community {
type rt:route-target;
description
"List of BGP extended community attributes. The received
extended community may be an explicitly modeled
type or unknown, represented by an 8-octet value
formatted according to RFC 4360.";
reference
"RFC 4360 - BGP Extended Communities Attribute";
}
}
}
container afi-safis {
config false;
description
"Enclosing container for address family list";
list afi-safi {
key "afi-safi-name";
description
"List of afi-safi types.";
leaf afi-safi-name {
type identityref {
base bt:afi-safi-type;
} }
description "AFI,SAFI name.";
}
container ipv6-srte-policy { container ipv4-unicast {
when "../afi-safi-name = 'srte-policy-ipv6'" { when "../afi-safi-name = 'bt:ipv4-unicast'" {
description
"Include this container only for the IPv6 AFI,
SR-TE Policy SAFI.";
}
description description
"Routing tables for the IPv6 Unicast, SR-TE Policy "Include this container for IPv4 unicast RIB";
SAFI.";
uses ipvX-srte-policy-locrib;
uses ipvX-srte-policy-adjrib;
} }
description
"Routing tables for IPv4 unicast -- active when the
afi-safi name is ipv4-unicast";
uses ipv4-loc-rib;
uses ipv4-adj-rib;
}
container ipv6-unicast {
when "../afi-safi-name = 'bt:ipv6-unicast'" {
description
"Include this container for IPv6 unicast RIB";
}
description
"Routing tables for IPv6 unicast -- active when the
afi-safi name is ipv6-unicast";
uses ipv6-loc-rib;
uses ipv6-adj-rib;
} }
} }
} }
description
"Top level container for BGP RIB";
} }
} }
<CODE ENDS> }
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-ext@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-rib-ext@2019-06-13.yang"
submodule ietf-bgp-rib-ext { submodule ietf-bgp-rib-ext {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "bre"; prefix "bre";
} }
include ietf-bgp-rib-types; include ietf-bgp-rib-types;
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"Defines additional data nodes for the OpenConfig BGP RIB model. "Defines additional data nodes for the OpenConfig BGP RIB model.
These items reflect extensions that are desirable features but These items reflect extensions that are desirable features but
are not currently supported in a majority of BGP are not currently supported in a majority of BGP
implementations."; implementations.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Revision."; "Initial Revision.";
reference reference
"RFC XXXX: BGP YANG Model for Service Providers."; "RFC XXXX: BGP YANG Model for Service Providers.";
} }
grouping rib-ext-route-annotations { grouping rib-ext-route-annotations {
description description
"Extended annotations for routes in the routing tables"; "Extended annotations for routes in the routing tables";
skipping to change at page 81, line 42 skipping to change at page 89, line 35
type union { type union {
type identityref { type identityref {
base bgp-not-selected-bestpath; base bgp-not-selected-bestpath;
} }
type identityref { type identityref {
base bgp-not-selected-policy; base bgp-not-selected-policy;
} }
} }
description description
"Indicates the reason the route is not used, either due to "Indicates the reason the route is not used, either due to
policy filtering or bestpath selection"; policy filtering or bestpath selection";
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-types@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-rib-types@2019-06-13.yang"
submodule ietf-bgp-rib-types { submodule ietf-bgp-rib-types {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "br"; prefix "br";
} }
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"Defines identity and type definitions associated with "Defines identity and type definitions associated with
the BGP RIB modules"; the BGP RIB modules";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXXX, BGP Model for Service Provider Network."; "RFC XXXX, BGP Model for Service Provider Network.";
} }
identity invalid-route-reason { identity invalid-route-reason {
description description
"Base identity for reason code for routes that are rejected as "Base identity for reason code for routes that are rejected as
invalid. Some derived entities are based on BMP v3"; invalid. Some derived entities are based on BMP v3";
skipping to change at page 83, line 6 skipping to change at page 90, line 48
identity invalid-as-loop { identity invalid-as-loop {
base invalid-route-reason; base invalid-route-reason;
description description
"Route was invalid due to AS_PATH loop"; "Route was invalid due to AS_PATH loop";
} }
identity invalid-originator { identity invalid-originator {
base invalid-route-reason; base invalid-route-reason;
description description
"Route was invalid due to ORIGINATOR_ID, e.g., update has "Route was invalid due to ORIGINATOR_ID, e.g., update has
local router as originator"; local router as originator";
}
identity invalid-confed {
base invalid-route-reason;
description
"Route was invalid due to a loop in the AS_CONFED_SEQUENCE or
AS_CONFED_SET attributes";
} }
identity bgp-not-selected-bestpath { identity bgp-not-selected-bestpath {
description description
"Base identity for indicating reason a route was was not "Base identity for indicating reason a route was was not
selected by BGP route selection algorithm"; selected by BGP route selection algorithm";
reference reference
"RFC 4271 - Section 9.1"; "RFC 4271 - Section 9.1";
} }
skipping to change at page 83, line 44 skipping to change at page 91, line 30
description description
"Route has a longer AS path attribute than current best path"; "Route has a longer AS path attribute than current best path";
reference reference
"RFC 4271 - Section 9.1.2.2 (a)"; "RFC 4271 - Section 9.1.2.2 (a)";
} }
identity origin-type-higher { identity origin-type-higher {
base bgp-not-selected-bestpath; base bgp-not-selected-bestpath;
description description
"Route has a higher origin type, i.e., IGP origin is preferred "Route has a higher origin type, i.e., IGP origin is preferred
over EGP or incomplete"; over EGP or incomplete";
reference reference
"RFC 4271 - Section 9.1.2.2 (b)"; "RFC 4271 - Section 9.1.2.2 (b)";
} }
identity med-higher { identity med-higher {
base bgp-not-selected-bestpath; base bgp-not-selected-bestpath;
description description
"Route has a higher MED, or metric, attribute than the current "Route has a higher MED, or metric, attribute than the current
best path"; best path";
reference reference
skipping to change at page 84, line 30 skipping to change at page 92, line 16
description description
"Route has a higher interior cost to the next hop."; "Route has a higher interior cost to the next hop.";
reference reference
"RFC 4271 - Section 9.1.2.2 (e)"; "RFC 4271 - Section 9.1.2.2 (e)";
} }
identity higher-router-id { identity higher-router-id {
base bgp-not-selected-bestpath; base bgp-not-selected-bestpath;
description description
"Route was sent by a peer with a higher BGP Identifier value, "Route was sent by a peer with a higher BGP Identifier value,
or router id"; or router id";
reference reference
"RFC 4271 - Section 9.1.2.2 (f)"; "RFC 4271 - Section 9.1.2.2 (f)";
} }
identity higher-peer-address { identity higher-peer-address {
base bgp-not-selected-bestpath; base bgp-not-selected-bestpath;
description description
"Route was sent by a peer with a higher IP address"; "Route was sent by a peer with a higher IP address";
reference reference
"RFC 4271 - Section 9.1.2.2 (g)"; "RFC 4271 - Section 9.1.2.2 (g)";
skipping to change at page 85, line 6 skipping to change at page 92, line 40
description description
"Base identity for reason code for routes that are rejected "Base identity for reason code for routes that are rejected
due to policy"; due to policy";
} }
identity rejected-import-policy { identity rejected-import-policy {
base bgp-not-selected-policy; base bgp-not-selected-policy;
description description
"Route was rejected after apply import policies"; "Route was rejected after apply import policies";
} }
identity tunnel-encapsulation-type {
description
"Types of tunnel encapsulation, as described by the Tunnel
Encapsulation attribute";
reference
"RFC5512";
}
identity srte-policy {
description
"Segment Routing Traffic Engineering Policy.";
reference
"TODO: Insert reference here.";
}
identity srte-policy-ipv4 {
base srte-policy;
description
"Segment Routing Traffice Engineering Policy for IPv4.";
reference
"TODO: Insert reference here.";
}
identity srte-policy-ipv6 {
base srte-policy;
description
"Segment Routing Traffic Engineering Policy for IPv6.";
reference
"TODO: Insert reference here.";
}
identity srte-policy-tunnel {
base tunnel-encapsulation-type;
description
"Segment Routing Traffic Engineering Policy tunnel.";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity tunnel-encapsulation-subtlv-type {
description
"SubTLVs of the Tunnel Encapsulation attribute";
reference
"RFC5512";
}
identity tunnel-remote-endpoint {
base tunnel-encapsulation-subtlv-type;
description
"Remote endpoint of the tunnel.";
reference
"RFC5512";
}
identity tunnel-color {
base tunnel-encapsulation-subtlv-type;
description
"Colour of the tunnel";
reference
"RFC5512";
}
identity srte-preference {
base tunnel-encapsulation-subtlv-type;
description
"Preference of the SR-TE policy entry described by
the tunnel encapsulation attribute.";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity srte-binding-sid {
base tunnel-encapsulation-subtlv-type;
description
"Binding SID to be used by the SR-TE policy described
by the tunnel encapsulation attribute.";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity srte-segment-list {
base tunnel-encapsulation-subtlv-type;
description
"Segment lists to be used by the SR-TE policy described
by the tunnel encapsulation attribute.";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity srte-segment-list-subtlv {
description
"SubTLVs of the SR-TE Policy Segment List sub-TLV of the
Tunnel Encapsulation attribute.";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity srte-segment-list-weight {
base srte-segment-list-subtlv;
description
"Weight of the segment list within the SR-TE policy";
reference
"draft-previdi-idr-segment-routing-te-policy";
}
identity srte-segment-list-segment {
base srte-segment-list-subtlv;
description
"An individual element within the SR-TE Policy Segment
List.";
}
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-attributes@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-rib-attributes@2019-06-13.yang"
submodule ietf-bgp-rib-attributes { submodule ietf-bgp-rib-attributes {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix "br"; prefix "br";
} }
// import some basic types // import some basic types
import ietf-bgp-types { import ietf-bgp-types {
prefix bgpt; prefix bgpt;
} }
skipping to change at page 88, line 5 skipping to change at page 93, line 24
// meta // meta
organization organization
"IETF IDR Working Group"; "IETF IDR Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/idr> "WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org> WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com), Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com), Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com"; Susan Hares (shares at ndzh.com)";
description description
"This submodule contains common data definitions for BGP "This submodule contains common data definitions for BGP
attributes for use in BGP RIB tables."; attributes for use in BGP RIB tables.";
revision "2019-03-21" { revision "2019-06-13" {
description description
"Initial version"; "Initial version";
reference reference
"RFC XXXX: BGP YANG Model for Service Provider Network"; "RFC XXXX: BGP YANG Model for Service Provider Network";
} }
grouping bgp-as-path-attr { grouping bgp-as-path-attr {
description description
"Data for representing BGP AS-PATH attribute"; "Data for representing BGP AS-PATH attribute";
skipping to change at page 88, line 37 skipping to change at page 94, line 9
"The type of AS-PATH segment"; "The type of AS-PATH segment";
} }
leaf-list member { leaf-list member {
type inet:as-number; type inet:as-number;
description description
"List of the AS numbers in the AS-PATH segment"; "List of the AS numbers in the AS-PATH segment";
} }
} }
grouping bgp-as-path-attr-top {
description
"Top-level grouping for AS-PATH attribute data";
container as-path {
description
"Enclosing container for the list of AS path segments.
In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively. For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.
In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)
RFC 6793 - BGP Support for Four-octet AS Number Space
RFC 5065 - Autonomous System Confederations for BGP";
list segment {
key "type";
config false;
uses bgp-as-path-attr;
description
"List of AS PATH segments";
}
}
}
grouping bgp-as4-path-attr-top {
description
"Top-level grouping for AS4-PATH attribute data";
container as4-path {
description
"This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively. It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.";
reference
"RFC 6793 - BGP Support for Four-octet AS Number Space";
list segment {
key "type";
config false;
uses bgp-as-path-attr;
description
"List of AS PATH segments";
}
}
}
grouping bgp-community-attr-state { grouping bgp-community-attr-state {
description description
"Common definition of BGP community attributes"; "Common definition of BGP community attributes";
leaf-list community { leaf-list community {
type union { type union {
type bgpt:bgp-well-known-community-type; type bgpt:bgp-well-known-community-type;
type bgpt:bgp-std-community-type; type bgpt:bgp-std-community-type;
} }
description description
"List of standard or well-known BGP community "List of standard or well-known BGP community
attributes."; attributes.";
}
}
grouping bgp-extended-community-attr-state {
description
"Common definition of BGP extended community attribute";
leaf-list ext-community {
// type bgpt:bgp-ext-community-recv-type;
type bgpt:bgp-ext-community-type;
description
"List of BGP extended community attributes. The received
extended community may be an explicitly modeled
type or unknown, represented by an 8-octet value
formatted according to RFC 4360.";
reference
"RFC 4360 - BGP Extended Communities Attribute";
}
}
grouping bgp-aggregator-attr-top {
description
"Common definition of the BGP aggregator attribute";
container aggregator {
config false;
description
"BGP attribute indicating the prefix has been aggregated by
the specified AS and router.";
leaf as {
type inet:as-number;
description
"AS number of the autonomous system that performed the
aggregation.";
}
leaf as4 {
type inet:as-number;
description
"AS number of the autonomous system that performed the
aggregation (4-octet representation). This value is
populated if an upstream router is not 4-octet capable.
Its semantics are similar to the AS4_PATH optional
transitive attribute";
reference
"RFC 6793 - BGP Support for Four-octet AS Number Space";
}
leaf address {
type inet:ipv4-address;
description
"IP address of the router that performed the
aggregation.";
}
}
}
grouping bgp-shared-common-attr-state {
description
"Route attributes shared across route table entries,
common to both LOC-Rib and Adj-RIB";
leaf origin {
type bgpt:bgp-origin-attr-type;
description
"BGP attribute defining the origin of the path information.";
}
leaf atomic-aggregate {
type boolean;
description
"BGP attribute indicating that the prefix is an atomic
aggregate, i.e., the peer selected a less specific
route without selecting a more specific route that is
included in it.";
}
leaf next-hop {
type inet:ip-address;
description
"BGP next hop attribute defining the IP address of the router
that should be used as the next hop to the destination";
}
leaf med {
type uint32;
description
"BGP multi-exit discriminator attribute used in BGP route
selection process";
}
leaf local-pref {
type uint32;
description
"BGP local preference attribute sent to internal peers to
indicate the degree of preference for externally learned
routes. The route with the highest local preference value
is preferred.";
}
leaf originator-id {
type inet:ipv4-address;
description
"BGP attribute that provides the id as an IPv4 address
of the originator of the announcement.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf-list cluster-list {
type inet:ipv4-address;
description
"Represents the reflection path that the route has passed.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf aigp {
type uint64;
description
"BGP path attribute representing the accumulated IGP metric
for the path";
reference
"RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
} }
} }
grouping bgp-unknown-attr-flags-state { grouping bgp-unknown-attr-flags-state {
description description
"Operational state data for path attribute flags"; "Operational state data for path attribute flags";
leaf optional { leaf optional {
type boolean; type boolean;
description description
skipping to change at page 93, line 20 skipping to change at page 94, line 43
Set in the high-order bit of the BGP attribute Set in the high-order bit of the BGP attribute
flags octet."; flags octet.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
leaf transitive { leaf transitive {
type boolean; type boolean;
description description
"Defines whether an optional attribute is transitive "Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false). For (if set to true) or non-transitive (if set to false). For
well-known attributes, the transitive flag must be set to well-known attributes, the transitive flag must be set to
true. Set in the second high-order bit of the BGP attribute true. Set in the second high-order bit of the BGP attribute
flags octet."; flags octet.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
leaf partial { leaf partial {
type boolean; type boolean;
description description
"Defines whether the information contained in the optional "Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete transitive attribute is partial (if set to true) or complete
(if set to false). For well-known attributes and for (if set to false). For well-known attributes and for
optional non-transitive attributes, the partial flag optional non-transitive attributes, the partial flag
must be set to false. Set in the third high-order bit of must be set to false. Set in the third high-order bit of
the BGP attribute flags octet."; the BGP attribute flags octet.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
leaf extended { leaf extended {
type boolean; type boolean;
description description
"Defines whether the attribute length is one octet "Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true). Set in (if set to false) or two octets (if set to true). Set in
the fourth high-order bit of the BGP attribute flags the fourth high-order bit of the BGP attribute flags
octet."; octet.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
} }
grouping bgp-unknown-attr-state { grouping bgp-unknown-attr-state {
description description
"Operational state data for path attributes not shared "Operational state data for path attributes not shared
across route entries, common to LOC-RIB and Adj-RIB"; across route entries, common to LOC-RIB and Adj-RIB";
leaf attr-type { leaf attr-type {
type uint8; type uint8;
description description
"1-octet value encoding the attribute type code"; "1-octet value encoding the attribute type code";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
leaf attr-len { leaf attr-len {
type uint16; type uint16;
description description
"One or two octet attribute length field indicating the "One or two octet attribute length field indicating the
length of the attribute data in octets. If the Extended length of the attribute data in octets. If the Extended
Length attribute flag is set, the length field is 2 octets, Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet"; otherwise it is 1 octet";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
leaf attr-value { leaf attr-value {
type binary { type binary {
length 1..65535; length 0..65535;
} }
description description
"Raw attribute value, not including the attribute "Raw attribute value, not including the attribute
flags, type, or length. The maximum length flags, type, or length. The maximum length
of the attribute value data is 2^16-1 per the max value of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets)."; of the attr-len field (2 octets).";
reference reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
} }
} }
grouping bgp-unknown-attr-top { grouping bgp-unknown-attr-top {
description description
"Unknown path attributes that are not expected to be shared "Unknown path attributes that are not expected to be shared
across route entries, common to LOC-RIB and Adj-RIB"; across route entries, common to LOC-RIB and Adj-RIB";
container unknown-attributes { container unknown-attributes {
description description
"Unknown path attributes that were received in the UPDATE "Unknown path attributes that were received in the UPDATE
message which contained the prefix."; message which contained the prefix.";
list unknown-attribute { list unknown-attribute {
key "attr-type"; key "attr-type";
description description
"This list contains received attributes that are unrecognized "This list contains received attributes that are unrecognized
or unsupported by the local router. The list may be empty."; or unsupported by the local router. The list may be empty.";
uses bgp-unknown-attr-flags-state; uses bgp-unknown-attr-flags-state;
uses bgp-unknown-attr-state; uses bgp-unknown-attr-state;
} }
} }
} }
grouping bgp-loc-rib-attr-state { grouping bgp-loc-rib-attr-state {
description description
"Path attributes that are not expected to be shared across "Path attributes that are not expected to be shared across
route entries, specific to LOC-RIB"; route entries, specific to LOC-RIB";
} }
grouping bgp-adj-rib-attr-state { grouping bgp-adj-rib-attr-state {
description description
"Path attributes that are not expected to be shared across "Path attributes that are not expected to be shared across
route entries, specific to Adj-RIB"; route entries, specific to Adj-RIB";
leaf path-id { leaf path-id {
type uint32; type uint32;
description description
"When the BGP speaker supports advertisement of multiple "When the BGP speaker supports advertisement of multiple
paths for a prefix, the path identifier is used to paths for a prefix, the path identifier is used to
uniquely identify a route based on the combination of the uniquely identify a route based on the combination of the
prefix and path id. In the Adj-RIB-In, the path-id value is prefix and path id. In the Adj-RIB-In, the path-id value is
the value received in the update message. In the Loc-RIB, the value received in the update message. In the Loc-RIB,
if used, it should represent a locally generated path-id if used, it should represent a locally generated path-id
value for the corresponding route. In Adj-RIB-Out, it value for the corresponding route. In Adj-RIB-Out, it
should be the value sent to a neighbor when add-paths is should be the value sent to a neighbor when add-paths is
used, i.e., the capability has been negotiated."; used, i.e., the capability has been negotiated.";
reference reference
"draft-ietf-idr-add-paths - Advertisement of Multiple Paths "RFC 7911: Advertisement of Multiple Paths in BGP";
in BGP";
}
}
grouping bgp-tunnel-encapsulation-attr-top {
description
"Top-level definition of the BGP Tunnel encapsulation
attribute.";
container tunnel-encapsulation {
config false;
description
"The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.";
reference "RFC5512, draft-ietf-idr-tunnel-encaps";
container tunnels {
description
"Surrounding container for the set of tunnels included
within the tunnel encapsulation attribute.";
list tunnel {
key "type";
description
"List of the tunnels that are specified within the
attribute. Keyed on the type of tunnel that the
TLV describes.";
leaf type {
type identityref {
base "tunnel-encapsulation-type";
}
description
"Type of the tunnel described within the tunnel
encapsulation attribute.";
}
container subtlvs {
description
"Surrounding container for the list of sub-TLVs within
the tunnel encapsulation attribute.";
list subtlv {
key "type";
description
"List of the subTLVs that are specified within the
TLV instance inside the tunnel encapsulation
attribute.";
leaf type {
type identityref {
base "tunnel-encapsulation-subtlv-type";
}
description
"Type of the sub-TLV within the tunnel encapsulation
attribute";
}
leaf-list colors {
when "../type = 'tunnel-color'" {
description
"Only allow list of colors to be specified when
the sub-TLV specifies colors associated with the
tunnel encapsulation attribute.";
}
type uint32;
description
"The colors associated with the tunnel encapsulation
attribute, as described by RFC5512.";
}
leaf preference {
when "../type = 'srte-preference'" {
description
"Only allow the preference to be specified when the
sub-TLV specifies the preference associated with
the tunnel encapsulation attribute.";
}
type uint32;
default 100;
description
"The preference of the SR-TE policy described by the
tunnel encapsulation attribute. If unspecified, the
preference defaults to 100.";
}
leaf binding-sid {
when "../type = 'srte-binding-sid'" {
description
"Only allow the binding SID to be specified when the
sub-TLV is specified to be the of the relevant
type.";
}
// type sr:sr-sid-type;
// defining it as string, till we figure what this
// should be.
type string;
description
"Binding SID associated with the SR-TE policy";
}
container remote-endpoints {
when "../type = 'tunnel-remote-endpoint'" {
description
"Only allow the remote endpoint to be specified
when the subTLV is specified to describe remote
endpoints.";
}
description
"The remote endpoints associated with the tunnel
described by the attribute.";
list remote-endpoint {
key "endpoint";
config false;
description
"List of the remote endpoints described within
the TLV.";
leaf as {
type inet:as-number;
description
"The remote AS to which the IP address of the
remote endpoint belongs.";
}
leaf endpoint {
type inet:ip-address;
description
"IP address of the remote endpoint.";
}
}
}
container segment-lists {
when "../type = 'srte-segment-list'" {
description
"Only allow the segment lists to be specified when
the sub-TLV is of the relevant type.";
}
description
"Surrounding container for the list of segment lists
that are associated with a SR-TE Policy tunnel.";
list segment-list {
key "instance-id";
config false;
description
"List of segment lists that are specified within the
tunnel encapsulation attribute.";
leaf instance-id {
type uint64;
description
"Instance of the segment list within the
sub-TLV";
}
leaf weight {
type uint32;
description
"The weight given to the path within the set of
segment lists that are included in the tunnel
attribute sub-TLV.";
}
container segments {
description
"Surrounding container for the list of segments
within the SR-TE segment list.";
list segment {
key "index";
config false;
description
"List of segments within the SR-TE segment
list.";
leaf index {
type uint64;
description
"Index of the segment within the segment
list. The segments are ordered in ascending
order, beginning at 0.";
}
leaf type {
type enumeration {
enum MPLS_SID {
value 1;
description
"The segment is specified as an MPLS
label.";
}
enum IPV6_SID {
value 2;
description
"The segment is specified as an IPv6
address.";
}
enum IPV4_NODE_ADDRESS {
value 3;
description
"The segment is specified as an IPv4
node address with optional SID.";
}
enum IPV6_NODE_ADDRESS {
value 4;
description
"The segment is specified as an IPv6
node address with optional SID.";
}
enum IPV4_LOCAL_INTF_ID {
value 5;
description
"The segment is specified as an IPv4
address with a local interface
identifier along with an .";
}
enum IPV4_LOCAL_REMOTE_ADDR {
value 6;
description
"The segment is specified as an IPv4
local and remote address with an
optional SID.";
}
enum IPV6_LOCAL_INTF_ID {
value 7;
description
"The segment is specified as an IPv6
address with an index, along with an
optional SID.";
}
enum IPV6_LOCAL_REMOTE_ADDR {
value 8;
description
"The segmetn is specified as an IPv6
local and remote address with an
optional SID.";
}
}
description
"The type of segment specified within the
segment entry.";
}
leaf sid {
// TODO: type sr:sr-sid-type;
// using string till this is resolved.
type string;
description
"SID value for the segment entry, specified
as an MPLS label or IPv6 address.";
}
leaf mpls-tc {
when "../type = 'MPLS_SID'" {
description
"The MPLS TC bits can only be specified
when the segment time is an MPLS label.";
}
type uint8 {
range "0..7";
}
description
"The MPLS TC bits used when the SID is
specified as an MPLS label. If set to zero,
the receiving system specifies the value of
the TC bits.";
}
leaf mpls-bos {
when "../type = 'MPLS_SID'" {
description
"The MPLS BoS bit can only be specified
when the segment type is an MPLS label.";
}
type boolean;
description
"When this leaf is set to true the MPLS
bottom-of-stack (BoS) bit is set in the
MPLS segment. The BoS bit should always be
set to zero by the sender.";
}
leaf mpls-ttl {
when "../type = 'MPLS_SID'" {
description
"The MPLS TTL can only be set when the
segment type is an MPLS label.";
}
type uint8;
description
"The MPLS time to live (TTL) to be set for
the MPLS segment. If set to 255, the
receiver specifies the TTL value that is
used for packets sent with this segment in
the stack.";
}
leaf remote-ipv4-address {
when "../type = 'IPV4_NODE_ADDRESS' or" +
// "../type='../IPV4_ADDRESS_INDEX' or" +
"../type='IPV4_LOCAL_INTF_ID' or " +
"../type='IPV4_LOCAL_REMOTE_ADDR'" {
description
"An IPv4 address can only be associated
with the segment entry when the type of
the SID is a node address, or an IPv6
address with an index.";
}
type inet:ipv4-address;
description
"An IPv4 address specified as the remote
node address. When the type of the segment
specifies only the remote address, no other
addresses are specified. When the type of
the segment requires a local address,
this leaf specifies the remote IPv4
address.";
}
leaf local-ipv4-address {
when "../type = 'IPV4_LOCAL_REMOTE_ADDR'" {
description
"A local IPv4 address can only be specified
when the segment is specified by the
local and remote IPv4 interface
addresses.";
}
type inet:ipv4-address;
description
"An IPv4 address of a local adjacency that is
used to identify the segment.";
}
leaf remote-ipv6-address {
when "../type = 'IPV6_NODE_ADDRESS' or" +
// "../type='IPV6_ADDRESS_INDEX' or" +
"../type='IPV6_LOCAL_INTF_ID' or " +
"../type='IPV6_LOCAL_REMOTE_ADDR'" {
description
"An IPv6 address can only be specified with
a segment entry when the type of the SID
is a node address, or an IPv6 address
with an index.";
}
type inet:ipv6-address;
description
"An IPv6 address specified as the remote node
address. When the type of the segment
specifies only the remote address, no other
addresses are specified. When the type of
the segment requires a local address,
this leaf specifies the remote IPv6
address.";
}
leaf local-ipv6-address {
when "../type = 'IPV6_LOCAL_REMOTE_ADDR'" {
description
"A local IPv6 address can only be
specified when the segment is specified
by the local and remote IPv6 interface
addresses.";
}
type inet:ipv6-address;
description
"An IPv6 address of a local adjacency that is
used to identify the segment.";
}
leaf local-interface-id {
when "../type = 'IPV4_LOCAL_INTF_ID' or" +
"../type='IPV6_LOCAL_INTF_ID'" {
description
"A local interface identifier can only be
specified when the type of the segment
is an IPv4 address with local interface
ID, or IPv6 address with local interface
ID.";
}
type uint32;
description
"The local interface identifier to be
utilised for the segment.";
reference
"draft-ietf-pce-segment-routing";
}
}
}
}
}
}
}
}
}
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-shared-attributes@2019-03-21.yang" <CODE BEGINS> file "ietf-bgp-rib-table-attributes@2019-06-13.yang"
submodule ietf-bgp-rib-shared-attributes {
yang-version "1.1";
belongs-to ietf-bgp {
prefix "br";
}
// import some basic types
include ietf-bgp-rib-attributes;
organization
"IETF IDR Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org>
Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Keyur Patel (keyur at arrcus.com),
Susan Hares (shares at ndzh.com";
description
"This submodule contains structural data definitions for
attribute sets shared across routes.";
revision "2019-03-21" {
description
"Initial version";
reference
"RFC XXXX: BGP YANG Model for Service Provider Network.";
}
grouping attribute-sets {
description
"Top level grouping for list of common attribute sets";
container attr-sets {
description
"Enclosing container for the list of path attribute sets";
list attr-set {
key "index";
description
"List of path attributes that may be in use by multiple
routes in the table";
leaf index {
type uint64;
description
"System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}
uses bgp-shared-common-attr-state;
uses bgp-aggregator-attr-top;
uses bgp-as-path-attr-top;
uses bgp-as4-path-attr-top;
uses bgp-tunnel-encapsulation-attr-top;
}
}
}
grouping community-sets {
description
"Top level grouping for list of shared community attribute
sets";
container communities {
description
"Enclosing container for the list of community attribute
sets";
list community {
key "index";
config false;
description
"List of path attributes that may be in use by multiple
routes in the table";
leaf index {
type uint64;
description
"System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}
uses bgp-community-attr-state;
}
}
}
grouping ext-community-sets {
description
"Top level grouping for list of extended community attribute
sets";
container ext-communities {
description
"Enclosing container for the list of extended community
attribute sets";
list ext-community {
key "index";
config false;
description
"List of path attributes that may be in use by multiple
routes in the table";
leaf index {
type uint64;
description
"System generated index for each attribute set. The
index is used to reference an attribute set from a
specific path. Multiple paths may reference the same
attribute set.";
}