draft-ietf-idr-bgp-model-03.txt   draft-ietf-idr-bgp-model-04.txt 
Interdomain Routing K. Patel Interdomain Routing K. Patel
Internet-Draft Arrcus Internet-Draft Arrcus
Intended status: Standards Track M. Jethanandani Intended status: Standards Track M. Jethanandani
Expires: November 11, 2018 Expires: August 29, 2019 VMware
S. Hares S. Hares
Huawei Huawei
May 10, 2018 February 25, 2019
BGP Model for Service Provider Networks BGP YANG Model for Service Provider Networks
draft-ietf-idr-bgp-model-03 draft-ietf-idr-bgp-model-04
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 based on BGP, including protocol, policy, and operational aspects based on
data center, carrier and content provider operational requirements. data center, carrier and content provider operational requirements.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
skipping to change at page 1, line 35 skipping to change at page 1, line 35
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 November 11, 2018. This Internet-Draft will expire on August 29, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
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 . . . . . . . . . . . . . . . . . . . 2 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3
1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4
2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 4 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. BGP protocol configuration . . . . . . . . . . . . . . . 4 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 5
2.2. Policy configuration overview . . . . . . . . . . . . . . 6 2.2. Policy configuration overview . . . . . . . . . . . . . . 7
3. Relation to other YANG data models . . . . . . . . . . . . . 7 2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 8
4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 20
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 20
5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 8 2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 20
5.2. YANG Module Name Registration . . . . . . . . . . . . . . 8 2.3.4. Pre route advertisements per-neighbor . . . . . . . . 20
6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3.5. Post route advertisements per-neighbor . . . . . . . 20
7. BGP main module and submodule for base items . . . . . . . . 10 3. Relation to other YANG data models . . . . . . . . . . . . . 21
8. BGP types . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4. Security Considerations . . . . . . . . . . . . . . . . . . . 21
9. BGP policy data . . . . . . . . . . . . . . . . . . . . . . . 58 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21
10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 72 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 21
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 72 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 22
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 72 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 23
12.1. Normative references . . . . . . . . . . . . . . . . . . 72 7. Structure of the YANG modules . . . . . . . . . . . . . . . . 23
12.2. Informative references . . . . . . . . . . . . . . . . . 74 7.1. Main module and submodules for base items . . . . . . . . 23
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 74 7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 60
7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 70
7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 81
8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 132
8.2. Neighbor Address Family Configuration . . . . . . . . . . 133
9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 135
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 135
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.1. Normative references . . . . . . . . . . . . . . . . . . 135
11.2. Informative references . . . . . . . . . . . . . . . . . 137
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 137
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
[RFC4271] protocol, including various protocol extensions, policy [RFC4271] protocol, including various protocol extensions, policy
configuration, as well as defining key operational state data. The configuration, as well as defining key operational state data,
model is intended to be vendor-neutral, in order to allow operators including Routing Information Base (RIB). The model is intended to
to manage BGP configuration in heterogeneous environments with be vendor-neutral, in order to allow operators to manage BGP
routers supplied by multiple vendors. The model is also intended to configuration in heterogeneous environments with routers supplied by
be readily mapped to existing implementations to facilitate support multiple vendors. The model is also intended to be readily mapped to
from as large a set of routing hardware and software vendors as existing implementations to facilitate support from as large a set of
possible. routing hardware and software vendors as possible.
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],
Graceful Restart Mechanism for BGP [RFC4724], and BGP Prefix Origin Graceful Restart Mechanism for BGP [RFC4724], and BGP Prefix Origin
Validation [RFC6811]. Validation [RFC6811].
Along with configuration of base BGP features, this model also Along with configuration of base BGP features, this model also
addresses policy configuration, by providing "hooks" for applying addresses policy configuration, by providing "hooks" for applying
policies, and also defining BGP-specific policy features. The BGP policies, and also defining BGP-specific policy features. The BGP
policy features are intended to be used with the general routing policy features are intended to be used with the general routing
policy model defined in A YANG Data Model for Routing Policy policy model defined in A YANG Data Model for Routing Policy
Management [I-D.ietf-rtgwg-policy-model]. The model supports the Management [I-D.ietf-rtgwg-policy-model]. The model conforms to the
NMDA [RFC8342] architecture. NMDA [RFC8342] architecture.
For the base BGP features, the focus of the model described in this For the base BGP features, the focus of the model described in this
document is on providing configuration and operational state document is on providing configuration and operational state
information relating to: information relating to:
o The global BGP instance, and neighbors whose configuration is o The global BGP instance, and neighbors whose configuration is
specified individually, or templated with the use of peer-groups. specified individually, or templated with the use of peer-groups.
o The address families that are supported by peers, and the global o The address families that are supported by peers, and the global
configuration which relates to them. configuration which relates to them.
o The policy configuration "hooks" and BGP-specific policy features o The policy configuration "hooks" and BGP-specific policy features
that relate to a neighbor - controlling the import and export of that relate to a neighbor - controlling the import and export of
NLRIs. NLRIs.
o RIB contents.
As mentioned earlier, any configuration items that are deemed to be As mentioned earlier, any configuration items that are deemed to be
widely available in existing major BGP implementations are included widely available in existing major BGP implementations are included
in the model. Additional, more esoteric, configuration items that in the model. Additional, more esoteric, configuration items that
are not commonly used, or only available from a single are not commonly used, or only available from a single
implementation, are omitted from the model with an expectation that implementation, are omitted from the model with an expectation that
they will be available in companion modules that augment or extend they will be available in companion modules that augment or extend
the current model. This allows clarity in identifying data that is the current model. This allows clarity in identifying data that is
part of the vendor-neutral base model. part of the vendor-neutral base model.
Where possible, naming in the model follows conventions used in Where possible, naming in the model follows conventions used in
available standards documents, and otherwise tries to be self- available standards documents, and otherwise tries to be self-
explanatory with sufficient descriptions of the intended behavior. explanatory with sufficient descriptions of the intended behavior.
Similarly, configuration data value constraints and default values, Similarly, configuration data value constraints and default values,
where used, are based on recommendations in current standards where used, are based on recommendations in current standards
documentation, or those commonly used in multiple implementations. documentation, or those commonly used in multiple implementations.
Since implementations can vary widely in this respect, this version Since implementations can vary widely in this respect, this version
of the model specifies only a limited set of defaults and ranges with of the model specifies only a limited set of defaults and ranges with
the expectation of being more prescriptive in future versions based the expectation of being more prescriptive in future versions based
on actual operator use. on actual operator use.
1.2. Note to RFC Editor
This document uses several placeholder values throughout the
document. Please replace them as follows and remove this note before
publication.
RFC XXXX, where XXXX is the number assigned to this document at the
time of publication.
2019-02-25 with the actual date of the publication of this document.
RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for
Routing Policy Management [I-D.ietf-rtgwg-policy-model].
2. Model overview 2. Model overview
The BGP model is defined across several YANG modules and submodules, The BGP model is defined across several YANG modules and submodules,
but at a high level is organized into six elements: but at a high level is organized into six elements:
o base protocol configuration -- configuration affecting BGP o base protocol configuration -- configuration affecting BGP
protocol-related operations, defined at various levels of protocol-related operations, defined at various levels of
hierarchy. hierarchy.
o multiprotocol configuration -- configuration affecting individual o multiprotocol configuration -- configuration affecting individual
address-families within BGP Multiprotocl Extensions for BGP-4 address-families within BGP Multiprotocol Extensions for BGP-4
[RFC4760]. [RFC4760].
o neighbor configuration -- configuration affecting an individual o neighbor configuration -- configuration affecting an individual
neighbor within BGP. neighbor within BGP.
o neighbor multiprotocol configuration -- configuration affecting o neighbor multiprotocol configuration -- configuration affecting
individual address-families for a neighbor within BGP. individual address-families for a neighbor within BGP.
o policy configuration -- hooks for application of the policies o policy configuration -- hooks for application of the policies
defined in A YANG Data Model for Routing Policy Management defined in A YANG Data Model for Routing Policy Management
skipping to change at page 4, line 44 skipping to change at page 5, line 21
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.
+--rw bgp! +--rw bgp
+--rw global +--rw global!
| +-- (global-configuration-options) | +-- (global-configuration-options)
+--rw neighbors +--rw neighbors
| +--rw neighbor* [neighbor-address] | +--rw neighbor* [neighbor-address]
| +-- (neighbor-configuration-options) | +-- (neighbor-configuration-options)
+--rw peer-groups +--rw peer-groups
+--rw peer-group* [peer-group-name] +--rw peer-group* [peer-group-name]
+-- (neighbor-configuration-options) +-- (neighbor-configuration-options)
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
skipping to change at page 6, line 5 skipping to change at page 6, line 25
all address-families (e.g., whether the AFI-SAFI is enabled) is all address-families (e.g., whether the AFI-SAFI is enabled) is
presented at the top-level, with address-family specific containers presented at the top-level, with address-family specific containers
made available for options relating to only that AFI-SAFI. Within made available for options relating to only that AFI-SAFI. Within
the current revision of the model a generic set of address-families, the current revision of the model a generic set of address-families,
and common configuration and state options are included - further and common configuration and state options are included - further
work is expected to add additional parameters to this area of the work is expected to add additional parameters to this area of the
model. model.
The following address-families are currently supported by the model: The following address-families are currently supported by the model:
+--rw bgp! +--rw bgp
+--rw global +--rw global!
+--rw afi-safis +--rw afi-safis
+--rw afi-safi* [afi-safi-name] +--rw afi-safi* [afi-safi-name]
+--rw afi-safi-name -> ../config/afi-safi-name +--rw afi-safi-name identityref
| |
+--rw ipv4-unicast +--rw ipv4-unicast
| ... | ...
+--rw ipv6-unicast +--rw ipv6-unicast
| ... | ...
+--rw ipv4-labelled-unicast +--rw ipv4-labeled-unicast
| ... | ...
+--rw ipv6-labelled-unicast +--rw ipv6-labeled-unicast
| ... | ...
+--rw l3vpn-ipv4-unicast +--rw l3vpn-ipv4-unicast
| ... | ...
+--rw l3vpn-ipv6-unicast +--rw l3vpn-ipv6-unicast
| ... | ...
+--rw l3vpn-ipv4-multicast +--rw l3vpn-ipv4-multicast
| ... | ...
+--rw l3vpn-ipv6-multicast +--rw l3vpn-ipv6-multicast
| ... | ...
+--rw l2vpn-vpls +--rw l2vpn-vpls
| ... | ...
+--rw l2vpn-evpn +--rw l2vpn-evpn
| ... | ...
2.2. Policy configuration overview 2.2. Policy configuration overview
The BGP policy configuration model references the generic YANG The BGP policy configuration model augments the generic YANG routing
routing policy model described in A YANG Data Model for Routing policy model described in A YANG Data Model for Routing Policy
Policy Management [I-D.ietf-rtgwg-policy-model], which represents a Management [I-D.ietf-rtgwg-policy-model], which represents a
condition-action policy framework for routing. This model adds BGP- condition-action policy framework for routing. This model adds BGP-
specific conditions (e.g., matching on the community attribute), and specific conditions (e.g., matching on the community attribute), and
actions (e.g., setting local preference) to the generic policy actions (e.g., setting local preference) to the generic policy
framework. framework.
Policies that are defined in the routing-policy model are referenced Policies that are defined in the routing-policy model are referenced
in multiple places within the model: in multiple places within the model:
o within the global instance, where a policy applies to all address- o within the global instance, where a policy applies to all address-
families for all peers. families for all peers.
skipping to change at page 7, line 14 skipping to change at page 7, line 33
o on a per-peer-group or per-neighbor basis - where the policy o on a per-peer-group or per-neighbor basis - where the policy
applies to all address-families for the particular group or applies to all address-families for the particular group or
neighbor. neighbor.
o on a per-afi-safi basis within a neighbor or peer-group context, o on a per-afi-safi basis within a neighbor or peer-group context,
where the policy is specific to the AFI-SAFI for a a specific where the policy is specific to the AFI-SAFI for a a specific
neighbor or group. neighbor or group.
+--rw bgp +--rw bgp
+--rw global +--rw global!
| +--rw afi-safi | +--rw afi-safis
| | +--rw afi-safi* [afi-safi-name] | +--rw afi-safi
| | +--rw apply-policy | | +--rw afi-safi* [afi-safi-name]
| +--rw apply-policy | | +--rw apply-policy
| +--rw apply-policy
+--rw neighbors +--rw neighbors
| +--rw neighbor* [neighbor-address] | +--rw neighbor* [neighbor-address]
| +--rw afi-safi | +--rw afi-safi
| | +--rw afi-safi* [afi-safi-name] | | +--rw afi-safi* [afi-safi-name]
| | +--rw apply-policy | | +--rw apply-policy
| +--rw apply-policy | +--rw apply-policy
+--rw peer-groups +--rw peer-groups
+--rw peer-group* [peer-group-name] +--rw peer-group* [peer-group-name]
+--rw afi-safi +--rw afi-safi
| +--rw afi-safi* [afi-safi-name] | +--rw afi-safi* [afi-safi-name]
| +--rw apply-policy | +--rw apply-policy
+--rw apply-policy +--rw apply-policy
3. Relation to other YANG data models 2.3. BGP RIB overview
The BGP model is intended to work within a larger framework model, The RIB data model represents the BGP RIB contents. The model
such as the Network Instance model YANG Model for Network Instance supports five logical RIBs per address family.
[I-D.ietf-rtgwg-ni-model] which provides a comprehensive model for
defining VRFs, associated routing protocols, multiple protocol
instances, and inter-protocol and inter-instance routing policies.
The current version of the model imports and instantiates the BGP
model in its tree at /network-instances/network-instance/vrf-
root/rt:routing/control-plane-protocols/control-plane-protocol/
bgp/...
It is also possible to integrate the BGP model with the Routing A version of the tree showing the five logical RIBs is shown below.
Management model A YANG Data Model for Routing Management [RFC8349]
which defines the notion of routing instances, or VRFs. module: ietf-bgp-rib
augment /rt:routing/rt:ribs:
+--ro rib
+--ro attr-sets
| +--ro attr-set* [index]
| +--ro index uint64
| +--ro origin? bgpt:bgp-origin-attr-type
| +--ro atomic-aggregate? boolean
| +--ro next-hop? inet:ip-address
| +--ro med? uint32
| +--ro local-pref? uint32
| +--ro originator-id? inet:ipv4-address
| +--ro cluster-list* inet:ipv4-address
| +--ro aigp? uint64
| +--ro aggregator
| | +--ro as? inet:as-number
| | +--ro as4? inet:as-number
| | +--ro address? inet:ipv4-address
| +--ro as-path
| | +--ro segment* [type]
| | +--ro type identityref
| | +--ro member* inet:as-number
| +--ro as4-path
| | +--ro segment* [type]
| | +--ro type identityref
| | +--ro member* inet:as-number
| +--ro tunnel-encapsulation
| +--ro tunnels
| +--ro tunnel* [type]
| +--ro type identityref
| +--ro subtlvs
| +--ro subtlv* [type]
| +--ro type identityref
| +--ro colors* uint32
| +--ro preference? uint32
| +--ro binding-sid? string
| +--ro remote-endpoints
| | +--ro remote-endpoint* [endpoint]
| | +--ro as? inet:as-number
| | +--ro endpoint inet:ip-address
| +--ro segment-lists
| +--ro segment-list* [instance-id]
| +--ro instance-id uint64
| +--ro weight? uint32
| +--ro segments
| +--ro segment* [index]
| +--ro index
| | uint64
| +--ro type?
| | enumeration
| +--ro sid?
| | string
| +--ro mpls-tc?
| | uint8
| +--ro mpls-bos?
| | boolean
| +--ro mpls-ttl?
| | uint8
| +--ro remote-ipv4-address?
| | inet:ipv4-address
| +--ro local-ipv4-address?
| | inet:ipv4-address
| +--ro remote-ipv6-address?
| | inet:ipv6-address
| +--ro local-ipv6-address?
| | inet:ipv6-address
| +--ro local-interface-id?
| uint32
+--ro communities
| +--ro community* [index]
| +--ro index uint64
| +--ro community* union
+--ro ext-communities
| +--ro ext-community* [index]
| +--ro index uint64
| +--ro ext-community* bgpt:bgp-ext-community-type
+--ro afi-safis
+--ro afi-safi* [afi-safi-name]
+--ro afi-safi-name identityref
+--ro ipv4-unicast
| +--ro loc-rib
| | +--ro routes
| | +--ro route* [prefix origin path-id]
| | +--ro prefix
| | | inet:ipv4-prefix
| | +--ro origin union
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified? types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason? identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute* [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro neighbors
| +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv4-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-in-post
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv4-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro best-path? boolean
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-pre
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv4-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-post
| +--ro routes
| +--ro route* [prefix path-id]
| +--ro prefix
| | inet:ipv4-prefix
| +--ro path-id uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro ipv6-unicast
| +--ro loc-rib
| | +--ro routes
| | +--ro route* [prefix origin path-id]
| | +--ro prefix
| | | inet:ipv6-prefix
| | +--ro origin union
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified? types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason? identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute* [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro neighbors
| +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv6-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-in-post
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv6-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro best-path? boolean
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-pre
| | +--ro routes
| | +--ro route* [prefix path-id]
| | +--ro prefix
| | | inet:ipv6-prefix
| | +--ro path-id uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-post
| +--ro routes
| +--ro route* [prefix path-id]
| +--ro prefix
| | inet:ipv6-prefix
| +--ro path-id uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro ipv4-srte-policy
| +--ro loc-rib
| | +--ro routes
| | +--ro route* [path-id endpoint color]
| | +--ro path-id uint32
| | +--ro endpoint inet:ip-address
| | +--ro color uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified? types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason? identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute* [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro neighbors
| +--ro neighbor* [neighbor-address]
| +--ro neighbor-address inet:ip-address
| +--ro adj-rib-in-pre
| | +--ro routes
| | +--ro route* [path-id endpoint color]
| | +--ro path-id uint32
| | +--ro endpoint
| | | inet:ip-address
| | +--ro color uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-in-post
| | +--ro routes
| | +--ro route* [path-id endpoint color]
| | +--ro path-id uint32
| | +--ro endpoint
| | | inet:ip-address
| | +--ro color uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro best-path? boolean
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-pre
| | +--ro routes
| | +--ro route* [path-id endpoint color]
| | +--ro path-id uint32
| | +--ro endpoint
| | | inet:ip-address
| | +--ro color uint32
| | +--ro attr-index? leafref
| | +--ro community-index? leafref
| | +--ro ext-community-index? leafref
| | +--ro last-modified?
| | | types:timeticks
| | +--ro valid-route? boolean
| | +--ro invalid-reason?
| | | identityref
| | +--ro unknown-attributes
| | +--ro unknown-attribute*
| | [attr-type]
| | +--ro optional? boolean
| | +--ro transitive? boolean
| | +--ro partial? boolean
| | +--ro extended? boolean
| | +--ro attr-type uint8
| | +--ro attr-len? uint16
| | +--ro attr-value? binary
| +--ro adj-rib-out-post
| +--ro routes
| +--ro route* [path-id endpoint color]
| +--ro path-id uint32
| +--ro endpoint
| | inet:ip-address
| +--ro color uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro ipv6-srte-policy
+--ro loc-rib
| +--ro routes
| +--ro route* [path-id endpoint color]
| +--ro path-id uint32
| +--ro endpoint inet:ip-address
| +--ro color uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified? types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason? identityref
| +--ro unknown-attributes
| +--ro unknown-attribute* [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro neighbors
+--ro neighbor* [neighbor-address]
+--ro neighbor-address inet:ip-address
+--ro adj-rib-in-pre
| +--ro routes
| +--ro route* [path-id endpoint color]
| +--ro path-id uint32
| +--ro endpoint
| | inet:ip-address
| +--ro color uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro adj-rib-in-post
| +--ro routes
| +--ro route* [path-id endpoint color]
| +--ro path-id uint32
| +--ro endpoint
| | inet:ip-address
| +--ro color uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro best-path? boolean
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro adj-rib-out-pre
| +--ro routes
| +--ro route* [path-id endpoint color]
| +--ro path-id uint32
| +--ro endpoint
| | inet:ip-address
| +--ro color uint32
| +--ro attr-index? leafref
| +--ro community-index? leafref
| +--ro ext-community-index? leafref
| +--ro last-modified?
| | types:timeticks
| +--ro valid-route? boolean
| +--ro invalid-reason?
| | identityref
| +--ro unknown-attributes
| +--ro unknown-attribute*
| [attr-type]
| +--ro optional? boolean
| +--ro transitive? boolean
| +--ro partial? boolean
| +--ro extended? boolean
| +--ro attr-type uint8
| +--ro attr-len? uint16
| +--ro attr-value? binary
+--ro adj-rib-out-post
+--ro routes
+--ro route* [path-id endpoint color]
+--ro path-id uint32
+--ro endpoint
| inet:ip-address
+--ro color uint32
+--ro attr-index? leafref
+--ro community-index? leafref
+--ro ext-community-index? leafref
+--ro last-modified?
| types:timeticks
+--ro valid-route? boolean
+--ro invalid-reason?
| identityref
+--ro unknown-attributes
+--ro unknown-attribute*
[attr-type]
+--ro optional? boolean
+--ro transitive? boolean
+--ro partial? boolean
+--ro extended? boolean
+--ro attr-type uint8
+--ro attr-len? uint16
+--ro attr-value? binary
2.3.1. Local Routing
The loc-rib is the main BGP routing table for the local routing
instance, containing best-path selections for each prefix. The 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.
2.3.2. Pre updates per-neighbor
The adj-rib-in-pre table is a per-neighbor table containing the NLRI
updates received from the neighbor before any local input policy
rules or filters have been applied. This can be considered the 'raw'
updates from a given neighbor.
2.3.3. Post updates per-neighbor
The adj-rib-in-post table is a per-neighbor table containing the
routes received from the neighbor that are eligible for best-path
selection after local input policy rules have been applied.
2.3.4. Pre route advertisements per-neighbor
The adj-rib-out-pre table is a per-neighbor table containing routes
eligible for sending (advertising) to the neighbor before output
policy rules have been applied.
2.3.5. Post route advertisements per-neighbor
The adj-rib-out-post table is a per-neighbor table containing routes
eligible for sending (advertising) to the neighbor after output
policy rules have been applied
3. Relation to other YANG data models
The BGP model augments the Routing Management model A YANG Data Model
for Routing Management [RFC8349] which defines the notion of routing,
routing protocols, routing instances, or VRFs, and RIBs.
4. Security Considerations 4. Security Considerations
The YANG module specified in this document defines a schema for data The YANG module specified in this document defines a schema for data
that is designed to be accessed via network management protocols such that is designed to be accessed via network management protocols such
as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer
is the secure transport layer, and the mandatory-to-implement secure is the secure transport layer, and the mandatory-to-implement secure
transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer
is HTTPS, and the mandatory-to-implement secure transport is TLS is HTTPS, and the mandatory-to-implement secure transport is TLS
[RFC5246]. The NETCONF Access Control Model (NACM) [RFC8341] [RFC8446]. The NETCONF Access Control Model (NACM) [RFC8341]
provides the means to restrict access for particular NETCONF or provides the means to restrict access for particular NETCONF or
RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or
RESTCONF protocol operations and content. RESTCONF protocol operations and content.
There are a number of data nodes defined in this YANG module that are There are a number of data nodes defined in this YANG module that are
writable/creatable/deletable (i.e., config true, which is the writable/creatable/deletable (i.e., config true, which is the
default). These data nodes may be considered sensitive or vulnerable default). These data nodes may be considered sensitive or vulnerable
in some network environments. Write operations (e.g., edit-config) in some network environments. Write operations (e.g., edit-config)
to these data nodes without proper protection can have a negative to these data nodes without proper protection can have a negative
effect on network operations. These are the subtrees and data nodes effect on network operations. These are the subtrees and data nodes
skipping to change at page 8, line 33 skipping to change at page 21, line 45
notification) to these data nodes. These are the subtrees and data notification) to these data nodes. These are the subtrees and data
nodes and their sensitivity/vulnerability: nodes and their sensitivity/vulnerability:
Some of the RPC operations in this YANG module may be considered Some of the RPC operations in this YANG module may be considered
sensitive or vulnerable in some network environments. It is thus sensitive or vulnerable in some network environments. It is thus
important to control access to these operations. These are the important to control access to these operations. These are the
operations and their sensitivity/vulnerability: operations and their sensitivity/vulnerability:
5. IANA Considerations 5. IANA Considerations
This document registers three URIs and three YANG modules. This document registers six URIs and six YANG modules.
5.1. URI Registration 5.1. URI Registration
in the IETF XML registry [RFC3688] [RFC3688]. Following the format in the IETF XML registry [RFC3688] [RFC3688]. Following the format
in RFC 3688, the following registration is requested to be made: in RFC 3688, the following registration is requested to be made:
URI: urn:ietf:params:xml:ns:yang:ietf-bgp URI: urn:ietf:params:xml:ns:yang:ietf-bgp
URI: urn:ietf:params:xml:ns:yang:ietf-bgp-policy URI: urn:ietf:params:xml:ns:yang:ietf-bgp-policy
URI: urn:ietf:params:xml:ns:yang:ietf-bgp-types URI: urn:ietf:params:xml:ns:yang:ietf-bgp-types
URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib
URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext
URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types
Registrant Contact: The IESG. XML: N/A, the requested URI is an XML Registrant Contact: The IESG. XML: N/A, the requested URI is an XML
namespace. namespace.
5.2. YANG Module Name Registration 5.2. YANG Module Name Registration
This document registers three YANG module in the YANG Module Names This document registers three YANG module in the YANG Module Names
registry YANG [RFC6020]. registry YANG [RFC6020].
name: ietf-bgp name: ietf-bgp
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp namespace: urn:ietf:params:xml:ns:yang:ietf-bgp
prefix: bgp prefix: bgp
reference: RFC XXXX reference: RFC XXXX
name: ietf-bgp-policy name: ietf-bgp-policy
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-policy namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-policy
prefix: bgp-pol prefix: bp
reference: RFC XXXX reference: RFC XXXX
name: ietf-bgp-types name: ietf-bgp-types
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-types namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-types
prefix: bgp-types prefix: bt
reference: RFC XXXX
name: ietf-bgp-rib
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib
prefix: br
reference: RFC XXXX
name: ietf-bgp-rib-ext
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext
prefix: bre
reference: RFC XXXX
name: ietf-bgp-rib-types
namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types
prefix: brt
reference: RFC XXXX reference: RFC XXXX
6. YANG modules 6. YANG modules
The modules comprising the BGP configuration and operational model The modules comprising the BGP configuration and operational model
are described by the YANG modules and submodules in the sections are described by the YANG modules and submodules in the sections
below. below.
The main module, ietf-bgp.yang, includes the following submodules: The main module, ietf-bgp.yang, includes the following submodules:
skipping to change at page 10, line 9 skipping to change at page 23, line 43
Additional modules include: Additional modules include:
o ietf-bgp-types - common type and identity definitions for BGP, o ietf-bgp-types - common type and identity definitions for BGP,
including BGP policy including BGP policy
o ietf-bgp-policy - BGP-specific policy data definitions for use o ietf-bgp-policy - BGP-specific policy data definitions for use
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. BGP main module and submodule for base items 7. Structure of the YANG modules
<CODE BEGINS> file "ietf-bgp@2018-05-09.yang"
module ietf-bgp {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp";
prefix "bgp";
import ietf-routing-policy {
prefix rpol;
reference
"RFC ZZZZ: A YANG Data Model for Routing Policy Management";
}
include ietf-bgp-common;
include ietf-bgp-common-multiprotocol;
include ietf-bgp-common-structure;
include ietf-bgp-neighbor;
include ietf-bgp-global;
include ietf-bgp-peer-group;
organization
"IETF IDR Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org>
Authors: Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani (mjethanandani at gmail.com),
Susan Hares (shares at ndzh.com";
description
"This module describes a YANG model for BGP protocol
configuration. It is a limited subset of all of the configuration
parameters available in the variety of vendor implementations,
hence it is expected that it would be augmented with vendor-
specific configuration data as needed. Additional modules or
submodules to handle other aspects of BGP configuration,
including policy, VRFs, VPNs, and additional address families
are also expected.
This model supports the following BGP configuration level
hierarchy:
BGP
|
+-> [ global BGP configuration ]
+-> AFI / SAFI global
+-> peer group
+-> [ peer group config ]
+-> AFI / SAFI [ per-AFI overrides ]
+-> neighbor
+-> [ neighbor config ]
+-> [ optional pointer to peer-group ]
+-> AFI / SAFI [ per-AFI overrides ]";
revision "2018-05-09" {
description
"Initial Version";
reference
"RFC XXXX, BGP Model for Service Provider Network ";
}
/*
* Groupings
*/
container bgp {
description
"Top-level configuration for the BGP router";
container global { The YANG model can be subdivided between the main module for base
presence "Enables global configuration of BGP"; items, types, policy data, and the RIB module.
description
"Global configuration for the BGP router";
uses bgp-global-base;
uses rpol:apply-policy-group;
}
container neighbors { 7.1. Main module and submodules for base items
description
"Configuration for BGP neighbors";
uses bgp-neighbor-list;
}
container peer-groups { <CODE BEGINS> file "ietf-bgp-common@2019-02-25.yang"
description
"Configuration for BGP peer-groups";
uses bgp-peer-group-list;
}
}
}
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-common@2018-05-09.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 bgp-types; prefix bt;
} }
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
} }
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: Keyur Patel, Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Mahesh Jethanandani, Keyur Patel (keyur at arrcus.com),
Susan Hares"; 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 "2018-05-09" { revision "2019-02-25" {
description description
"Initial Version"; "Initial Version";
reference reference
"RFC XXX, BGP Model for Service Provider Network."; "RFC XXXX, BGP Model for Service Provider Network.";
} }
grouping bgp-common-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 {
type decimal64 { type decimal64 {
fraction-digits 2; fraction-digits 2;
} }
default 30; default 30;
description description
skipping to change at page 13, line 51 skipping to change at page 25, line 49
messages relating to a common set of NLRI being transmitted messages relating to a common set of NLRI being transmitted
to a peer. This timer is referred to as to a peer. This timer is referred to as
MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to
reduce the number of UPDATE messages transmitted when a reduce the number of UPDATE messages transmitted when a
particular set of NLRI exhibit instability."; particular set of NLRI exhibit instability.";
reference reference
"RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1";
} }
} }
grouping bgp-common-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.";
} }
leaf local-as { leaf local-as {
type inet:as-number; type inet:as-number;
description description
"The local autonomous system number that is to be used when "The local autonomous system number that is to be used when
establishing sessions with the remote peer or peer group, if establishing sessions with the remote peer or peer group, if
this differs from the global BGP router autonomous system this differs from the global BGP router autonomous system
number."; number.";
} }
leaf peer-type { leaf peer-type {
type bgp-types:peer-type; type bt:peer-type;
description description
"Explicitly designate the peer or peer group as internal "Explicitly designate the peer or peer group as internal
(iBGP) or external (eBGP)."; (iBGP) or external (eBGP).";
} }
leaf auth-password { leaf auth-password {
type string; type string;
description description
"Configures an MD5 authentication password for use with "Configures an MD5 authentication password for use with
neighboring devices."; neighboring devices.";
} }
leaf remove-private-as { leaf remove-private-as {
// 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 bgp-types: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 { leaf route-flap-damping {
type boolean; type boolean;
default false; default false;
description description
skipping to change at page 15, line 4 skipping to change at page 26, line 50
"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 { leaf route-flap-damping {
type boolean; type boolean;
default false; default false;
description description
"Enable route flap damping."; "Enable route flap damping.";
} }
leaf send-community { leaf send-community {
type bgp-types:community-type; type bt:community-type;
default "NONE"; default "NONE";
description description
"Specify which types of community should be sent to the "Specify which types of community should be sent to the
neighbor or group. The default is to not send the community neighbor or group. The default is to not send the community
attribute"; 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 bgp-common-neighbor-group-transport-config { grouping neighbor-group-transport-config {
description description
"Configuration parameters relating to the transport protocol "Configuration parameters relating to the transport protocol
used by the BGP session to the peer"; used by the BGP session to the peer";
leaf tcp-mss { leaf tcp-mss {
type uint16; type uint16;
description description
"Sets the max segment size for BGP TCP sessions."; "Sets the max segment size for BGP TCP sessions.";
} }
skipping to change at page 16, line 18 skipping to change at page 28, line 15
//to point to an interface when YANG 1.1 is available with //to point to an interface when YANG 1.1 is available with
//leafrefs in union types. //leafrefs in union types.
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 bgp-common-neighbor-group-error-handling-config { grouping neighbor-group-error-handling-config {
description description
"Configuration parameters relating to enhanced error handling "Configuration parameters relating to enhanced error handling
behaviours for BGP"; behaviors for BGP";
leaf treat-as-withdraw { leaf treat-as-withdraw {
type boolean; type boolean;
default "false"; default "false";
description description
"Specify whether erroneous UPDATE messages for which the NLRI "Specify whether erroneous UPDATE messages for which the NLRI
can be extracted are reated as though the NLRI is withdrawn can be extracted are treated as though the NLRI is withdrawn
- avoiding session reset"; - avoiding session reset";
reference "draft-ietf-idr-error-handling-16"; reference "draft-ietf-idr-error-handling-16";
} }
} }
grouping bgp-common-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 {
skipping to change at page 17, line 32 skipping to change at page 29, line 28
leaf helper-only { leaf helper-only {
type boolean; type boolean;
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 bgp-common-use-multiple-paths-config { grouping use-multiple-paths-config {
description description
"Generic configuration options relating to use of multiple "Generic configuration options relating to use of multiple
paths for a referenced AFI-SAFI, group or neighbor"; paths for a referenced AFI-SAFI, group or neighbor";
leaf enabled { leaf enabled {
type boolean; type boolean;
default false; default false;
description description
"Whether the use of multiple paths for the same NLRI is "Whether the use of multiple paths for the same NLRI is
enabled for the neighbor. This value is overridden by any enabled for the neighbor. This value is overridden by any
more specific configuration value."; more specific configuration value.";
} }
} }
grouping bgp-common-use-multiple-paths-ebgp-as-options-config { grouping use-multiple-paths-ebgp-as-options-config {
description description
"Configuration parameters specific to eBGP multi-path applicable "Configuration parameters specific to eBGP multi-path applicable
to all contexts"; to all contexts";
leaf allow-multiple-as { leaf allow-multiple-as {
type boolean; type boolean;
default "false"; default "false";
description description
"Allow multi-path to use paths from different neighboring ASes. "Allow multi-path to use paths from different neighboring ASes.
The default is to only consider multiple paths from the same The default is to only consider multiple paths from the same
neighboring AS."; neighboring AS.";
} }
} }
grouping bgp-common-global-group-use-multiple-paths { grouping global-group-use-multiple-paths {
description description
"Common grouping used for both global and groups which provides "Common grouping used for both global and groups which provides
configuration and state parameters relating to use of multiple configuration and state parameters relating to use of multiple
paths"; paths";
container use-multiple-paths { container use-multiple-paths {
description description
"Parameters related to the use of multiple paths for the "Parameters related to the use of multiple paths for the
same NLRI"; same NLRI";
uses bgp-common-use-multiple-paths-config; uses use-multiple-paths-config;
container ebgp { container ebgp {
description description
"Multi-Path parameters for eBGP"; "Multi-Path parameters for eBGP";
leaf allow-multiple-as { leaf allow-multiple-as {
type boolean; type boolean;
default "false"; default "false";
description description
"Allow multi-path to use paths from different neighboring "Allow multi-path to use paths from different neighboring
skipping to change at page 19, line 16 skipping to change at page 31, line 12
type uint32; type uint32;
default 1; default 1;
description description
"Maximum number of parallel paths to consider when using "Maximum number of parallel paths to consider when using
iBGP multi-path. The default is to use a single path"; iBGP multi-path. The default is to use a single path";
} }
} }
} }
} }
grouping bgp-common-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 { leaf always-compare-med {
type boolean; type boolean;
default "false"; default "false";
skipping to change at page 20, line 30 skipping to change at page 32, line 27
type boolean; type boolean;
default "false"; default "false";
description description
"Ignore the IGP metric to the next-hop when calculating BGP "Ignore the IGP metric to the next-hop when calculating BGP
best-path. The default is to select the route for which best-path. The default is to select the route for which
the metric to the next-hop is lowest"; the metric to the next-hop is lowest";
} }
} }
} }
grouping bgp-common-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;
config false; config false;
description description
"Total number of BGP paths within the context"; "Total number of BGP paths within the context";
} }
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@2018-05-09.yang"
<CODE BEGINS> file "ietf-bgp-common-multiprotocol@2019-02-25.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 bgp-types; prefix bt;
} }
import ietf-routing-policy { import ietf-routing-policy {
prefix rpol; prefix rpol;
} }
include ietf-bgp-common; include ietf-bgp-common;
// 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>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Authors: Keyur Patel, Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani, Susan Hares (shares at ndzh.com";
Susan Hares";
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 "2018-05-09" { revision "2019-02-25" {
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-common-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;
description description
"This leaf indicates whether graceful-restart is enabled for "This leaf indicates whether graceful-restart is enabled for
this AFI-SAFI"; this AFI-SAFI";
} }
} }
grouping bgp-common-mp-afi-safi-config { grouping mp-afi-safi-config {
description description
"Configuration parameters used for all BGP AFI-SAFIs"; "Configuration parameters used for all BGP AFI-SAFIs";
leaf afi-safi-name { leaf afi-safi-name {
type identityref { type identityref {
base bgp-types:AFI_SAFI_TYPE; base "bt:afi-safi-type";
} }
description "AFI,SAFI"; description "AFI,SAFI";
} }
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 bgp-common-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;
uses bgp-common-mp-ipv4-unicast-group;
uses bgp-common-mp-ipv6-unicast-group;
uses bgp-common-mp-ipv4-labeled-unicast-group;
uses bgp-common-mp-ipv6-labeled-unicast-group;
uses bgp-common-mp-l3vpn-ipv4-unicast-group;
uses bgp-common-mp-l3vpn-ipv6-unicast-group;
uses bgp-common-mp-l3vpn-ipv4-multicast-group;
uses bgp-common-mp-l3vpn-ipv6-multicast-group;
uses bgp-common-mp-l2vpn-vpls-group;
uses bgp-common-mp-l2vpn-evpn-group;
}
// Groupings relating to each address family
grouping bgp-common-mp-ipv4-unicast-group {
description
"Group for IPv4 Unicast configuration options";
container ipv4-unicast { container ipv4-unicast {
when "../afi-safi-name = 'bgp-types: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 "IPv4 unicast configuration options"; description
"IPv4 unicast configuration options";
// include common IPv[46] unicast options // include common IPv[46] unicast options
uses bgp-common-mp-ipv4-ipv6-unicast-common; uses mp-ipv4-ipv6-unicast-common;
// placeholder for IPv4 unicast specific configuration // placeholder for IPv4 unicast specific configuration
} }
}
grouping bgp-common-mp-ipv6-unicast-group {
description
"Group for IPv6 Unicast configuration options";
container ipv6-unicast { container ipv6-unicast {
when "../afi-safi-name = 'bgp-types: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 "IPv6 unicast configuration options"; description
"IPv6 unicast configuration options";
// include common IPv[46] unicast options // include common IPv[46] unicast options
uses bgp-common-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
} }
}
grouping bgp-common-mp-ipv4-labeled-unicast-group {
description
"Group for IPv4 Labeled Unicast configuration options";
container ipv4-labeled-unicast { container ipv4-labeled-unicast {
when "../afi-safi-name = 'bgp-types: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 "IPv4 Labeled Unicast configuration options"; description
"IPv4 Labeled Unicast configuration options";
uses bgp-common-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
} }
}
grouping bgp-common-mp-ipv6-labeled-unicast-group {
description
"Group for IPv6 Labeled Unicast configuration options";
container ipv6-labeled-unicast { container ipv6-labeled-unicast {
when "../afi-safi-name = 'bgp-types: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 "IPv6 Labeled Unicast configuration options"; description
"IPv6 Labeled Unicast configuration options";
uses bgp-common-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.
} }
}
grouping bgp-common-mp-l3vpn-ipv4-unicast-group {
description
"Group for IPv4 Unicast L3VPN configuration options";
container l3vpn-ipv4-unicast { container l3vpn-ipv4-unicast {
when "../afi-safi-name = 'bgp-types: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 "Unicast IPv4 L3VPN configuration options"; description
"Unicast IPv4 L3VPN configuration options";
// include common L3VPN configuration options // include common L3VPN configuration options
uses bgp-common-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.
} }
}
grouping bgp-common-mp-l3vpn-ipv6-unicast-group {
description
"Group for IPv6 Unicast L3VPN configuration options";
container l3vpn-ipv6-unicast { container l3vpn-ipv6-unicast {
when "../afi-safi-name = 'bgp-types: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 "Unicast IPv6 L3VPN configuration options"; description
"Unicast IPv6 L3VPN configuration options";
// include common L3VPN configuration options // include common L3VPN configuration options
uses bgp-common-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
} }
}
grouping bgp-common-mp-l3vpn-ipv4-multicast-group {
description
"Group for IPv4 L3VPN multicast configuration options";
container l3vpn-ipv4-multicast { container l3vpn-ipv4-multicast {
when "../afi-safi-name = 'bgp-types: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 "Multicast IPv4 L3VPN configuration options"; description
"Multicast IPv4 L3VPN configuration options";
// include common L3VPN multicast options // include common L3VPN multicast options
uses bgp-common-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
}
}
grouping bgp-common-mp-l3vpn-ipv6-multicast-group { }
description
"Group for IPv6 L3VPN multicast configuration options";
container l3vpn-ipv6-multicast { container l3vpn-ipv6-multicast {
when "../afi-safi-name = 'bgp-types: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 "Multicast IPv6 L3VPN configuration options"; description
"Multicast IPv6 L3VPN configuration options";
// include common L3VPN multicast options // include common L3VPN multicast options
uses bgp-common-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
} }
}
grouping bgp-common-mp-l2vpn-vpls-group {
description
"Group for BGP-signalled VPLS configuration options";
container l2vpn-vpls { container l2vpn-vpls {
when "../afi-safi-name = 'bgp-types: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 "BGP-signalled VPLS configuration options"; description
"BGP-signalled VPLS configuration options";
// include common L2VPN options // include common L2VPN options
uses bgp-common-mp-l2vpn-common; uses mp-l2vpn-common;
// placeholder for BGP-signalled VPLS specific configuration // placeholder for BGP-signalled VPLS specific configuration
// options // options
} }
}
grouping bgp-common-mp-l2vpn-evpn-group {
description
"Group for BGP EVPN configuration options";
container l2vpn-evpn { container l2vpn-evpn {
when "../afi-safi-name = 'bgp-types: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 "BGP EVPN configuration options"; description
"BGP EVPN configuration options";
// include common L2VPN options // include common L2VPN options
uses bgp-common-mp-l2vpn-common; uses mp-l2vpn-common;
// placeholder for BGP EVPN specific configuration options // placeholder for BGP EVPN specific configuration options
} }
} }
// Common groupings across multiple AFI,SAFIs // Common groupings across multiple AFI,SAFIs
grouping bgp-common-mp-all-afi-safi-common { grouping mp-all-afi-safi-common {
description description
"Grouping for configuration common to all AFI,SAFI"; "Grouping for configuration common to all AFI,SAFI";
container prefix-limit { container prefix-limit {
description description
"Parameters relating to the prefix limit for the AFI-SAFI"; "Parameters relating to the prefix limit for the AFI-SAFI";
leaf max-prefixes { leaf max-prefixes {
type uint32; type uint32;
description description
"Maximum number of prefixes that will be accepted from the "Maximum number of prefixes that will be accepted from the
neighbour"; neighbour";
} }
leaf shutdown-threshold-pct { leaf shutdown-threshold-pct {
type bgp-types:percentage; type bt:percentage;
description description
"Threshold on number of prefixes that can be received from "Threshold on number of prefixes that can be received from
a neighbour before generation of warning messages or log a neighbour before generation of warning messages or log
entries. Expressed as a percentage of max-prefixes"; entries. Expressed as a percentage of max-prefixes";
} }
leaf restart-timer { leaf restart-timer {
type decimal64 { type decimal64 {
fraction-digits 2; fraction-digits 2;
} }
units "seconds"; units "seconds";
description description
"Time interval in seconds after which the BGP session is "Time interval in seconds after which the BGP session is
re-established after being torn down due to exceeding the re-established after being torn down due to exceeding the
max-prefix limit."; max-prefix limit.";
} }
} }
} }
grouping bgp-common-mp-ipv4-ipv6-unicast-common { grouping mp-ipv4-ipv6-unicast-common {
description description
"Common configuration that is applicable for IPv4 and IPv6 "Common configuration that is applicable for IPv4 and IPv6
unicast"; unicast";
// include common afi-safi options. // include common afi-safi options.
uses bgp-common-mp-all-afi-safi-common; uses mp-all-afi-safi-common;
// configuration options that are specific to IPv[46] unicast // configuration options that are specific to IPv[46] unicast
leaf send-default-route { leaf send-default-route {
type boolean; type boolean;
default "false"; default "false";
description description
"If set to true, send the default-route to the neighbour(s)"; "If set to true, send the default-route to the neighbour(s)";
} }
} }
grouping bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common { grouping mp-l3vpn-ipv4-ipv6-unicast-common {
description description
"Common configuration applied across L3VPN for IPv4 "Common configuration applied across L3VPN for IPv4
and IPv6"; and IPv6";
// placeholder -- specific configuration options that are generic // placeholder -- specific configuration options that are generic
// across IPv[46] unicast address families. // across IPv[46] unicast address families.
uses bgp-common-mp-all-afi-safi-common; uses mp-all-afi-safi-common;
} }
grouping bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common { grouping mp-l3vpn-ipv4-ipv6-multicast-common {
description description
"Common configuration applied across L3VPN for IPv4 "Common configuration applied across L3VPN for IPv4
and IPv6"; and IPv6";
// placeholder -- specific configuration options that are // placeholder -- specific configuration options that are
// generic across IPv[46] multicast address families. // generic across IPv[46] multicast address families.
uses bgp-common-mp-all-afi-safi-common; uses mp-all-afi-safi-common;
} }
grouping bgp-common-mp-l2vpn-common { grouping mp-l2vpn-common {
description description
"Common configuration applied across L2VPN address "Common configuration applied across L2VPN address
families"; families";
// placeholder -- specific configuration options that are // placeholder -- specific configuration options that are
// generic across L2VPN address families // generic across L2VPN address families
uses bgp-common-mp-all-afi-safi-common; uses mp-all-afi-safi-common;
} }
// Config groupings for common groups // Config groupings for common groups
grouping bgp-common-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-02-25.yang"
<CODE BEGINS> file "ietf-bgp-common-structure@2018-05-09.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 bgp-types; } 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;
// 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>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Authors: Keyur Patel, Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani, Susan Hares (shares at ndzh.com";
Susan Hares";
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 "2018-05-09" { revision "2019-02-25" {
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-common-structure-neighbor-group-logging-options { grouping structure-neighbor-group-logging-options {
description description
"Structural grouping used to include error handling "Structural grouping used to include error handling
configuration and state for both BGP neighbors and groups"; configuration and state for both BGP neighbors and groups";
container logging-options { container logging-options {
description description
"Logging options for events related to the BGP neighbor or "Logging options for events related to the BGP neighbor or
group"; group";
leaf log-neighbor-state-changes { leaf log-neighbor-state-changes {
type boolean; type boolean;
default "true"; default "true";
description description
"Configure logging of peer state changes. Default is to "Configure logging of peer state changes. Default is to
enable logging of peer state changes."; enable logging of peer state changes.";
} }
} }
} }
grouping bgp-common-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";
leaf enabled { leaf enabled {
skipping to change at page 30, line 50 skipping to change at page 41, line 41
leaf multihop-ttl { leaf multihop-ttl {
type uint8; type uint8;
description description
"Time-to-live value to use when packets are sent to the "Time-to-live value to use when packets are sent to the
referenced group or neighbors and ebgp-multihop is referenced group or neighbors and ebgp-multihop is
enabled"; enabled";
} }
} }
} }
grouping bgp-common-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";
leaf route-reflector-cluster-id { leaf route-reflector-cluster-id {
type bgp-types: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.";
} }
leaf route-reflector-client { leaf route-reflector-client {
type boolean; type boolean;
default "false"; default "false";
description description
"Configure the neighbor as a route reflector client."; "Configure the neighbor as a route reflector client.";
} }
} }
} }
grouping bgp-common-structure-neighbor-group-as-path-options { grouping structure-neighbor-group-as-path-options {
description description
"Structural grouping used to include AS_PATH manipulation "Structural grouping used to include AS_PATH manipulation
configuration and state for both BGP neighbors and peer configuration and state for both BGP neighbors and peer
groups"; groups";
container as-path-options { container as-path-options {
description description
"AS_PATH manipulation parameters for the BGP neighbor or "AS_PATH manipulation parameters for the BGP neighbor or
group"; group";
leaf allow-own-as { leaf allow-own-as {
skipping to change at page 32, line 11 skipping to change at page 42, line 50
leaf replace-peer-as { leaf replace-peer-as {
type boolean; type boolean;
default "false"; default "false";
description description
"Replace occurrences of the peer's AS in the AS_PATH with "Replace occurrences of the peer's AS in the AS_PATH with
the local autonomous system number"; the local autonomous system number";
} }
} }
} }
grouping bgp-common-structure-neighbor-group-add-paths { grouping structure-neighbor-group-add-paths {
description description
"Structural grouping used to include ADD-PATHs configuration "Structural grouping used to include ADD-PATHs configuration
and state for both BGP neighbors and peer groups"; and state for both BGP neighbors and peer groups";
container add-paths { container add-paths {
description description
"Parameters relating to the advertisement and receipt of "Parameters relating to the advertisement and receipt of
multiple paths for a single NLRI (add-paths)"; multiple paths for a single NLRI (add-paths)";
leaf receive { leaf receive {
skipping to change at page 32, line 49 skipping to change at page 43, line 40
} }
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@2018-05-09.yang" <CODE BEGINS> file "ietf-bgp-peer-group@2019-02-25.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
skipping to change at page 33, line 26 skipping to change at page 44, line 17
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>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Authors: Keyur Patel, Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani, Susan Hares (shares at ndzh.com";
Susan Hares";
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 "2018-05-09" { revision "2019-02-25" {
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.,
skipping to change at page 34, line 15 skipping to change at page 45, line 4
} }
} }
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 bgp-common-mp-afi-safi-config; uses mp-afi-safi-config;
container graceful-restart { container graceful-restart {
description description
"Parameters relating to BGP graceful-restart"; "Parameters relating to BGP graceful-restart";
uses bgp-common-mp-afi-safi-graceful-restart-config; uses mp-afi-safi-graceful-restart-config;
} }
uses bgp-common-route-selection-options; uses route-selection-options;
uses bgp-common-global-group-use-multiple-paths; uses global-group-use-multiple-paths;
uses bgp-common-mp-all-afi-safi-list-contents; uses mp-all-afi-safi-list-contents;
} }
} }
grouping bgp-peer-group-base { grouping bgp-peer-group-base {
description description
"Parameters related to a BGP group"; "Parameters related to a BGP group";
uses bgp-peer-group-config; uses bgp-peer-group-config;
uses bgp-common-neighbor-group-config; uses neighbor-group-config;
uses bgp-common-state; uses state;
container timers { container timers {
description description
"Timers related to a BGP peer-group"; "Timers related to a BGP peer-group";
uses bgp-common-neighbor-group-timers-config; uses neighbor-group-timers-config;
} }
container transport { container transport {
description description
"Transport session parameters for the BGP peer-group"; "Transport session parameters for the BGP peer-group";
uses bgp-common-neighbor-group-transport-config; uses neighbor-group-transport-config;
} }
container error-handling { container error-handling {
description description
"Error handling parameters used for the BGP peer-group"; "Error handling parameters used for the BGP peer-group";
uses bgp-common-neighbor-group-error-handling-config; uses neighbor-group-error-handling-config;
} }
container graceful-restart { container graceful-restart {
description description
"Parameters relating the graceful restart mechanism for BGP"; "Parameters relating the graceful restart mechanism for BGP";
uses bgp-common-graceful-restart-config; uses graceful-restart-config;
} }
uses bgp-common-structure-neighbor-group-logging-options; uses structure-neighbor-group-logging-options;
uses bgp-common-structure-neighbor-group-ebgp-multihop; uses structure-neighbor-group-ebgp-multihop;
uses bgp-common-structure-neighbor-group-route-reflector; uses structure-neighbor-group-route-reflector;
uses bgp-common-structure-neighbor-group-as-path-options; uses structure-neighbor-group-as-path-options;
uses bgp-common-structure-neighbor-group-add-paths; uses structure-neighbor-group-add-paths;
uses bgp-common-global-group-use-multiple-paths; uses global-group-use-multiple-paths;
uses rpol:apply-policy-group; uses rpol:apply-policy-group;
container afi-safis { container afi-safis {
description description
"Per-address-family configuration parameters associated with "Per-address-family configuration parameters associated with
thegroup"; thegroup";
uses bgp-peer-group-afi-safi-list; uses bgp-peer-group-afi-safi-list;
} }
} }
skipping to change at page 36, line 4 skipping to change at page 46, line 42
key "peer-group-name"; key "peer-group-name";
description description
"List of BGP peer-groups configured on the local system - "List of BGP peer-groups configured on the local system -
uniquely identified by peer-group name"; uniquely identified by peer-group name";
uses bgp-peer-group-base; uses bgp-peer-group-base;
} }
} }
} }
<CODE ENDS> <CODE ENDS>
<CODE BEGINS> file "ietf-bgp-neighbor@2018-05-09.yang"
submodule ietf-bgp-neighbor {
yang-version "1.1";
belongs-to ietf-bgp {
prefix "bgp";
}
import ietf-routing-policy { <CODE BEGINS> file "ietf-bgp-neighbor@2019-02-25.yang"
prefix rpol; submodule ietf-bgp-neighbor {
} yang-version "1.1";
import ietf-bgp-types { belongs-to ietf-bgp {
prefix bgp-types; prefix "bgp";
} }
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
// Include the common submodule import ietf-routing-policy {
include ietf-bgp-common; prefix rpol;
include ietf-bgp-common-multiprotocol; }
include ietf-bgp-peer-group; import ietf-bgp-types {
include ietf-bgp-common-structure; prefix bt;
}
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
// meta // Include the common submodule
organization include ietf-bgp-common;
"IETF IDR Working Group"; include ietf-bgp-common-multiprotocol;
include ietf-bgp-peer-group;
include ietf-bgp-common-structure;
contact // meta
"WG Web: <http://tools.ietf.org/wg/idr> organization
WG List: <idr@ietf.org> "IETF IDR Working Group";
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) contact
Authors: Keyur Patel, "WG Web: <http://tools.ietf.org/wg/idr>
Mahesh Jethanandani, WG List: <idr@ietf.org>
Susan Hares";
description Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
"This sub-module contains groupings that are specific to the Keyur Patel (keyur at arrcus.com),
neighbor context of the OpenConfig BGP module."; Susan Hares (shares at ndzh.com";
revision "2018-05-09" { description
description "This sub-module contains groupings that are specific to the
"Initial Version"; neighbor context of the OpenConfig BGP module.";
reference
"RFC XXX, BGP Model for Service Provider Network.";
} revision "2019-02-25" {
description
"Initial Version";
reference
"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";
container use-multiple-paths { container use-multiple-paths {
description description
"Parameters related to the use of multiple-paths for the same "Parameters related to the use of multiple-paths for the same
NLRI when they are received only from this neighbor"; NLRI when they are received only from this neighbor";
uses bgp-common-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 bgp-common-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 UPDATE {
type uint64; type uint64;
description description
"Number of BGP UPDATE messages announcing, withdrawing or "Number of BGP UPDATE messages announcing, withdrawing or
modifying paths exchanged."; modifying paths exchanged.";
} }
leaf NOTIFICATION { 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
"AFI,SAFI configuration available for the neighbour or
group";
uses bgp-common-mp-afi-safi-config; description
"AFI,SAFI configuration available for the neighbour or
group";
leaf active { uses mp-afi-safi-config;
type boolean;
config false;
description
"This value indicates whether a particular AFI-SAFI has
been succesfully negotiated with the peer. An AFI-SAFI may
be enabled in the current running configuration, but a
session restart may be required in order to negotiate the
new capability.";
}
container prefixes { leaf active {
config false; type boolean;
description "Prefix counters for the BGP session"; config false;
leaf received { description
type uint32; "This value indicates whether a particular AFI-SAFI has
description been successfully negotiated with the peer. An AFI-SAFI may
"The number of prefixes received from the neighbor"; be enabled in the current running configuration, but a
} session restart may be required in order to negotiate the
new capability.";
}
leaf sent { container prefixes {
type uint32; config false;
description description "Prefix counters for the BGP session";
"The number of prefixes advertised to the neighbor"; leaf received {
} type uint32;
description
"The number of prefixes received from the neighbor";
}
leaf installed { leaf sent {
type uint32; type uint32;
description description
"The number of advertised prefixes installed in the "The number of prefixes advertised to the neighbor";
Loc-RIB"; }
}
}
container graceful-restart { leaf installed {
description type uint32;
"Parameters relating to BGP graceful-restart"; description
"The number of advertised prefixes installed in the
Loc-RIB";
}
}
uses bgp-common-mp-afi-safi-graceful-restart-config; container graceful-restart {
description
"Parameters relating to BGP graceful-restart";
leaf received { uses mp-afi-safi-graceful-restart-config;
type boolean;
config false;
description
"This leaf indicates whether the neighbor advertised the
ability to support graceful-restart for this AFI-SAFI";
}
leaf advertised { leaf received {
type boolean; type boolean;
config false; config false;
description description
"This leaf indicates whether the ability to support "This leaf indicates whether the neighbor advertised the
graceful-restart has been advertised to the peer"; ability to support graceful-restart for this AFI-SAFI";
} }
}
uses bgp-common-mp-all-afi-safi-list-contents; leaf advertised {
uses bgp-neighbor-use-multiple-paths; type boolean;
} config false;
} description
"This leaf indicates whether the ability to support
graceful-restart has been advertised to the peer";
}
}
grouping bgp-neighbor-base { uses mp-all-afi-safi-list-contents;
description uses bgp-neighbor-use-multiple-paths;
"Parameters related to a BGP neighbor"; }
}
leaf peer-group { grouping bgp-neighbor-base {
type leafref { description
path "../../../peer-groups/peer-group/peer-group-name"; "Parameters related to a BGP neighbor";
}
description
"The peer-group with which this neighbor is associated";
}
leaf neighbor-address { leaf peer-group {
type inet:ip-address; type leafref {
description path "../../../peer-groups/peer-group/peer-group-name";
"Address of the BGP peer, either in IPv4 or IPv6"; }
} description
"The peer-group with which this neighbor is associated";
}
leaf enabled { leaf neighbor-address {
type boolean; type inet:ip-address;
default true; description
description "Address of the BGP peer, either in IPv4 or IPv6";
"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.";
} 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 bgp-common-neighbor-group-config; uses neighbor-group-config;
leaf session-state { leaf session-state {
type enumeration { type enumeration {
enum IDLE { enum IDLE {
description description
"neighbor is down, and in the Idle state of the FSM"; "neighbor is down, and in the Idle state of the FSM";
} }
enum CONNECT { enum CONNECT {
description description
"neighbor is down, and the session is waiting for the "neighbor is down, and the session is waiting for the
underlying transport session to be established"; underlying transport session to be established";
} }
enum ACTIVE { enum ACTIVE {
description description
"neighbor is down, and the local system is awaiting a "neighbor is down, and the local system is awaiting a
connection from the remote peer"; connection from the remote peer";
} }
enum OPENSENT { enum OPENSENT {
description description
"neighbor is in the process of being established. The "neighbor is in the process of being established. The
local system has sent an OPEN message"; local system has sent an OPEN message";
} }
enum OPENCONFIRM { enum OPENCONFIRM {
description description
"neighbor is in the process of being established. The "neighbor is in the process of being established. The
local system is awaiting a NOTIFICATION or KEEPALIVE local system is awaiting a NOTIFICATION or KEEPALIVE
message"; message";
} }
enum ESTABLISHED { enum ESTABLISHED {
description description
"neighbor is up - the BGP session with the peer is "neighbor is up - the BGP session with the peer is
established"; established";
} }
} }
config false; config false;
description description
"Operational state of the BGP peer"; "Operational state of the BGP peer";
} }
leaf last-established { leaf last-established {
// Was oc-types:timeticks64 // Was oc-types:timeticks64
type uint64; type uint64;
config false; config false;
description description
"This timestamp indicates the time that the BGP session last "This timestamp indicates the time that the BGP session last
transitioned in or out of the Established state. The value transitioned in or out of the Established state. The value
is the timestamp in seconds relative to the Unix Epoch (Jan is the timestamp in seconds relative to the Unix Epoch (Jan
1, 1970 00:00:00 UTC). 1, 1970 00:00:00 UTC).
The BGP session uptime can be computed by clients as the The BGP session uptime can be computed by clients as the
difference between this value and the current time in UTC difference between this value and the current time in UTC
(assuming the session is in the ESTABLISHED state, per the (assuming the session is in the ESTABLISHED state, per the
session-state leaf)."; 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 { leaf established-transitions {
type identityref { type yang:counter64;
base bgp-types:BGP_CAPABILITY; config false;
} description
config false; "Number of transitions to the Established state for the
description neighbor session. This value is analogous to the
"BGP capabilities negotiated as supported with the peer"; bgpPeerFsmEstablishedTransitions object from the standard
} BGP-4 MIB";
reference
"RFC 4273 - Definitions of Managed Objects for BGP-4";
}
container messages { leaf-list supported-capabilities {
config false; type identityref {
description base bt:BGP_CAPABILITY;
"Counters for BGP messages sent and received from the }
neighbor"; config false;
container sent { description
description "BGP capabilities negotiated as supported with the peer";
"Counters relating to BGP messages sent to the neighbor"; }
uses bgp-neighbor-counters-message-types-state;
}
container received { container messages {
description config false;
"Counters for BGP messages received from the neighbor"; description
uses bgp-neighbor-counters-message-types-state; "Counters for BGP messages sent and received from the
} neighbor";
} container sent {
container queues { description
config false; "Counters relating to BGP messages sent to the neighbor";
description uses bgp-neighbor-counters-message-types-state;
"Counters related to queued messages associated with the BGP }
neighbor";
leaf input { container received {
type uint32; description
description "Counters for BGP messages received from the neighbor";
"The number of messages received from the peer currently uses bgp-neighbor-counters-message-types-state;
queued"; }
} }
leaf output { container queues {
type uint32; config false;
description description
"The number of messages queued to be sent to the peer"; "Counters related to queued messages associated with the BGP
} neighbor";
}
container timers { leaf input {
description type uint32;
"Timers related to a BGP neighbor"; description
"The number of messages received from the peer currently
queued";
}
uses bgp-common-neighbor-group-timers-config; leaf output {
type uint32;
description
"The number of messages queued to be sent to the peer";
}
}
leaf negotiated-hold-time { container timers {
type decimal64 { description
fraction-digits 2; "Timers related to a BGP neighbor";
}
config false;
description
"The negotiated hold-time for the BGP session";
}
}
container transport { uses neighbor-group-timers-config;
description
"Transport session parameters for the BGP neighbor";
uses bgp-common-neighbor-group-transport-config; leaf negotiated-hold-time {
type decimal64 {
fraction-digits 2;
}
config false;
description
"The negotiated hold-time for the BGP session";
}
}
leaf local-port { container transport {
type inet:port-number; description
config false; "Transport session parameters for the BGP neighbor";
description
"Local TCP port being used for the TCP session supporting
the BGP session";
} uses neighbor-group-transport-config;
leaf remote-address { leaf local-port {
type inet:ip-address; type inet:port-number;
config false; config false;
description description
"Remote address to which the BGP session has been "Local TCP port being used for the TCP session supporting
established"; the BGP session";
} }
leaf remote-port { leaf remote-address {
type inet:port-number; type inet:ip-address;
config false; config false;
description description
"Remote port being used by the peer for the TCP session "Remote address to which the BGP session has been
supporting the BGP session"; established";
} }
}
container error-handling { leaf remote-port {
description type inet:port-number;
"Error handling parameters used for the BGP neighbor or config false;
group"; description
uses bgp-common-neighbor-group-error-handling-config; "Remote port being used by the peer for the TCP session
supporting the BGP session";
}
}
leaf erroneous-update-messages { container error-handling {
type uint32; description
config false; "Error handling parameters used for the BGP neighbor or
description group";
"The number of BGP UPDATE messages for which the uses neighbor-group-error-handling-config;
treat-as-withdraw mechanism has been applied based on
erroneous message contents";
}
}
container graceful-restart { leaf erroneous-update-messages {
description type uint32;
"Parameters relating the graceful restart mechanism for BGP"; config false;
description
"The number of BGP UPDATE messages for which the
treat-as-withdraw mechanism has been applied based on
erroneous message contents";
}
}
uses bgp-common-graceful-restart-config; container graceful-restart {
description
"Parameters relating the graceful restart mechanism for BGP";
leaf peer-restart-time { uses graceful-restart-config;
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 { leaf peer-restart-time {
type boolean; type uint16 {
config false; range 0..4096;
description }
"This flag indicates whether the remote neighbor is config false;
currently in the process of restarting, and hence received description
routes are currently stale"; "The period of time (advertised by the peer) that the peer
} expects a restart of a BGP session to take";
}
leaf local-restarting { leaf peer-restarting {
type boolean; type boolean;
config false; config false;
description description
"This flag indicates whether the local neighbor is "This flag indicates whether the remote neighbor is
currently restarting. The flag is unset after all NLRI currently in the process of restarting, and hence received
have been advertised to the peer, and the End-of-RIB (EOR) routes are currently stale";
marker has been unset"; }
}
leaf mode { leaf local-restarting {
type enumeration { type boolean;
enum HELPER_ONLY { config false;
description description
"The local router is operating in helper-only mode, and "This flag indicates whether the local neighbor is
hence will not retain forwarding state during a local currently restarting. The flag is unset after all NLRI
session restart, but will do so during a restart of have been advertised to the peer, and the End-of-RIB (EOR)
the remote peer"; marker has been unset";
} }
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 bgp-common-structure-neighbor-group-logging-options; leaf mode {
uses bgp-common-structure-neighbor-group-ebgp-multihop; type enumeration {
uses bgp-common-structure-neighbor-group-route-reflector; enum HELPER_ONLY {
uses bgp-common-structure-neighbor-group-as-path-options; description
uses bgp-common-structure-neighbor-group-add-paths; "The local router is operating in helper-only mode, and
uses bgp-neighbor-use-multiple-paths; hence will not retain forwarding state during a local
uses rpol:apply-policy-group; 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";
}
}
container afi-safis { uses structure-neighbor-group-logging-options;
description uses structure-neighbor-group-ebgp-multihop;
"Per-address-family configuration parameters associated with uses structure-neighbor-group-route-reflector;
the neighbor"; uses structure-neighbor-group-as-path-options;
uses bgp-neighbor-afi-safi-list; uses structure-neighbor-group-add-paths;
} uses bgp-neighbor-use-multiple-paths;
} uses rpol:apply-policy-group;
grouping bgp-neighbor-list { container afi-safis {
description description
"The list of BGP neighbors"; "Per-address-family configuration parameters associated with
the neighbor";
uses bgp-neighbor-afi-safi-list;
}
}
list neighbor { grouping bgp-neighbor-list {
key "neighbor-address"; description
description "The list of BGP neighbors";
"List of BGP neighbors configured on the local system,
uniquely identified by peer IPv[46] address";
uses bgp-neighbor-base; list neighbor {
} key "neighbor-address";
} description
} "List of BGP neighbors configured on the local system,
<CODE ENDS> uniquely identified by peer IPv[46] address";
<CODE BEGINS> file "ietf-bgp-global@2018-05-09.yang" uses bgp-neighbor-base;
}
}
}
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-global@2019-02-25.yang"
submodule ietf-bgp-global { submodule ietf-bgp-global {
yang-version "1.1"; yang-version "1.1";
belongs-to ietf-bgp { belongs-to ietf-bgp {
prefix bgp; prefix bgp;
} }
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
} }
import ietf-yang-types { import ietf-yang-types {
skipping to change at page 46, line 17 skipping to change at page 57, line 10
include ietf-bgp-common; include ietf-bgp-common;
include ietf-bgp-common-multiprotocol; include ietf-bgp-common-multiprotocol;
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>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Authors: Keyur Patel, Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani, Susan Hares (shares at ndzh.com";
Susan Hares";
description description
"This sub-module contains groupings that are specific to the "This sub-module contains groupings that are specific to the
global context of the BGP module"; global context of the BGP module";
revision "2018-05-09" { revision "2019-02-25" {
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-global-config { grouping bgp-global-config {
description description
"Global configuration options for the BGP router."; "Global configuration options for the BGP router.";
skipping to change at page 47, line 12 skipping to change at page 58, line 5
reference reference
"RFC4271 - A Border Gateway Protocol 4 (BGP-4), "RFC4271 - A Border Gateway Protocol 4 (BGP-4),
Section 4.2"; Section 4.2";
} }
} }
grouping bgp-global-state { grouping bgp-global-state {
description description
"Operational state parameters for the BGP neighbor"; "Operational state parameters for the BGP neighbor";
uses bgp-common-state; uses state;
} }
grouping bgp-global-default-route-distance-config { grouping bgp-global-default-route-distance-config {
description description
"Configuration options relating to the administrative distance "Configuration options relating to the administrative distance
(or preference) assigned to routes received from different (or preference) assigned to routes received from different
sources (external, internal, and local)."; sources (external, internal, and local).";
leaf external-route-distance { leaf external-route-distance {
type uint8 { type uint8 {
skipping to change at page 48, line 29 skipping to change at page 59, line 21
description description
"List of address-families associated with the BGP instance"; "List of address-families associated with the BGP instance";
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 bgp-common-mp-afi-safi-config; uses mp-afi-safi-config;
uses bgp-common-state; uses state;
container graceful-restart { container graceful-restart {
description description
"Parameters relating to BGP graceful-restart"; "Parameters relating to BGP graceful-restart";
uses bgp-common-mp-afi-safi-graceful-restart-config; uses mp-afi-safi-graceful-restart-config;
} }
uses bgp-common-route-selection-options; uses route-selection-options;
uses bgp-common-global-group-use-multiple-paths; uses global-group-use-multiple-paths;
uses bgp-common-mp-all-afi-safi-list-contents; uses mp-all-afi-safi-list-contents;
} }
} }
// Structural groupings // Structural groupings
grouping bgp-global-base { grouping bgp-global-base {
description description
"Global configuration parameters for the BGP router"; "Global configuration parameters for the BGP router";
uses bgp-global-config; uses bgp-global-config;
uses bgp-global-state; uses bgp-global-state;
skipping to change at page 49, line 24 skipping to change at page 60, line 18
description description
"Parameters indicating whether the local system acts as part "Parameters indicating whether the local system acts as part
of a BGP confederation"; of a BGP confederation";
uses bgp-global-confederation-config; uses bgp-global-confederation-config;
} }
container graceful-restart { container graceful-restart {
description description
"Parameters relating the graceful restart mechanism for BGP"; "Parameters relating the graceful restart mechanism for BGP";
uses bgp-common-graceful-restart-config; uses graceful-restart-config;
} }
uses bgp-common-global-group-use-multiple-paths; uses global-group-use-multiple-paths;
uses bgp-common-route-selection-options; uses route-selection-options;
container afi-safis { container afi-safis {
description description
"Address family specific configuration"; "Address family specific configuration";
uses bgp-global-afi-safi-list; uses bgp-global-afi-safi-list;
} }
} }
} }
<CODE ENDS> <CODE ENDS>
8. BGP types 7.2. BGP types
<CODE BEGINS> file "ietf-bgp-types@2018-05-09.yang" <CODE BEGINS> file "ietf-bgp-types@2019-02-25.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 "bgp-types"; prefix "bt";
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
} }
// 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>
skipping to change at page 50, line 15 skipping to change at page 61, line 7
} }
// 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>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com) Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
Authors: Keyur Patel, Keyur Patel (keyur at arrcus.com),
Mahesh Jethanandani, Susan Hares (shares at ndzh.com";
Susan Hares";
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 "2018-05-09" { revision "2019-02-25" {
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 { identity BGP_CAPABILITY {
description "Base identity for a BGP capability"; description "Base identity for a BGP capability";
} }
skipping to change at page 51, line 22 skipping to change at page 62, line 15
reference "RFC4724"; reference "RFC4724";
} }
identity ADD_PATHS { identity ADD_PATHS {
base BGP_CAPABILITY; base BGP_CAPABILITY;
description description
"BGP add-paths"; "BGP add-paths";
reference "draft-ietf-idr-add-paths"; reference "draft-ietf-idr-add-paths";
} }
identity AFI_SAFI_TYPE { identity afi-safi-type {
description description
"Base identity type for AFI,SAFI tuples for BGP-4"; "Base identity type for AFI,SAFI tuples for BGP-4";
reference "RFC4760 - multi-protocol extensions for BGP-4"; reference "RFC4760 - multi-protocol extensions for BGP-4";
} }
identity IPV4_UNICAST { identity ipv4-unicast {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"IPv4 unicast (AFI,SAFI = 1,1)"; "IPv4 unicast (AFI,SAFI = 1,1)";
reference "RFC4760"; reference "RFC4760";
} }
identity IPV6_UNICAST { identity ipv6-unicast {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"IPv6 unicast (AFI,SAFI = 2,1)"; "IPv6 unicast (AFI,SAFI = 2,1)";
reference "RFC4760"; reference "RFC4760";
} }
identity IPV4_LABELED_UNICAST { identity IPV4_LABELED_UNICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Labeled IPv4 unicast (AFI,SAFI = 1,4)"; "Labeled IPv4 unicast (AFI,SAFI = 1,4)";
reference "RFC3107"; reference "RFC3107";
} }
identity IPV6_LABELED_UNICAST { identity IPV6_LABELED_UNICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Labeled IPv6 unicast (AFI,SAFI = 2,4)"; "Labeled IPv6 unicast (AFI,SAFI = 2,4)";
reference "RFC3107"; reference "RFC3107";
} }
identity L3VPN_IPV4_UNICAST { identity L3VPN_IPV4_UNICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)";
reference "RFC4364"; reference "RFC4364";
} }
identity L3VPN_IPV6_UNICAST { identity L3VPN_IPV6_UNICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)";
reference "RFC4659"; reference "RFC4659";
} }
identity L3VPN_IPV4_MULTICAST { identity L3VPN_IPV4_MULTICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)";
reference "RFC6514"; reference "RFC6514";
} }
identity L3VPN_IPV6_MULTICAST { identity L3VPN_IPV6_MULTICAST {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)";
reference "RFC6514"; reference "RFC6514";
} }
identity L2VPN_VPLS { identity L2VPN_VPLS {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"BGP-signalled VPLS (AFI,SAFI = 25,65)"; "BGP-signalled VPLS (AFI,SAFI = 25,65)";
reference "RFC4761"; reference "RFC4761";
} }
identity L2VPN_EVPN { identity L2VPN_EVPN {
base AFI_SAFI_TYPE; base afi-safi-type;
description description
"BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)";
} }
identity BGP_WELL_KNOWN_STD_COMMUNITY { identity BGP_WELL_KNOWN_STD_COMMUNITY {
description description
"Reserved communities within the standard community space "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 0x00000000 to 0xFFFFFFFF";
reference "RFC1997"; reference "RFC1997";
skipping to change at page 53, line 48 skipping to change at page 64, line 40
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"; 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";
}
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";
}
identity as-sequence {
base as-path-segment-type;
description
"Ordered set of autonomous systems that a route in the UPDATE
message has traversed.";
reference
"RFC 5065";
}
identity as-confed-sequence {
base as-path-segment-type;
description
"Ordered set of Member Autonomous Systems in the local
confederation that the UPDATE message has traversed.";
reference
"RFC 5065";
}
identity as-confed-set {
base as-path-segment-type;
description
"Unordered set of Member Autonomous Systems in the local
confederation that the UPDATE message has traversed.";
reference
"RFC 5065";
}
typedef bgp-session-direction { typedef bgp-session-direction {
type enumeration { type enumeration {
enum INBOUND { enum INBOUND {
description description
"Refers to all NLRI received from the BGP peer"; "Refers to all NLRI received from the BGP peer";
} }
enum OUTBOUND { enum OUTBOUND {
description description
"Refers to all NLRI advertised to the BGP peer"; "Refers to all NLRI advertised to the BGP peer";
} }
skipping to change at page 57, line 16 skipping to change at page 69, line 4
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 autonmous 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
skipping to change at page 58, line 39 skipping to change at page 70, line 27
} }
description description
"type describing variations of community attributes: "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>
9. BGP policy data 7.3. BGP policy data
<CODE BEGINS> file "ietf-bgp-policy@2018-05-09.yang" <CODE BEGINS> file "ietf-bgp-policy@2019-02-25.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";
prefix "bp";
// namespace // import some basic types
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; import ietf-inet-types {
prefix inet;
}
import ietf-routing-policy {
prefix rpol;
}
import ietf-bgp-types {
prefix bt;
}
prefix "bgp-pol"; import ietf-routing-types {
prefix rt-types;
}
// import some basic types organization
import ietf-inet-types { "IETF IDR Working Group";
prefix inet;
} contact
import ietf-routing-policy { "WG Web: <http://tools.ietf.org/wg/idr>
prefix rpol; 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 module contains data definitions for BGP routing policy.
It augments the base routing-policy module with BGP-specific
options for conditions and actions.";
revision "2019-02-25" {
description
"Initial Version";
reference
"RFC XXX, BGP Model for Service Provider Network.";
}
// typedef statements
typedef bgp-set-community-option-type {
type enumeration {
enum ADD {
description
"add the specified communities to the existing
community attribute";
}
enum REMOVE {
description
"remove the specified communities from the
existing community attribute";
}
enum REPLACE {
description
"replace the existing community attribute with
the specified communities. If an empty set is
specified, this removes the community attribute
from the route.";
}
} }
import ietf-bgp-types { description
prefix bgp-types; "Type definition for options when setting the community
attribute in a policy action";
}
typedef bgp-next-hop-type {
type union {
type inet:ip-address-no-zone;
type enumeration {
enum SELF {
description "special designation for local router's own
address, i.e., next-hop-self";
}
}
} }
description
"type definition for specifying next-hop in policy actions";
}
import ietf-routing-types { typedef bgp-set-med-type {
prefix rt-types; type union {
type uint32;
type string {
pattern "^[+-][0-9]+";
}
type enumeration {
enum IGP {
description "set the MED value to the IGP cost toward the
next hop for the route";
}
}
} }
description
"Type definition for specifying how the BGP MED can
be set in BGP policy actions. The three choices are to set
the MED directly, increment/decrement using +/- notation,
and setting it to the IGP cost (predefined value).";
}
// meta // augment statements
organization
"IETF IDR Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/idr>
WG List: <idr@ietf.org>
Editor: Mahesh Jethanandani (mjethanandani@gmail.com)
Authors: Keyur Patel,
Mahesh Jethanandani,
Susan Hares";
augment "/rpol:routing-policy/rpol:defined-sets" {
description description
"This module contains data definitions for BGP routing policy. "Adds BGP defined sets container to routing policy model.";
It augments the base routing-policy module with BGP-specific
options for conditions and actions.";
revision "2018-05-09" { container bgp-defined-sets {
description description
"Initial Version"; "BGP-related set definitions for policy match conditions";
reference
"RFC XXX, BGP Model for Service Provider Network.";
}
// typedef statements container community-sets {
description
"Enclosing container for list of defined BGP community sets";
typedef bgp-set-community-option-type { list community-set {
type enumeration { key "community-set-name";
enum ADD {
description description
"add the specified communities to the existing "List of defined BGP community sets";
community attribute";
leaf community-set-name {
type string;
mandatory true;
description
"name / label of the community set -- this is used to
reference the set in match conditions";
}
leaf-list community-member {
type union {
type bt:bgp-std-community-type;
type bt:bgp-community-regexp-type;
type bt:bgp-well-known-community-type;
}
description
"members of the community set";
}
} }
enum REMOVE { }
container ext-community-sets {
description
"Enclosing container for list of extended BGP community
sets";
list ext-community-set {
key "ext-community-set-name";
description description
"remove the specified communities from the "List of defined extended BGP community sets";
existing community attribute";
leaf ext-community-set-name {
type string;
description
"name / label of the extended community set -- this is
used to reference the set in match conditions";
}
leaf-list ext-community-member {
type union {
type rt-types:route-target;
type bt:bgp-community-regexp-type;
}
description
"members of the extended community set";
}
} }
enum REPLACE { }
container as-path-sets {
description
"Enclosing container for list of define AS path sets";
list as-path-set {
key "as-path-set-name";
description description
"replace the existing community attribute with "List of defined AS path sets";
the specified communities. If an empty set is
specified, this removes the community attribute leaf as-path-set-name {
from the route."; type string;
description
"name of the AS path set -- this is used to reference the
set in match conditions";
}
leaf-list as-path-set-member {
// TODO: need to refine typedef for AS path expressions
type string;
description
"AS path expression -- list of ASes in the set";
}
} }
} }
description
"Type definition for options when setting the community
attribute in a policy action";
} }
}
typedef bgp-next-hop-type { grouping as-path-prepend-top {
type union { description
type inet:ip-address-no-zone; "Top-level grouping for the AS path prepend action";
type enumeration {
enum SELF { }
description "special designation for local router's own
address, i.e., next-hop-self"; grouping set-community-action-common {
} description
"Common leaves for set-community and set-ext-community
actions";
leaf method {
type enumeration {
enum INLINE {
description
"The extended communities are specified inline as a
list";
}
enum REFERENCE {
description
"The extended communities are specified by referencing a
defined ext-community set";
} }
} }
description description
"type definition for specifying next-hop in policy actions"; "Indicates the method used to specify the extended
communities for the set-ext-community action";
} }
typedef bgp-set-med-type { leaf options {
type union { type bgp-set-community-option-type;
description
"Options for modifying the community attribute with
the specified values. These options apply to both
methods of setting the community attribute.";
}
}
augment "/rpol:routing-policy/rpol:policy-definitions/" +
"rpol:policy-definition/rpol:statements/rpol:statement/" +
"rpol:conditions" {
description
"BGP policy conditions added to routing policy module";
container bgp-conditions {
description
"Top-level container for BGP specific policy conditions ";
leaf med-eq {
type uint32; type uint32;
type string { description
pattern "^[+-][0-9]+"; "Condition to check if the received MED value is equal to
the specified value";
}
leaf origin-eq {
type bt:bgp-origin-attr-type;
description
"Condition to check if the route origin is equal to the
specified value";
}
leaf-list next-hop-in {
type inet:ip-address-no-zone;
description
"List of next hop addresses to check for in the route
update";
}
leaf-list afi-safi-in {
type identityref {
base bt:afi-safi-type;
} }
description
"List of address families which the NLRI may be within";
}
leaf local-pref-eq {
type uint32;
// TODO: add support for other comparisons if needed
description
"Condition to check if the local pref attribute is equal to
the specified value";
}
leaf route-type {
// TODO: verify extent of vendor support for this comparison
type enumeration { type enumeration {
enum IGP { enum INTERNAL {
description "set the MED value to the IGP cost toward the description "route type is internal";
next hop for the route"; }
enum EXTERNAL {
description "route type is external";
} }
} }
description
"Condition to check the route type in the route update";
} }
description
"Type definition for specifying how the BGP MED can
be set in BGP policy actions. The three choices are to set
the MED directly, increment/decrement using +/- notation,
and setting it to the IGP cost (predefined value).";
}
// grouping statements container community-count {
description
"Value and comparison operations for conditions based on the
number of communities in the route update";
}
grouping match-community-top { container as-path-length {
description description
"Top-level grouping for match conditions on communities"; "Value and comparison operations for conditions based on the
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/" +
"bgp-pol:bgp-defined-sets/bgp-pol:community-sets/" + "bp:bgp-defined-sets/bp:community-sets/" +
"bgp-pol:community-set/bgp-pol: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;
} }
}
grouping match-ext-community-top {
description
"Top-level grouping for match conditions on extended
communities";
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/" +
"bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/" + "bp:bgp-defined-sets/bp:ext-community-sets/" +
"bgp-pol:ext-community-set/" + "bp:ext-community-set/" +
"bgp-pol: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;
} }
}
grouping match-as-path-top {
description
"Top-level grouping for match conditions on AS path set";
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/" +
"bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/" + "bp:bgp-defined-sets/bp:as-path-sets/" +
"bgp-pol:as-path-set/bgp-pol:as-path-set-name"; "bp:as-path-set/bp:as-path-set-name";
} }
description "References a defined AS path set"; description
"References a defined AS path set";
} }
uses rpol:match-set-options-group; uses rpol:match-set-options-group;
} }
} }
}
grouping bgp-match-set-conditions { augment "/rpol:routing-policy/rpol:policy-definitions/" +
description "rpol:policy-definition/rpol:statements/rpol:statement/" +
"Condition statement definitions for checking membership in a "rpol:actions" {
defined set"; description
"BGP policy actions added to routing policy module.";
uses match-community-top;
uses match-ext-community-top;
uses match-as-path-top;
}
grouping community-count-top { container bgp-actions {
description description
"Top-level grouping for community count condition"; "Top-level container for BGP-specific actions";
container community-count { leaf set-route-origin {
type bt:bgp-origin-attr-type;
description description
"Value and comparison operations for conditions based on the "set the origin attribute to the specified value";
number of communities in the route update";
} }
}
grouping as-path-length-top { leaf set-local-pref {
description type uint32;
"Top-level grouping for AS path length condition"; description
"set the local pref attribute on the route update";
}
container as-path-length { leaf set-next-hop {
type bgp-next-hop-type;
description description
"Value and comparison operations for conditions based on the "set the next-hop attribute in the route update";
length of the AS path in the route update";
} }
}
grouping bgp-conditions-top { leaf set-med {
description type bgp-set-med-type;
"Top-level grouping for BGP-specific policy conditions"; description
"set the med metric attribute in the route update";
}
container bgp-conditions { container set-as-path-prepend {
description description
"Top-level container "; "action to prepend local AS number to the AS-path a
specified number of times";
leaf med-eq { leaf repeat-n {
type uint32; type uint8 {
range 1..max;
}
description description
"Condition to check if the received MED value is equal to "Number of times to prepend the local AS number to the AS
the specified value"; path. The value should be between 1 and the maximum
supported by the implementation.";
} }
}
leaf origin-eq { container set-community {
type bgp-types:bgp-origin-attr-type; description
description "Action to set the community attributes of the route, along
"Condition to check if the route origin is equal to the with options to modify how the community is modified.
specified value"; Communities may be set using an inline list OR
} reference to an existing defined set (not both).";
leaf-list next-hop-in { uses set-community-action-common;
type inet:ip-address-no-zone; container inline {
when "../config/method=INLINE" {
description
"Active only when the set-community method is INLINE";
}
description description
"List of next hop addresses to check for in the route "Set the community values for the action inline with
update"; a list.";
}
leaf-list afi-safi-in { leaf-list communities {
type identityref { type union {
base bgp-types:AFI_SAFI_TYPE; type bt:bgp-std-community-type;
type bt:bgp-well-known-community-type;
}
description
"Set the community values for the update inline with a
list.";
} }
description
"List of address families which the NLRI may be within";
} }
leaf local-pref-eq { container reference {
type uint32; when "../config/method=REFERENCE" {
// TODO: add support for other comparisons if needed description
"Active only when the set-community method is REFERENCE";
}
description description
"Condition to check if the local pref attribute is equal to "Provide a reference to a defined community set for the
the specified value"; set-community action";
}
leaf route-type { leaf community-set-ref {
// TODO: verify extent of vendor support for this comparison type leafref {
type enumeration { path "/rpol:routing-policy/rpol:defined-sets/" +
enum INTERNAL { "bp:bgp-defined-sets/" +
description "route type is internal"; "bp:community-sets/bp:community-set/" +
} "bp:community-set-name";
enum EXTERNAL {
description "route type is external";
} }
description
"References a defined community set by name";
} }
description
"Condition to check the route type in the route update";
} }
uses community-count-top;
uses as-path-length-top;
uses bgp-match-set-conditions;
} }
}
grouping community-set-top {
description
"Top-level grouping for BGP community sets";
container community-sets { container set-ext-community {
description description
"Enclosing container for list of defined BGP community sets"; "Action to set the extended community attributes of the
route, along with options to modify how the community is
list community-set { modified. Extended communities may be set using an inline
key "community-set-name"; list OR a reference to an existing defined set (but not
description both).";
"List of defined BGP community sets";
leaf community-set-name { uses set-community-action-common;
type string; container inline {
mandatory true; when "../config/method=INLINE" {
description description
"name / label of the community set -- this is used to "Active only when the set-community method is INLINE";
reference the set in match conditions";
} }
description
"Set the extended community values for the action inline
with a list.";
leaf-list community-member { leaf-list communities {
type union { type union {
type bgp-types:bgp-std-community-type; type rt-types:route-target;
type bgp-types:bgp-community-regexp-type; type bt:bgp-well-known-community-type;
type bgp-types:bgp-well-known-community-type;
} }
description description
"members of the community set"; "Set the extended community values for the update inline
with a list.";
} }
} }
}
}
grouping ext-community-set-top {
description
"Top-level grouping for extended BGP community sets";
container ext-community-sets { container reference {
description when "../config/method=REFERENCE" {
"Enclosing container for list of extended BGP community
sets";
list ext-community-set {
key "ext-community-set-name";
description
"List of defined extended BGP community sets";
leaf ext-community-set-name {
type string;
description description
"name / label of the extended community set -- this is "Active only when the set-community method is REFERENCE";
used to reference the set in match conditions";
} }
description
"Provide a reference to an extended community set for the
set-ext-community action";
leaf-list ext-community-member { leaf ext-community-set-ref {
type union { type leafref {
type rt-types:route-target; path
type bgp-types:bgp-community-regexp-type; "/rpol:routing-policy/rpol:defined-sets/" +
"bp:bgp-defined-sets/bp:ext-community-sets/" +
"bp:ext-community-set/" +
"bp:ext-community-set-name";
} }
description description
"members of the extended community set"; "References a defined extended community set by name";
} }
} }
} }
}
}
// rpc statements
// notification statements
}
<CODE ENDS>
7.4. RIB modules
<CODE BEGINS> file "ietf-bgp-rib@2019-02-25.yang"
module ietf-bgp-rib {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib";
prefix "br";
/*
* Import and Include
*/
import ietf-routing {
prefix "rt";
reference
"RFC 8349: YANG Route Management.";
}
import ietf-bgp-types {
prefix "bt";
reference
"RFC XXXX: BGP YANG Model for Service Provider Networks.";
}
include ietf-bgp-rib-tables;
include ietf-bgp-rib-shared-attributes;
// groupings of attributes in three categories:
// - shared across multiple routes
// - common to LOC-RIB and Adj-RIB, but not shared across routes
// - specific to LOC-RIB or Adj-RIB
include ietf-bgp-rib-attributes;
// groupings of annotations for each route or table
include ietf-bgp-rib-table-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
"Defines a data model for representing BGP routing table (RIB)
contents. The model supports 5 logical RIBs per address family:
loc-rib: This is the main BGP routing table for the local routing
instance, containing best-path selections for each prefix. The
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
updates received from the neighbor before any local input policy
rules or filters have been applied. This can be considered the
'raw' updates from a given neighbor.
adj-rib-in-post: This is a per-neighbor table containing the
routes received from the neighbor that are eligible for
best-path selection after local input policy rules have been
applied.
adj-rib-out-pre: This is a per-neighbor table containing routes
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-02-25" {
description
"Initial Version";
reference
"RFC XXXX, BGP YANG Model for Service Provider Network.";
}
augment "/rt:routing/rt:ribs" {
when "derived-from-or-self(../rt:control-plane-protocols/" +
"rt:control-plane-protocol/rt:type, 'bgp')" {
description
"This augmentation is only valid for routes whose control
plane protocol is BGP.";
}
description
"Support for RIBS.";
container rib {
config false;
description
"Top level container for BGP RIB";
uses attribute-sets;
uses community-sets;
uses ext-community-sets;
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 ipv4-unicast {
when "../afi-safi-name = 'bt:ipv4-unicast'" {
description
"Include this container for IPv4 unicast RIB";
}
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;
}
container ipv4-srte-policy {
when "../afi-safi-name = 'bt:srte-policy-ipv4'" {
description
"Include this container only for the IPv4 AFI, SR-TE
Policy SAFI.";
}
description
"Routing tables for the IPv4 Unicast, SR-TE Policy
SAFI.";
uses ipvX-srte-policy-locrib;
uses ipvX-srte-policy-adjrib;
}
container ipv6-srte-policy {
when "../afi-safi-name = 'bt:srte-policy-ipv6'" {
description
"Include this container only for the IPv6 AFI,
SR-TE Policy SAFI.";
}
description
"Routing tables for the IPv6 Unicast, SR-TE Policy
SAFI.";
uses ipvX-srte-policy-locrib;
uses ipvX-srte-policy-adjrib;
}
}
}
}
}
}
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-ext@2019-02-25.yang"
module ietf-bgp-rib-ext {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext";
prefix "bre";
import ietf-routing {
prefix "rt";
reference
"RFC 8349: YANG Routing Management.";
}
import ietf-bgp-rib {
prefix bgprib;
}
import ietf-bgp-rib-types {
prefix bgpribt;
} }
grouping as-path-set-top { organization
description "IETF IDR Working Group";
"Top-level grouping for AS path sets";
container as-path-sets { contact
description "WG Web: <http://tools.ietf.org/wg/idr>
"Enclosing container for list of define AS path sets"; WG List: <idr@ietf.org>
list as-path-set { Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
key "as-path-set-name"; Keyur Patel (keyur at arrcus.com),
description Susan Hares (shares at ndzh.com";
"List of defined AS path sets";
leaf as-path-set-name { description
type string; "Defines additional data nodes for the OpenConfig BGP RIB model.
description These items reflect extensions that are desirable features but
"name of the AS path set -- this is used to reference the are not currently supported in a majority of BGP
set in match conditions"; implementations.";
}
leaf-list as-path-set-member { revision "2019-02-25" {
// TODO: need to refine typedef for AS path expressions description
type string; "Initial Revision.";
description reference
"AS path expression -- list of ASes in the set"; "RFC XXXX: BGP YANG Model for Service Providers.";
}
grouping rib-ext-route-annotations {
description
"Extended annotations for routes in the routing tables";
leaf reject-reason {
type union {
type identityref {
base bgpribt:bgp-not-selected-bestpath;
}
type identityref {
base bgpribt:bgp-not-selected-policy;
} }
} }
description
"Indicates the reason the route is not used, either due to
policy filtering or bestpath selection";
} }
} }
// augment statements augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv4-unicast/bgprib:loc-rib/" +
"bgprib:routes/bgprib:route" {
description
"Add extended annotations to the Loc-RIB for IPv4";
augment "/rpol:routing-policy/rpol:defined-sets" { uses rib-ext-route-annotations;
description "adds BGP defined sets container to routing policy }
model";
container bgp-defined-sets { augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv6-unicast/bgprib:loc-rib/" +
"bgprib:routes/bgprib:route" {
description description
"BGP-related set definitions for policy match conditions"; "Add extended annotations to the Loc-RIB for IPv6";
uses community-set-top; uses rib-ext-route-annotations;
uses ext-community-set-top;
uses as-path-set-top;
}
} }
grouping as-path-prepend-top {
description
"Top-level grouping for the AS path prepend action";
container set-as-path-prepend { augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv4-unicast/" +
"bgprib:neighbors/bgprib:neighbor/" +
"bgprib:adj-rib-in-pre/bgprib:routes/bgprib:route" {
description description
"action to prepend local AS number to the AS-path a "Add extended annotations to Adj-RIB for IPv4";
specified number of times";
leaf repeat-n { uses rib-ext-route-annotations;
type uint8 {
range 1..max;
}
description
"Number of times to prepend the local AS number to the AS
path. The value should be between 1 and the maximum
supported by the implementation.";
}
}
} }
grouping set-community-action-common { augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
description "bgprib:afi-safi/bgprib:ipv4-unicast/" +
"Common leaves for set-community and set-ext-community "bgprib:neighbors/bgprib:neighbor/" +
actions"; "bgprib:adj-rib-in-post/bgprib:routes/bgprib:route" {
description
"Add extended annotations to Adj-RIB for IPv4";
leaf method { uses rib-ext-route-annotations;
type enumeration { }
enum INLINE {
description augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"The extended communities are specified inline as a "bgprib:afi-safi/bgprib:ipv4-unicast/" +
list"; "bgprib:neighbors/bgprib:neighbor/" +
} "bgprib:adj-rib-out-pre/bgprib:routes/bgprib:route" {
enum REFERENCE {
description
"The extended communities are specified by referencing a
defined ext-community set";
}
}
description description
"Indicates the method used to specify the extended "Add extended annotations to Adj-RIB for IPv4";
communities for the set-ext-community action";
}
leaf options { uses rib-ext-route-annotations;
type bgp-set-community-option-type; }
augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv4-unicast/" +
"bgprib:neighbors/bgprib:neighbor/" +
"bgprib:adj-rib-out-post/bgprib:routes/bgprib:route" {
description description
"Options for modifying the community attribute with "Add extended annotations to Adj-RIB for IPv4";
the specified values. These options apply to both
methods of setting the community attribute."; uses rib-ext-route-annotations;
}
} }
grouping set-community-inline-top { augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
description "bgprib:afi-safi/bgprib:ipv6-unicast/" +
"Top-level grouping or inline specification of set-community "bgprib:neighbors/bgprib:neighbor/" +
action"; "bgprib:adj-rib-in-pre/bgprib:routes/bgprib:route" {
description
"Add extended annotations to Adj-RIB for IPv6";
container inline { uses rib-ext-route-annotations;
when "../config/method=INLINE" { }
description augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"Active only when the set-community method is INLINE"; "bgprib:afi-safi/bgprib:ipv6-unicast/" +
} "bgprib:neighbors/bgprib:neighbor/" +
"bgprib:adj-rib-in-post/bgprib:routes/bgprib:route" {
description description
"Set the community values for the action inline with "Add extended annotations to Adj-RIB for IPv6";
a list.";
leaf-list communities { uses rib-ext-route-annotations;
type union {
type bgp-types:bgp-std-community-type;
type bgp-types:bgp-well-known-community-type;
}
description
"Set the community values for the update inline with a
list.";
}
}
} }
grouping set-community-reference-top { augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv6-unicast/" +
"bgprib:neighbors/bgprib:neighbor/" +
"bgprib:adj-rib-out-pre/bgprib:routes/bgprib:route" {
description
"Add extended annotations to Adj-RIB for IPv6";
uses rib-ext-route-annotations;
}
augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" +
"bgprib:afi-safi/bgprib:ipv6-unicast/" +
"bgprib:neighbors/bgprib:neighbor/" +
"bgprib:adj-rib-out-post/bgprib:routes/bgprib:route" {
description
"Add extended annotations to Adj-RIB for IPv6";
uses rib-ext-route-annotations;
}
}
<CODE ENDS>
<CODE BEGINS> file "ietf-bgp-rib-types@2019-02-25.yang"
module ietf-bgp-rib-types {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types";
prefix "brt";
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
"Defines identity and type definitions associated with
the BGP RIB modules";
revision "2019-02-25" {
description description
"Top-level grouping for referencing a community-set in the "Initial Version";
set-community action"; reference
"RFC XXX, BGP Model for Service Provider Network.";
}
container reference { identity invalid-route-reason {
when "../config/method=REFERENCE" { description
description "Base identity for reason code for routes that are rejected as
"Active only when the set-community method is REFERENCE"; invalid. Some derived entities are based on BMP v3";
} reference
"BGP Monitoring Protocol (draft-ietf-grow-bmp-07)";
}
identity invalid-cluster-loop {
base invalid-route-reason;
description
"Route was invalid due to CLUSTER_LIST loop";
}
identity invalid-as-loop {
base invalid-route-reason;
description
"Route was invalid due to AS_PATH loop";
}
identity invalid-originator {
base invalid-route-reason;
description
"Route was invalid due to ORIGINATOR_ID, e.g., update has
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 {
description
"Base identity for indicating reason a route was was not
selected by BGP route selection algorithm";
reference
"RFC 4271 - Section 9.1";
}
identity local-pref-lower {
base bgp-not-selected-bestpath;
description
"Route has a lower localpref attribute than current best path";
reference
"RFC 4271 - Section 9.1.2";
}
identity as-path-longer {
base bgp-not-selected-bestpath;
description
"Route has a longer AS path attribute than current best path";
reference
"RFC 4271 - Section 9.1.2.2 (a)";
}
identity origin-type-higher {
base bgp-not-selected-bestpath;
description
"Route has a higher origin type, i.e., IGP origin is preferred
over EGP or incomplete";
reference
"RFC 4271 - Section 9.1.2.2 (b)";
}
identity med-higher {
base bgp-not-selected-bestpath;
description
"Route has a higher MED, or metric, attribute than the current
best path";
reference
"RFC 4271 - Section 9.1.2.2 (c)";
}
identity prefer-external {
base bgp-not-selected-bestpath;
description
"Route source is via IGP, rather than EGP.";
reference
"RFC 4271 - Section 9.1.2.2 (d)";
}
identity nexthop-cost-higher {
base bgp-not-selected-bestpath;
description
"Route has a higher interior cost to the next hop.";
reference
"RFC 4271 - Section 9.1.2.2 (e)";
}
identity higher-router-id {
base bgp-not-selected-bestpath;
description
"Route was sent by a peer with a higher BGP Identifier value,
or router id";
reference
"RFC 4271 - Section 9.1.2.2 (f)";
}
identity higher-peer-address {
base bgp-not-selected-bestpath;
description
"Route was sent by a peer with a higher IP address";
reference
"RFC 4271 - Section 9.1.2.2 (g)";
}
identity bgp-not-selected-policy {
description
"Base identity for reason code for routes that are rejected
due to policy";
}
identity rejected-import-policy {
base bgp-not-selected-policy;
description
"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 BEGINS> file "ietf-bgp-rib-attributes@2019-02-25.yang"
submodule ietf-bgp-rib-attributes {
yang-version "1.1";
belongs-to ietf-bgp-rib {
prefix "br";
}
// import some basic types
import ietf-bgp-types {
prefix bgpt;
}
import ietf-bgp-rib-types {
prefix bgprt;
}
import ietf-inet-types {
prefix inet;
}
// meta
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 common data definitions for BGP
attributes for use in BGP RIB tables.";
revision "2019-02-25" {
description
"Initial version";
reference
"RFC XXXX: BGP YANG Model for Service Provider Network";
}
grouping bgp-as-path-attr {
description
"Data for representing BGP AS-PATH attribute";
leaf type {
type identityref {
base bgpt:as-path-segment-type;
}
description
"The type of AS-PATH segment";
}
leaf-list member {
type inet:as-number;
description
"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 {
description
"Common definition of BGP community attributes";
leaf-list community {
type union {
type bgpt:bgp-well-known-community-type;
type bgpt:bgp-std-community-type;
}
description
"List of standard or well-known BGP community
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 {
description
"Operational state data for path attribute flags";
leaf optional {
type boolean;
description
"Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf transitive {
type boolean;
description
"Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false). For
well-known attributes, the transitive flag must be set to
true. Set in the second high-order bit of the BGP attribute
flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf partial {
type boolean;
description
"Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false). For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false. Set in the third high-order bit of
the BGP attribute flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf extended {
type boolean;
description
"Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true). Set in
the fourth high-order bit of the BGP attribute flags
octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
}
grouping bgp-unknown-attr-state {
description
"Operational state data for path attributes not shared
across route entries, common to LOC-RIB and Adj-RIB";
leaf attr-type {
type uint8;
description
"1-octet value encoding the attribute type code";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf attr-len {
type uint16;
description
"One or two octet attribute length field indicating the
length of the attribute data in octets. If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf attr-value {
type binary {
length 1..65535;
}
description
"Raw attribute value, not including the attribute
flags, type, or length. The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
}
grouping bgp-unknown-attr-top {
description
"Unknown path attributes that are not expected to be shared
across route entries, common to LOC-RIB and Adj-RIB";
container unknown-attributes {
description
"Unknown path attributes that were received in the UPDATE
message which contained the prefix.";
list unknown-attribute {
key "attr-type";
description
"This list contains received attributes that are unrecognized
or unsupported by the local router. The list may be empty.";
uses bgp-unknown-attr-flags-state;
uses bgp-unknown-attr-state;
}
}
}
grouping bgp-loc-rib-attr-state {
description
"Path attributes that are not expected to be shared across
route entries, specific to LOC-RIB";
}
grouping bgp-adj-rib-attr-state {
description
"Path attributes that are not expected to be shared across
route entries, specific to Adj-RIB";
leaf path-id {
type uint32;
description
"When the BGP speaker supports advertisement of multiple
paths for a prefix, the path identifier is used to
uniquely identify a route based on the combination of the
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,
if used, it should represent a locally generated path-id
value for the corresponding route. In Adj-RIB-Out, it
should be the value sent to a neighbor when add-paths is
used, i.e., the capability has been negotiated.";
reference
"draft-ietf-idr-add-paths - Advertisement of Multiple Paths
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 "bgprt: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 "bgprt:tunnel-encapsulation-subtlv-type";
}
description
"Type of the sub-TLV within the tunnel encapsulation
attribute";
}
leaf-list colors {
when "../type = 'bgprt: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 = 'bgprt: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 = 'bgprt: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 = 'bgprt: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 = 'bgprt: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 BEGINS> file "ietf-bgp-rib-shared-attributes@2019-02-25.yang"
submodule ietf-bgp-rib-shared-attributes {
yang-version "1.1";
belongs-to ietf-bgp-rib {
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-02-25" {
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 description
"Provide a reference to a defined community set for the "Enclosing container for the list of path attribute sets";
set-community action";
list attr-set {
key "index";
leaf community-set-ref {
type leafref {
path "/rpol:routing-policy/rpol:defined-sets/" +
"bgp-pol:bgp-defined-sets/" +
"bgp-pol:community-sets/bgp-pol:community-set/" +
"bgp-pol:community-set-name";
}
description description
"References a defined community set by name"; "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 set-community-action-top { grouping community-sets {
description description
"Top-level grouping for the set-community action"; "Top level grouping for list of shared community attribute
sets";
container set-community { container communities {
description description
"Action to set the community attributes of the route, along "Enclosing container for the list of community attribute
with options to modify how the community is modified. sets";
Communities may be set using an inline list OR
reference to an existing defined set (not both).";
uses set-community-action-common; list community {
uses set-community-inline-top; key "index";
uses set-community-reference-top;
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 set-ext-community-inline-top { grouping ext-community-sets {
description description
"Top-level grouping or inline specification of "Top level grouping for list of extended community attribute
set-ext-community action"; sets";
container inline { container ext-communities {
when "../config/method=INLINE" {
description
"Active only when the set-community method is INLINE";
}
description description
"Set the extended community values for the action inline with "Enclosing container for the list of extended community
a list."; attribute sets";
leaf-list communities { list ext-community {
type union { key "index";
type rt-types:route-target;
type bgp-types:bgp-well-known-community-type; config false;
}
description description
"Set the extended community values for the update inline "List of path attributes that may be in use by multiple
with a list."; 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-extended-community-attr-state;
} }
} }
} }
}
<CODE ENDS>
grouping set-ext-community-reference-top { <CODE BEGINS> file "ietf-bgp-rib-table-attributes@2019-02-25.yang"
submodule ietf-bgp-rib-table-attributes {
yang-version "1.1";
belongs-to ietf-bgp-rib {
prefix "br";
}
// import some basic types
import ietf-yang-types { prefix types; }
import ietf-bgp-rib-types { prefix bgpribt; }
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 common data definitions for data
related to a RIB entry, or RIB table.";
revision "2019-02-25" {
description description
"Top-level grouping for referening an extended community-set "Initial version.";
in the set-community action"; reference
"RFC XXXX: BGP YANG Model for Service Provider Network.";
}
container reference { grouping bgp-common-route-annotations-state {
when "../config/method=REFERENCE" { description
description "Data definitions for flags and other information attached
"Active only when the set-community method is REFERENCE"; to routes in both LOC-RIB and Adj-RIB";
}
leaf last-modified {
type types:timeticks;
description description
"Provide a reference to an extended community set for the "Timestamp when this path was last modified.
set-ext-community action";
leaf ext-community-set-ref { The value is the timestamp in seconds relative to
type leafref { the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
path }
"/rpol:routing-policy/rpol:defined-sets/" +
"bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/" + leaf valid-route {
"bgp-pol:ext-community-set/" + type boolean;
"bgp-pol:ext-community-set-name"; description
} "Indicates that the route is considered valid by the
description local router";
"References a defined extended community set by name"; }
leaf invalid-reason {
type identityref {
base bgpribt:invalid-route-reason;
} }
description
"If the route is rejected as invalid, this indicates the
reason.";
} }
} }
grouping set-ext-community-action-top { grouping bgp-loc-rib-route-annotations-state {
description description
"Top-level grouping for the set-ext-community action"; "Data definitions for inf