idnits 2.17.1 draft-ietf-idr-bgp-model-13.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 442 has weird spacing: '...address ine...' == Line 458 has weird spacing: '...address ine...' == Line 7378 has weird spacing: '...rw name if:...' == Line 7452 has weird spacing: '...address ine...' == Line 7618 has weird spacing: '...address ine...' -- The document date (6 March 2022) is 753 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 4451 == Outdated reference: A later version (-09) exists of draft-ietf-tcpm-yang-tcp-06 Summary: 1 error (**), 0 flaws (~~), 8 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Interdomain Routing M. Jethanandani 3 Internet-Draft Kloud Services 4 Intended status: Standards Track K. Patel 5 Expires: 7 September 2022 Arrcus 6 S. Hares 7 Huawei 8 J. Haas 9 Juniper Networks 10 6 March 2022 12 BGP YANG Model for Service Provider Networks 13 draft-ietf-idr-bgp-model-13 15 Abstract 17 This document defines a YANG data model for configuring and managing 18 BGP, including protocol, policy, and operational aspects, such as 19 RIB, based on data center, carrier, and content provider operational 20 requirements. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on 7 September 2022. 39 Copyright Notice 41 Copyright (c) 2022 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 46 license-info) in effect on the date of publication of this document. 47 Please review these documents carefully, as they describe your rights 48 and restrictions with respect to this document. Code Components 49 extracted from this document must include Revised BSD License text as 50 described in Section 4.e of the Trust Legal Provisions and are 51 provided without warranty as described in the Revised BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3 57 1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4 58 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 59 1.4. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 5 60 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 5 61 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 6 62 2.2. Policy configuration overview . . . . . . . . . . . . . . 9 63 2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 9 64 2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 11 65 2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 11 66 2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 11 67 2.3.4. Pre route advertisements per-neighbor . . . . . . . . 11 68 2.3.5. Post route advertisements per-neighbor . . . . . . . 11 69 3. Relation to other YANG data models . . . . . . . . . . . . . 11 70 4. Security Considerations . . . . . . . . . . . . . . . . . . . 12 71 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 72 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 13 73 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 14 74 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 14 75 7. Structure of the YANG modules . . . . . . . . . . . . . . . . 15 76 7.1. Main module and submodules for base items . . . . . . . . 15 77 7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 66 78 7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 79 79 7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 94 80 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 124 81 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 124 82 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 124 83 10.1. Normative references . . . . . . . . . . . . . . . . . . 124 84 10.2. Informative references . . . . . . . . . . . . . . . . . 128 85 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 129 86 A.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 129 87 A.2. Neighbor Address Family Configuration . . . . . . . . . . 130 88 A.3. IPv6 Neighbor Configuration . . . . . . . . . . . . . . . 131 89 A.4. VRF Configuration . . . . . . . . . . . . . . . . . . . . 132 90 A.5. BGP Policy . . . . . . . . . . . . . . . . . . . . . . . 134 91 Appendix B. How to add a new AFI and Augment a Module . . . . . 138 92 Appendix C. How to deviate a module . . . . . . . . . . . . . . 142 93 Appendix D. Complete configuration tree diagram . . . . . . . . 142 94 Appendix E. Complete policy tree diagram . . . . . . . . . . . . 163 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 165 97 1. Introduction 99 This document describes a YANG 1.1 [RFC7950] data model for the BGP-4 100 [RFC4271] protocol, including various protocol extensions, policy 101 configuration, as well as defining key operational state data, 102 including a Routing Information Base (RIB). The model is intended to 103 be vendor-neutral, in order to allow operators to manage BGP 104 configuration in heterogeneous environments with routers supplied by 105 multiple vendors. The model is also intended to be readily mapped to 106 existing implementations to facilitate support from as large a set of 107 routing hardware and software vendors as possible. This module does 108 not support previous versions of BGP, and cannot support establishing 109 and maintaining state information of neighbors with previous versions 110 of BGP. 112 1.1. Goals and approach 114 The model covers the base BGP features that are deployed across major 115 implementations and the common BGP configurations in use across a 116 number of operator network deployments. In particular, this model 117 attempts to cover BGP features defined in BGP [RFC4271], BGP 118 Communities Attribute [RFC1997], BGP Route Reflection [RFC4456], 119 Multiprotocol Extensions for BGP-4 [RFC4760], Autonomous System 120 Confederations for BGP [RFC5065], BGP Route Flap Damping [RFC2439], 121 Graceful Restart Mechanism for BGP [RFC4724], BGP Prefix Origin 122 Validation [RFC6811], and Advertisement of Multiple Paths in BGP 123 [RFC7911]. 125 Along with configuration of base BGP features, this model also 126 addresses policy configuration, by providing "hooks" for applying 127 policies, and also defining BGP-specific policy features. The BGP 128 policy features are intended to be used with the general routing 129 policy model defined in A YANG Data Model for Routing Policy 130 Management [RFC9067]. 132 The model conforms to the NMDA [RFC8342] architecture. It has 133 support for securing BGP sessions using TCP-AO [RFC5925] or TCP-MD5, 134 and for configuring Bidirectional Forward Detection (BFD) [RFC5880] 135 for fast next hop liveliness checking. 137 For the base BGP features, the focus of the model described in this 138 document is on providing configuration and operational state 139 information relating to: 141 * The global BGP instance, and neighbors whose configuration is 142 specified individually, or templated with the use of peer-groups. 144 * The address families that are supported by peers, and the global 145 configuration which relates to them. 147 * The policy configuration "hooks" and BGP-specific policy features 148 that relate to a neighbor - controlling the import and export of 149 NLRIs. 151 * BGP RIB contents. 153 As mentioned earlier, any configuration items that are deemed to be 154 widely available in existing major BGP implementations are included 155 in the model. Additional, more esoteric, configuration items that 156 are not commonly used, or only available from a single 157 implementation, are omitted from the model with an expectation that 158 they will be available in companion modules that augment or extend 159 the current model. This allows clarity in identifying data that is 160 part of the vendor-neutral base model. 162 Where possible, naming in the model follows conventions used in 163 available standards documents, and otherwise tries to be self- 164 explanatory with sufficient descriptions of the intended behavior. 165 Similarly, configuration data value constraints and default values, 166 where used, are based on recommendations in current standards 167 documentation, or those commonly used in multiple implementations. 168 Since implementations can vary widely in this respect, this version 169 of the model specifies only a limited set of defaults and ranges with 170 the expectation of being more prescriptive in future versions based 171 on actual operator use. 173 1.2. Note to RFC Editor 175 This document uses several placeholder values throughout the 176 document. Please replace them as follows and remove this note before 177 publication. 179 RFC XXXX, where XXXX is the number assigned to this document at the 180 time of publication. 182 2022-03-06 with the actual date of the publication of this document. 184 RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for 185 Routing Policy Management [RFC9067]. 187 1.3. Terminology 189 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 190 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 191 "OPTIONAL" in this document are to be interpreted as described in BCP 192 14 [RFC2119] [RFC8174] when, and only when, they appear in all 193 capitals, as shown here. 195 1.4. Abbreviations 197 +==============+===========================================+ 198 | Abbreviation | | 199 +==============+===========================================+ 200 | AFI | Address Family Identifier | 201 +--------------+-------------------------------------------+ 202 | BFD | Bidirectional Forward Detection | 203 +--------------+-------------------------------------------+ 204 | NLRI | Network Layer Reachability Information | 205 +--------------+-------------------------------------------+ 206 | NMDA | Network Management Datastore Architecture | 207 +--------------+-------------------------------------------+ 208 | RIB | Routing Information Base | 209 +--------------+-------------------------------------------+ 210 | SAFI | Subsequent Address Family Identifier | 211 +--------------+-------------------------------------------+ 212 | VRF | Virtual Routing and Forwarding | 213 +--------------+-------------------------------------------+ 215 Table 1 217 2. Model overview 219 The BGP model is defined across several YANG modules and submodules, 220 but at a high level is organized into six elements: 222 * base protocol configuration -- configuration affecting BGP 223 protocol-related operations, defined at various levels of 224 hierarchy. 226 * multiprotocol configuration -- configuration affecting individual 227 address-families within BGP Multiprotocol Extensions for BGP-4 228 [RFC4760]. 230 * neighbor configuration -- configuration affecting an individual 231 neighbor within BGP. 233 * neighbor multiprotocol configuration -- configuration affecting 234 individual address-families for a neighbor within BGP. 236 * policy configuration -- hooks for application of the policies 237 defined in A YANG Data Model for Routing Policy Management 238 [RFC9067] that act on routes sent (received) to (from) peers or 239 other routing protocols and BGP-specific policy features. 241 * operational state -- variables used for monitoring and management 242 of BGP operations. 244 These modules also make use of standard Internet types, such as IP 245 addresses and prefixes, autonomous system numbers, etc., defined in 246 Common YANG Data Types [RFC6991]. 248 2.1. BGP protocol configuration 250 The BGP protocol configuration model is organized hierarchically, 251 much like the majority of router implementations. That is, 252 configuration items can be specified at multiple levels, as shown 253 below. 255 module: ietf-bgp 257 augment /rt:routing/rt:control-plane-protocols 258 /rt:control-plane-protocol: 259 +--rw bgp 260 +--rw global! 261 | +--rw as inet:as-number 262 | +--rw identifier? yang:dotted-quad 263 | +--rw distance 264 | | ... 265 | +--rw confederation 266 | | ... 267 | +--rw graceful-restart {bt:graceful-restart}? 268 | | ... 269 | +--rw use-multiple-paths 270 | | ... 271 | +--rw route-selection-options 272 | | ... 273 | +--rw afi-safis 274 | | ... 275 | +--rw apply-policy 276 | | ... 277 | +--ro total-paths? uint32 278 | +--ro total-prefixes? uint32 279 +--rw neighbors 280 | +--rw neighbor* [remote-address] 281 | | ... 282 | +---n established 283 | | ... 285 | +---n backward-transition 286 | | ... 287 | +---x clear {bt:clear-neighbors}? 288 | ... 289 +--rw peer-groups 290 | +--rw peer-group* [name] 291 | ... 292 +--rw interfaces 293 | +--rw interface* [name] 294 | ... 295 +--ro rib 296 +--ro attr-sets 297 | ... 298 +--ro communities 299 | ... 300 +--ro ext-communities 301 | ... 302 +--ro large-communities 303 | ... 304 +--ro afi-safis 305 ... 307 Users may specify configuration at a higher level and have it apply 308 to all lower-level items, or provide overriding configuration at a 309 lower level of the hierarchy. Overriding configuration items are 310 optional, with neighbor-specific configuration being the most 311 specific or lowest level, followed by peer-group, and finally global. 312 Global configuration options reflect a subset of the peer-group or 313 neighbor-specific configuration options which are relevant to the 314 entire BGP instance. 316 The model makes the simplifying assumption that most of the 317 configuration items are available at all levels of the hierarchy. 318 That is, very little configuration is specific to a particular level 319 in the hierarchy, other than obvious items such as "group-name" only 320 being available for the peer group-level config. A notable exception 321 is for sub-address family configuration where some items are only 322 applicable for a given AFI-SAFI combination. 324 In order to allow common configuration to be applied to a set of 325 neighbors, all neighbor configuration options are available within a 326 peer-group. A neighbor is associated to a particular peer-group 327 through the use of a peer-group leaf (which provides a reference to a 328 configured item in the peer-group list). 330 Address-family configuration is made available in multiple points 331 within the model - primarily within the global container, where 332 instance-wide configuration can be set (for example, global protocol 333 parameters, the BGP best-path route selection options, or global 334 policies relating to the address-family); and on a per-neighbor or 335 per-peer-group basis, where address-families can be enabled or 336 disabled, and policy associated with the parent entity applied. 337 Within the afi-safi container, generic configuration that applies to 338 all address-families (e.g., whether the AFI-SAFI is enabled) is 339 presented at the top-level, with address-family specific containers 340 made available for options relating to only that AFI-SAFI. Within 341 the current revision of the model a generic set of address-families, 342 and common configuration and state options are included - further 343 work is expected to add additional parameters to this area of the 344 model. 346 The model supports ipv4-unicast and ipv6-unicast address-families and 347 defers the remaining AFI/SAFI to other or future drafts: 349 +--rw bgp 350 +--rw global! 351 +--rw afi-safis 352 +--rw afi-safi* [afi-safi-name] 353 +--rw afi-safi-name identityref 354 | 355 +--rw ipv4-unicast 356 | ... 357 +--rw ipv6-unicast 358 | ... 359 +--rw ipv4-labeled-unicast 360 | ... 361 +--rw ipv6-labeled-unicast 362 | ... 363 +--rw l3vpn-ipv4-unicast 364 | ... 365 +--rw l3vpn-ipv6-unicast 366 | ... 367 +--rw l3vpn-ipv4-multicast 368 | ... 369 +--rw l3vpn-ipv6-multicast 370 | ... 371 +--rw l2vpn-vpls 372 | ... 373 +--rw l2vpn-evpn 374 | ... 376 2.2. Policy configuration overview 378 The BGP policy configuration model augments the generic YANG routing 379 policy model described in A YANG Data Model for Routing Policy 380 Management [RFC9067], which represents a condition-action policy 381 framework for routing. This model adds BGP-specific conditions 382 (e.g., matching on the community attribute), and actions (e.g., 383 setting local preference) to the generic policy framework. 385 Policies that are defined in the routing-policy model are referenced 386 in multiple places within the model: 388 * within the global instance, where a policy applies to all address- 389 families for all peers. 391 * on a global AFI-SAFI basis, where policies apply to all peers for 392 a particular address-family. 394 * on a per-peer-group or per-neighbor basis - where the policy 395 applies to all address-families for the particular group or 396 neighbor. 398 * on a per-afi-safi basis within a neighbor or peer-group context, 399 where the policy is specific to the AFI-SAFI for a a specific 400 neighbor or group. 402 module: ietf-bgp-policy 404 augment /rt-pol:routing-policy/rt-pol:defined-sets: 405 +--rw bgp-defined-sets 406 ... 407 augment /rt-pol:routing-policy/rt-pol:policy-definitions 408 /rt-pol:policy-definition/rt-pol:statements 409 /rt-pol:statement/rt-pol:conditions: 410 +--rw bgp-conditions 411 ... 412 augment /rt-pol:routing-policy/rt-pol:policy-definitions 413 /rt-pol:policy-definition/rt-pol:statements 414 /rt-pol:statement/rt-pol:actions: 415 +--rw bgp-actions 416 ... 418 2.3. BGP RIB overview 420 The RIB data model represents the BGP RIB contents. The model 421 supports five logical RIBs per address family. 423 An abridged version of the tree shows the RIB portion of the tree 424 diagram. 426 module: ietf-bgp 428 augment /rt:routing/rt:control-plane-protocols 429 /rt:control-plane-protocol: 430 +--rw bgp 431 +--ro rib 432 +--ro afi-safis 433 +--ro afi-safi* [name] 434 +--ro name identityref 435 +--ro ipv4-unicast 436 | +--ro loc-rib 437 | | +--ro routes 438 | | +--ro route* [prefix origin path-id] 439 | | ... 440 | +--ro neighbors 441 | +--ro neighbor* [neighbor-address] 442 | +--ro neighbor-address inet:ip-address 443 | +--ro adj-rib-in-pre 444 | | ... 445 | +--ro adj-rib-in-post 446 | | ... 447 | +--ro adj-rib-out-pre 448 | | ... 449 | +--ro adj-rib-out-post 450 | ... 451 +--ro ipv6-unicast 452 +--ro loc-rib 453 | +--ro routes 454 | +--ro route* [prefix origin path-id] 455 | ... 456 +--ro neighbors 457 +--ro neighbor* [neighbor-address] 458 +--ro neighbor-address inet:ip-address 459 +--ro adj-rib-in-pre 460 | ... 461 +--ro adj-rib-in-post 462 | ... 463 +--ro adj-rib-out-pre 464 | ... 465 +--ro adj-rib-out-post 466 ... 468 2.3.1. Local Routing 470 The loc-rib is the main BGP routing table for the local routing 471 instance, containing best-path selections for each prefix. The loc- 472 rib table may contain multiple routes for a given prefix, with an 473 attribute to indicate which was selected as the best-path. Note that 474 multiple paths may be used or advertised even if only one path is 475 marked as best, e.g., when using BGP add-paths. An implementation 476 may choose to mark multiple paths in the RIB as best-path by setting 477 the flag to true for multiple entries. 479 2.3.2. Pre updates per-neighbor 481 The adj-rib-in-pre table is a per-neighbor table containing the NLRI 482 updates received from the neighbor before any local input policy 483 rules or filters have been applied. This can be considered the 'raw' 484 updates from a given neighbor. 486 2.3.3. Post updates per-neighbor 488 The adj-rib-in-post table is a per-neighbor table containing the 489 routes received from the neighbor that are eligible for best-path 490 selection after local input policy rules have been applied. 492 2.3.4. Pre route advertisements per-neighbor 494 The adj-rib-out-pre table is a per-neighbor table containing routes 495 eligible for sending (advertising) to the neighbor before output 496 policy rules have been applied. 498 2.3.5. Post route advertisements per-neighbor 500 The adj-rib-out-post table is a per-neighbor table containing routes 501 eligible for sending (advertising) to the neighbor after output 502 policy rules have been applied. 504 3. Relation to other YANG data models 506 The BGP model augments the Routing Management model A YANG Data Model 507 for Routing Management [RFC8349] which defines the notion of routing, 508 routing protocols, and RIBs. The notion of Virtual Routing and 509 Forwarding (VRF) is derived by using the YANG Schema Mount [RFC8528] 510 to mount the Routing Management module under the YANG Data Model for 511 Network Instances [RFC8529]. 513 4. Security Considerations 515 The YANG module specified in this document defines a schema for data 516 that is designed to be accessed via network management protocols such 517 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 518 is the secure transport layer, and the mandatory-to-implement secure 519 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 520 is HTTPS, and the mandatory-to-implement secure transport is TLS 521 [RFC8446]. The NETCONF Access Control Model (NACM) [RFC8341] 522 provides the means to restrict access for particular NETCONF or 523 RESTCONF users to a preconfigured subset of all available NETCONF or 524 RESTCONF protocol operations and content. 526 There are a number of data nodes defined in this YANG module that are 527 writable/creatable/deletable (i.e., config true, which is the 528 default). These data nodes may be considered sensitive or vulnerable 529 in some network environments. Write operations (e.g., edit-config) 530 to these data nodes without proper protection can have a negative 531 effect on network operations. Some of the subtrees and data nodes 532 and their sensitivity/vulnerability are described here. 534 - The attribute 'as'. If a user is allowed to change this attribute, 535 it will have the net effect of bringing down the entire routing 536 instance, causing it to delete all the current routing entries, and 537 learning new ones. 539 - The attribute 'identifier'. If a user is allowed to change this 540 attribute, it will have the net effect of this routing instance re- 541 advertising all its routes. 543 - The attribute 'distance'. If a user is allowed to change this 544 attribute, it will cause the preference for routes, e.g. external vs 545 internal to change. 547 - The attribute 'enabled' in the 'confederation' container. This 548 attribute defines whether a local-AS is part of a BGP federation. 550 - Finally, there are a whole set of route selection options such as 551 'always-compare-med', 'ignore-as-path-length' that affect the way the 552 system picks up a particular route. Being able to change will 553 adversely affect how the route selection happens. 555 Some of the readable data nodes in this YANG module may be considered 556 sensitive or vulnerable in some network environments. It is thus 557 important to control read access (e.g., via get, get-config, or 558 notification) to these data nodes. Some of the subtrees and data 559 nodes and their sensitivity/vulnerability are: 561 - The list of neighbors, and their attributes. Allowing a user to 562 read these attributes, in particular the address/port information may 563 allow a malicious user to launch an attack at the particular address/ 564 port. 566 - The 'rib' container. This container contains sensitive information 567 such as attribute sets, communities and external communities. Being 568 able to read the contents of this container will allow a malicious 569 user to understand how the system decide how to route a packet, and 570 thus try to affect a change. 572 Some of the RPC operations in this YANG module may be considered 573 sensitive or vulnerable in some network environments. It is thus 574 important to control access to these operations. These are the 575 operations and their sensitivity/vulnerability: 577 - The model allows for routes to be cleared using the 'clear' RPC 578 operations, causing the entire RIB table to be cleared. 580 - The model allows for statistics to be cleared by the 'clear' RPC 581 operation, causing all the individual statistics to be cleared. 583 - The model also allows for neighbors that have been learnt by the 584 system to be cleared by using the 'clear' RPC operation. 586 BGP OPSEC [RFC7454] describes several policies that can be used to 587 secure a BGP. In particular, it recommends securing the underlying 588 TCP session and to use Generalized TTL Security Mechanism (GTSM) 589 [RFC5082] capability to make it harder to spoof a BGP session. This 590 module allows implementations that want to support the capability to 591 configure a TTL value, under a feature flag. It also defines a 592 container 'secure-session' that can be augmented with 593 TCP-Authentication Option (TCP-AO) [RFC5925], or other methods to 594 secure a BGP session, and will be developed in a future version of 595 this draft. 597 5. IANA Considerations 599 This document registers three URIs and three YANG modules. 601 5.1. URI Registration 603 Following the format in the IETF XML registry [RFC3688] [RFC3688], 604 the following registration is requested to be made: 606 URI: urn:ietf:params:xml:ns:yang:ietf-bgp 607 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 608 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-types 609 Registrant Contact: The IESG. XML: N/A, the requested URI is an XML 610 namespace. 612 5.2. YANG Module Name Registration 614 This document registers three YANG modules in the YANG Module Names 615 registry YANG [RFC6020]. 617 name: ietf-bgp 618 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp 619 prefix: bgp 620 reference: RFC XXXX 622 name: ietf-bgp-policy 623 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 624 prefix: bp 625 reference: RFC XXXX 627 name: ietf-bgp-types 628 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-types 629 prefix: bt 630 reference: RFC XXXX 632 6. YANG modules 634 The modules comprising the BGP configuration and operational model 635 are described by the YANG modules and submodules in the sections 636 below. 638 The main module, ietf-bgp.yang, includes the following submodules: 640 * ietf-bgp-common - defines the groupings that are common across 641 more than one context (where contexts are neighbor, group, global) 643 * ietf-bgp-common-multiprotocol - defines the groupings that are 644 common across more than one context, and relate to multiprotocol 645 BGP 647 * ietf-bgp-common-structure - defines groupings that are shared by 648 multiple contexts, but are used only to create structural 649 elements, i.e., containers (leaf nodes are defined in separate 650 groupings) 652 * ietf-bgp-neighbor - groupings with data specific to the neighbor 653 context 655 * ietf-bgp-rib - grouping for representing BGP RIB. 657 Additionally, modules include: 659 * ietf-bgp-types - common type and identity definitions for BGP, 660 including BGP policy 662 * ietf-bgp-policy - BGP-specific policy data definitions for use 663 with [RFC9067] (described in more detail Section 2.2) 665 7. Structure of the YANG modules 667 The YANG model can be subdivided between the main module for base 668 items, types, policy data, and the RIB module. It references BGP 669 Communities Attribute [RFC1997], Route Refresh Capability for BGP-4 670 [RFC2918], NOPEER Community for BGP [RFC3765], BGP/MPLS IP Virtual 671 Private Networks (VPNs) [RFC4364], BGP MED Considerations [RFC4451], 672 BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN 673 [RFC4659], Graceful Restart Mechanism for BGP [RFC4724], 674 Multiprotocol Extentions for BGP-4 [RFC4760], Virtual Private LAN 675 Service (VPLS) Using BGP for Auto-Discovery and Signaling [RFC4761], 676 Autonomous System Configuration for BGP [RFC5065], The Generalized 677 TTL Security Mechanism (GTSM) [RFC5082], Bidirectional Forward 678 Detection (BFD) [RFC5880], Bidirectional Forward Detection for IPv4 679 and IPv6 (Single Hop) [RFC5881], Bidirectional Forwarding Detection 680 (BFD) for Multihop Paths [RFC5883], The TCP Authentication Option 681 [RFC5925], BGP Encodings and Procedures for Multicast in MPLS/BGP IP 682 VPNs [RFC6514], BGP Support for Four-Octet Autonomous System (AS) 683 Number Space [RFC6793], Advertisement of Multiple Paths in BGP 684 [RFC7911], YANG Key Chain [RFC8177], Carrying Label Information in 685 BGP-4 [RFC8277], A YANG Data Model for Routing Policy [RFC9067], YANG 686 Data Model for Bidirectional Forward Detection [RFC9127], and YANG 687 Model for Transmission Control Protocol (TCP) Configuration 688 [I-D.ietf-tcpm-yang-tcp]. 690 7.1. Main module and submodules for base items 692 file "ietf-bgp@2022-03-06.yang" 693 module ietf-bgp { 694 yang-version 1.1; 695 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp"; 696 prefix bgp; 698 /* 699 * Import and Include 700 */ 702 import ietf-routing { 703 prefix rt; 704 reference 705 "RFC 8349, A YANG Data Model for Routing Management 706 (NMDA Version)."; 707 } 708 import ietf-routing-policy { 709 prefix rt-pol; 710 reference 711 "RFC ZZZZ, A YANG Data Model for Routing Policy Management."; 712 } 713 import ietf-interfaces { 714 prefix if; 715 reference 716 "RFC 8343, A YANG Data Model for Interface Management."; 717 } 718 import ietf-bgp-types { 719 prefix bt; 720 reference 721 "RFC XXXX, BGP YANG Model for Service Provider Network."; 722 } 723 import ietf-bfd-types { 724 prefix bfd-types; 725 reference 726 "I-D.ietf-bfd-rfc9127-bis: YANG Data Model for 727 Bidirectional Forward Detection (BFD)."; 728 } 729 import ietf-inet-types { 730 prefix inet; 731 reference 732 "RFC 6991: Common YANG Data Types."; 733 } 734 import ietf-yang-types { 735 prefix yang; 736 reference 737 "RFC 6991: Common YANG Data Types."; 738 } 739 import ietf-key-chain { 740 prefix key-chain; 741 reference 742 "RFC 8177: YANG Key Chain."; 743 } 744 import ietf-tcp { 745 prefix tcp; 746 reference 747 "I-D.ietf-tcpm-yang-tcp: Transmission Control Protocol (TCP) 748 YANG Model."; 749 } 750 include ietf-bgp-common { 751 revision-date 2022-03-06; 752 } 753 include ietf-bgp-common-multiprotocol { 754 revision-date 2022-03-06; 755 } 756 include ietf-bgp-common-structure { 757 revision-date 2022-03-06; 758 } 759 include ietf-bgp-neighbor { 760 revision-date 2022-03-06; 761 } 762 include ietf-bgp-rib-types { 763 revision-date 2022-03-06; 764 } 765 include ietf-bgp-rib { 766 revision-date 2022-03-06; 767 } 768 include ietf-bgp-rib-attributes { 769 revision-date 2022-03-06; 770 } 771 include ietf-bgp-rib-tables { 772 revision-date 2022-03-06; 773 } 775 organization 776 "IETF IDR Working Group"; 777 contact 778 "WG Web: 779 WG List: 781 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 782 Keyur Patel (keyur at arrcus.com), 783 Susan Hares (shares at ndzh.com), 784 Jeffrey Haas (jhaas at juniper.net)."; 786 description 787 "This module describes a YANG model for BGP protocol 788 configuration. It is a limited subset of all of the 789 configuration parameters available in the variety of vendor 790 implementations, hence it is expected that it would be augmented 791 with vendor-specific configuration data as needed. Additional 792 modules or submodules to handle other aspects of BGP 793 configuration, including policy, VRFs, VPNs, and additional 794 address families are also expected. 796 This model supports the following BGP configuration level 797 hierarchy: 799 BGP 800 | 801 +-> [ global BGP configuration ] 802 +-> AFI / SAFI global 803 +-> peer group 804 +-> [ peer group config ] 805 +-> AFI / SAFI [ per-AFI overrides ] 806 +-> neighbor 807 +-> [ neighbor config ] 808 +-> [ optional pointer to peer-group ] 809 +-> AFI / SAFI [ per-AFI overrides ] 811 Copyright (c) 2021 IETF Trust and the persons identified as 812 authors of the code. All rights reserved. 814 Redistribution and use in source and binary forms, with or 815 without modification, is permitted pursuant to, and subject to 816 the license terms contained in, the Simplified BSD License set 817 forth in Section 4.c of the IETF Trust's Legal Provisions 818 Relating to IETF Documents 819 (https://trustee.ietf.org/license-info). 821 This version of this YANG module is part of RFC XXXX 822 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 823 for full legal notices. 825 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 826 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 827 'MAY', and 'OPTIONAL' in this document are to be interpreted as 828 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 829 they appear in all capitals, as shown here."; 831 revision 2022-03-06 { 832 description 833 "Initial Version"; 834 reference 835 "RFC XXXX, BGP Model for Service Provider Network "; 836 } 838 /* 839 * Identity 840 */ 842 identity bgp { 843 base rt:routing-protocol; 844 description 845 "BGP protocol."; 846 } 848 /* 849 * Groupiings 850 */ 851 grouping neighbor-and-peer-group-common { 852 description 853 "Neighbor and Peer Group configuration that is common."; 855 container timers { 856 description 857 "Timers related to a BGP neighbor"; 858 uses neighbor-group-timers-config; 859 } 861 container transport { 862 description 863 "Transport session parameters for the BGP neighbor"; 864 uses neighbor-group-transport-config; 865 } 867 container graceful-restart { 868 if-feature "bt:graceful-restart"; 869 description 870 "Parameters relating the graceful restart mechanism for 871 BGP"; 872 uses graceful-restart-config; 873 leaf peer-restart-time { 874 type uint16 { 875 range "0..4096"; 876 } 877 config false; 878 description 879 "The period of time (advertised by the peer) that the 880 peer expects a restart of a BGP session to take."; 881 } 883 leaf peer-restarting { 884 type boolean; 885 config false; 886 description 887 "This flag indicates whether the remote neighbor is 888 currently in the process of restarting, and hence 889 received routes are currently stale."; 890 } 892 leaf local-restarting { 893 type boolean; 894 config false; 895 description 896 "This flag indicates whether the local neighbor is 897 currently restarting. The flag is cleared after all 898 NLRI have been advertised to the peer, and the 899 End-of-RIB (EOR) marker has been cleared."; 900 } 902 leaf mode { 903 type enumeration { 904 enum helper-only { 905 description 906 "The local router is operating in helper-only 907 mode, and hence will not retain forwarding state 908 during a local session restart, but will do so 909 during a restart of the remote peer"; 910 } 911 enum bilateral { 912 description 913 "The local router is operating in both helper 914 mode, and hence retains forwarding state during 915 a remote restart, and also maintains forwarding 916 state during local session restart"; 917 } 918 enum remote-helper { 919 description 920 "The local system is able to retain routes during 921 restart but the remote system is only able to 922 act as a helper"; 923 } 924 } 925 config false; 926 description 927 "This leaf indicates the mode of operation of BGP 928 graceful restart with the peer"; 929 } 930 } 931 uses structure-neighbor-group-logging-options; 932 uses structure-neighbor-group-ebgp-multihop; 933 uses structure-neighbor-group-route-reflector; 934 uses structure-neighbor-group-as-path-options; 935 uses structure-neighbor-group-add-paths; 936 uses bgp-neighbor-use-multiple-paths; 937 uses rt-pol:apply-policy-group; 938 } 940 /* 941 * Containers 942 */ 944 augment "/rt:routing/rt:control-plane-protocols/" 945 + "rt:control-plane-protocol" { 946 when "derived-from-or-self(rt:type, 'bgp')" { 947 description 948 "This augmentation is valid for a routing protocol 949 instance of BGP."; 950 } 951 description 952 "BGP protocol augmentation of ietf-routing module 953 control-plane-protocol."; 954 container bgp { 955 description 956 "Top-level configuration for the BGP router."; 957 container global { 958 presence "Enables global configuration of BGP"; 959 description 960 "Global configuration for the BGP router."; 961 leaf as { 962 type inet:as-number; 963 mandatory true; 964 description 965 "Local autonomous system number of the router. Uses 966 the 32-bit as-number type from the model in RFC 6991."; 967 } 968 leaf identifier { 969 type yang:dotted-quad; 970 description 971 "BGP Identifier of the router - an unsigned 32-bit, 972 non-zero integer that should be unique within an AS. 973 The value of the BGP Identifier for a BGP speaker is 974 determined upon startup and is the same for every local 975 interface and BGP peer."; 976 reference 977 "RFC 6286: AS-Wide Unique BGP ID for BGP-4. Section 2.1"; 978 } 979 container distance { 980 description 981 "Administrative distances (or preferences) assigned to 982 routes received from different sources (external, and 983 internal)."; 984 leaf external { 985 type uint8 { 986 range "1..255"; 987 } 988 description 989 "Administrative distances for routes learned from 990 external BGP (eBGP)."; 991 } 992 leaf internal { 993 type uint8 { 994 range "1..255"; 995 } 996 description 997 "Administrative distances for routes learned from 998 internal BGP (iBGP)."; 999 } 1000 } 1001 container confederation { 1002 description 1003 "Configuration options specifying parameters when the 1004 local router is within an autonomous system which is 1005 part of a BGP confederation."; 1006 leaf enabled { 1007 type boolean; 1008 description 1009 "When this leaf is set to true it indicates that 1010 the local-AS is part of a BGP confederation."; 1011 } 1012 leaf identifier { 1013 type inet:as-number; 1014 description 1015 "Confederation identifier for the autonomous system."; 1016 } 1017 leaf-list member-as { 1018 type inet:as-number; 1019 description 1020 "Remote autonomous systems that are to be treated 1021 as part of the local confederation."; 1022 } 1023 } 1024 container graceful-restart { 1025 if-feature "bt:graceful-restart"; 1026 description 1027 "Parameters relating the graceful restart mechanism for 1028 BGP."; 1029 uses graceful-restart-config; 1030 } 1031 uses global-group-use-multiple-paths; 1032 uses route-selection-options; 1033 container afi-safis { 1034 description 1035 "List of address-families associated with the BGP 1036 instance."; 1037 list afi-safi { 1038 key "name"; 1039 description 1040 "AFI,SAFI configuration available for the 1041 neighbor or group."; 1042 uses mp-afi-safi-config; 1043 uses state; 1044 container graceful-restart { 1045 if-feature "bt:graceful-restart"; 1046 description 1047 "Parameters relating to BGP graceful-restart"; 1048 uses mp-afi-safi-graceful-restart-config; 1049 } 1050 uses route-selection-options; 1051 uses global-group-use-multiple-paths; 1052 uses mp-all-afi-safi-list-contents; 1053 } 1054 } 1055 uses rt-pol:apply-policy-group; 1056 uses state; 1057 } 1059 container neighbors { 1060 description 1061 "Configuration for BGP neighbors."; 1063 list neighbor { 1064 key "remote-address"; 1065 description 1066 "List of BGP neighbors configured on the local system, 1067 uniquely identified by remote IPv[46] address."; 1069 leaf remote-address { 1070 type inet:ip-address; 1071 description 1072 "The remote IP address of this entry's BGP peer."; 1073 } 1075 leaf local-address { 1076 type inet:ip-address; 1077 config false; 1078 description 1079 "The local IP address of this entry's BGP connection."; 1080 } 1082 leaf local-port { 1083 type inet:port-number; 1084 config false; 1085 description 1086 "The local port for the TCP connection between 1087 the BGP peers."; 1088 } 1089 leaf remote-port { 1090 type inet:port-number; 1091 config false; 1092 description 1093 "The remote port for the TCP connection 1094 between the BGP peers. Note that the 1095 objects local-addr, local-port, remote-addr, and 1096 reemote-port provide the appropriate 1097 reference to the standard MIB TCP 1098 connection table."; 1099 } 1101 leaf peer-type { 1102 type bt:peer-type; 1103 config false; 1104 description 1105 "The type of peering session associated with this 1106 neighbor."; 1107 reference 1108 "RFC 4271: A Border Gateway Protocol 4 (BGP-4) 1109 Section 1.1 for iBGP and eBGP. 1110 RFC 5065: Autonomous System Configuration 1111 for Confederation internal and external."; 1112 } 1114 leaf peer-group { 1115 type leafref { 1116 path "../../../peer-groups/peer-group/name"; 1117 } 1118 description 1119 "The peer-group with which this neighbor is 1120 associated."; 1121 } 1123 leaf identifier { 1124 type yang:dotted-quad; 1125 config false; 1126 description 1127 "The BGP Identifier of this entry's BGP peer. 1128 This entry MUST be 0.0.0.0 unless the 1129 session state is in the openconfirm or the 1130 established state."; 1131 reference 1132 "RFC 4271, Section 4.2, 'BGP Identifier'."; 1133 } 1135 leaf enabled { 1136 type boolean; 1137 default "true"; 1138 description 1139 "Whether the BGP peer is enabled. In cases where the 1140 enabled leaf is set to false, the local system should 1141 not initiate connections to the neighbor, and should 1142 not respond to TCP connections attempts from the 1143 neighbor. If the state of the BGP session is 1144 ESTABLISHED at the time that this leaf is set to 1145 false, the BGP session should be ceased. 1147 A transition from 'false' to 'true' will cause 1148 the BGP Manual Start Event to be generated. 1149 A transition from 'true' to 'false' will cause 1150 the BGP Manual Stop Event to be generated. 1151 This parameter can be used to restart BGP peer 1152 connections. Care should be used in providing 1153 write access to this object without adequate 1154 authentication."; 1155 reference 1156 "RFC 4271, Section 8.1.2."; 1157 } 1159 leaf secure-session-enable { 1160 type boolean; 1161 default "false"; 1162 description 1163 "Does this session need to be secured?"; 1164 } 1166 container secure-session { 1167 when "../secure-session-enable = 'true'"; 1168 description 1169 "Container for describing how a particular BGP session 1170 is to be secured."; 1172 choice option { 1173 case ao { 1174 uses tcp:ao; 1175 leaf ao-keychain { 1176 type key-chain:key-chain-ref; 1177 description 1178 "Reference to the key chain that will be used by 1179 this model. Applicable for TCP-AO and TCP-MD5 1180 only"; 1181 reference 1182 "RFC 8177: YANG Key Chain."; 1183 } 1184 description 1185 "Uses TCP-AO to secure the session. Parameters for 1186 those are defined as a grouping in the TCP YANG 1187 model."; 1188 reference 1189 "RFC 5925 - The TCP Authentication Option."; 1190 } 1192 case md5 { 1193 uses tcp:md5; 1194 leaf md5-keychain { 1195 type key-chain:key-chain-ref; 1196 description 1197 "Reference to the key chain that will be used by 1198 this model. Applicable for TCP-AO and TCP-MD5 1199 only"; 1200 reference 1201 "RFC 8177: YANG Key Chain."; 1202 } 1203 description 1204 "Uses TCP-MD5 to secure the session. Parameters for 1205 those are defined as a grouping in the TCP YANG 1206 model."; 1207 reference 1208 "RFC 5925: The TCP Authentication Option."; 1209 } 1211 description 1212 "Choice of authentication options."; 1213 } 1214 } 1215 leaf ttl-security { 1216 if-feature "bt:ttl-security"; 1217 type uint8; 1218 default "255"; 1219 description 1220 "BGP Time To Live (TTL) security check."; 1221 reference 1222 "RFC 5082: The Generalized TTL Security Mechanism 1223 (GTSM), 1224 RFC 7454: BGP Operations and Security."; 1225 } 1227 uses neighbor-group-config; 1228 uses neighbor-and-peer-group-common; 1230 container afi-safis { 1231 description 1232 "Per-address-family configuration parameters associated 1233 with the neighbor"; 1234 uses bgp-neighbor-afi-safi-list; 1235 } 1237 leaf session-state { 1238 type enumeration { 1239 enum idle { 1240 description 1241 "Neighbor is down, and in the Idle state of the 1242 FSM."; 1243 } 1244 enum connect { 1245 description 1246 "Neighbor is down, and the session is waiting for 1247 the underlying transport session to be 1248 established."; 1249 } 1250 enum active { 1251 description 1252 "Neighbor is down, and the local system is awaiting 1253 a connection from the remote peer."; 1254 } 1255 enum opensent { 1256 description 1257 "Neighbor is in the process of being established. 1258 The local system has sent an OPEN message."; 1259 } 1260 enum openconfirm { 1261 description 1262 "Neighbor is in the process of being established. 1263 The local system is awaiting a NOTIFICATION or 1264 KEEPALIVE message."; 1265 } 1266 enum established { 1267 description 1268 "Neighbor is up - the BGP session with the peer is 1269 established."; 1270 } 1271 } 1272 // notification does not like a non-config statement. 1273 // config false; 1274 description 1275 "The BGP peer connection state."; 1276 reference 1277 "RFC 4271, Section 8.1.2."; 1278 } 1279 leaf last-established { 1280 type yang:date-and-time; 1281 config false; 1282 description 1283 "This timestamp indicates the time that the BGP session 1284 last transitioned in or out of the Established state. 1285 The value is the timestamp in seconds relative to the 1286 Unix Epoch (Jan 1, 1970 00:00:00 UTC). 1288 The BGP session uptime can be computed by clients as 1289 the difference between this value and the current time 1290 in UTC (assuming the session is in the ESTABLISHED 1291 state, per the session-state leaf)."; 1292 } 1293 leaf-list negotiated-capabilities { 1294 type identityref { 1295 base bt:bgp-capability; 1296 } 1297 config false; 1298 description 1299 "Negotiated BGP capabilities."; 1300 } 1301 leaf negotiated-hold-time { 1302 type uint16; 1303 config false; 1304 description 1305 "The negotiated hold-time for the BGP session"; 1306 } 1307 leaf last-error { 1308 type binary { 1309 length "2"; 1310 } 1311 config false; 1312 description 1313 "The last error code and subcode seen by this 1314 peer on this connection. If no error has 1315 occurred, this field is zero. Otherwise, the 1316 first byte of this two byte OCTET STRING 1317 contains the error code, and the second byte 1318 contains the subcode."; 1319 reference 1320 "RFC 4271, Section 4.5."; 1321 } 1322 leaf fsm-established-time { 1323 type yang:gauge32; 1324 units "seconds"; 1325 config false; 1326 description 1327 "This timer indicates how long (in 1328 seconds) this peer has been in the 1329 established state or how long 1330 since this peer was last in the 1331 established state. It is set to zero when 1332 a new peer is configured or when the router is 1333 booted."; 1334 reference 1335 "RFC 4271, Section 8."; 1336 } 1337 leaf treat-as-withdraw { 1338 type boolean; 1339 default "false"; 1340 description 1341 "Specify whether erroneous UPDATE messages for which 1342 the NLRI can be extracted are treated as though the 1343 NLRI is withdrawn - avoiding session reset"; 1344 reference 1345 "RFC 7606: Revised Error Handling for BGP UPDATE 1346 Messages."; 1347 } 1348 leaf erroneous-update-messages { 1349 type uint32; 1350 config false; 1351 description 1352 "The number of BGP UPDATE messages for which the 1353 treat-as-withdraw mechanism has been applied based on 1354 erroneous message contents"; 1355 } 1357 container bfd { 1358 if-feature "bt:bfd"; 1359 uses bfd-types:client-cfg-parms; 1360 description 1361 "BFD configuration per-neighbor."; 1362 } 1364 container statistics { 1365 description 1366 "Statistics per neighbor."; 1368 leaf peer-fsm-established-transitions { 1369 type yang:counter64; 1370 config false; 1371 description 1372 "Number of transitions to the Established state for 1373 the neighbor session. This value is analogous to the 1374 bgpPeerFsmEstablishedTransitions object from the 1375 standard BGP-4 MIB"; 1376 reference 1377 "RFC 4273, Definitions of Managed Objects for 1378 BGP-4."; 1379 } 1380 leaf fsm-established-transitions { 1381 type yang:counter32; 1382 config false; 1383 description 1384 "The total number of times the BGP FSM 1385 transitioned into the established state 1386 for this peer."; 1387 reference 1388 "RFC 4271, Section 8."; 1389 } 1390 container messages { 1391 config false; 1392 description 1393 "Counters for BGP messages sent and received from the 1394 neighbor"; 1395 leaf in-total-messages { 1396 type yang:counter32; 1397 config false; 1398 description 1399 "The total number of messages received 1400 from the remote peer on this connection."; 1401 reference 1402 "RFC 4271, Section 4."; 1403 } 1404 leaf out-total-messages { 1405 type yang:counter32; 1406 config false; 1407 description 1408 "The total number of messages transmitted to 1409 the remote peer on this connection."; 1410 reference 1411 "RFC 4271, Section 4."; 1412 } 1413 leaf in-update-elapsed-time { 1414 type yang:gauge32; 1415 units "seconds"; 1416 config false; 1417 description 1418 "Elapsed time (in seconds) since the last BGP 1419 UPDATE message was received from the peer. 1420 Each time in-updates is incremented, 1421 the value of this object is set to zero (0)."; 1422 reference 1423 "RFC 4271, Section 4.3. 1424 RFC 4271, Section 8.2.2, Established state."; 1426 } 1427 container sent { 1428 description 1429 "Counters relating to BGP messages sent to the 1430 neighbor"; 1431 uses bgp-neighbor-counters-message-types-state; 1432 } 1433 container received { 1434 description 1435 "Counters for BGP messages received from the 1436 neighbor"; 1437 uses bgp-neighbor-counters-message-types-state; 1438 } 1439 } 1440 container queues { 1441 config false; 1442 description 1443 "Counters related to queued messages associated with 1444 the BGP neighbor"; 1445 leaf input { 1446 type uint32; 1447 description 1448 "The number of messages received from the peer 1449 currently queued"; 1450 } 1451 leaf output { 1452 type uint32; 1453 description 1454 "The number of messages queued to be sent to the 1455 peer"; 1456 } 1457 } 1458 action clear { 1459 if-feature "bt:clear-statistics"; 1460 description 1461 "Clear statistics action command. 1463 Execution of this command should result in all the 1464 counters to be cleared and set to 0."; 1466 input { 1467 leaf clear-at { 1468 type yang:date-and-time; 1469 description 1470 "Time when the clear action needs to be 1471 executed."; 1472 } 1473 } 1474 output { 1475 leaf clear-finished-at { 1476 type yang:date-and-time; 1477 description 1478 "Time when the clear action command completed."; 1479 } 1480 } 1481 } 1482 } 1483 } 1485 notification established { 1486 leaf remote-address { 1487 type leafref { 1488 path "../../neighbor/remote-address"; 1489 } 1490 description 1491 "IP address of the neighbor that went into established 1492 state."; 1493 } 1494 leaf last-error { 1495 type leafref { 1496 path "../../neighbor/last-error"; 1497 } 1498 description 1499 "The last error code and subcode seen by this 1500 peer on this connection. If no error has 1501 occurred, this field is zero. Otherwise, the 1502 first octet of this two byte OCTET STRING 1503 contains the error code, and the second octet 1504 contains the subcode."; 1505 reference 1506 "RFC 4271, Section 4.5."; 1507 } 1508 leaf session-state { 1509 type leafref { 1510 path "../../neighbor/session-state"; 1511 } 1512 description 1513 "The BGP peer connection state."; 1514 reference 1515 "RFC 4271, Section 8.2.2."; 1516 } 1517 description 1518 "The established event is generated 1519 when the BGP FSM enters the established state."; 1520 } 1521 notification backward-transition { 1522 leaf remote-addr { 1523 type leafref { 1524 path "../../neighbor/remote-address"; 1525 } 1526 description 1527 "IP address of the neighbor that changed its state from 1528 established state."; 1529 } 1530 leaf last-error { 1531 type leafref { 1532 path "../../neighbor/last-error"; 1533 } 1534 description 1535 "The last error code and subcode seen by this 1536 peer on this connection. If no error has 1537 occurred, this field is zero. Otherwise, the 1538 first byte of this two byte OCTET STRING 1539 contains the error code, and the second byte 1540 contains the subcode."; 1541 reference 1542 "RFC 4271, Section 4.5."; 1543 } 1544 leaf session-state { 1545 type leafref { 1546 path "../../neighbor/session-state"; 1547 } 1548 description 1549 "The BGP peer connection state."; 1550 reference 1551 "RFC 4271, Section 8.2.2."; 1552 } 1553 description 1554 "The backward-transition event is 1555 generated when the BGP FSM moves from a higher 1556 numbered state to a lower numbered state."; 1557 } 1558 action clear { 1559 if-feature "bt:clear-neighbors"; 1560 description 1561 "Clear neighbors action."; 1563 input { 1564 choice operation { 1565 default operation-admin; 1566 description 1567 "The type of operation for the clear action."; 1568 case operation-admin { 1569 leaf admin { 1570 type empty; 1571 description 1572 "Closes the Established BGP session with a BGP 1573 NOTIFICATION message with the Administrative 1574 Reset error subcode."; 1575 reference 1576 "RFC 4486 - Subcodes for BGP Cease Notification 1577 Message."; 1578 } 1579 } 1580 case operation-hard { 1581 leaf hard { 1582 type empty; 1583 description 1584 "Closes the Established BGP session with a BGP 1585 NOTIFICATION message with the Hard Reset error 1586 subcode."; 1587 reference 1588 "RFC 8538, Section 3 - Notification Message 1589 Support for BGP Graceful Restart."; 1590 } 1591 } 1592 case operation-soft { 1593 leaf soft { 1594 type empty; 1595 description 1596 "Re-sends the current Adj-Rib-Out to this 1597 neighbor."; 1598 } 1599 } 1600 case operation-soft-inbound { 1601 leaf soft-inbound { 1602 if-feature "bt:route-refresh"; 1603 type empty; 1604 description 1605 "Requests the Adj-Rib-In for this neighbor to be 1606 re-sent using the BGP Route Refresh feature."; 1607 } 1608 } 1609 } 1611 leaf clear-at { 1612 type yang:date-and-time; 1613 description 1614 "Time when the clear action command needs to be 1615 executed."; 1617 } 1618 } 1619 output { 1620 leaf clear-finished-at { 1621 type yang:date-and-time; 1622 description 1623 "Time when the clear action command completed."; 1624 } 1625 } 1626 } 1627 } 1629 container peer-groups { 1630 description 1631 "Configuration for BGP peer-groups"; 1633 list peer-group { 1634 key "name"; 1635 description 1636 "List of BGP peer-groups configured on the local system - 1637 uniquely identified by peer-group name"; 1639 leaf name { 1640 type string; 1641 description 1642 "Name of the BGP peer-group"; 1643 } 1645 leaf secure-session-enable { 1646 type boolean; 1647 default "false"; 1648 description 1649 "Does this session need to be secured?"; 1650 } 1652 container secure-session { 1653 when "../secure-session-enable = 'true'"; 1654 description 1655 "Container for describing how a particular BGP session 1656 is to be secured."; 1658 choice option { 1659 case ao { 1660 uses tcp:ao; 1661 leaf ao-keychain { 1662 type key-chain:key-chain-ref; 1663 description 1664 "Reference to the key chain that will be used by 1665 this model. Applicable for TCP-AO and TCP-MD5 1666 only"; 1667 reference 1668 "RFC 8177: YANG Key Chain."; 1669 } 1670 description 1671 "Uses TCP-AO to secure the session. Parameters for 1672 those are defined as a grouping in the TCP YANG 1673 model."; 1674 reference 1675 "RFC 5925 - The TCP Authentication Option."; 1676 } 1677 case md5 { 1678 uses tcp:md5; 1679 leaf md5-keychain { 1680 type key-chain:key-chain-ref; 1681 description 1682 "Reference to the key chain that will be used by 1683 this model. Applicable for TCP-AO and TCP-MD5 1684 only"; 1685 reference 1686 "RFC 8177: YANG Key Chain."; 1687 } 1688 description 1689 "Uses TCP-MD5 to secure the session. Parameters for 1690 those are defined as a grouping in the TCP YANG 1691 model."; 1692 reference 1693 "RFC 5925: The TCP Authentication Option."; 1694 } 1695 case ipsec { 1696 leaf sa { 1697 type string; 1698 description 1699 "Security Association (SA) name."; 1700 } 1701 description 1702 "Currently, the IPsec/IKE YANG model has no 1703 grouping defined that this model can use. When 1704 such a grouping is defined, this model can import 1705 the grouping to add the key parameters 1706 needed to kick of IKE."; 1707 } 1708 description 1709 "Choice of authentication options."; 1710 } 1711 } 1712 leaf ttl-security { 1713 if-feature "bt:ttl-security"; 1714 type uint8; 1715 default "255"; 1716 description 1717 "BGP Time To Live (TTL) security check."; 1718 reference 1719 "RFC 5082: The Generalized TTL Security Mechanism 1720 (GTSM), 1721 RFC 7454: BGP Operations and Security."; 1722 } 1724 uses neighbor-group-config; 1725 uses neighbor-and-peer-group-common; 1727 container afi-safis { 1728 description 1729 "Per-address-family configuration parameters 1730 associated with the peer-group."; 1731 list afi-safi { 1732 key "name"; 1733 description 1734 "AFI, SAFI configuration available for the 1735 neighbor or group"; 1736 uses mp-afi-safi-config; 1737 container graceful-restart { 1738 if-feature "bt:graceful-restart"; 1739 description 1740 "Parameters relating to BGP graceful-restart"; 1741 uses mp-afi-safi-graceful-restart-config; 1742 } 1743 uses bgp-neighbor-use-multiple-paths; 1744 uses mp-all-afi-safi-list-contents; 1745 } 1746 } 1747 } 1748 } 1750 container interfaces { 1751 list interface { 1752 key "name"; 1753 leaf name { 1754 type if:interface-ref; 1755 description 1756 "Reference to the interface within the routing 1757 instance."; 1758 } 1759 container bfd { 1760 if-feature "bt:bfd"; 1761 leaf enabled { 1762 type boolean; 1763 default "false"; 1764 description 1765 "Indicates whether BFD is enabled on this 1766 interface."; 1767 } 1768 description 1769 "BFD client configuration."; 1770 reference 1771 "I-D.ietf-bfd-rfc9127-bis: YANG Data Model for 1772 Bidirectional Forward Detection (BFD)."; 1773 } 1774 description 1775 "List of interfaces within the routing instance."; 1776 } 1777 description 1778 "Interface specific parameters."; 1779 } 1780 uses rib; 1781 } 1782 } 1783 } 1784 1786 file "ietf-bgp-common@2022-03-06.yang" 1787 submodule ietf-bgp-common { 1788 yang-version 1.1; 1789 belongs-to ietf-bgp { 1790 prefix bgp; 1791 } 1793 import ietf-bgp-types { 1794 prefix bt; 1795 reference 1796 "RFC XXXX: BGP Model for Service Provider Network."; 1797 } 1798 import ietf-inet-types { 1799 prefix inet; 1800 reference 1801 "RFC 6991: Common YANG Data Types."; 1802 } 1803 import ietf-bfd-types { 1804 prefix bfd-types; 1805 reference 1806 "RFC XXXX, YANG Data Model for Bidirectional Forward 1807 Detection."; 1809 } 1811 organization 1812 "IETF IDR Working Group"; 1813 contact 1814 "WG Web: 1815 WG List: 1817 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 1818 Keyur Patel (keyur at arrcus.com), 1819 Susan Hares (shares at ndzh.com, 1820 Jeffrey Haas (jhaas at juniper.net)."; 1822 description 1823 "This sub-module contains common groupings that are common across 1824 multiple contexts within the BGP module. That is to say that 1825 they may be application to a subset of global, peer-group, or 1826 neighbor contexts. 1828 Copyright (c) 2021 IETF Trust and the persons identified as 1829 authors of the code. All rights reserved. 1831 Redistribution and use in source and binary forms, with or 1832 without modification, is permitted pursuant to, and subject to 1833 the license terms contained in, the Simplified BSD License set 1834 forth in Section 4.c of the IETF Trust's Legal Provisions 1835 Relating to IETF Documents 1836 (https://trustee.ietf.org/license-info). 1838 This version of this YANG module is part of RFC XXXX 1839 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 1840 for full legal notices. 1842 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 1843 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 1844 'MAY', and 'OPTIONAL' in this document are to be interpreted as 1845 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 1846 they appear in all capitals, as shown here."; 1848 revision 2022-03-06 { 1849 description 1850 "Initial Version"; 1851 reference 1852 "RFC XXXX, BGP Model for Service Provider Network."; 1853 } 1855 grouping neighbor-group-timers-config { 1856 description 1857 "Config parameters related to timers associated with the BGP 1858 peer"; 1859 leaf connect-retry-interval { 1860 type uint16 { 1861 range "1..max"; 1862 } 1863 units "seconds"; 1864 default "120"; 1865 description 1866 "Time interval (in seconds) for the ConnectRetryTimer. The 1867 suggested value for this timer is 120 seconds."; 1868 reference 1869 "RFC 4271, Section 8.2.2. This is the value used 1870 to initialize the 'ConnectRetryTimer'."; 1871 } 1872 leaf hold-time { 1873 type uint16 { 1874 range "0 | 3..65535"; 1875 } 1876 units "seconds"; 1877 default "90"; 1878 description 1879 "Time interval (in seconds) for the HoldTimer established 1880 with the peer. When read as operational data (ro), the 1881 value of this object is calculated by this BGP speaker, 1882 using the smaller of the values in hold-time that was 1883 configured (rw) in the running datastore and the Hold Time 1884 received in the OPEN message. 1886 This value must be at least three seconds 1887 if it is not zero (0). 1889 If the Hold Timer has not been established 1890 with the peer this object MUST have a value 1891 of zero (0). 1893 If the configured value of hold-time object was 1894 a value of (0), then when read this object MUST have a 1895 value of (0) also."; 1896 reference 1897 "RFC 4271, Section 4.2. 1898 RFC 4271, Section 10."; 1899 } 1900 leaf keepalive { 1901 type uint16 { 1902 range "0..21845"; 1903 } 1904 units "seconds"; 1905 description 1906 "When used as a configuration (rw) value, this Time interval 1907 (in seconds) for the KeepAlive timer configured for this BGP 1908 speaker with this peer. A reasonable maximum value for this 1909 timer would be one-third of the configured hold-time. 1911 In the absence of explicit configuration of the keepalive 1912 value, operationally it SHOULD have a value of one-third of 1913 the negotiated hold-time. 1915 If the value of this object is zero (0), no periodic 1916 KEEPALIVE messages are sent to the peer after the BGP 1917 connection has been established. 1919 The actual time interval for the KEEPALIVE messages is 1920 indicated by operational value of keepalive."; 1921 reference 1922 "RFC 4271, Section 4.4. 1923 RFC 4271, Section 10."; 1924 } 1925 leaf min-as-origination-interval { 1926 type uint16 { 1927 range "0..max"; 1928 } 1929 units "seconds"; 1930 description 1931 "Time interval (in seconds) for the MinASOriginationInterval 1932 timer. The suggested value for this timer is 15 seconds."; 1933 reference 1934 "RFC 4271, Section 9.2.1.2. 1935 RFC 4271, Section 10."; 1936 } 1937 leaf min-route-advertisement-interval { 1938 type uint16 { 1939 range "0..max"; 1940 } 1941 units "seconds"; 1942 description 1943 "Time interval (in seconds) for the 1944 MinRouteAdvertisementInterval timer. 1945 The suggested value for this timer is 30 1946 seconds for EBGP connections and 5 1947 seconds for IBGP connections."; 1948 reference 1949 "RFC 4271, Section 9.2.1.1. 1950 RFC 4271, Section 10."; 1951 } 1952 } 1953 grouping neighbor-group-config { 1954 description 1955 "Neighbor level configuration items."; 1956 leaf peer-as { 1957 type inet:as-number; 1958 description 1959 "AS number of the peer."; 1960 } 1961 leaf local-as { 1962 type inet:as-number; 1963 description 1964 "The local autonomous system number that is to be used when 1965 establishing sessions with the remote peer or peer group, if 1966 this differs from the global BGP router autonomous system 1967 number."; 1968 } 1970 leaf remove-private-as { 1971 type bt:remove-private-as-option; 1972 description 1973 "When this leaf is specified, remove private AS numbers from 1974 updates sent to peers."; 1975 } 1976 container route-flap-damping { 1977 if-feature "bt:damping"; 1978 leaf enable { 1979 type boolean; 1980 default "false"; 1981 description 1982 "Enable route flap damping."; 1983 } 1984 leaf suppress-above { 1985 type decimal64 { 1986 fraction-digits 1; 1987 } 1988 default "3.0"; 1989 description 1990 "This is the value of the instability metric at which 1991 route suppression takes place. A route is not installed 1992 in the forwarding information base (FIB), or announced 1993 even if it is reachable during the period that it is 1994 suppressed."; 1995 } 1996 leaf reuse-above { 1997 type decimal64 { 1998 fraction-digits 1; 1999 } 2000 default "2.0"; 2001 description 2002 "This is the value of the instability metric at which a 2003 suppressed route becomes unsuppressed if it is reachable 2004 but currently suppressed. The value assigned to 2005 reuse-below must be less than suppress-above."; 2006 } 2007 leaf max-flap { 2008 type decimal64 { 2009 fraction-digits 1; 2010 } 2011 default "16.0"; 2012 description 2013 "This is the upper limit of the instability metric. This 2014 value must be greater than the larger of 1 and 2015 suppress-above."; 2016 } 2017 leaf reach-decay { 2018 type uint32; 2019 units "seconds"; 2020 default "300"; 2021 description 2022 "This value specifies the time desired for the instability 2023 metric value to reach one-half of its current value when 2024 the route is reachable. This half-life value determines 2025 the rate at which the metric value is decayed. A smaller 2026 half-life value makes a suppressed route reusable sooner 2027 than a larger value."; 2028 } 2029 leaf unreach-decay { 2030 type uint32; 2031 units "seconds"; 2032 default "900"; 2033 description 2034 "This value acts the same as reach-decay except that it 2035 specifies the rate at which the instability metric is 2036 decayed when a route is unreachable. It should have a 2037 value greater than or equal to reach-decay."; 2038 } 2039 leaf keep-history { 2040 type uint32; 2041 units "seconds"; 2042 default "1800"; 2043 description 2044 "This value specifies the period over which the route 2045 flapping history is to be maintained for a given route. 2046 The size of the configuration arrays described below is 2047 directly affected by this value."; 2048 } 2049 description 2050 "Routes learned via BGP are subject to weighted route 2051 dampening."; 2052 } 2053 leaf-list send-community { 2054 if-feature "bt:send-communities"; 2055 type identityref { 2056 base "bt:send-community-feature"; 2057 } 2058 description 2059 "When supported, this tells the router to propagate any 2060 prefixes that are attached to these community-types."; 2061 } 2062 leaf description { 2063 type string; 2064 description 2065 "An optional textual description (intended primarily for use 2066 with a peer or group"; 2067 } 2068 } 2070 grouping neighbor-group-transport-config { 2071 description 2072 "Configuration parameters relating to the transport protocol 2073 used by the BGP session to the peer."; 2074 leaf tcp-mss { 2075 type uint16; 2076 description 2077 "Sets the max segment size for BGP TCP sessions."; 2078 } 2079 leaf mtu-discovery { 2080 type boolean; 2081 default "true"; 2082 description 2083 "Turns path mtu discovery for BGP TCP sessions on (true) or 2084 off (false)."; 2085 reference 2086 "RFC 1191: Path MTU discovery."; 2087 } 2088 leaf passive-mode { 2089 type boolean; 2090 default "false"; 2091 description 2092 "Wait for peers to issue requests to open a BGP session, 2093 rather than initiating sessions from the local router."; 2094 } 2095 leaf local-address { 2096 type union { 2097 type inet:ip-address; 2098 type leafref { 2099 path "../../../../interfaces/interface/name"; 2100 } 2101 } 2102 description 2103 "Set the local IP (either IPv4 or IPv6) address to use for 2104 the session when sending BGP update messages. This may be 2105 expressed as either an IP address or reference to the name 2106 of an interface."; 2107 } 2108 leaf md5-auth-password { 2109 type string; 2110 description 2111 "Configures an MD5 authentication password for use with 2112 neighboring devices."; 2113 reference 2114 "RFC 2385: Protection of BGP Sessions via the TCP MD5 2115 Signature Option."; 2116 } 2117 container bfd { 2118 if-feature "bt:bfd"; 2119 uses bfd-types:client-cfg-parms; 2120 description 2121 "BFD client configuration."; 2122 reference 2123 "RFC XXXX, YANG Data Model for Bidirectional Forwarding 2124 Detection."; 2125 } 2126 } 2128 grouping graceful-restart-config { 2129 description 2130 "Configuration parameters relating to BGP graceful restart."; 2131 leaf enabled { 2132 type boolean; 2133 default "false"; 2134 description 2135 "Enable or disable the graceful-restart capability."; 2136 } 2137 leaf restart-time { 2138 type uint16 { 2139 range "0..4096"; 2140 } 2141 description 2142 "Estimated time (in seconds) for the local BGP speaker to 2143 restart a session. This value is advertise in the graceful 2144 restart BGP capability. This is a 12-bit value, referred to 2145 as Restart Time in RFC4724. Per RFC4724, the suggested 2146 default value is <= the hold-time value."; 2147 reference 2148 "RFC 4724: Graceful Restart Mechanism for BGP."; 2149 } 2150 leaf stale-routes-time { 2151 type uint32; 2152 description 2153 "An upper-bound on the time that stale routes will be 2154 retained by a router after a session is restarted. If an 2155 End-of-RIB (EOR) marker is received prior to this timer 2156 expiring, stale-routes will be flushed upon its receipt - if 2157 no EOR is received, then when this timer expires stale paths 2158 will be purged. This timer is referred to as the 2159 Selection_Deferral_Timer in RFC4724"; 2160 reference 2161 "RFC 4724: Graceful Restart Mechanism for BGP."; 2162 } 2163 leaf helper-only { 2164 type boolean; 2165 default "true"; 2166 description 2167 "Enable graceful-restart in helper mode only. When this leaf 2168 is set, the local system does not retain forwarding its own 2169 state during a restart, but supports procedures for the 2170 receiving speaker, as defined in RFC4724."; 2171 reference 2172 "RFC 4724: Graceful Restart Mechanism for BGP."; 2173 } 2174 } 2176 grouping global-group-use-multiple-paths { 2177 description 2178 "Common grouping used for both global and groups which provides 2179 configuration and state parameters relating to use of multiple 2180 paths"; 2181 container use-multiple-paths { 2182 description 2183 "Parameters related to the use of multiple paths for the 2184 same NLRI"; 2185 leaf enabled { 2186 type boolean; 2187 default "false"; 2188 description 2189 "Whether the use of multiple paths for the same NLRI is 2190 enabled for the neighbor. This value is overridden by any 2191 more specific configuration value."; 2192 } 2193 container ebgp { 2194 description 2195 "Multi-Path parameters for eBGP"; 2196 leaf allow-multiple-as { 2197 type boolean; 2198 default "false"; 2199 description 2200 "Allow multi-path to use paths from different neighboring 2201 ASes. The default is to only consider multiple paths 2202 from the same neighboring AS."; 2203 } 2204 leaf maximum-paths { 2205 type uint32; 2206 default "1"; 2207 description 2208 "Maximum number of parallel paths to consider when using 2209 BGP multi-path. The default is use a single path."; 2210 } 2211 } 2212 container ibgp { 2213 description 2214 "Multi-Path parameters for iBGP"; 2215 leaf maximum-paths { 2216 type uint32; 2217 default "1"; 2218 description 2219 "Maximum number of parallel paths to consider when using 2220 iBGP multi-path. The default is to use a single path"; 2221 } 2222 } 2223 } 2224 } 2226 grouping route-selection-options { 2227 description 2228 "Configuration and state relating to route selection options"; 2229 container route-selection-options { 2230 description 2231 "Parameters relating to options for route selection"; 2232 leaf always-compare-med { 2233 type boolean; 2234 default "false"; 2235 description 2236 "Compare multi-exit discriminator (MED) value from 2237 different ASes when selecting the best route. The default 2238 behavior is to only compare MEDs for paths received from 2239 the same AS."; 2240 } 2241 leaf ignore-as-path-length { 2242 type boolean; 2243 default "false"; 2244 description 2245 "Ignore the AS path length when selecting the best path. 2246 The default is to use the AS path length and prefer paths 2247 with a shorter length."; 2248 } 2249 leaf external-compare-router-id { 2250 type boolean; 2251 default "true"; 2252 description 2253 "When comparing similar routes received from external BGP 2254 peers, use the router-id as a criterion to select the 2255 active path."; 2256 } 2257 leaf advertise-inactive-routes { 2258 type boolean; 2259 default "false"; 2260 description 2261 "Advertise inactive routes to external peers. The default 2262 is to only advertise active routes."; 2263 reference 2264 "I-D.ietf-idr-best-external: Advertisement of the best 2265 external route in BGP."; 2266 } 2267 leaf enable-aigp { 2268 type boolean; 2269 default "false"; 2270 description 2271 "Flag to enable sending / receiving accumulated IGP 2272 attribute in routing updates"; 2273 reference 2274 "RFC 7311: AIGP Metric Attribute for BGP."; 2275 } 2276 leaf ignore-next-hop-igp-metric { 2277 type boolean; 2278 default "false"; 2279 description 2280 "Ignore the IGP metric to the next-hop when calculating BGP 2281 best-path. The default is to select the route for which 2282 the metric to the next-hop is lowest"; 2283 } 2284 leaf enable-med { 2285 type boolean; 2286 default "false"; 2287 description 2288 "Flag to enable sending/receiving of MED metric attribute 2289 in routing updates."; 2290 } 2291 container med-plus-igp { 2292 leaf enabled { 2293 type boolean; 2294 default "false"; 2295 description 2296 "When enabled allows BGP to use MED and IGP values 2297 defined below to determine the optimal route."; 2298 reference 2299 "RFC 4451: BGP MED Considerations."; 2300 } 2301 leaf igp-multiplier { 2302 type uint16; 2303 default 1; 2304 description 2305 "Specifies an IGP cost multiplier."; 2306 reference 2307 "RFC 4451: BGP MED Considerations."; 2308 } 2309 leaf med-multiplier { 2310 type uint16; 2311 default 1; 2312 description 2313 "Specifies a MED multiplier."; 2314 reference 2315 "RFC 4451: BGP MED Considerations."; 2316 } 2317 description 2318 "The med-plus-igp option enables BGP to use the sum of 2319 MED multiplied by a MED multiplier and IGP cost multiplied 2320 by IGP cost multiplier to select routes when MED is 2321 required to determine the optimal route."; 2322 } 2323 } 2324 } 2326 grouping state { 2327 description 2328 "Grouping containing common counters relating to prefixes and 2329 paths"; 2330 leaf total-paths { 2331 type uint32; 2332 config false; 2333 description 2334 "Total number of BGP paths (BGP routes) within the context"; 2335 } 2336 leaf total-prefixes { 2337 type uint32; 2338 config false; 2339 description 2340 "Total number of BGP prefixes (destinations) received within 2341 the context"; 2342 } 2343 } 2344 } 2345 2347 file "ietf-bgp-common-multiprotocol@2022-03-06.yang" 2348 submodule ietf-bgp-common-multiprotocol { 2349 yang-version 1.1; 2350 belongs-to ietf-bgp { 2351 prefix bgp; 2352 } 2354 import ietf-bgp-types { 2355 prefix bt; 2356 } 2357 import ietf-routing-policy { 2358 prefix rt-pol; 2359 } 2360 import ietf-routing-types { 2361 prefix rt-types; 2362 } 2363 include ietf-bgp-common; 2365 // meta 2367 organization 2368 "IETF IDR Working Group"; 2369 contact 2370 "WG Web: 2371 WG List: 2373 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2374 Keyur Patel (keyur at arrcus.com), 2375 Susan Hares (shares at ndzh.com), 2376 Jeffrey Haas (jhaas at juniper.net)."; 2378 description 2379 "This sub-module contains groupings that are related to support 2380 for multiple protocols in BGP. The groupings are common across 2381 multiple contexts. 2383 Copyright (c) 2021 IETF Trust and the persons identified as 2384 authors of the code. All rights reserved. 2386 Redistribution and use in source and binary forms, with or 2387 without modification, is permitted pursuant to, and subject to 2388 the license terms contained in, the Simplified BSD License set 2389 forth in Section 4.c of the IETF Trust's Legal Provisions 2390 Relating to IETF Documents 2391 (https://trustee.ietf.org/license-info). 2393 This version of this YANG module is part of RFC XXXX 2394 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2395 for full legal notices. 2397 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2398 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2399 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2400 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2401 they appear in all capitals, as shown here."; 2403 revision 2022-03-06 { 2404 description 2405 "Initial Version"; 2406 reference 2407 "RFC XXX, BGP Model for Service Provider Network."; 2408 } 2410 grouping mp-afi-safi-graceful-restart-config { 2411 description 2412 "BGP graceful restart parameters that apply on a per-AFI-SAFI 2413 basis"; 2414 leaf enabled { 2415 type boolean; 2416 must ". = ../../../../graceful-restart/enabled"; 2417 default "false"; 2418 description 2419 "This leaf indicates whether graceful-restart is enabled for 2420 this AFI-SAFI."; 2421 } 2422 } 2424 grouping mp-afi-safi-config { 2425 description 2426 "Configuration parameters used for all BGP AFI-SAFIs"; 2427 leaf name { 2428 type identityref { 2429 base bt:afi-safi-type; 2430 } 2431 description 2432 "AFI,SAFI"; 2433 } 2434 leaf enabled { 2435 type boolean; 2436 default "false"; 2437 description 2438 "This leaf indicates whether this AFI,SAFI is enabled for 2439 the neighbor or group"; 2440 } 2441 } 2443 grouping mp-all-afi-safi-list-contents { 2444 description 2445 "A common grouping used for contents of the list that is used 2446 for AFI-SAFI entries"; 2447 // import and export policy included for the afi/safi 2448 uses rt-pol:apply-policy-group; 2449 container ipv4-unicast { 2450 when "../name = 'bt:ipv4-unicast'" { 2451 description 2452 "Include this container for IPv4 Unicast specific 2453 configuration"; 2454 } 2455 description 2456 "IPv4 unicast configuration options"; 2457 // include common IPv[46] unicast options 2458 uses mp-ipv4-ipv6-unicast-common; 2459 // placeholder for IPv4 unicast specific configuration 2460 } 2461 container ipv6-unicast { 2462 when "../name = 'bt:ipv6-unicast'" { 2463 description 2464 "Include this container for IPv6 Unicast specific 2465 configuration"; 2466 } 2467 description 2468 "IPv6 unicast configuration options"; 2469 // include common IPv[46] unicast options 2470 uses mp-ipv4-ipv6-unicast-common; 2471 // placeholder for IPv6 unicast specific configuration 2472 // options 2473 } 2474 container ipv4-labeled-unicast { 2475 when "../name = 'bt:ipv4-labeled-unicast'" { 2476 description 2477 "Include this container for IPv4 Labeled Unicast specific 2478 configuration"; 2479 } 2480 description 2481 "IPv4 Labeled Unicast configuration options"; 2483 uses mp-all-afi-safi-common; 2484 // placeholder for IPv4 Labeled Unicast specific config 2485 // options 2486 } 2487 container ipv6-labeled-unicast { 2488 when "../name = 'bt:ipv6-labeled-unicast'" { 2489 description 2490 "Include this container for IPv6 Labeled Unicast specific 2491 configuration"; 2492 } 2493 description 2494 "IPv6 Labeled Unicast configuration options"; 2495 uses mp-all-afi-safi-common; 2496 // placeholder for IPv6 Labeled Unicast specific config 2497 // options. 2498 } 2499 container l3vpn-ipv4-unicast { 2500 when "../name = 'bt:l3vpn-ipv4-unicast'" { 2501 description 2502 "Include this container for IPv4 Unicast L3VPN specific 2503 configuration"; 2504 } 2505 description 2506 "Unicast IPv4 L3VPN configuration options"; 2507 // include common L3VPN configuration options 2508 uses mp-l3vpn-ipv4-ipv6-unicast-common; 2509 // placeholder for IPv4 Unicast L3VPN specific config options. 2510 } 2511 container l3vpn-ipv6-unicast { 2512 when "../name = 'bt:l3vpn-ipv6-unicast'" { 2513 description 2514 "Include this container for unicast IPv6 L3VPN specific 2515 configuration"; 2516 } 2517 description 2518 "Unicast IPv6 L3VPN configuration options"; 2519 // include common L3VPN configuration options 2520 uses mp-l3vpn-ipv4-ipv6-unicast-common; 2521 // placeholder for IPv6 Unicast L3VPN specific configuration 2522 // options 2523 } 2524 container l3vpn-ipv4-multicast { 2525 when "../name = 'bt:l3vpn-ipv4-multicast'" { 2526 description 2527 "Include this container for multicast IPv6 L3VPN specific 2528 configuration"; 2529 } 2530 description 2531 "Multicast IPv4 L3VPN configuration options"; 2532 // include common L3VPN multicast options 2533 uses mp-l3vpn-ipv4-ipv6-multicast-common; 2534 // placeholder for IPv4 Multicast L3VPN specific configuration 2535 // options 2536 } 2537 container l3vpn-ipv6-multicast { 2538 when "../name = 'bt:l3vpn-ipv6-multicast'" { 2539 description 2540 "Include this container for multicast IPv6 L3VPN specific 2541 configuration"; 2542 } 2543 description 2544 "Multicast IPv6 L3VPN configuration options"; 2545 // include common L3VPN multicast options 2546 uses mp-l3vpn-ipv4-ipv6-multicast-common; 2547 // placeholder for IPv6 Multicast L3VPN specific configuration 2548 // options 2549 } 2550 container l2vpn-vpls { 2551 when "../name = 'bt:l2vpn-vpls'" { 2552 description 2553 "Include this container for BGP-signalled VPLS specific 2554 configuration"; 2555 } 2556 description 2557 "BGP-signalled VPLS configuration options"; 2558 // include common L2VPN options 2559 uses mp-l2vpn-common; 2560 // placeholder for BGP-signalled VPLS specific configuration 2561 // options 2562 } 2563 container l2vpn-evpn { 2564 when "../name = 'bt:l2vpn-evpn'" { 2565 description 2566 "Include this container for BGP EVPN specific 2567 configuration"; 2568 } 2569 description 2570 "BGP EVPN configuration options"; 2571 // include common L2VPN options 2572 uses mp-l2vpn-common; 2573 // placeholder for BGP EVPN specific configuration options 2574 } 2575 } 2577 // Common groupings across multiple AFI,SAFIs 2578 grouping mp-all-afi-safi-common { 2579 description 2580 "Grouping for configuration common to all AFI,SAFI"; 2581 container prefix-limit { 2582 description 2583 "Parameters relating to the prefix limit for the AFI-SAFI"; 2584 leaf max-prefixes { 2585 type uint32; 2586 description 2587 "Maximum number of prefixes that will be accepted from the 2588 neighbor"; 2589 } 2590 leaf shutdown-threshold-pct { 2591 type rt-types:percentage; 2592 description 2593 "Threshold on number of prefixes that can be received from 2594 a neighbor before generation of warning messages or log 2595 entries. Expressed as a percentage of max-prefixes"; 2596 } 2597 leaf restart-timer { 2598 type uint32; 2599 units "seconds"; 2600 description 2601 "Time interval in seconds after which the BGP session is 2602 re-established after being torn down due to exceeding the 2603 max-prefix limit."; 2604 } 2605 } 2606 } 2608 grouping mp-ipv4-ipv6-unicast-common { 2609 description 2610 "Common configuration that is applicable for IPv4 and IPv6 2611 unicast"; 2612 // include common afi-safi options. 2613 uses mp-all-afi-safi-common; 2614 // configuration options that are specific to IPv[46] unicast 2615 leaf send-default-route { 2616 type boolean; 2617 default "false"; 2618 description 2619 "If set to true, send the default-route to the neighbor(s)"; 2620 } 2621 } 2623 grouping mp-l3vpn-ipv4-ipv6-unicast-common { 2624 description 2625 "Common configuration applied across L3VPN for IPv4 2626 and IPv6"; 2627 // placeholder -- specific configuration options that are generic 2628 // across IPv[46] unicast address families. 2629 uses mp-all-afi-safi-common; 2630 } 2632 grouping mp-l3vpn-ipv4-ipv6-multicast-common { 2633 description 2634 "Common configuration applied across L3VPN for IPv4 2635 and IPv6"; 2636 // placeholder -- specific configuration options that are 2637 // generic across IPv[46] multicast address families. 2638 uses mp-all-afi-safi-common; 2639 } 2641 grouping mp-l2vpn-common { 2642 description 2643 "Common configuration applied across L2VPN address 2644 families"; 2645 // placeholder -- specific configuration options that are 2646 // generic across L2VPN address families 2647 uses mp-all-afi-safi-common; 2648 } 2650 // Config groupings for common groups 2652 grouping mp-all-afi-safi-common-prefix-limit-config { 2653 description 2654 "Configuration parameters relating to prefix-limits for an 2655 AFI-SAFI"; 2656 } 2657 } 2658 2660 file "ietf-bgp-common-structure@2022-03-06.yang" 2661 submodule ietf-bgp-common-structure { 2662 yang-version 1.1; 2663 belongs-to ietf-bgp { 2664 prefix bgp; 2665 } 2667 import ietf-routing-policy { 2668 prefix rt-pol; 2669 reference 2670 "RFC ZZZZ, A YANG Data Model for Routing Policy Management"; 2671 } 2672 import ietf-bgp-types { 2673 prefix bt; 2674 reference 2675 "RFC XXXX, BGP YANG Model for Service Provider Network."; 2676 } 2677 include ietf-bgp-common-multiprotocol; 2678 include ietf-bgp-common; 2680 // meta 2682 organization 2683 "IETF IDR Working Group"; 2684 contact 2685 "WG Web: 2686 WG List: 2688 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2689 Keyur Patel (keyur at arrcus.com), 2690 Susan Hares (shares at ndzh.com), 2691 Jeffrey Haas (jhaas at juniper.net)."; 2693 description 2694 "This sub-module contains groupings that are common across 2695 multiple BGP contexts and provide structure around other 2696 primitive groupings. 2698 Copyright (c) 2021 IETF Trust and the persons identified as 2699 authors of the code. All rights reserved. 2701 Redistribution and use in source and binary forms, with or 2702 without modification, is permitted pursuant to, and subject to 2703 the license terms contained in, the Simplified BSD License set 2704 forth in Section 4.c of the IETF Trust's Legal Provisions 2705 Relating to IETF Documents 2706 (https://trustee.ietf.org/license-info). 2708 This version of this YANG module is part of RFC XXXX 2709 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2710 for full legal notices. 2712 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2713 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2714 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2715 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2716 they appear in all capitals, as shown here."; 2718 revision 2022-03-06 { 2719 description 2720 "Initial Version"; 2721 reference 2722 "RFC XXX, BGP Model for Service Provider Network."; 2723 } 2725 grouping structure-neighbor-group-logging-options { 2726 description 2727 "Structural grouping used to include error handling 2728 configuration and state for both BGP neighbors and groups"; 2729 container logging-options { 2730 description 2731 "Logging options for events related to the BGP neighbor or 2732 group"; 2733 leaf log-neighbor-state-changes { 2734 type boolean; 2735 default "true"; 2736 description 2737 "Configure logging of peer state changes. Default is to 2738 enable logging of peer state changes. 2740 Note: Documenting demotion from ESTABLISHED state is 2741 desirable, but documenting all backward transitions 2742 is problematic, and should be avoided."; 2743 } 2744 } 2745 } 2747 grouping structure-neighbor-group-ebgp-multihop { 2748 description 2749 "Structural grouping used to include eBGP multi-hop 2750 configuration and state for both BGP neighbors and peer 2751 groups"; 2752 container ebgp-multihop { 2753 description 2754 "eBGP multi-hop parameters for the BGP peer-group"; 2755 leaf enabled { 2756 type boolean; 2757 default "false"; 2758 description 2759 "When enabled, the referenced group or neighbors are 2760 permitted to be indirectly connected - including cases 2761 where the TTL can be decremented between the BGP peers"; 2762 } 2763 leaf multihop-ttl { 2764 type uint8; 2765 description 2766 "Time-to-live value to use when packets are sent to the 2767 referenced group or neighbors and ebgp-multihop is 2768 enabled"; 2769 } 2771 } 2772 } 2774 grouping structure-neighbor-group-route-reflector { 2775 description 2776 "Structural grouping used to include route reflector 2777 configuration and state for both BGP neighbors and peer 2778 groups"; 2779 container route-reflector { 2780 description 2781 "Route reflector parameters for the BGP peer-group"; 2782 reference 2783 "RFC 4456: BGP Route Reflection."; 2784 leaf cluster-id { 2785 type bt:rr-cluster-id-type; 2786 description 2787 "Route Reflector cluster id to use when local router is 2788 configured as a route reflector. Commonly set at the 2789 group level, but allows a different cluster id to be set 2790 for each neighbor."; 2791 reference 2792 "RFC 4456: BGP Route Reflection: An Alternative to 2793 Full Mesh."; 2794 } 2795 leaf no-client-reflect { 2796 type boolean; 2797 default "false"; 2798 description 2799 "When set to 'true', this disables route redistribution 2800 by the Route Reflector. It is set 'true' when the client 2801 is fully meshed in its peer-group to prevent sending of 2802 redundant route advertisements."; 2803 } 2804 leaf client { 2805 type boolean; 2806 default "false"; 2807 description 2808 "Configure the neighbor as a route reflector client."; 2809 reference 2810 "RFC 4456: BGP Route Reflection: An Alternative to 2811 Full Mesh."; 2812 } 2813 } 2814 } 2816 grouping structure-neighbor-group-as-path-options { 2817 description 2818 "Structural grouping used to include AS_PATH manipulation 2819 configuration and state for both BGP neighbors and peer 2820 groups"; 2821 container as-path-options { 2822 description 2823 "AS_PATH manipulation parameters for the BGP neighbor or 2824 group"; 2825 leaf allow-own-as { 2826 type uint8; 2827 default "0"; 2828 description 2829 "Specify the number of occurrences of the local BGP 2830 speaker's AS that can occur within the AS_PATH before it 2831 is rejected as looped."; 2832 } 2833 leaf replace-peer-as { 2834 type boolean; 2835 default "false"; 2836 description 2837 "Replace occurrences of the peer's AS in the AS_PATH with 2838 the local autonomous system number"; 2839 } 2840 } 2841 } 2843 grouping structure-neighbor-group-add-paths { 2844 description 2845 "Structural grouping used to include ADD-PATHs configuration 2846 and state for both BGP neighbors and peer groups"; 2847 container add-paths { 2848 if-feature "bt:add-paths"; 2849 description 2850 "Parameters relating to the advertisement and receipt of 2851 multiple paths for a single NLRI (add-paths)"; 2852 reference 2853 "RFC 7911: Advertisements of Multiple Paths in BGP."; 2854 leaf receive { 2855 type boolean; 2856 default "false"; 2857 description 2858 "Enable ability to receive multiple path advertisements for 2859 an NLRI from the neighbor or group"; 2860 } 2861 choice send { 2862 description 2863 "Choice of sending the max. number of paths or to send 2864 all."; 2865 case max { 2866 leaf max { 2867 type uint8; 2868 description 2869 "The maximum number of paths to advertise to neighbors 2870 for a single NLRI"; 2871 } 2872 } 2873 case all { 2874 leaf all { 2875 type empty; 2876 description 2877 "Send all the path advertisements to neighbors for a 2878 single NLRI."; 2879 } 2880 } 2881 } 2882 leaf eligible-prefix-policy { 2883 type leafref { 2884 path "/rt-pol:routing-policy/rt-pol:policy-definitions/" 2885 + "rt-pol:policy-definition/rt-pol:name"; 2886 } 2887 description 2888 "A reference to a routing policy which can be used to 2889 restrict the prefixes for which add-paths is enabled"; 2890 } 2891 } 2892 } 2893 } 2894 2896 file "ietf-bgp-neighbor@2022-03-06.yang" 2897 submodule ietf-bgp-neighbor { 2898 yang-version 1.1; 2899 belongs-to ietf-bgp { 2900 prefix bgp; 2901 } 2903 import ietf-bgp-types { 2904 prefix bt; 2905 reference 2906 "RFC XXXX, BGP Model for Service Provider Network."; 2907 } 2909 // Include the common submodule 2911 include ietf-bgp-common; 2912 include ietf-bgp-common-multiprotocol; 2913 include ietf-bgp-common-structure; 2914 // meta 2916 organization 2917 "IETF IDR Working Group"; 2918 contact 2919 "WG Web: 2920 WG List: 2922 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2923 Keyur Patel (keyur at arrcus.com), 2924 Susan Hares (shares at ndzh.com), 2925 Jeffrey Haas (jhaas at juniper.net)."; 2927 description 2928 "This sub-module contains groupings that are specific to the 2929 neighbor context of the BGP module. 2931 Copyright (c) 2021 IETF Trust and the persons identified as 2932 authors of the code. All rights reserved. 2934 Redistribution and use in source and binary forms, with or 2935 without modification, is permitted pursuant to, and subject to 2936 the license terms contained in, the Simplified BSD License set 2937 forth in Section 4.c of the IETF Trust's Legal Provisions 2938 Relating to IETF Documents 2939 (https://trustee.ietf.org/license-info). 2941 This version of this YANG module is part of RFC XXXX 2942 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2943 for full legal notices. 2945 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2946 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2947 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2948 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2949 they appear in all capitals, as shown here."; 2951 revision 2022-03-06 { 2952 description 2953 "Initial Version"; 2954 reference 2955 "RFC XXX, BGP Model for Service Provider Network."; 2956 } 2958 grouping bgp-neighbor-use-multiple-paths { 2959 description 2960 "Multi-path configuration and state applicable to a BGP 2961 neighbor"; 2963 container use-multiple-paths { 2964 description 2965 "Parameters related to the use of multiple-paths for the same 2966 NLRI when they are received only from this neighbor"; 2967 leaf enabled { 2968 type boolean; 2969 default "false"; 2970 description 2971 "Whether the use of multiple paths for the same NLRI is 2972 enabled for the neighbor."; 2973 } 2974 container ebgp { 2975 description 2976 "Multi-path configuration for eBGP"; 2977 leaf allow-multiple-as { 2978 type boolean; 2979 default "false"; 2980 description 2981 "Allow multi-path to use paths from different neighboring 2982 ASes. The default is to only consider multiple paths 2983 from the same neighboring AS."; 2984 } 2985 } 2986 } 2987 } 2989 grouping bgp-neighbor-counters-message-types-state { 2990 description 2991 "Grouping of BGP message types, included for re-use across 2992 counters"; 2993 leaf updates-received { 2994 type uint64; 2995 description 2996 "Number of BGP UPDATE messages received from this neighbor."; 2997 reference 2998 "RFC 4273: bgpPeerInUpdates."; 2999 } 3000 leaf updates-sent { 3001 type uint64; 3002 description 3003 "Number of BGP UPDATE messages sent to this neighbor"; 3004 reference 3005 "RFC 4273 - bgpPeerOutUpdates"; 3006 } 3007 leaf messages-received { 3008 type uint64; 3009 description 3010 "Number of BGP messages received from thsi neighbor"; 3012 reference 3013 "RFC 4273 - bgpPeerInTotalMessages"; 3014 } 3015 leaf messages-sent { 3016 type uint64; 3017 description 3018 "Number of BGP messages received from thsi neighbor"; 3019 reference 3020 "RFC 4273 - bgpPeerOutTotalMessages"; 3021 } 3022 leaf notification { 3023 type uint64; 3024 description 3025 "Number of BGP NOTIFICATION messages indicating an error 3026 condition has occurred exchanged."; 3027 } 3028 } 3030 grouping bgp-neighbor-afi-safi-list { 3031 description 3032 "List of address-families associated with the BGP neighbor"; 3033 list afi-safi { 3034 key "name"; 3035 description 3036 "AFI, SAFI configuration available for the neighbor or 3037 group"; 3038 uses mp-afi-safi-config; 3039 leaf active { 3040 type boolean; 3041 config false; 3042 description 3043 "This value indicates whether a particular AFI-SAFI has 3044 been successfully negotiated with the peer. An AFI-SAFI 3045 may be enabled in the current running configuration, but 3046 a session restart may be required in order to negotiate 3047 the new capability."; 3048 } 3049 container prefixes { 3050 config false; 3051 description 3052 "Prefix counters for the AFI/SAFI in this BGP session"; 3053 leaf received { 3054 type uint32; 3055 description 3056 "The number of prefixes received from the neighbor"; 3057 } 3058 leaf sent { 3059 type uint32; 3060 description 3061 "The number of prefixes advertised to the neighbor"; 3062 } 3063 leaf installed { 3064 type uint32; 3065 description 3066 "The number of advertised prefixes installed in the 3067 Loc-RIB"; 3068 } 3069 } 3070 container graceful-restart { 3071 if-feature "bt:graceful-restart"; 3072 description 3073 "Parameters relating to BGP graceful-restart"; 3074 uses mp-afi-safi-graceful-restart-config; 3075 leaf received { 3076 type boolean; 3077 config false; 3078 description 3079 "This leaf indicates whether the neighbor advertised the 3080 ability to support graceful-restart for this AFI-SAFI"; 3081 } 3082 leaf advertised { 3083 type boolean; 3084 config false; 3085 description 3086 "This leaf indicates whether the ability to support 3087 graceful-restart has been advertised to the peer"; 3088 } 3089 leaf local-forwarding-state-preserved { 3090 type boolean; 3091 config false; 3092 description 3093 "This leaf indicates whether the local router has 3094 or would advertise the Forwarding State bit in its 3095 Graceful Restart capability for this AFI-SAFI."; 3096 reference 3097 "RFC 4724: Graceful Restart Mechanism for BGP."; 3098 } 3099 leaf forwarding-state-preserved { 3100 type boolean; 3101 config false; 3102 description 3103 "This leaf indicates whether the neighbor has advertised 3104 the Forwarding State bit in its Graceful Restart 3105 capability for this AFI-SAFI."; 3106 reference 3107 "RFC 4724: Graceful Restart Mechanism for BGP."; 3109 } 3110 leaf end-of-rib-received { 3111 type boolean; 3112 config false; 3113 description 3114 "This leaf indicates whether the neighbor has advertised 3115 the End-of-RIB marker for this AFI-SAFI."; 3116 reference 3117 "RFC 4724: Graceful Restart Mechanism for BGP."; 3118 } 3119 } 3120 uses mp-all-afi-safi-list-contents; 3121 uses bgp-neighbor-use-multiple-paths; 3122 } 3123 } 3124 } 3125 3127 7.2. BGP types 3129 file "ietf-bgp-types@2022-03-06.yang" 3130 module ietf-bgp-types { 3131 yang-version 1.1; 3132 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types"; 3133 prefix bt; 3135 import ietf-inet-types { 3136 prefix inet; 3137 } 3139 // meta 3141 organization 3142 "IETF IDR Working Group"; 3143 contact 3144 "WG Web: 3145 WG List: 3147 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3148 Keyur Patel (keyur at arrcus.com), 3149 Susan Hares (shares at ndzh.com), 3150 Jeffrey Haas (jhaas at juniper.net)."; 3152 description 3153 "This module contains general data definitions for use in BGP. 3154 It can be imported by modules that make use of BGP attributes. 3156 Copyright (c) 2021 IETF Trust and the persons identified as 3157 authors of the code. All rights reserved. 3159 Redistribution and use in source and binary forms, with or 3160 without modification, is permitted pursuant to, and subject to 3161 the license terms contained in, the Simplified BSD License set 3162 forth in Section 4.c of the IETF Trust's Legal Provisions 3163 Relating to IETF Documents 3164 (https://trustee.ietf.org/license-info). 3166 This version of this YANG module is part of RFC XXXX 3167 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 3168 for full legal notices. 3170 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 3171 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 3172 'MAY', and 'OPTIONAL' in this document are to be interpreted as 3173 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 3174 they appear in all capitals, as shown here."; 3176 revision 2022-03-06 { 3177 description 3178 "Initial Version"; 3179 reference 3180 "RFC XXX, BGP Model for Service Provider Network."; 3181 } 3183 /* 3184 * Features. 3185 */ 3187 feature graceful-restart { 3188 description 3189 "Graceful restart as defined in RFC 4724 is supported."; 3190 } 3192 feature clear-neighbors { 3193 description 3194 "Clearing of BGP neighbors is supported."; 3195 } 3197 feature clear-statistics { 3198 description 3199 "Clearing of BGP statistics is supported."; 3200 } 3202 feature send-communities { 3203 description 3204 "Enable the propagation of communities."; 3206 } 3208 feature ttl-security { 3209 description 3210 "BGP Time To Live (TTL) security check support."; 3211 reference 3212 "RFC 5082, The Generalized TTL Security Mechanism (GTSM)."; 3213 } 3215 feature bfd { 3216 description 3217 "Support for BFD detection of BGP neighbor reachability."; 3218 reference 3219 "RFC 5880, Bidirectional Forward Detection (BFD), 3220 RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6 3221 (Single Hop), 3222 RFC 5883, Bidirectional Forwarding Detection (BFD) for 3223 Multihop Paths."; 3224 } 3226 feature damping { 3227 description 3228 "Weighted route dampening is supported."; 3229 } 3231 feature clear-routes { 3232 description 3233 "Clearing of BGP routes is supported."; 3234 } 3236 feature add-paths { 3237 description 3238 "Advertisement of multiple paths for the same address prefix 3239 without the new paths implicitly replacing any previous 3240 ones."; 3241 reference 3242 "RFC 7911: Advertisement of Multiple Paths in BGP."; 3243 } 3245 feature route-refresh { 3246 description 3247 "Support for the BGP Route Refresh capability."; 3248 reference 3249 "RFC 2918: Route Refresh Capability for BGP-4."; 3250 } 3252 /* 3253 * Identities. 3255 */ 3257 identity bgp-capability { 3258 description 3259 "Base identity for a BGP capability"; 3260 } 3262 identity mp-bgp { 3263 base bgp-capability; 3264 description 3265 "Multi-protocol extensions to BGP"; 3266 reference 3267 "RFC 4760: Multiprotocol Extentions for BGP-4."; 3268 } 3270 identity route-refresh { 3271 base bgp-capability; 3272 description 3273 "The BGP route-refresh functionality"; 3274 reference 3275 "RFC 2918: Route Refresh Capability for BGP-4."; 3276 } 3278 identity asn32 { 3279 base bgp-capability; 3280 description 3281 "4-byte (32-bit) AS number functionality"; 3282 reference 3283 "RFC6793: BGP Support for Four-Octet Autonomous System (AS) 3284 Number Space."; 3285 } 3287 identity graceful-restart { 3288 if-feature "graceful-restart"; 3289 base bgp-capability; 3290 description 3291 "Graceful restart functionality"; 3292 reference 3293 "RFC 4724: Graceful Restart Mechanism for BGP."; 3294 } 3296 identity add-paths { 3297 if-feature "add-paths"; 3298 base bgp-capability; 3299 description 3300 "Advertisement of multiple paths for the same address prefix 3301 without the new paths implicitly replacing any previous 3302 ones."; 3304 reference 3305 "RFC 7911: Advertisement of Multiple Paths in BGP."; 3306 } 3308 identity afi-safi-type { 3309 description 3310 "Base identity type for AFI,SAFI tuples for BGP-4"; 3311 reference 3312 "RFC4760: Multiprotocol Extentions for BGP-4"; 3313 } 3315 identity ipv4-unicast { 3316 base afi-safi-type; 3317 description 3318 "IPv4 unicast (AFI,SAFI = 1,1)"; 3319 reference 3320 "RFC4760: Multiprotocol Extentions for BGP-4"; 3321 } 3323 identity ipv6-unicast { 3324 base afi-safi-type; 3325 description 3326 "IPv6 unicast (AFI,SAFI = 2,1)"; 3327 reference 3328 "RFC4760: Multiprotocol Extentions for BGP-4"; 3329 } 3331 identity ipv4-labeled-unicast { 3332 base afi-safi-type; 3333 description 3334 "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; 3335 reference 3336 "RFC 8277: Using BGP to Bind MPLS Labels to Address Prefixes."; 3337 } 3339 identity ipv6-labeled-unicast { 3340 base afi-safi-type; 3341 description 3342 "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; 3343 reference 3344 "RFC 8277: Using BGP to Bind MPLS Labels to Address Prefixes."; 3345 } 3347 identity l3vpn-ipv4-unicast { 3348 base afi-safi-type; 3349 description 3350 "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; 3351 reference 3352 "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; 3353 } 3355 identity l3vpn-ipv6-unicast { 3356 base afi-safi-type; 3357 description 3358 "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; 3359 reference 3360 "RFC 4659: BGP-MPLS IP Virtual Private Network (VPN) Extension 3361 for IPv6 VPN."; 3362 } 3364 identity l3vpn-ipv4-multicast { 3365 base afi-safi-type; 3366 description 3367 "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; 3368 reference 3369 "RFC 6514: BGP Encodings and Procedures for Multicast in 3370 MPLS/BGP IP VPNs."; 3371 } 3373 identity l3vpn-ipv6-multicast { 3374 base afi-safi-type; 3375 description 3376 "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; 3377 reference 3378 "RFC 6514: BGP Encodings and Procedures for Multicast in 3379 MPLS/BGP IP VPNs."; 3380 } 3382 identity l2vpn-vpls { 3383 base afi-safi-type; 3384 description 3385 "BGP-signalled VPLS (AFI,SAFI = 25,65)"; 3386 reference 3387 "RFC 4761: Virtual Private LAN Service (VPLS) Using BGP for 3388 Auto-Discovery and Signaling."; 3389 } 3391 identity l2vpn-evpn { 3392 base afi-safi-type; 3393 description 3394 "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; 3395 } 3397 identity bgp-well-known-std-community { 3398 description 3399 "Base identity for reserved communities within the standard 3400 community space defined by RFC 1997. These communities must 3401 fall within the range 0xFFFF0000 to 0xFFFFFFFF"; 3402 reference 3403 "RFC 1997: BGP Communities Attribute."; 3404 } 3406 identity no-export { 3407 base bgp-well-known-std-community; 3408 description 3409 "Do not export NLRI received carrying this community outside 3410 the bounds of this autonomous system, or this confederation 3411 (if the local autonomous system is a confederation member AS). 3412 This community has a value of 0xFFFFFF01."; 3413 reference 3414 "RFC 1997: BGP Communities Attribute."; 3415 } 3417 identity no-advertise { 3418 base bgp-well-known-std-community; 3419 description 3420 "All NLRI received carrying this community must not be 3421 advertised to other BGP peers. This community has a value of 3422 0xFFFFFF02."; 3423 reference 3424 "RFC 1997: BGP Communities Attribute."; 3425 } 3427 identity no-export-subconfed { 3428 base bgp-well-known-std-community; 3429 description 3430 "All NLRI received carrying this community must not be 3431 advertised to external BGP peers - including over 3432 confederation sub-AS boundaries. This community has a value of 3433 0xFFFFFF03."; 3434 reference 3435 "RFC 1997: BGP Communities Attribute."; 3436 } 3438 identity no-peer { 3439 base bgp-well-known-std-community; 3440 description 3441 "An autonomous system receiving NLRI tagged with this community 3442 is advised not to re-advertise the NLRI to external bilateral 3443 peer autonomous systems. An AS may also filter received NLRI 3444 from bilateral peer sessions when they are tagged with this 3445 community value. This community has a value of 0xFFFFFF04."; 3446 reference 3447 "RFC 3765: NOPEER Community for BGP."; 3449 } 3451 identity as-path-segment-type { 3452 description 3453 "Base AS Path Segment Type. In [BGP-4], the path segment type 3454 is a 1-octet field with the following values defined."; 3455 reference 3456 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3457 } 3459 identity as-set { 3460 base as-path-segment-type; 3461 description 3462 "Unordered set of autonomous systems that a route in the UPDATE 3463 message has traversed."; 3464 reference 3465 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3466 } 3468 identity as-sequence { 3469 base as-path-segment-type; 3470 description 3471 "Ordered set of autonomous systems that a route in the UPDATE 3472 message has traversed."; 3473 reference 3474 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3475 } 3477 identity as-confed-sequence { 3478 base as-path-segment-type; 3479 description 3480 "Ordered set of Member Autonomous Systems in the local 3481 confederation that the UPDATE message has traversed."; 3482 reference 3483 "RFC 5065, Autonomous System Configuration for BGP."; 3484 } 3486 identity as-confed-set { 3487 base as-path-segment-type; 3488 description 3489 "Unordered set of Member Autonomous Systems in the local 3490 confederation that the UPDATE message has traversed."; 3491 reference 3492 "RFC 5065, Autonomous System Configuration for BGP."; 3493 } 3495 identity send-community-feature { 3496 description 3497 "Base identity to identify send-community feature."; 3498 } 3500 identity standard { 3501 base send-community-feature; 3502 description 3503 "Send standard communities."; 3504 reference 3505 "RFC 1997: BGP Communities Attribute."; 3506 } 3508 identity extended { 3509 base send-community-feature; 3510 description 3511 "Send extended communities."; 3512 reference 3513 "RFC 4360: BGP Extended Communities Attribute."; 3514 } 3516 identity large { 3517 base send-community-feature; 3518 description 3519 "Send large communities."; 3520 reference 3521 "RFC 8092: BGP Large Communities Attribute."; 3522 } 3524 /* 3525 * Typedefs. 3526 */ 3528 typedef bgp-session-direction { 3529 type enumeration { 3530 enum inbound { 3531 description 3532 "Refers to all NLRI received from the BGP peer"; 3533 } 3534 enum oubound { 3535 description 3536 "Refers to all NLRI advertised to the BGP peer"; 3537 } 3538 } 3539 description 3540 "Type to describe the direction of NLRI transmission"; 3541 } 3543 typedef bgp-well-known-community-type { 3544 type identityref { 3545 base bgp-well-known-std-community; 3546 } 3547 description 3548 "Type definition for well-known IETF community attribute 3549 values."; 3550 reference 3551 "IANA Border Gateway Protocol (BGP) Well Known Communities"; 3552 } 3554 typedef bgp-std-community-type { 3555 type union { 3556 type uint32; 3557 type string { 3558 pattern '([0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|' 3559 + '6[0-5][0-9]{3}|66[0-4][0-9]{2}|' 3560 + '665[0-2][0-9]|6653[0-5]):' 3561 + '([0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|' 3562 + '6[0-5][0-9]{3}|66[0-4][0-9]{2}|' 3563 + '665[0-2][0-9]|6653[0-5])'; 3564 } 3565 } 3566 description 3567 "Type definition for standard community attributes."; 3568 reference 3569 "RFC 1997 - BGP Communities Attribute"; 3570 } 3572 typedef bgp-ext-community-type { 3573 type union { 3574 type string { 3575 // Type 1: 2-octet global and 4-octet local 3576 // (AS number) (Integer) 3577 pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3578 + '[1-9][0-9]{1,4}|[0-9]):' 3579 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3580 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3581 } 3583 type string { 3584 // Type 2: 4-octet global and 2-octet local 3585 // (ipv4-address) (integer) 3586 pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3587 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3588 + '2[0-4][0-9]|25[0-5]):' 3589 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3590 + '[1-9][0-9]{1,4}|[0-9])'; 3591 } 3592 type string { 3593 // route-target with Type 1 3594 // route-target:(ASN):(local-part) 3595 // 2 octets global and 4 octets local. 3596 pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' 3597 + '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' 3598 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3599 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3600 } 3602 type string { 3603 // route-target with Type 2 3604 // route-target:(IPv4):(local-part) 3605 // 4 bytes of IP address, and 2 bytes for local. 3606 pattern 'route\-target:' 3607 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3608 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3609 + '2[0-4][0-9]|25[0-5]):' 3610 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3611 + '[1-9][0-9]{1,4}|[0-9])'; 3612 } 3614 type string { 3615 // route-origin with Type 1 3616 // All 6 octets are open. 3617 pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' 3618 + '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' 3619 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3620 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3621 } 3623 type string { 3624 // route-origin with Type 2 3625 // 4 octets of IP address and two octets of local. 3626 pattern 'route\-origin:' 3627 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3628 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3629 + '2[0-4][0-9]|25[0-5]):' 3630 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3631 + '[1-9][0-9]{1,4}|[0-9])'; 3632 } 3633 } 3634 description 3635 "Type definition for extended community attributes"; 3636 reference 3637 "RFC 4360 - BGP Extended Communities Attribute"; 3638 } 3639 typedef bgp-community-regexp-type { 3640 type string; 3641 description 3642 "Type definition for communities specified as regular 3643 expression patterns"; 3644 } 3646 typedef bgp-origin-attr-type { 3647 type enumeration { 3648 enum igp { 3649 description 3650 "Origin of the NLRI is internal"; 3651 } 3652 enum egp { 3653 description 3654 "Origin of the NLRI is EGP"; 3655 } 3656 enum incomplete { 3657 description 3658 "Origin of the NLRI is neither IGP or EGP"; 3659 } 3660 } 3661 description 3662 "Type definition for standard BGP origin attribute"; 3663 reference 3664 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3"; 3665 } 3667 typedef bgp-large-community-type { 3668 type string { 3669 // 4-octets global:4-octets local part-1:4-octets local part-2. 3670 pattern '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3671 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9]):' 3672 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3673 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9]):' 3674 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3675 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3676 } 3677 description 3678 "Type definition for a large BGP community"; 3679 reference 3680 "RFC 8092: BGP Large Communities Attribute."; 3681 } 3683 typedef peer-type { 3684 type enumeration { 3685 enum internal { 3686 description 3687 "Internal (IBGP) peer"; 3688 } 3689 enum external { 3690 description 3691 "External (EBGP) peer"; 3692 } 3693 enum confederation-internal { 3694 description 3695 "Confederation Internal (IBGP) peer."; 3696 } 3697 enum confederation-external { 3698 description 3699 "Confederation External (EBGP) peer."; 3700 } 3701 } 3702 description 3703 "Labels a peer or peer group as explicitly internal, 3704 external, or the related confederation type."; 3705 reference 3706 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 1.1. 3707 RFC 5065, Autonomous System Configuration for BGP."; 3708 } 3710 identity remove-private-as-option { 3711 description 3712 "Base identity for options for removing private autonomous 3713 system numbers from the AS_PATH attribute"; 3714 } 3716 identity private-as-remove-all { 3717 base remove-private-as-option; 3718 description 3719 "Strip all private autonomous system numbers from the AS_PATH. 3720 This action is performed regardless of the other content of 3721 the AS_PATH attribute, and for all instances of private AS 3722 numbers within that attribute."; 3723 } 3725 identity private-as-replace-all { 3726 base remove-private-as-option; 3727 description 3728 "Replace all instances of private autonomous system numbers in 3729 the AS_PATH with the local BGP speaker's autonomous system 3730 number. This action is performed regardless of the other 3731 content of the AS_PATH attribute, and for all instances of 3732 private AS number within that attribute."; 3733 } 3734 typedef remove-private-as-option { 3735 type identityref { 3736 base remove-private-as-option; 3737 } 3738 description 3739 "Set of options for configuring how private AS path numbers 3740 are removed from advertisements"; 3741 } 3743 typedef rr-cluster-id-type { 3744 type union { 3745 type uint32; 3746 type inet:ipv4-address; 3747 } 3748 description 3749 "Union type for route reflector cluster ids: 3750 option 1: 4-byte number 3751 option 2: IP address"; 3752 } 3753 } 3754 3756 7.3. BGP policy data 3758 file "ietf-bgp-policy@2022-03-06.yang" 3759 module ietf-bgp-policy { 3760 yang-version 1.1; 3761 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; 3762 prefix bp; 3764 // import some basic types 3766 import ietf-inet-types { 3767 prefix inet; 3768 } 3769 import ietf-routing-policy { 3770 prefix rt-pol; 3771 } 3772 import ietf-bgp-types { 3773 prefix bt; 3774 } 3775 import ietf-routing-types { 3776 prefix rt-types; 3777 } 3779 organization 3780 "IETF IDR Working Group"; 3781 contact 3782 "WG Web: 3783 WG List: 3785 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3786 Keyur Patel (keyur at arrcus.com), 3787 Susan Hares (shares at ndzh.com), 3788 Jeffrey Haas (jhaas at juniper.net)."; 3790 description 3791 "This module contains data definitions for BGP routing policy. 3792 It augments the base routing-policy module with BGP-specific 3793 options for conditions and actions. 3795 Copyright (c) 2022 IETF Trust and the persons identified as 3796 authors of the code. All rights reserved. 3798 Redistribution and use in source and binary forms, with or 3799 without modification, is permitted pursuant to, and subject to 3800 the license terms contained in, the Simplified BSD License set 3801 forth in Section 4.c of the IETF Trust's Legal Provisions 3802 Relating to IETF Documents 3803 (https://trustee.ietf.org/license-info). 3805 This version of this YANG module is part of RFC XXXX 3806 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 3807 for full legal notices. 3809 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 3810 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 3811 'MAY', and 'OPTIONAL' in this document are to be interpreted as 3812 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 3813 they appear in all capitals, as shown here."; 3815 revision 2022-03-06 { 3816 description 3817 "Initial Version"; 3818 reference 3819 "RFC XXX, BGP Model for Service Provider Network."; 3820 } 3822 /* 3823 * typedef statements 3824 */ 3826 typedef bgp-set-community-option-type { 3827 type enumeration { 3828 enum add { 3829 description 3830 "Add the specified communities to the existing 3831 community attribute."; 3832 } 3833 enum remove { 3834 description 3835 "Remove the specified communities from the 3836 existing community attribute."; 3837 } 3838 enum replace { 3839 description 3840 "Replace the existing community attribute with 3841 the specified communities. If an empty set is 3842 specified, this removes the community attribute 3843 from the route."; 3844 } 3845 } 3846 description 3847 "Type definition for options when setting the community 3848 attribute in a policy action."; 3849 } 3851 typedef bgp-next-hop-type { 3852 type union { 3853 type inet:ip-address-no-zone; 3854 type enumeration { 3855 enum self { 3856 description 3857 "Special designation for local router's own 3858 address, i.e., next-hop-self."; 3859 } 3860 } 3861 } 3862 description 3863 "Type definition for specifying next-hop in policy actions."; 3864 } 3866 typedef bgp-set-med-type { 3867 type union { 3868 type uint32; 3869 type string { 3870 pattern '^[+-]([0-9]{1,8}|[0-3][0-9]{1,9}|4[0-1][0-9]{1,8}|' 3871 + '428[0-9]{1,7}|429[0-3][0-9]{1,6}|42948[0-9]{1,5}|' 3872 + '42949[0-5][0-9]{1,4}|429496[0-6][0-9]{1,3}|' 3873 + '4294971[0-9]{1,2}|42949728[0-9]|42949729[0-5])$'; 3874 } 3875 type enumeration { 3876 enum igp { 3877 description 3878 "Set the MED value to the IGP cost toward the 3879 next hop for the route."; 3880 } 3881 enum med-plus-igp { 3882 description 3883 "Before comparing MED values for path selection, adds to 3884 the MED the cost of the IGP route to the BGP next-hop 3885 destination. 3887 This option replaces the MED value for the router, 3888 but does not affect the IGP metric comparison. As a 3889 result, when multiple routes have the same value 3890 after the MED-plus-IPG comparison, and route selection 3891 continues, the IGP route metric is also compared, even 3892 though it was added to the MED value and compared 3893 earlier in the selection process. 3895 Useful when the downstream AS requires the complete 3896 cost of a certain route that is received across 3897 multiple ASs."; 3898 } 3899 } 3900 } 3901 description 3902 "Type definition for specifying how the BGP MED can 3903 be set in BGP policy actions. The three choices are to set 3904 the MED directly, increment/decrement using +/- notation, 3905 and setting it to the IGP cost (predefined value)."; 3906 } 3908 // Identities 3910 // augment statements 3912 augment "/rt-pol:routing-policy/rt-pol:defined-sets" { 3913 description 3914 "Adds BGP defined sets container to routing policy model."; 3915 container bgp-defined-sets { 3916 description 3917 "BGP-related set definitions for policy match conditions."; 3918 container community-sets { 3919 description 3920 "Enclosing container for list of defined BGP community 3921 sets."; 3922 list community-set { 3923 key "name"; 3924 description 3925 "List of defined BGP community sets."; 3927 leaf name { 3928 type string; 3929 description 3930 "Name / label of the community set -- this is used to 3931 reference the set in match conditions."; 3932 } 3933 leaf-list member { 3934 type union { 3935 type bt:bgp-std-community-type; 3936 type bt:bgp-community-regexp-type; 3937 type bt:bgp-well-known-community-type; 3938 } 3939 description 3940 "Members of the community set"; 3941 } 3942 } 3943 } 3945 container ext-community-sets { 3946 description 3947 "Enclosing container for list of extended BGP community 3948 sets"; 3949 list ext-community-set { 3950 key "name"; 3951 description 3952 "List of defined extended BGP community sets"; 3953 leaf name { 3954 type string; 3955 description 3956 "Name / label of the extended community set -- this is 3957 used to reference the set in match conditions"; 3958 } 3959 leaf-list member { 3960 type union { 3961 type rt-types:route-target; 3962 type bt:bgp-community-regexp-type; 3963 } 3964 description 3965 "Members of the extended community set."; 3966 } 3967 } 3968 } 3970 container large-community-sets { 3971 description 3972 "Enclosing container for list of large BGP community 3973 sets"; 3974 list large-community-set { 3975 key "name"; 3976 description 3977 "List of defined large BGP community sets"; 3978 leaf name { 3979 type string; 3980 description 3981 "Name / label of the large community set -- this is 3982 used to reference the set in match conditions"; 3983 } 3984 leaf-list member { 3985 type union { 3986 type bt:bgp-large-community-type; 3987 type bt:bgp-community-regexp-type; 3988 } 3989 description 3990 "Members of the large community set."; 3991 } 3992 } 3993 } 3995 container as-path-sets { 3996 description 3997 "Enclosing container for list of define AS path sets."; 3998 list as-path-set { 3999 key "name"; 4000 description 4001 "List of defined AS path sets."; 4002 leaf name { 4003 type string; 4004 description 4005 "Name of the AS path set -- this is used to reference 4006 the set in match conditions."; 4007 } 4008 leaf-list member { 4009 type string; 4010 description 4011 "AS path regular expression -- list of ASes in the 4012 set."; 4013 } 4014 } 4015 } 4017 container next-hop-sets { 4018 description 4019 "Definition of a list of IPv4 or IPv6 next-hops which can 4020 be matched in a routing policy."; 4022 list next-hop-set { 4023 key "name"; 4024 description 4025 "List of defined next-hop sets for use in policies."; 4027 leaf name { 4028 type string; 4029 description 4030 "Name of the next-hop set."; 4031 } 4032 leaf-list next-hop { 4033 type bgp-next-hop-type; 4034 description 4035 "List of IP addresses in the next-hop set."; 4036 } 4037 } 4038 } 4039 } 4040 } 4042 augment "/rt-pol:routing-policy/rt-pol:policy-definitions/" + 4043 "rt-pol:policy-definition/rt-pol:statements/" + 4044 "rt-pol:statement/rt-pol:conditions" { 4045 description 4046 "BGP policy conditions added to routing policy module."; 4048 container bgp-conditions { 4049 description 4050 "Top-level container for BGP specific policy conditions."; 4052 leaf med-eq { 4053 type uint32; 4054 description 4055 "Condition to check if the received MED value is equal to 4056 the specified value."; 4057 } 4059 leaf origin-eq { 4060 type bt:bgp-origin-attr-type; 4061 description 4062 "Condition to check if the route origin is equal to the 4063 specified value."; 4064 } 4066 leaf-list next-hop-in-eq { 4067 type inet:ip-address-no-zone; 4068 description 4069 "List of next hop addresses to check for in the route 4070 update."; 4072 } 4074 leaf-list afi-safi-in { 4075 type identityref { 4076 base bt:afi-safi-type; 4077 } 4078 description 4079 "List of address families which the NLRI may be within."; 4080 } 4082 leaf local-pref-eq { 4083 type uint32; 4084 description 4085 "Condition to check if the local pref attribute is equal to 4086 the specified value."; 4087 } 4089 leaf-list neighbor-eq { 4090 type inet:ip-address; 4091 description 4092 "List of neighbor addresses to check for in the ingress 4093 direction."; 4094 } 4096 leaf route-type { 4097 type enumeration { 4098 enum internal { 4099 description 4100 "route type is internal."; 4101 } 4102 enum external { 4103 description 4104 "route type is external."; 4105 } 4106 } 4107 description 4108 "Condition to check the route type in the route update."; 4109 } 4111 container community-count { 4112 description 4113 "Value and comparison operations for conditions based on 4114 the number of communities in the route update."; 4116 leaf community-count { 4117 type uint32; 4118 description 4119 "Value for the number of communities in the route 4120 update."; 4121 } 4123 choice operation { 4124 case eq { 4125 leaf eq { 4126 type empty; 4127 description 4128 "Check to see if the value is equal."; 4129 } 4130 } 4132 case lt-or-eq { 4133 leaf lt-or-eq { 4134 type empty; 4135 description 4136 "Check to see if the value is less than or equal."; 4137 } 4138 } 4140 case gt-or-eq { 4141 leaf gt-or-eq { 4142 type empty; 4143 description 4144 "Check to see if the value is greater than or 4145 equal."; 4146 } 4147 } 4148 description 4149 "Choice of operations on the value of community-count."; 4150 } 4151 } 4153 container as-path-length { 4154 description 4155 "Value and comparison operations for conditions based on 4156 the length of the AS path in the route update. 4158 The as-path-length SHALL be calculated and SHALL follow 4159 RFC 4271 rules."; 4160 reference 4161 "RFC 4271: BGP-4."; 4163 leaf as-path-length { 4164 type uint32; 4165 description 4166 "Value of the AS path length in the route update."; 4167 } 4168 choice operation { 4169 case eq { 4170 leaf eq { 4171 type empty; 4172 description 4173 "Check to see if the value is equal."; 4174 } 4175 } 4177 case lt-or-eq { 4178 leaf lt-or-eq { 4179 type empty; 4180 description 4181 "Check to see if the value is less than or equal."; 4182 } 4183 } 4185 case gt-or-eq { 4186 leaf gt-or-eq { 4187 type empty; 4188 description 4189 "Check to see if the value is greater than or 4190 equal."; 4191 } 4192 } 4193 description 4194 "Choice of operations on the value of as-path-len."; 4195 } 4196 } 4198 container match-community-set { 4199 description 4200 "Top-level container for match conditions on communities. 4201 Match a referenced community-set according to the logic 4202 defined in the match-set-options leaf."; 4203 leaf community-set { 4204 type leafref { 4205 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4206 + "bgp-defined-sets/community-sets/" 4207 + "community-set/name"; 4208 } 4209 description 4210 "References a defined community set."; 4211 } 4212 uses rt-pol:match-set-options-group; 4213 } 4215 container match-ext-community-set { 4216 description 4217 "Match a referenced extended community-set according to the 4218 logic defined in the match-set-options leaf."; 4219 leaf ext-community-set { 4220 type leafref { 4221 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4222 + "bgp-defined-sets/ext-community-sets/" 4223 + "ext-community-set/name"; 4224 } 4225 description 4226 "References a defined extended community set."; 4227 } 4228 uses rt-pol:match-set-options-group; 4229 } 4231 container match-large-community-set { 4232 description 4233 "Match a referenced large community-set according to the 4234 logic defined in the match-set-options leaf."; 4235 leaf ext-community-set { 4236 type leafref { 4237 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4238 + "bgp-defined-sets/large-community-sets/" 4239 + "large-community-set/name"; 4240 } 4241 description 4242 "References a defined large community set."; 4243 } 4244 uses rt-pol:match-set-options-group; 4245 } 4247 container match-as-path-set { 4248 description 4249 "Match a referenced as-path set according to the logic 4250 defined in the match-set-options leaf."; 4251 leaf as-path-set { 4252 type leafref { 4253 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4254 + "bgp-defined-sets/as-path-sets/" 4255 + "as-path-set/name"; 4256 } 4257 description 4258 "References a defined AS path set"; 4259 } 4260 uses rt-pol:match-set-options-group; 4261 } 4263 container match-next-hop-set { 4264 description 4265 "Match a referenced next-hop set according to the logic 4266 defined in the match-set-options leaf."; 4267 leaf next-hop-set { 4268 type leafref { 4269 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4270 + "bgp-defined-sets/next-hop-sets/" 4271 + "next-hop-set/name"; 4272 } 4273 description 4274 "Reference a defined next-hop set."; 4275 } 4276 uses rt-pol:match-set-options-group; 4277 } 4278 } 4279 } 4281 augment "/rt-pol:routing-policy/rt-pol:policy-definitions/" + 4282 "rt-pol:policy-definition/rt-pol:statements/" + 4283 "rt-pol:statement/rt-pol:actions" { 4284 description 4285 "BGP policy actions added to routing policy module."; 4286 container bgp-actions { 4287 description 4288 "Top-level container for BGP-specific actions"; 4289 leaf set-route-origin { 4290 type bt:bgp-origin-attr-type; 4291 description 4292 "Set the origin attribute to the specified value"; 4293 } 4294 leaf set-local-pref { 4295 type uint32; 4296 description 4297 "Set the local pref attribute on the route."; 4298 } 4299 leaf set-next-hop { 4300 type bgp-next-hop-type; 4301 description 4302 "Set the next-hop attribute in the route."; 4303 } 4304 leaf set-med { 4305 type bgp-set-med-type; 4306 description 4307 "Set the med metric attribute in the route."; 4308 } 4309 container set-as-path-prepend { 4310 description 4311 "Action to prepend local AS number to the AS-path a 4312 specified number of times"; 4314 leaf repeat-n { 4315 type uint8 { 4316 range "1..max"; 4317 } 4318 description 4319 "Number of times to prepend the local AS number to the AS 4320 path. The value should be between 1 and the maximum 4321 supported by the implementation."; 4322 } 4323 } 4325 container set-community { 4326 description 4327 "Action to set the community attributes of the route, along 4328 with options to modify how the community is modified. 4329 Communities may be set using an inline list OR 4330 reference to an existing defined set (not both)."; 4332 leaf options { 4333 type bgp-set-community-option-type; 4334 description 4335 "Options for modifying the community attribute with 4336 the specified values. These options apply to both 4337 methods of setting the community attribute."; 4338 } 4340 choice method { 4341 description 4342 "Indicates the method used to specify the extended 4343 communities for the set-community action"; 4344 case inline { 4345 leaf-list communities { 4346 type union { 4347 type bt:bgp-std-community-type; 4348 type bt:bgp-well-known-community-type; 4349 } 4350 description 4351 "Set the community values for the update inline with 4352 a list."; 4353 } 4354 } 4356 case reference { 4357 leaf community-set-ref { 4358 type leafref { 4359 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4360 + "bgp-defined-sets/" 4361 + "community-sets/community-set/name"; 4362 } 4363 description 4364 "References a defined community set by name"; 4365 } 4366 } 4367 } 4368 } 4370 container set-ext-community { 4371 description 4372 "Action to set the extended community attributes of the 4373 route, along with options to modify how the community is 4374 modified. Extended communities may be set using an inline 4375 list OR a reference to an existing defined set (but not 4376 both)."; 4378 leaf options { 4379 type bgp-set-community-option-type; 4380 description 4381 "Options for modifying the community attribute with 4382 the specified values. These options apply to both 4383 methods of setting the community attribute."; 4384 } 4386 choice method { 4387 description 4388 "Indicates the method used to specify the extended 4389 communities for the set-ext-community action"; 4390 case inline { 4391 leaf-list communities { 4392 type rt-types:route-target; 4393 description 4394 "Set the extended community values for the update 4395 inline with a list."; 4396 } 4397 } 4398 case reference { 4399 leaf ext-community-set-ref { 4400 type leafref { 4401 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4402 + "bgp-defined-sets/ext-community-sets/" 4403 + "ext-community-set/name"; 4404 } 4405 description 4406 "References a defined extended community set by 4407 name."; 4409 } 4410 } 4411 } 4412 } 4414 container set-large-community { 4415 description 4416 "Action to set the large community attributes of the 4417 route, along with options to modify how the community is 4418 modified. Large communities may be set using an inline 4419 list OR a reference to an existing defined set (but not 4420 both)."; 4422 leaf options { 4423 type bgp-set-community-option-type; 4424 description 4425 "Options for modifying the community attribute with 4426 the specified values. These options apply to both 4427 methods of setting the community attribute."; 4428 } 4430 choice method { 4431 description 4432 "Indicates the method used to specify the large 4433 communities for the set-large-community action"; 4434 case inline { 4435 leaf-list communities { 4436 type bt:bgp-large-community-type; 4437 description 4438 "Set the large community values for the update 4439 inline with a list."; 4440 } 4441 } 4442 case reference { 4443 leaf large-community-set-ref { 4444 type leafref { 4445 path "/rt-pol:routing-policy/rt-pol:defined-sets/" 4446 + "bgp-defined-sets/large-community-sets/" 4447 + "large-community-set/name"; 4448 } 4449 description 4450 "References a defined extended community set by 4451 name."; 4452 } 4453 } 4454 } 4455 } 4456 } 4458 } 4459 } 4460 4462 7.4. RIB modules 4464 file "ietf-bgp-rib@2022-03-06.yang" 4465 submodule ietf-bgp-rib { 4466 yang-version 1.1; 4467 belongs-to ietf-bgp { 4468 prefix br; 4469 } 4471 /* 4472 * Import and Include 4473 */ 4475 import ietf-bgp-types { 4476 prefix bt; 4477 reference 4478 "RFC XXXX: BGP YANG Model for Service Provider Networks."; 4479 } 4480 import ietf-inet-types { 4481 prefix inet; 4482 reference 4483 "RFC 6991: Common YANG Types."; 4484 } 4485 import ietf-yang-types { 4486 prefix yang; 4487 reference 4488 "RFC 6991: Common YANG Types."; 4489 } 4490 import ietf-routing-types { 4491 prefix rt; 4492 reference 4493 "RFC 8294: Routing Area YANG Types."; 4494 } 4495 include ietf-bgp-rib-types; 4496 include ietf-bgp-rib-tables; 4498 // groupings of attributes in three categories: 4499 // - shared across multiple routes 4500 // - common to LOC-RIB and Adj-RIB, but not shared across routes 4501 // - specific to LOC-RIB or Adj-RIB 4502 // groupings of annotations for each route or table 4503 include ietf-bgp-rib-attributes; 4505 organization 4506 "IETF IDR Working Group"; 4507 contact 4508 "WG Web: 4509 WG List: 4511 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4512 Keyur Patel (keyur at arrcus.com), 4513 Susan Hares (shares at ndzh.com), 4514 Jeffrey Haas (jhaas at juniper dot net)."; 4516 description 4517 "Defines a submodule for representing BGP routing table (RIB) 4518 contents. The submodule supports 5 logical RIBs per address 4519 family: 4521 loc-rib: This is the main BGP routing table for the local 4522 routing instance, containing best-path selections for each 4523 prefix. The loc-rib table may contain multiple routes for a 4524 given prefix, with an attribute to indicate which was selected 4525 as the best path. Note that multiple paths may be used or 4526 advertised even if only one path is marked as best, e.g., when 4527 using BGP add-paths. An implementation may choose to mark 4528 multiple paths in the RIB as best path by setting the flag to 4529 true for multiple entries. 4531 adj-rib-in-pre: This is a per-neighbor table containing the NLRI 4532 updates received from the neighbor before any local input policy 4533 rules or filters have been applied. This can be considered the 4534 'raw' updates from a given neighbor. 4536 adj-rib-in-post: This is a per-neighbor table containing the 4537 routes received from the neighbor that are eligible for 4538 best-path selection after local input policy rules have been 4539 applied. 4541 adj-rib-out-pre: This is a per-neighbor table containing routes 4542 eligible for sending (advertising) to the neighbor before output 4543 policy rules have been applied. 4545 adj-rib-out-post: This is a per-neighbor table containing routes 4546 eligible for sending (advertising) to the neighbor after output 4547 policy rules have been applied. 4549 Copyright (c) 2021 IETF Trust and the persons identified as 4550 authors of the code. All rights reserved. 4552 Redistribution and use in source and binary forms, with or 4553 without modification, is permitted pursuant to, and subject to 4554 the license terms contained in, the Simplified BSD License set 4555 forth in Section 4.c of the IETF Trust's Legal Provisions 4556 Relating to IETF Documents 4557 (https://trustee.ietf.org/license-info). 4559 This version of this YANG module is part of RFC XXXX 4560 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4561 for full legal notices. 4563 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4564 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4565 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4566 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4567 they appear in all capitals, as shown here."; 4569 revision 2022-03-06 { 4570 description 4571 "Initial Version"; 4572 reference 4573 "RFC XXXX, BGP YANG Model for Service Provider Network."; 4574 } 4576 grouping attr-set-attributes { 4577 description 4578 "A grouping for all attribute set parameters."; 4580 container attributes { 4581 description 4582 "A container for attribute set parameters."; 4584 leaf origin { 4585 type bt:bgp-origin-attr-type; 4586 description 4587 "BGP attribute defining the origin of the path 4588 information."; 4589 } 4590 leaf atomic-aggregate { 4591 type boolean; 4592 description 4593 "BGP attribute indicating that the prefix is an atomic 4594 aggregate; i.e., the peer selected is a less specific 4595 route without selecting a more specific route that is 4596 subsumed by it."; 4597 reference 4598 "RFC 4271: Section 5.1.6."; 4599 } 4600 leaf next-hop { 4601 type inet:ip-address; 4602 description 4603 "BGP next hop attribute defining the IP address of the 4604 router that should be used as the next hop to the 4605 destination."; 4606 reference 4607 "RFC 4271: Section 5.1.3."; 4608 } 4609 leaf link-local-next-hop { 4610 type inet:ipv6-address; 4611 description 4612 "When both a global and a link-local next-hop are sent 4613 when following RFC 2545 procedures, this leaf contains 4614 the link-local next-hop."; 4615 reference 4616 "RFC 2545: Use of BGP-4 Multiprotocol Extensions for IPv6 4617 Inter-Domain Routing"; 4618 } 4619 leaf med { 4620 type uint32; 4621 description 4622 "BGP multi-exit discriminator attribute used in the BGP 4623 route selection process."; 4624 reference 4625 "RFC 4271: Section 5.1.4."; 4626 } 4627 leaf local-pref { 4628 type uint32; 4629 description 4630 "BGP local preference attribute sent to internal peers to 4631 indicate the degree of preference for externally learned 4632 routes. The route with the highest local preference 4633 value is preferred."; 4634 reference 4635 "RFC 4271: Section 5.1.5."; 4636 } 4637 leaf originator-id { 4638 type yang:dotted-quad; 4639 description 4640 "BGP attribute that provides the id as an IPv4 address 4641 of the originator of the announcement."; 4642 reference 4643 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4644 Mesh Internal BGP (IBGP)"; 4645 } 4646 leaf-list cluster-list { 4647 type yang:dotted-quad; 4648 description 4649 "Represents the reflection path that the route has 4650 passed."; 4651 reference 4652 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4653 Mesh Internal BGP (IBGP)"; 4654 } 4655 leaf aigp-metric { 4656 type uint64; 4657 description 4658 "BGP path attribute representing the accumulated IGP 4659 metric for the path"; 4660 reference 4661 "RFC 7311 - The Accumulated IGP Metric Attribute for BGP"; 4662 } 4663 container aggregator { 4664 config false; 4665 description 4666 "BGP attribute indicating the prefix has been 4667 aggregated by the specified AS and router."; 4668 reference 4669 "RFC 4271: Section 5.1.7. 4670 RFC 6793 - BGP Support for Four-octet AS Number Space."; 4671 leaf as { 4672 type inet:as-number; 4673 description 4674 "AS number of the autonomous system that performed the 4675 aggregation."; 4676 } 4677 leaf address { 4678 type inet:ipv4-address; 4679 description 4680 "IP address of the router that performed the 4681 aggregation."; 4682 } 4683 } 4684 container aggregator4 { 4685 config false; 4686 description 4687 "BGP attribute indicating the prefix has been 4688 aggregated by the specified AS and router. 4689 This value is populated with the received or sent 4690 attribute in Adj-RIB-In or Adj-RIB-Out, respectively. 4691 It should not be populated in Loc-RIB since the Loc-RIB 4692 is expected to store the effective AGGREGATOR in the 4693 aggregator/as leaf regardless of being 4-octet or 4694 2-octet."; 4695 reference 4696 "RFC 4271: Section 5.1.7."; 4697 leaf as4 { 4698 type inet:as-number; 4699 description 4700 "AS number of the autonomous system that performed the 4701 aggregation (4-octet representation). This value is 4702 populated if an upstream router is not 4-octet capable. 4703 Its semantics are similar to the AS4_PATH optional 4704 transitive attribute"; 4705 reference 4706 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4707 } 4708 leaf address { 4709 type inet:ipv4-address; 4710 description 4711 "IP address of the router that performed the 4712 aggregation."; 4713 } 4714 } 4715 container as-path { 4716 description 4717 "Enclosing container for the list of AS path segments. 4719 In the Adj-RIB-In or Adj-RIB-Out, this list should show 4720 the received or sent AS_PATH, respectively. For 4721 example, if the local router is not 4-byte capable, this 4722 value should consist of 2-octet ASNs or the AS_TRANS 4723 (AS 23456) values received or sent in route updates. 4725 In the Loc-RIB, this list should reflect the effective 4726 AS path for the route, e.g., a 4-octet value if the 4727 local router is 4-octet capable."; 4728 reference 4729 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4) 4730 RFC 6793 - BGP Support for Four-octet AS Number Space 4731 RFC 5065 - Autonomous System Confederations for BGP"; 4732 list segment { 4733 config false; 4734 uses bgp-as-path-attr; 4735 description 4736 "List of AS PATH segments"; 4737 } 4738 } 4739 container as4-path { 4740 description 4741 "This is the path encoded with 4-octet 4742 AS numbers in the optional transitive AS4_PATH attribute. 4743 This value is populated with the received or sent 4744 attribute in Adj-RIB-In or Adj-RIB-Out, respectively. 4745 It should not be populated in Loc-RIB since the Loc-RIB 4746 is expected to store the effective AS-Path in the 4747 as-path leaf regardless of being 4-octet or 2-octet."; 4748 reference 4749 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4750 list segment { 4751 config false; 4752 uses bgp-as-path-attr; 4753 description 4754 "List of AS PATH segments"; 4755 } 4756 } 4757 } 4758 } 4760 grouping attr-set { 4761 description 4762 "A grouping for all path attributes."; 4764 list attr-set { 4765 key "index"; 4766 description 4767 "List of path attributes that may be in use by multiple 4768 routes in the table"; 4769 leaf index { 4770 type uint64; 4771 description 4772 "System generated index for each attribute set. The 4773 index is used to reference an attribute set from a 4774 specific path. Multiple paths may reference the same 4775 attribute set."; 4776 } 4777 uses attr-set-attributes; 4778 } 4779 } 4781 grouping attr-sets { 4782 description 4783 "A grouping for all sets of path attributes."; 4785 container attr-sets { 4786 description 4787 "Enclosing container for the list of path attribute sets"; 4788 uses attr-set; 4789 } 4790 } 4792 grouping ext-community-attributes { 4793 description 4794 "A grouping for all extended community parameters."; 4796 leaf-list ext-community { 4797 type rt:route-target; 4798 description 4799 "List of BGP extended community attributes. The received 4800 extended community may be an explicitly modeled 4801 type or unknown, represented by an 8-octet value 4802 formatted according to RFC 4360."; 4803 reference 4804 "RFC 4360 - BGP Extended Communities Attribute"; 4805 } 4806 } 4808 grouping large-community-attributes { 4809 description 4810 "A grouping for all large community parameters."; 4812 leaf-list large-community { 4813 type bt:bgp-large-community-type; 4814 description 4815 "List of BGP large community attributes."; 4816 reference 4817 "RFC 8092: BGP Large Communities Attribute."; 4818 } 4819 } 4821 grouping rib { 4822 description 4823 "Grouping for rib."; 4824 container rib { 4825 config false; 4826 uses attr-sets; 4827 container communities { 4828 description 4829 "Enclosing container for the list of community attribute 4830 sets."; 4831 list community { 4832 key "index"; 4833 config false; 4834 description 4835 "List of path attributes that may be in use by multiple 4836 routes in the table."; 4837 leaf index { 4838 type uint64; 4839 description 4840 "System generated index for each attribute set. The 4841 index is used to reference an attribute set from a 4842 specific path. Multiple paths may reference the same 4843 attribute set."; 4844 } 4845 uses bgp-community-attr-state; 4846 } 4847 } 4848 container ext-communities { 4849 description 4850 "Enclosing container for the list of extended community 4851 attribute sets."; 4852 list ext-community { 4853 key "index"; 4854 config false; 4855 description 4856 "List of path attributes that may be in use by multiple 4857 routes in the table."; 4858 leaf index { 4859 type uint64; 4860 description 4861 "System generated index for each attribute set. The 4862 index is used to reference an attribute set from a 4863 specific path. Multiple paths may reference the same 4864 attribute set."; 4865 } 4866 uses ext-community-attributes; 4867 } 4868 } 4869 container large-communities { 4870 description 4871 "Enclosing container for the list of large community 4872 attribute sets."; 4873 list large-community { 4874 key "index"; 4875 config false; 4876 description 4877 "List of path attributes that may be in use by multiple 4878 routes in the table."; 4879 leaf index { 4880 type uint64; 4881 description 4882 "System generated index for each attribute set. The 4883 index is used to reference an attribute set from a 4884 specific path. Multiple paths may reference the same 4885 attribute set."; 4886 } 4887 uses large-community-attributes; 4888 } 4889 } 4890 container afi-safis { 4891 config false; 4892 description 4893 "Enclosing container for address family list."; 4894 list afi-safi { 4895 key "name"; 4896 description 4897 "List of afi-safi types."; 4898 leaf name { 4899 type identityref { 4900 base bt:afi-safi-type; 4901 } 4902 description 4903 "AFI,SAFI name."; 4904 } 4905 container ipv4-unicast { 4906 when "../name = 'bt:ipv4-unicast'" { 4907 description 4908 "Include this container for IPv4 unicast RIB."; 4909 } 4910 description 4911 "Routing tables for IPv4 unicast -- active when the 4912 afi-safi name is ipv4-unicast."; 4914 container loc-rib { 4915 config false; 4916 description 4917 "Container for the IPv4 BGP LOC-RIB data."; 4918 container routes { 4919 description 4920 "Enclosing container for list of routes in the 4921 routing table."; 4922 list route { 4923 key "prefix origin path-id"; 4924 description 4925 "List of routes in the table, keyed by the route 4926 prefix, the route origin, and path-id. The route 4927 origin can be either the neighbor address from 4928 which the route was learned, or the source 4929 protocol that injected the route. The path-id 4930 distinguishes routes for the same prefix 4931 received from a neighbor (e.g., if add-paths is 4932 enabled)."; 4933 leaf prefix { 4934 type inet:ipv4-prefix; 4935 description 4936 "The IPv4 prefix corresponding to the route."; 4937 } 4938 uses bgp-loc-rib-common-keys; 4939 uses bgp-loc-rib-common-attr-refs; 4940 uses bgp-common-route-annotations-state; 4941 uses bgp-unknown-attr-top; 4942 uses rib-ext-route-annotations; 4943 } 4944 } 4945 } 4947 container neighbors { 4948 config false; 4949 description 4950 "Enclosing container for neighbor list."; 4951 list neighbor { 4952 key "neighbor-address"; 4953 description 4954 "List of neighbors (peers) of the local BGP 4955 speaker."; 4956 leaf neighbor-address { 4957 type inet:ip-address; 4958 description 4959 "IP address of the BGP neighbor or peer."; 4960 } 4961 container adj-rib-in-pre { 4962 description 4963 "Per-neighbor table containing the NLRI updates 4964 received from the neighbor before any local 4965 input policy rules or filters have been applied. 4966 This can be considered the 'raw' updates from 4967 the neighbor."; 4968 uses ipv4-adj-rib-common; 4969 uses clear-routes { 4970 description 4971 "Clears the adj-rib-in state for the containing 4972 neighbor. Subsequently, implementations might 4973 issue a 'route refresh' if 'route refresh' has 4974 been negotiatited, or reset the session. "; 4975 } 4976 } 4977 container adj-rib-in-post { 4978 description 4979 "Per-neighbor table containing the paths received 4980 from the neighbor that are eligible for 4981 best-path selection after local input policy 4982 rules have been applied."; 4983 uses ipv4-adj-rib-in-post; 4984 uses clear-routes { 4985 description 4986 "Clears the adj-rib-in state for the containing 4987 neighbor. Subsequently, implementations might 4988 issue a 'route refresh' if 'route refresh' has 4989 been negotiatited, or reset the session. "; 4990 } 4991 } 4992 container adj-rib-out-pre { 4993 description 4994 "Per-neighbor table containing paths eligible for 4995 sending (advertising) to the neighbor before 4996 output policy rules have been applied."; 4997 uses ipv4-adj-rib-common; 4998 uses clear-routes { 4999 description 5000 "Clears the adj-rib-out state for the 5001 containing neighbor. Subsequently, neighbors 5002 will announce BGP updates to resynchronize 5003 these routes."; 5004 } 5005 } 5006 container adj-rib-out-post { 5007 description 5008 "Per-neighbor table containing paths eligible for 5009 sending (advertising) to the neighbor after 5010 output policy rules have been applied."; 5011 uses ipv4-adj-rib-common; 5012 uses clear-routes { 5013 description 5014 "Clears the adj-rib-out state for the 5015 containing neighbor. Subsequently, neighbors 5016 will announce BGP updates to resynchronize 5017 these routes."; 5018 } 5019 } 5020 } 5021 } 5022 } 5024 container ipv6-unicast { 5025 when "../name = 'bt:ipv6-unicast'" { 5026 description 5027 "Include this container for IPv6 unicast RIB."; 5028 } 5029 description 5030 "Routing tables for IPv6 unicast -- active when the 5031 afi-safi name is ipv6-unicast."; 5033 container loc-rib { 5034 config false; 5035 description 5036 "Container for the IPv6 BGP LOC-RIB data."; 5037 container routes { 5038 description 5039 "Enclosing container for list of routes in the 5040 routing table."; 5041 list route { 5042 key "prefix origin path-id"; 5043 description 5044 "List of routes in the table, keyed by the route 5045 prefix, the route origin, and path-id. The route 5046 origin can be either the neighbor address from 5047 which the route was learned, or the source 5048 protocol that injected the route. The path-id 5049 distinguishes routes for the same prefix 5050 received from a neighbor (e.g., if add-paths is 5051 enabled)."; 5052 leaf prefix { 5053 type inet:ipv6-prefix; 5054 description 5055 "The IPv6 prefix corresponding to the route."; 5056 } 5057 uses bgp-loc-rib-common-keys; 5058 uses bgp-loc-rib-common-attr-refs; 5059 uses bgp-common-route-annotations-state; 5060 uses bgp-unknown-attr-top; 5061 uses rib-ext-route-annotations; 5062 } 5063 } 5064 } 5066 container neighbors { 5067 config false; 5068 description 5069 "Enclosing container for neighbor list."; 5070 list neighbor { 5071 key "neighbor-address"; 5072 description 5073 "List of neighbors (peers) of the local BGP 5074 speaker."; 5075 leaf neighbor-address { 5076 type inet:ip-address; 5077 description 5078 "IP address of the BGP neighbor or peer."; 5079 } 5080 container adj-rib-in-pre { 5081 description 5082 "Per-neighbor table containing the NLRI updates 5083 received from the neighbor before any local 5084 input policy rules or filters have been applied. 5085 This can be considered the 'raw' updates from 5086 the neighbor."; 5087 uses ipv6-adj-rib-common; 5088 uses clear-routes { 5089 description 5090 "Clears the adj-rib-in state for the containing 5091 neighbor. Subsequently, implementations might 5092 issue a 'route refresh' if 'route refresh' has 5093 been negotiatited, or reset the session. "; 5094 } 5095 } 5096 container adj-rib-in-post { 5097 description 5098 "Per-neighbor table containing the paths received 5099 from the neighbor that are eligible for 5100 best-path selection after local input policy 5101 rules have been applied."; 5102 uses ipv6-adj-rib-in-post; 5103 uses clear-routes { 5104 description 5105 "Clears the adj-rib-in state for the containing 5106 neighbor. Subsequently, implementations might 5107 issue a 'route refresh' if 'route refresh' has 5108 been negotiatited, or reset the session. "; 5109 } 5110 } 5111 container adj-rib-out-pre { 5112 description 5113 "Per-neighbor table containing paths eligible for 5114 sending (advertising) to the neighbor before 5115 output policy rules have been applied."; 5116 uses ipv6-adj-rib-common; 5117 uses clear-routes { 5118 description 5119 "Clears the adj-rib-out state for the 5120 containing neighbor. Subsequently, neighbors 5121 will announce BGP updates to resynchronize 5122 these routes."; 5123 } 5124 } 5125 container adj-rib-out-post { 5126 description 5127 "Per-neighbor table containing paths eligible for 5128 sending (advertising) to the neighbor after 5129 output policy rules have been applied."; 5131 uses ipv6-adj-rib-common; 5132 uses clear-routes { 5133 description 5134 "Clears the adj-rib-out state for the 5135 containing neighbor. Subsequently, neighbors 5136 will announce BGP updates to resynchronize 5137 these routes."; 5138 } 5139 } 5140 } 5141 } 5142 } 5143 } 5144 } 5145 description 5146 "Top level container for BGP RIB."; 5147 } 5148 } 5149 } 5150 5152 file "ietf-bgp-rib-types@2022-03-06.yang" 5153 submodule ietf-bgp-rib-types { 5154 yang-version 1.1; 5155 belongs-to ietf-bgp { 5156 prefix br; 5157 } 5159 organization 5160 "IETF IDR Working Group"; 5161 contact 5162 "WG Web: 5163 WG List: 5165 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5166 Keyur Patel (keyur at arrcus.com), 5167 Susan Hares (shares at ndzh.com), 5168 Jeffrey Haas (jhaas at juniper.net)."; 5170 description 5171 "Defines identity and type definitions associated with 5172 the BGP RIB modules. 5174 Copyright (c) 2021 IETF Trust and the persons identified as 5175 authors of the code. All rights reserved. 5177 Redistribution and use in source and binary forms, with or 5178 without modification, is permitted pursuant to, and subject to 5179 the license terms contained in, the Simplified BSD License set 5180 forth in Section 4.c of the IETF Trust's Legal Provisions 5181 Relating to IETF Documents 5182 (https://trustee.ietf.org/license-info). 5184 This version of this YANG module is part of RFC XXXX 5185 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 5186 for full legal notices. 5188 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 5189 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 5190 'MAY', and 'OPTIONAL' in this document are to be interpreted as 5191 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 5192 they appear in all capitals, as shown here."; 5194 revision 2022-03-06 { 5195 description 5196 "Initial Version"; 5197 reference 5198 "RFC XXXX, BGP Model for Service Provider Network."; 5199 } 5201 identity ineligible-route-reason { 5202 description 5203 "Base identity for reason code for routes that are rejected as 5204 ineligible. Some derived entities are based on BMP v3."; 5205 reference 5206 "RFC 7854: BGP Monitoring Protocol."; 5207 } 5209 identity ineligible-cluster-loop { 5210 base ineligible-route-reason; 5211 description 5212 "Route was ineligible due to CLUSTER_LIST loop"; 5213 } 5215 identity ineligible-as-loop { 5216 base ineligible-route-reason; 5217 description 5218 "Route was ineligible due to AS_PATH loop"; 5219 } 5221 identity ineligible-originator { 5222 base ineligible-route-reason; 5223 description 5224 "Route was ineligible due to ORIGINATOR_ID. For example, update 5225 has local router as originator"; 5226 } 5227 identity ineligible-confed { 5228 base ineligible-route-reason; 5229 description 5230 "Route was ineligible due to a loop in the AS_CONFED_SEQUENCE 5231 or AS_CONFED_SET attributes"; 5232 } 5234 identity bgp-not-selected-bestpath { 5235 description 5236 "Base identity for indicating reason a route was was not 5237 selected by BGP route selection algorithm"; 5238 reference 5239 "RFC 4271 - Section 9.1"; 5240 } 5242 identity local-pref-lower { 5243 base bgp-not-selected-bestpath; 5244 description 5245 "Route has a lower localpref attribute than current best path"; 5246 reference 5247 "RFC 4271 - Section 9.1.2"; 5248 } 5250 identity as-path-longer { 5251 base bgp-not-selected-bestpath; 5252 description 5253 "Route has a longer AS path attribute than current best path"; 5254 reference 5255 "RFC 4271 - Section 9.1.2.2 (a)"; 5256 } 5258 identity origin-type-higher { 5259 base bgp-not-selected-bestpath; 5260 description 5261 "Route has a higher origin type, i.e., IGP origin is preferred 5262 over EGP or incomplete"; 5263 reference 5264 "RFC 4271 - Section 9.1.2.2 (b)"; 5265 } 5267 identity med-higher { 5268 base bgp-not-selected-bestpath; 5269 description 5270 "Route has a higher MED, or metric, attribute than the current 5271 best path"; 5272 reference 5273 "RFC 4271 - Section 9.1.2.2 (c)"; 5274 } 5275 identity prefer-external { 5276 base bgp-not-selected-bestpath; 5277 description 5278 "Route source is via IBGP, rather than EGP."; 5279 reference 5280 "RFC 4271 - Section 9.1.2.2 (d)"; 5281 } 5283 identity nexthop-cost-higher { 5284 base bgp-not-selected-bestpath; 5285 description 5286 "Route has a higher interior cost to the next hop."; 5287 reference 5288 "RFC 4271 - Section 9.1.2.2 (e)"; 5289 } 5291 identity higher-router-id { 5292 base bgp-not-selected-bestpath; 5293 description 5294 "Route was sent by a peer with a higher BGP Identifier value."; 5295 reference 5296 "RFC 4271 - Section 9.1.2.2 (f)"; 5297 } 5299 identity higher-peer-address { 5300 base bgp-not-selected-bestpath; 5301 description 5302 "Route was sent by a peer with a higher IP address"; 5303 reference 5304 "RFC 4271 - Section 9.1.2.2 (g)"; 5305 } 5307 identity bgp-not-selected-policy { 5308 description 5309 "Base identity for reason code for routes that are rejected 5310 due to policy"; 5311 } 5313 identity rejected-import-policy { 5314 base bgp-not-selected-policy; 5315 description 5316 "Route was rejected after applying import policies."; 5317 } 5318 } 5319 5320 file "ietf-bgp-rib-attributes@2022-03-06.yang" 5321 submodule ietf-bgp-rib-attributes { 5322 yang-version 1.1; 5323 belongs-to ietf-bgp { 5324 prefix br; 5325 } 5327 // import some basic types 5329 import ietf-bgp-types { 5330 prefix bgpt; 5331 } 5332 import ietf-inet-types { 5333 prefix inet; 5334 } 5335 include ietf-bgp-rib-types; 5337 // meta 5339 organization 5340 "IETF IDR Working Group"; 5341 contact 5342 "WG Web: 5343 WG List: 5345 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5346 Keyur Patel (keyur at arrcus.com), 5347 Susan Hares (shares at ndzh.com), 5348 Jeffrey Haas (jhaas at juniper.net)."; 5350 description 5351 "This submodule contains common data definitions for BGP 5352 attributes for use in BGP RIB tables. 5354 Copyright (c) 2021 IETF Trust and the persons identified as 5355 authors of the code. All rights reserved. 5357 Redistribution and use in source and binary forms, with or 5358 without modification, is permitted pursuant to, and subject to 5359 the license terms contained in, the Simplified BSD License set 5360 forth in Section 4.c of the IETF Trust's Legal Provisions 5361 Relating to IETF Documents 5362 (https://trustee.ietf.org/license-info). 5364 This version of this YANG module is part of RFC XXXX 5365 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 5366 for full legal notices. 5368 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 5369 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 5370 'MAY', and 'OPTIONAL' in this document are to be interpreted as 5371 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 5372 they appear in all capitals, as shown here."; 5374 revision 2022-03-06 { 5375 description 5376 "Initial version"; 5377 reference 5378 "RFC XXXX: BGP YANG Model for Service Provider Network"; 5379 } 5381 grouping bgp-as-path-attr { 5382 description 5383 "Data for representing BGP AS-PATH attribute"; 5385 leaf type { 5386 type identityref { 5387 base bgpt:as-path-segment-type; 5388 } 5389 description 5390 "The type of AS-PATH segment"; 5391 } 5392 leaf-list member { 5393 type inet:as-number; 5394 description 5395 "List of the AS numbers in the AS-PATH segment"; 5396 } 5397 } 5399 grouping bgp-community-attr-state { 5400 description 5401 "Common definition of BGP community attributes"; 5402 leaf-list community { 5403 type union { 5404 type bgpt:bgp-well-known-community-type; 5405 type bgpt:bgp-std-community-type; 5406 } 5407 description 5408 "List of standard or well-known BGP community 5409 attributes."; 5410 } 5411 } 5413 grouping bgp-unknown-attr-top { 5414 description 5415 "Unknown path attributes that are not expected to be shared 5416 across route entries, common to LOC-RIB and Adj-RIB"; 5417 container unknown-attributes { 5418 description 5419 "Unknown path attributes that were received in the UPDATE 5420 message which contained the prefix."; 5422 list unknown-attribute { 5423 key "attr-type"; 5424 description 5425 "This list contains received attributes that are 5426 unrecognized or unsupported by the local router. The list 5427 may be empty."; 5429 leaf optional { 5430 type boolean; 5431 description 5432 "Defines whether the attribute is optional (if 5433 set to true) or well-known (if set to false). 5434 Set in the high-order bit of the BGP attribute 5435 flags octet."; 5436 reference 5437 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5438 } 5440 leaf transitive { 5441 type boolean; 5442 description 5443 "Defines whether an optional attribute is transitive 5444 (if set to true) or non-transitive (if set to false). 5445 For well-known attributes, the transitive flag must be 5446 set to true. Set in the second high-order bit of the BGP 5447 attribute flags octet."; 5448 reference 5449 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5450 } 5452 leaf partial { 5453 type boolean; 5454 description 5455 "Defines whether the information contained in the 5456 optional transitive attribute is partial (if set to 5457 true) or complete (if set to false). For well-known 5458 attributes and for optional non-transitive attributes, 5459 the partial flag must be set to false. Set in the third 5460 high-order bit of the BGP attribute flags octet."; 5461 reference 5462 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5463 } 5464 leaf extended { 5465 type boolean; 5466 description 5467 "Defines whether the attribute length is one octet 5468 (if set to false) or two octets (if set to true). Set in 5469 the fourth high-order bit of the BGP attribute flags 5470 octet."; 5471 reference 5472 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5473 } 5475 leaf attr-type { 5476 type uint8; 5477 description 5478 "1-octet value encoding the attribute type code"; 5479 reference 5480 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5481 } 5483 leaf attr-len { 5484 type uint16; 5485 description 5486 "One or two octet attribute length field indicating the 5487 length of the attribute data in octets. If the Extended 5488 Length attribute flag is set, the length field is 2 5489 octets, otherwise it is 1 octet"; 5490 reference 5491 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5492 } 5494 leaf attr-value { 5495 type binary { 5496 length "0..65535"; 5497 } 5498 description 5499 "Raw attribute value, not including the attribute 5500 flags, type, or length. The maximum length 5501 of the attribute value data is 2^16-1 per the max value 5502 of the attr-len field (2 octets)."; 5503 reference 5504 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 5505 } 5506 } 5507 } 5508 } 5510 grouping bgp-adj-rib-attr-state { 5511 description 5512 "Path attributes that are not expected to be shared across 5513 route entries, specific to Adj-RIB"; 5514 leaf path-id { 5515 type uint32; 5516 description 5517 "When the BGP speaker supports advertisement of multiple 5518 paths for a prefix, the path identifier is used to 5519 uniquely identify a route based on the combination of the 5520 prefix and path id. In the Adj-RIB-In, the path-id value is 5521 the value received in the update message. In the Loc-RIB, 5522 if used, it should represent a locally generated path-id 5523 value for the corresponding route. In Adj-RIB-Out, it 5524 should be the value sent to a neighbor when add-paths is 5525 used, i.e., the capability has been negotiated."; 5526 reference 5527 "RFC 7911: Advertisement of Multiple Paths in BGP"; 5528 } 5529 } 5530 } 5531 5533 file "ietf-bgp-rib-tables@2022-03-06.yang" 5534 submodule ietf-bgp-rib-tables { 5535 yang-version 1.1; 5536 belongs-to ietf-bgp { 5537 prefix br; 5538 } 5540 // import some basic types 5542 import ietf-inet-types { 5543 prefix inet; 5544 reference 5545 "RFC 6991: Common YANG Data Types."; 5546 } 5547 import ietf-yang-types { 5548 prefix yang; 5549 reference 5550 "RFC 6991: Common YANG Data Types."; 5551 } 5552 import ietf-routing { 5553 prefix rt; 5554 reference 5555 "RFC 8022: A YANG Data Model for Routing Management."; 5556 } 5557 import ietf-bgp-types { 5558 prefix bt; 5559 reference 5560 "RFC XXXX: BGP YANG Model for Service Provider Network."; 5561 } 5562 include ietf-bgp-rib-attributes; 5564 organization 5565 "IETF IDR Working Group"; 5566 contact 5567 "WG Web: 5568 WG List: 5570 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5571 Keyur Patel (keyur at arrcus.com), 5572 Susan Hares (shares at ndzh.com, 5573 Jeffrey Haas (jhaas at juniper.net)."; 5575 description 5576 "This submodule contains structural data definitions for 5577 BGP routing tables. 5579 Copyright (c) 2021 IETF Trust and the persons identified as 5580 authors of the code. All rights reserved. 5582 Redistribution and use in source and binary forms, with or 5583 without modification, is permitted pursuant to, and subject to 5584 the license terms contained in, the Simplified BSD License set 5585 forth in Section 4.c of the IETF Trust's Legal Provisions 5586 Relating to IETF Documents 5587 (https://trustee.ietf.org/license-info). 5589 This version of this YANG module is part of RFC XXXX 5590 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 5591 for full legal notices. 5593 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 5594 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 5595 'MAY', and 'OPTIONAL' in this document are to be interpreted as 5596 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 5597 they appear in all capitals, as shown here."; 5599 revision 2022-03-06 { 5600 description 5601 "Initial Version"; 5602 reference 5603 "RFC XXXX, BGP YANG Model for Service Provider Network."; 5604 } 5606 grouping bgp-common-route-annotations-state { 5607 description 5608 "Data definitions for flags and other information attached 5609 to routes in both LOC-RIB and Adj-RIB"; 5610 leaf last-modified { 5611 type yang:timeticks; 5612 description 5613 "Timestamp when this path was last modified. 5615 The value is the timestamp in seconds relative to 5616 the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; 5617 } 5618 leaf eligible-route { 5619 type boolean; 5620 description 5621 "Indicates that the route is eligible for selection for the 5622 best route in the Loc-Rib in BGP's Decision Process."; 5623 reference 5624 "RFC 4271, Section 9.1."; 5625 } 5626 leaf ineligible-reason { 5627 type identityref { 5628 base ineligible-route-reason; 5629 } 5630 description 5631 "If the route is ineligible for selection for the best route 5632 in the Loc-Rib in BGP's Decision process, this indicates the 5633 reason."; 5634 reference 5635 "RFC 4271, Section 9.1."; 5636 } 5637 } 5639 grouping bgp-adj-rib-in-post-route-annotations-state { 5640 description 5641 "Data definitions for information attached to routes in the 5642 Adj-RIB-in post-policy table"; 5643 leaf best-path { 5644 type boolean; 5645 description 5646 "Current path was selected as the best path."; 5647 } 5648 } 5650 grouping rib-ext-route-annotations { 5651 description 5652 "Extended annotations for routes in the routing tables"; 5653 leaf reject-reason { 5654 type union { 5655 type identityref { 5656 base bgp-not-selected-bestpath; 5657 } 5658 type identityref { 5659 base bgp-not-selected-policy; 5660 } 5661 } 5662 description 5663 "Indicates the reason the route is not used, either due to 5664 policy filtering or bestpath selection"; 5665 } 5666 } 5668 grouping bgp-adj-rib-common-attr-refs { 5669 description 5670 "Definitions of common references to attribute sets for 5671 multiple AFI-SAFIs for Adj-RIB tables."; 5672 leaf attr-index { 5673 type leafref { 5674 path "../../../../../../../../../attr-sets/" 5675 + "attr-set/index"; 5676 } 5677 description 5678 "Reference to the common attribute group for the 5679 route."; 5680 } 5681 leaf community-index { 5682 type leafref { 5683 path "../../../../../../../../../communities/community/" 5684 + "index"; 5685 } 5686 description 5687 "Reference to the community attribute for the route."; 5688 } 5689 leaf ext-community-index { 5690 type leafref { 5691 path "../../../../../../../../../ext-communities/" 5692 + "ext-community/index"; 5693 } 5694 description 5695 "Reference to the extended community attribute for the 5696 route."; 5697 } 5698 } 5700 grouping bgp-loc-rib-common-attr-refs { 5701 description 5702 "Definitions of common references to attribute sets for 5703 multiple AFI-SAFIs for LOC-RIB tables."; 5705 leaf attr-index { 5706 type leafref { 5707 path "../../../../../../../attr-sets/attr-set/" 5708 + "index"; 5709 } 5710 description 5711 "Reference to the common attribute group for the 5712 route."; 5713 } 5714 leaf community-index { 5715 type leafref { 5716 path "../../../../../../../communities/community/" 5717 + "index"; 5718 } 5719 description 5720 "Reference to the community attribute for the route."; 5721 } 5722 leaf ext-community-index { 5723 type leafref { 5724 path "../../../../../../../ext-communities/" 5725 + "ext-community/index"; 5726 } 5727 description 5728 "Reference to the extended community attribute for the 5729 route."; 5730 } 5731 } 5733 grouping bgp-loc-rib-common-keys { 5734 description 5735 "Common references used in keys for IPv4 and IPv6 5736 LOC-RIB entries."; 5737 leaf origin { 5738 type union { 5739 type inet:ip-address; 5740 type identityref { 5741 base rt:routing-protocol; 5742 } 5743 } 5744 description 5745 "Indicates the origin of the route. If the route is learned 5746 from a neighbor, this value is the neighbor address. If 5747 the route was injected or redistributed from another 5748 protocol, the origin indicates the source protocol for the 5749 route."; 5750 } 5751 leaf path-id { 5752 type uint32; 5753 description 5754 "If the route is learned from a neighbor, the path-id 5755 corresponds to the path-id for the route in the 5756 corresponding adj-rib-in-post table. If the route is 5757 injected from another protocol, or the neighbor does not 5758 support BGP add-paths, the path-id should be set 5759 to zero, also the default value. 5761 However, YANG does not allow default values to be set 5762 for parameters that form the key, so a default value 5763 cannot be set here."; 5764 } 5765 } 5767 grouping clear-routes { 5768 description 5769 "Action to clear BGP routes."; 5770 container clear-routes { 5771 if-feature "bt:clear-routes"; 5772 action clear { 5773 input { 5774 leaf clear-at { 5775 type yang:date-and-time; 5776 description 5777 "The time, in the future when the clear operation will 5778 be initiated."; 5779 } 5780 } 5781 output { 5782 leaf clear-finished-at { 5783 type yang:date-and-time; 5784 description 5785 "The time when the clear operation finished."; 5786 } 5787 } 5788 } 5789 description 5790 "Action commands to clear routes governed by a if-feature."; 5791 } 5792 } 5794 grouping ipv4-adj-rib-common { 5795 description 5796 "Common structural grouping for each IPv4 adj-RIB table."; 5797 container routes { 5798 config false; 5799 description 5800 "Enclosing container for list of routes in the routing 5801 table."; 5802 list route { 5803 key "prefix path-id"; 5804 description 5805 "List of routes in the table, keyed by a combination of 5806 the route prefix and path-id to distinguish multiple 5807 routes received from a neighbor for the same prefix, 5808 e.g., when BGP add-paths is enabled."; 5809 leaf prefix { 5810 type inet:ipv4-prefix; 5811 description 5812 "Prefix for the route."; 5813 } 5814 uses bgp-adj-rib-attr-state; 5815 uses bgp-adj-rib-common-attr-refs; 5816 uses bgp-common-route-annotations-state; 5817 uses bgp-unknown-attr-top; 5818 uses rib-ext-route-annotations; 5819 } 5820 } 5821 } 5823 grouping ipv4-adj-rib-in-post { 5824 description 5825 "Common structural grouping for the IPv4 adj-rib-in 5826 post-policy table."; 5827 container routes { 5828 config false; 5829 description 5830 "Enclosing container for list of routes in the routing 5831 table."; 5832 list route { 5833 key "prefix path-id"; 5834 description 5835 "List of routes in the table, keyed by a combination of 5836 the route prefix and path-id to distinguish multiple 5837 routes received from a neighbor for the same prefix, 5838 e.g., when BGP add-paths is enabled."; 5839 leaf prefix { 5840 type inet:ipv4-prefix; 5841 description 5842 "Prefix for the route."; 5843 } 5844 uses bgp-adj-rib-attr-state; 5845 uses bgp-adj-rib-common-attr-refs; 5846 uses bgp-common-route-annotations-state; 5847 uses bgp-adj-rib-in-post-route-annotations-state; 5848 uses bgp-unknown-attr-top; 5849 uses rib-ext-route-annotations; 5850 } 5851 } 5852 } 5854 grouping ipv6-adj-rib-common { 5855 description 5856 "Common structural grouping for each IPv6 adj-RIB table."; 5857 container routes { 5858 config false; 5859 description 5860 "Enclosing container for list of routes in the routing 5861 table."; 5862 list route { 5863 key "prefix path-id"; 5864 description 5865 "List of routes in the table."; 5866 leaf prefix { 5867 type inet:ipv6-prefix; 5868 description 5869 "Prefix for the route."; 5870 } 5871 uses bgp-adj-rib-attr-state; 5872 uses bgp-adj-rib-common-attr-refs; 5873 uses bgp-common-route-annotations-state; 5874 uses bgp-unknown-attr-top; 5875 uses rib-ext-route-annotations; 5876 } 5877 } 5878 } 5880 grouping ipv6-adj-rib-in-post { 5881 description 5882 "Common structural grouping for the IPv6 adj-rib-in 5883 post-policy table."; 5884 container routes { 5885 config false; 5886 description 5887 "Enclosing container for list of routes in the routing 5888 table."; 5889 list route { 5890 key "prefix path-id"; 5891 description 5892 "List of routes in the table."; 5893 leaf prefix { 5894 type inet:ipv6-prefix; 5895 description 5896 "Prefix for the route."; 5898 } 5899 uses bgp-adj-rib-attr-state; 5900 uses bgp-adj-rib-common-attr-refs; 5901 uses bgp-common-route-annotations-state; 5902 uses bgp-adj-rib-in-post-route-annotations-state; 5903 uses bgp-unknown-attr-top; 5904 uses rib-ext-route-annotations; 5905 } 5906 } 5907 } 5908 } 5909 5911 8. Contributors 5913 Previous versions of this document saw contributions from Anees 5914 Shaikh, Rob Shakir, Kevin D'Souza, Alexander Clemm, Aleksandr 5915 Zhadkin, and Xyfeng Liu. 5917 9. Acknowledgements 5919 The authors are grateful for valuable contributions to this document 5920 and the associated models from: Ebben Aires, Pavan Beeram, Chris 5921 Chase, Ed Crabbe, Luyuan Fang, Bill Fenner, Akshay Gattani, Josh 5922 George, Vijay Gill, Matt John, Jeff Haas, Dhanendra Jain, Acee 5923 Lindem, Ina Minei, Carl Moberg, Ashok Narayanan, Einar Nilsen- 5924 Nygaard, Adam Simpson, Puneet Sood, Jason Sterne, Jeff Tantsura, Jim 5925 Uttaro, and Gunter Vandevelde. 5927 Credit is also due to authors of the OpenConfig, whose model was 5928 relied upon to come up with this model. 5930 Special thanks to Robert Wilton who helped convert the YANG models to 5931 a NMDA compatible model. 5933 10. References 5935 10.1. Normative references 5937 [RFC1997] Chandra, R., Traina, P., and T. Li, "BGP Communities 5938 Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996, 5939 . 5941 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 5942 Requirement Levels", BCP 14, RFC 2119, 5943 DOI 10.17487/RFC2119, March 1997, 5944 . 5946 [RFC2439] Villamizar, C., Chandra, R., and R. Govindan, "BGP Route 5947 Flap Damping", RFC 2439, DOI 10.17487/RFC2439, November 5948 1998, . 5950 [RFC2918] Chen, E., "Route Refresh Capability for BGP-4", RFC 2918, 5951 DOI 10.17487/RFC2918, September 2000, 5952 . 5954 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 5955 DOI 10.17487/RFC3688, January 2004, 5956 . 5958 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 5959 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 5960 DOI 10.17487/RFC4271, January 2006, 5961 . 5963 [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private 5964 Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February 5965 2006, . 5967 [RFC4451] McPherson, D. and V. Gill, "BGP MULTI_EXIT_DISC (MED) 5968 Considerations", RFC 4451, DOI 10.17487/RFC4451, March 5969 2006, . 5971 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 5972 Reflection: An Alternative to Full Mesh Internal BGP 5973 (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, 5974 . 5976 [RFC4659] De Clercq, J., Ooms, D., Carugi, M., and F. Le Faucheur, 5977 "BGP-MPLS IP Virtual Private Network (VPN) Extension for 5978 IPv6 VPN", RFC 4659, DOI 10.17487/RFC4659, September 2006, 5979 . 5981 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 5982 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 5983 DOI 10.17487/RFC4724, January 2007, 5984 . 5986 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 5987 "Multiprotocol Extensions for BGP-4", RFC 4760, 5988 DOI 10.17487/RFC4760, January 2007, 5989 . 5991 [RFC4761] Kompella, K., Ed. and Y. Rekhter, Ed., "Virtual Private 5992 LAN Service (VPLS) Using BGP for Auto-Discovery and 5993 Signaling", RFC 4761, DOI 10.17487/RFC4761, January 2007, 5994 . 5996 [RFC5065] Traina, P., McPherson, D., and J. Scudder, "Autonomous 5997 System Confederations for BGP", RFC 5065, 5998 DOI 10.17487/RFC5065, August 2007, 5999 . 6001 [RFC5880] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 6002 (BFD)", RFC 5880, DOI 10.17487/RFC5880, June 2010, 6003 . 6005 [RFC5881] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 6006 (BFD) for IPv4 and IPv6 (Single Hop)", RFC 5881, 6007 DOI 10.17487/RFC5881, June 2010, 6008 . 6010 [RFC5883] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 6011 (BFD) for Multihop Paths", RFC 5883, DOI 10.17487/RFC5883, 6012 June 2010, . 6014 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 6015 the Network Configuration Protocol (NETCONF)", RFC 6020, 6016 DOI 10.17487/RFC6020, October 2010, 6017 . 6019 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 6020 and A. Bierman, Ed., "Network Configuration Protocol 6021 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 6022 . 6024 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 6025 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 6026 . 6028 [RFC6514] Aggarwal, R., Rosen, E., Morin, T., and Y. Rekhter, "BGP 6029 Encodings and Procedures for Multicast in MPLS/BGP IP 6030 VPNs", RFC 6514, DOI 10.17487/RFC6514, February 2012, 6031 . 6033 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 6034 Autonomous System (AS) Number Space", RFC 6793, 6035 DOI 10.17487/RFC6793, December 2012, 6036 . 6038 [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. 6039 Austein, "BGP Prefix Origin Validation", RFC 6811, 6040 DOI 10.17487/RFC6811, January 2013, 6041 . 6043 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 6044 RFC 6991, DOI 10.17487/RFC6991, July 2013, 6045 . 6047 [RFC7911] Walton, D., Retana, A., Chen, E., and J. Scudder, 6048 "Advertisement of Multiple Paths in BGP", RFC 7911, 6049 DOI 10.17487/RFC7911, July 2016, 6050 . 6052 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 6053 RFC 7950, DOI 10.17487/RFC7950, August 2016, 6054 . 6056 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 6057 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 6058 . 6060 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 6061 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 6062 May 2017, . 6064 [RFC8177] Lindem, A., Ed., Qu, Y., Yeung, D., Chen, I., and J. 6065 Zhang, "YANG Data Model for Key Chains", RFC 8177, 6066 DOI 10.17487/RFC8177, June 2017, 6067 . 6069 [RFC8277] Rosen, E., "Using BGP to Bind MPLS Labels to Address 6070 Prefixes", RFC 8277, DOI 10.17487/RFC8277, October 2017, 6071 . 6073 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 6074 Access Control Model", STD 91, RFC 8341, 6075 DOI 10.17487/RFC8341, March 2018, 6076 . 6078 [RFC8349] Lhotka, L., Lindem, A., and Y. Qu, "A YANG Data Model for 6079 Routing Management (NMDA Version)", RFC 8349, 6080 DOI 10.17487/RFC8349, March 2018, 6081 . 6083 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 6084 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 6085 . 6087 [RFC8528] Bjorklund, M. and L. Lhotka, "YANG Schema Mount", 6088 RFC 8528, DOI 10.17487/RFC8528, March 2019, 6089 . 6091 [RFC8529] Berger, L., Hopps, C., Lindem, A., Bogdanovic, D., and X. 6092 Liu, "YANG Data Model for Network Instances", RFC 8529, 6093 DOI 10.17487/RFC8529, March 2019, 6094 . 6096 [RFC9067] Qu, Y., Tantsura, J., Lindem, A., and X. Liu, "A YANG Data 6097 Model for Routing Policy", RFC 9067, DOI 10.17487/RFC9067, 6098 October 2021, . 6100 [RFC9127] Rahman, R., Ed., Zheng, L., Ed., Jethanandani, M., Ed., 6101 Pallagatti, S., and G. Mirsky, "YANG Data Model for 6102 Bidirectional Forwarding Detection (BFD)", RFC 9127, 6103 DOI 10.17487/RFC9127, October 2021, 6104 . 6106 [I-D.ietf-tcpm-yang-tcp] 6107 Scharf, M., Jethanandani, M., and V. Murgai, "A YANG Model 6108 for Transmission Control Protocol (TCP) Configuration", 6109 Work in Progress, Internet-Draft, draft-ietf-tcpm-yang- 6110 tcp-06, 3 February 2022, . 6113 10.2. Informative references 6115 [RFC3765] Huston, G., "NOPEER Community for Border Gateway Protocol 6116 (BGP) Route Scope Control", RFC 3765, 6117 DOI 10.17487/RFC3765, April 2004, 6118 . 6120 [RFC5082] Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C. 6121 Pignataro, "The Generalized TTL Security Mechanism 6122 (GTSM)", RFC 5082, DOI 10.17487/RFC5082, October 2007, 6123 . 6125 [RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP 6126 Authentication Option", RFC 5925, DOI 10.17487/RFC5925, 6127 June 2010, . 6129 [RFC7454] Durand, J., Pepelnjak, I., and G. Doering, "BGP Operations 6130 and Security", BCP 194, RFC 7454, DOI 10.17487/RFC7454, 6131 February 2015, . 6133 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 6134 and R. Wilton, "Network Management Datastore Architecture 6135 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 6136 . 6138 Appendix A. Examples 6140 This section tries to show some examples in how the model can be 6141 used. 6143 A.1. Creating BGP Instance 6145 This example shows how to enable BGP for a IPv4 unicast address 6146 family. 6148 [note: '\' line wrapping for formatting only] 6150 6151 6153 6154 6155 bgp:bgp 6158 BGP 6159 6161 6162 64496 6163 6164 6165 bt:ip\ 6168 v4-unicast 6169 6170 6171 6172 6173 6174 6175 6177 A.2. Neighbor Address Family Configuration 6179 This example shows how to configure a BGP neighbor, where the remote 6180 address is 192.0.2.1, the remote AS number is 64497, and the address 6181 family of the neighbor is IPv4 unicast. The neighbor is configured 6182 for route flap prevention and it set up for standard and large 6183 communities. In addition, BFD is configured at a neighbor level with 6184 a local multiplier of 2, a desired minimum transmit interval, and a 6185 required minimum receive interval of 3.3 ms. 6187 [note: '\' line wrapping for formatting only] 6189 6193 6194 6197 6198 6199 bgp:bgp 6202 name:BGP 6203 6205 6206 64496 6207 6208 6209 bt:ipv4-unicast 6210 6211 6212 6213 6214 6215 192.0.2.1 6216 64497 6217 6218 true 6219 4.0 6220 3.0 6221 15.0 6222 100 6223 500 6224 1000 6226 6227 bt:standard 6228 bt:large 6229 "Peer Router B" 6230 6231 6232 bt:ipv4-unicast 6233 6234 6235 6236 true 6237 2 6238 3300 6240 3300 6242 6243 6244 6245 6246 6247 6248 6250 A.3. IPv6 Neighbor Configuration 6252 This example shows how to configure a BGP peer, where the remote peer 6253 has a IPv6 address, uses TCP-AO to secure the session with the peer, 6254 and uses non-default timers for hold-time and keepalive. 6256 [note: '\' line wrapping for formatting only] 6258 6259 6261 6262 bgp-key-chain 6263 6264 6265 6267 6268 6269 bgp:bgp 6272 name:BGP 6273 6275 6276 64496 6277 6278 6279 bt:ip\ 6282 v6-unicast 6283 6284 6285 6286 6287 6288 2001:db8:: 6289 true 6290 true 6291 6292 true 6293 bgp-key-chain 6294 6295 64497 6296 "Peer Router B" 6297 6298 120 6299 70 6300 6301 6302 6303 bt:\ 6306 ipv6-unicast 6307 6308 6309 6310 6311 6312 6313 6314 6316 A.4. VRF Configuration 6318 This example shows how BGP can be configured for two VRFs, red and 6319 blue. In this case, the two network instances share a common AS, and 6320 distinguish between the instances using the router id. 6322 [note: '\' line wrapping for formatting only] 6324 6325 6327 6328 vrf-red 6329 6330 6332 192.0.2.1 6333 6334 6335 bgp:bgp 6339 BGP 6340 6342 6343 64496 6344 6345 6346 bt:ipv4-unicast 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 vrf-blue 6361 6362 6364 192.0.2.2 6365 6366 6367 bgp:bgp 6372 BGP 6373 6375 6376 64496 6377 6378 6379 bt:ipv4-unicast 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6394 A.5. BGP Policy 6396 Routing policy using community value involves configuring rules to 6397 match community values in the inbound or outbound direction. In this 6398 example, which is heavily borrowed from the example on the Cisco 6399 community page, we look at "match community exact" match, which 6400 happens only when BGP updates have the same community values as 6401 specified in the community list. 6403 The topology in this example consists of three routers, R1, R2, and 6404 R3, configured with AS value of 1, 2 and 3 respectively. R1 6405 advertises 5 prefixes to R2 and R3, as shown below. 6407 * 1.1.1.1/32 and 2.2.2.2/32 with community 11:11 6409 * 3.3.3.3/32 and 4.4.4.4/32 with community 11:11 and 22:22 6411 * 5.5.5.5/32 with community 33.33 6412 Route Policy TO_R2 defines the policy that R1 uses in route updates 6413 towards R2. It consists of three statements, statement 10 that has a 6414 exact match rule for the prefix list L0andL1, and a set-community 6415 action of add for 11:11. The second statement, statement 20, 6416 consists of an exact match rule for prefix list L2andL3, with a set 6417 community action of remove for 11:11 22:22. The final statement, 6418 statement 30, consists of an exact match rule for prefix list L4, 6419 with a set community action of replace for 33:33. 6421 [note: '\' line wrapping for formatting only] 6423 6424 6426 6427 6428 6429 L0andL1 6430 ipv4 6431 6432 6433 1.1.1.1/32 6434 32 6435 32 6436 6437 6438 2.2.2.2/32 6439 32 6440 32 6441 6442 6443 6444 6445 L2andL3 6446 ipv4 6447 6448 6449 3.3.3.3/32 6450 32 6451 32 6452 6453 6454 4.4.4.4/32 6455 32 6456 32 6457 6458 6459 6460 6461 L4 6462 ipv4 6463 6464 6465 5.5.5.5/32 6466 32 6467 32 6468 6469 6470 6471 6472 6473 6474 6475 TO_R2 6476 6477 6478 10 6479 6480 6481 L0andL1 6482 6483 6484 6485 \ 6488 6489 add 6490 11:11 6491 6492 6493 6494 6495 6496 20 6497 6498 6499 L2andL3 6500 6501 6502 6503 \ 6506 6507 remove 6508 11:11 6509 22:22 6510 6511 6512 6513 6514 6515 30 6516 6517 6518 L4 6519 6520 6521 6522 \ 6525 6526 replace 6527 33:33 6528 6529 6530 6531 6532 6533 6534 6535 6537 6540 6541 6542 bgp:bgp 6545 BGP 6546 6548 6549 1 6550 6551 6552 bt:ipv4-unicast 6553 6554 6555 6556 6557 6558 10.1.1.2 6559 2 6560 6561 6562 bt:ipv4-unicast 6563 6564 6565 bt:standard 6566 6567 TO_R2 6568 accept-route 6570 6571 6572 6573 6574 6575 6576 6578 Appendix B. How to add a new AFI and Augment a Module 6580 This section explains how a new AFI can be defined in a new module 6581 and how that module can then be augmented. Assume that the new AFI 6582 being defined is called 'foo' which extends the base identity of 6583 'afi-safi-type', and the augmentation is to add a new container for 6584 'foo' under two different XPaths. The example shows how the base 6585 identity can be extended to add this new AFI, and then use the 6586 augmented containers be used to add 'foo' specific information. 6588 module example-newafi-bgp { 6589 yang-version 1.1; 6590 namespace "http://example.com/ns/example-newafi-bgp"; 6591 prefix example-newafi-bgp; 6593 import ietf-inet-types { 6594 prefix inet; 6595 reference 6596 "RFC 6991: Common YANG Data Types."; 6597 } 6599 import ietf-routing { 6600 prefix rt; 6601 reference 6602 "RFC 8349, A YANG Data Model for Routing Management 6603 (NMDA Version)"; 6605 } 6607 import ietf-bgp { 6608 prefix "bgp"; 6609 reference 6610 "RFC XXXX: BGP YANG module for Service Provider Network."; 6611 } 6613 import ietf-bgp-types { 6614 prefix "bt"; 6615 } 6617 organization 6618 "Newafi model group."; 6620 contact 6621 "abc@newafi.com"; 6622 description 6623 "This YANG module defines and uses new AFI."; 6625 revision 2022-03-06 { 6626 description 6627 "Creating new AFI and using in this model"; 6629 reference 6630 "RFC XXXX: BGP YANG Model for Service Provider Network."; 6631 } 6633 identity foo { 6634 base bt:afi-safi-type; 6635 description 6636 "New AFI type foo."; 6637 } 6639 augment "/rt:routing/rt:control-plane-protocols/" + 6640 "rt:control-plane-protocol/bgp:bgp/bgp:global/" + 6641 "bgp:afi-safis/bgp:afi-safi" { 6642 when "derived-from-or-self(bgp:name, 'foo')" { 6643 description 6644 "This augmentation is valid for a AFI/SAFI instance 6645 of 'foo'"; 6646 } 6647 container foo { 6648 description 6649 "Container to add 'foo' specific AFI/SAFI information. 6650 First add the common stuff."; 6651 uses bgp:mp-all-afi-safi-common; 6652 } 6654 } 6656 augment "/rt:routing/rt:control-plane-protocols/" + 6657 "rt:control-plane-protocol/bgp:bgp/" + 6658 "bgp:rib/bgp:afi-safis/bgp:afi-safi" { 6659 when "derived-from-or-self(bgp:name, 'foo')" { 6660 description 6661 "This augmentation is valid for a AFI/SAFI instance 6662 of 'foo'"; 6663 } 6665 container foo { 6666 description 6667 "Container to add 'foo' rib specific information. 6668 First add the common stuff."; 6669 container loc-rib { 6670 config false; 6671 description 6672 "Container for the 'foo' BGP LOC-RIB data."; 6673 container routes { 6674 description 6675 "Enclosing container for list of routes in the routing 6676 table."; 6677 list route { 6678 key "prefix origin path-id"; 6679 description 6680 "List of routes in the table, keyed by the route 6681 prefix, the route origin, and path-id. The route 6682 origin can be either the neighbor address from which 6683 the route was learned, or the source protocol that 6684 injected the route. The path-id distinguishes routes 6685 for the same prefix received from a neighbor (e.g., 6686 if add-paths is enabled)."; 6687 leaf prefix { 6688 type inet:ip-address; 6689 description 6690 "The 'foo' prefix corresponding to the route."; 6691 } 6692 uses bgp:bgp-loc-rib-common-keys; 6693 uses bgp:bgp-loc-rib-common-attr-refs; 6694 uses bgp:bgp-common-route-annotations-state; 6695 uses bgp:bgp-unknown-attr-top; 6696 uses bgp:rib-ext-route-annotations; 6697 } 6698 uses bgp:clear-routes; 6699 } 6700 } 6701 container neighbors { 6702 config false; 6703 description 6704 "Enclosing container for neighbor list."; 6705 list neighbor { 6706 key "neighbor-address"; 6707 description 6708 "List of neighbors (peers) of the local BGP speaker."; 6709 leaf neighbor-address { 6710 type inet:ip-address; 6711 description 6712 "IP address of the BGP neighbor or peer."; 6713 } 6714 container adj-rib-in-pre { 6715 description 6716 "Per-neighbor table containing the NLRI updates 6717 received from the neighbor before any local input 6718 policy rules or filters have been applied. This can 6719 be considered the 'raw' updates from the neighbor."; 6720 uses bgp:ipv4-adj-rib-common; 6721 } 6722 container adj-rib-in-post { 6723 description 6724 "Per-neighbor table containing the paths received from 6725 the neighbor that are eligible for best-path selection 6726 after local input policy rules have been applied."; 6727 uses bgp:ipv4-adj-rib-in-post; 6728 } 6729 container adj-rib-out-pre { 6730 description 6731 "Per-neighbor table containing paths eligible for 6732 sending (advertising) to the neighbor before output 6733 policy rules have been applied."; 6734 uses bgp:ipv4-adj-rib-common; 6735 } 6736 container adj-rib-out-post { 6737 description 6738 "Per-neighbor table containing paths eligible for 6739 sending (advertising) to the neighbor after output 6740 policy rules have been applied."; 6741 uses bgp:ipv4-adj-rib-common; 6742 } 6743 } 6744 } 6745 } 6746 } 6747 } 6749 Appendix C. How to deviate a module 6751 This example shows how the BGP can be deviated to indicate two nodes 6752 that the particular implementation is choosing not to support. 6754 module example-newco-bgp { 6755 yang-version 1.1; 6756 namespace "http://example.com/ns/example-newco-bgp"; 6757 prefix example-newco-bgp; 6759 import ietf-bgp { 6760 prefix "bgp"; 6761 } 6763 organization 6764 "Newco model group."; 6766 contact 6767 "abc@newco.com"; 6768 description 6769 "This YANG module deviates IETF BGP YANG module."; 6771 revision 2022-03-06 { 6772 description 6773 "Creating NewCo deviations to ietf-bgp model"; 6775 reference 6776 "RFC XXXX: BGP YANG module for Service Provider Network."; 6777 } 6779 deviation "/bgp:bgp/bgp:global/bgp:graceful-restart/" + 6780 "bgp:restart-time" { 6781 deviate not-supported; 6782 } 6784 deviation "/bgp:bgp/bgp:global/bgp:graceful-restart/" + 6785 "bgp:stale-route-time" { 6786 deviate not-supported; 6787 } 6788 } 6790 Appendix D. Complete configuration tree diagram 6792 Here is a complete tree diagram for the configuration and operational 6793 part of the model. 6795 module: ietf-bgp 6797 augment /rt:routing/rt:control-plane-protocols 6798 /rt:control-plane-protocol: 6799 +--rw bgp 6800 +--rw global! 6801 | +--rw as inet:as-number 6802 | +--rw identifier? yang:dotted-quad 6803 | +--rw distance 6804 | | +--rw external? uint8 6805 | | +--rw internal? uint8 6806 | +--rw confederation 6807 | | +--rw enabled? boolean 6808 | | +--rw identifier? inet:as-number 6809 | | +--rw member-as* inet:as-number 6810 | +--rw graceful-restart {bt:graceful-restart}? 6811 | | +--rw enabled? boolean 6812 | | +--rw restart-time? uint16 6813 | | +--rw stale-routes-time? uint32 6814 | | +--rw helper-only? boolean 6815 | +--rw use-multiple-paths 6816 | | +--rw enabled? boolean 6817 | | +--rw ebgp 6818 | | | +--rw allow-multiple-as? boolean 6819 | | | +--rw maximum-paths? uint32 6820 | | +--rw ibgp 6821 | | +--rw maximum-paths? uint32 6822 | +--rw route-selection-options 6823 | | +--rw always-compare-med? boolean 6824 | | +--rw ignore-as-path-length? boolean 6825 | | +--rw external-compare-router-id? boolean 6826 | | +--rw advertise-inactive-routes? boolean 6827 | | +--rw enable-aigp? boolean 6828 | | +--rw ignore-next-hop-igp-metric? boolean 6829 | | +--rw enable-med? boolean 6830 | | +--rw med-plus-igp 6831 | | +--rw enabled? boolean 6832 | | +--rw igp-multiplier? uint16 6833 | | +--rw med-multiplier? uint16 6834 | +--rw afi-safis 6835 | | +--rw afi-safi* [name] 6836 | | +--rw name identityref 6837 | | +--rw enabled? boolean 6838 | | +--ro total-paths? uint32 6839 | | +--ro total-prefixes? uint32 6840 | | +--rw graceful-restart {bt:graceful-restart}? 6841 | | | +--rw enabled? boolean 6842 | | +--rw route-selection-options 6843 | | | +--rw always-compare-med? boolean 6844 | | | +--rw ignore-as-path-length? boolean 6845 | | | +--rw external-compare-router-id? boolean 6846 | | | +--rw advertise-inactive-routes? boolean 6847 | | | +--rw enable-aigp? boolean 6848 | | | +--rw ignore-next-hop-igp-metric? boolean 6849 | | | +--rw enable-med? boolean 6850 | | | +--rw med-plus-igp 6851 | | | +--rw enabled? boolean 6852 | | | +--rw igp-multiplier? uint16 6853 | | | +--rw med-multiplier? uint16 6854 | | +--rw use-multiple-paths 6855 | | | +--rw enabled? boolean 6856 | | | +--rw ebgp 6857 | | | | +--rw allow-multiple-as? boolean 6858 | | | | +--rw maximum-paths? uint32 6859 | | | +--rw ibgp 6860 | | | +--rw maximum-paths? uint32 6861 | | +--rw apply-policy 6862 | | | +--rw import-policy* leafref 6863 | | | +--rw default-import-policy? default-policy-type 6864 | | | +--rw export-policy* leafref 6865 | | | +--rw default-export-policy? default-policy-type 6866 | | +--rw ipv4-unicast 6867 | | | +--rw prefix-limit 6868 | | | | +--rw max-prefixes? uint32 6869 | | | | +--rw shutdown-threshold-pct? 6870 | | | | | rt-types:percentage 6871 | | | | +--rw restart-timer? uint32 6872 | | | +--rw send-default-route? boolean 6873 | | +--rw ipv6-unicast 6874 | | | +--rw prefix-limit 6875 | | | | +--rw max-prefixes? uint32 6876 | | | | +--rw shutdown-threshold-pct? 6877 | | | | | rt-types:percentage 6878 | | | | +--rw restart-timer? uint32 6879 | | | +--rw send-default-route? boolean 6880 | | +--rw ipv4-labeled-unicast 6881 | | | +--rw prefix-limit 6882 | | | +--rw max-prefixes? uint32 6883 | | | +--rw shutdown-threshold-pct? 6884 | | | | rt-types:percentage 6885 | | | +--rw restart-timer? uint32 6886 | | +--rw ipv6-labeled-unicast 6887 | | | +--rw prefix-limit 6888 | | | +--rw max-prefixes? uint32 6889 | | | +--rw shutdown-threshold-pct? 6890 | | | | rt-types:percentage 6891 | | | +--rw restart-timer? uint32 6892 | | +--rw l3vpn-ipv4-unicast 6893 | | | +--rw prefix-limit 6894 | | | +--rw max-prefixes? uint32 6895 | | | +--rw shutdown-threshold-pct? 6896 | | | | rt-types:percentage 6897 | | | +--rw restart-timer? uint32 6898 | | +--rw l3vpn-ipv6-unicast 6899 | | | +--rw prefix-limit 6900 | | | +--rw max-prefixes? uint32 6901 | | | +--rw shutdown-threshold-pct? 6902 | | | | rt-types:percentage 6903 | | | +--rw restart-timer? uint32 6904 | | +--rw l3vpn-ipv4-multicast 6905 | | | +--rw prefix-limit 6906 | | | +--rw max-prefixes? uint32 6907 | | | +--rw shutdown-threshold-pct? 6908 | | | | rt-types:percentage 6909 | | | +--rw restart-timer? uint32 6910 | | +--rw l3vpn-ipv6-multicast 6911 | | | +--rw prefix-limit 6912 | | | +--rw max-prefixes? uint32 6913 | | | +--rw shutdown-threshold-pct? 6914 | | | | rt-types:percentage 6915 | | | +--rw restart-timer? uint32 6916 | | +--rw l2vpn-vpls 6917 | | | +--rw prefix-limit 6918 | | | +--rw max-prefixes? uint32 6919 | | | +--rw shutdown-threshold-pct? 6920 | | | | rt-types:percentage 6921 | | | +--rw restart-timer? uint32 6922 | | +--rw l2vpn-evpn 6923 | | +--rw prefix-limit 6924 | | +--rw max-prefixes? uint32 6925 | | +--rw shutdown-threshold-pct? 6926 | | | rt-types:percentage 6927 | | +--rw restart-timer? uint32 6928 | +--rw apply-policy 6929 | | +--rw import-policy* leafref 6930 | | +--rw default-import-policy? default-policy-type 6931 | | +--rw export-policy* leafref 6932 | | +--rw default-export-policy? default-policy-type 6933 | +--ro total-paths? uint32 6934 | +--ro total-prefixes? uint32 6935 +--rw neighbors 6936 | +--rw neighbor* [remote-address] 6937 | | +--rw remote-address inet:ip-address 6938 | | +--ro local-address? inet:ip-address 6939 | | +--ro local-port? inet:port-number 6940 | | +--ro remote-port? inet:port-number 6941 | | +--ro peer-type? bt:peer-type 6942 | | +--rw peer-group? 6943 | | | -> ../../../peer-groups/peer-group/name 6944 | | +--ro identifier? yang:dotted-quad 6945 | | +--rw enabled? boolean 6946 | | +--rw secure-session-enable? boolean 6947 | | +--rw secure-session 6948 | | | +--rw (option)? 6949 | | | +--:(ao) 6950 | | | | +--rw enable-ao? boolean 6951 | | | | +--rw send-id? uint8 6952 | | | | +--rw recv-id? uint8 6953 | | | | +--rw include-tcp-options? boolean 6954 | | | | +--rw accept-ao-mismatch? boolean 6955 | | | | +--rw ao-keychain? 6956 | | | | key-chain:key-chain-ref 6957 | | | +--:(md5) 6958 | | | +--rw enable-md5? boolean 6959 | | | +--rw md5-keychain? 6960 | | | key-chain:key-chain-ref 6961 | | +--rw ttl-security? uint8 6962 | | | {bt:ttl-security}? 6963 | | +--rw peer-as? inet:as-number 6964 | | +--rw local-as? inet:as-number 6965 | | +--rw remove-private-as? 6966 | | | bt:remove-private-as-option 6967 | | +--rw route-flap-damping {bt:damping}? 6968 | | | +--rw enable? boolean 6969 | | | +--rw suppress-above? decimal64 6970 | | | +--rw reuse-above? decimal64 6971 | | | +--rw max-flap? decimal64 6972 | | | +--rw reach-decay? uint32 6973 | | | +--rw unreach-decay? uint32 6974 | | | +--rw keep-history? uint32 6975 | | +--rw send-community* identityref 6976 | | | {bt:send-communities}? 6977 | | +--rw description? string 6978 | | +--rw timers 6979 | | | +--rw connect-retry-interval? uint16 6980 | | | +--rw hold-time? uint16 6981 | | | +--rw keepalive? uint16 6982 | | | +--rw min-as-origination-interval? uint16 6983 | | | +--rw min-route-advertisement-interval? uint16 6984 | | +--rw transport 6985 | | | +--rw tcp-mss? uint16 6986 | | | +--rw mtu-discovery? boolean 6987 | | | +--rw passive-mode? boolean 6988 | | | +--rw local-address? union 6989 | | | +--rw md5-auth-password? string 6990 | | | +--rw bfd {bt:bfd}? 6991 | | | +--rw enabled? boolean 6992 | | | +--rw local-multiplier? multiplier 6993 | | | +--rw (interval-config-type)? 6994 | | | +--:(tx-rx-intervals) 6995 | | | | +--rw desired-min-tx-interval? uint32 6996 | | | | +--rw required-min-rx-interval? uint32 6997 | | | +--:(single-interval) 6998 | | | {single-minimum-interval}? 6999 | | | +--rw min-interval? uint32 7000 | | +--rw graceful-restart {bt:graceful-restart}? 7001 | | | +--rw enabled? boolean 7002 | | | +--rw restart-time? uint16 7003 | | | +--rw stale-routes-time? uint32 7004 | | | +--rw helper-only? boolean 7005 | | | +--ro peer-restart-time? uint16 7006 | | | +--ro peer-restarting? boolean 7007 | | | +--ro local-restarting? boolean 7008 | | | +--ro mode? enumeration 7009 | | +--rw logging-options 7010 | | | +--rw log-neighbor-state-changes? boolean 7011 | | +--rw ebgp-multihop 7012 | | | +--rw enabled? boolean 7013 | | | +--rw multihop-ttl? uint8 7014 | | +--rw route-reflector 7015 | | | +--rw cluster-id? bt:rr-cluster-id-type 7016 | | | +--rw no-client-reflect? boolean 7017 | | | +--rw client? boolean 7018 | | +--rw as-path-options 7019 | | | +--rw allow-own-as? uint8 7020 | | | +--rw replace-peer-as? boolean 7021 | | +--rw add-paths {bt:add-paths}? 7022 | | | +--rw receive? boolean 7023 | | | +--rw (send)? 7024 | | | | +--:(max) 7025 | | | | | +--rw max? uint8 7026 | | | | +--:(all) 7027 | | | | +--rw all? empty 7028 | | | +--rw eligible-prefix-policy? leafref 7029 | | +--rw use-multiple-paths 7030 | | | +--rw enabled? boolean 7031 | | | +--rw ebgp 7032 | | | +--rw allow-multiple-as? boolean 7033 | | +--rw apply-policy 7034 | | | +--rw import-policy* leafref 7035 | | | +--rw default-import-policy? default-policy-type 7036 | | | +--rw export-policy* leafref 7037 | | | +--rw default-export-policy? default-policy-type 7038 | | +--rw afi-safis 7039 | | | +--rw afi-safi* [name] 7040 | | | +--rw name identityref 7041 | | | +--rw enabled? boolean 7042 | | | +--ro active? boolean 7043 | | | +--ro prefixes 7044 | | | | +--ro received? uint32 7045 | | | | +--ro sent? uint32 7046 | | | | +--ro installed? uint32 7047 | | | +--rw graceful-restart {bt:graceful-restart}? 7048 | | | | +--rw enabled? 7049 | | | | | boolean 7050 | | | | +--ro received? 7051 | | | | | boolean 7052 | | | | +--ro advertised? 7053 | | | | | boolean 7054 | | | | +--ro local-forwarding-state-preserved? 7055 | | | | | boolean 7056 | | | | +--ro forwarding-state-preserved? 7057 | | | | | boolean 7058 | | | | +--ro end-of-rib-received? 7059 | | | | boolean 7060 | | | +--rw apply-policy 7061 | | | | +--rw import-policy* leafref 7062 | | | | +--rw default-import-policy? 7063 | | | | | default-policy-type 7064 | | | | +--rw export-policy* leafref 7065 | | | | +--rw default-export-policy? 7066 | | | | default-policy-type 7067 | | | +--rw ipv4-unicast 7068 | | | | +--rw prefix-limit 7069 | | | | | +--rw max-prefixes? uint32 7070 | | | | | +--rw shutdown-threshold-pct? 7071 | | | | | | rt-types:percentage 7072 | | | | | +--rw restart-timer? uint32 7073 | | | | +--rw send-default-route? boolean 7074 | | | +--rw ipv6-unicast 7075 | | | | +--rw prefix-limit 7076 | | | | | +--rw max-prefixes? uint32 7077 | | | | | +--rw shutdown-threshold-pct? 7078 | | | | | | rt-types:percentage 7079 | | | | | +--rw restart-timer? uint32 7080 | | | | +--rw send-default-route? boolean 7081 | | | +--rw ipv4-labeled-unicast 7082 | | | | +--rw prefix-limit 7083 | | | | +--rw max-prefixes? uint32 7084 | | | | +--rw shutdown-threshold-pct? 7085 | | | | | rt-types:percentage 7086 | | | | +--rw restart-timer? uint32 7087 | | | +--rw ipv6-labeled-unicast 7088 | | | | +--rw prefix-limit 7089 | | | | +--rw max-prefixes? uint32 7090 | | | | +--rw shutdown-threshold-pct? 7091 | | | | | rt-types:percentage 7092 | | | | +--rw restart-timer? uint32 7093 | | | +--rw l3vpn-ipv4-unicast 7094 | | | | +--rw prefix-limit 7095 | | | | +--rw max-prefixes? uint32 7096 | | | | +--rw shutdown-threshold-pct? 7097 | | | | | rt-types:percentage 7098 | | | | +--rw restart-timer? uint32 7099 | | | +--rw l3vpn-ipv6-unicast 7100 | | | | +--rw prefix-limit 7101 | | | | +--rw max-prefixes? uint32 7102 | | | | +--rw shutdown-threshold-pct? 7103 | | | | | rt-types:percentage 7104 | | | | +--rw restart-timer? uint32 7105 | | | +--rw l3vpn-ipv4-multicast 7106 | | | | +--rw prefix-limit 7107 | | | | +--rw max-prefixes? uint32 7108 | | | | +--rw shutdown-threshold-pct? 7109 | | | | | rt-types:percentage 7110 | | | | +--rw restart-timer? uint32 7111 | | | +--rw l3vpn-ipv6-multicast 7112 | | | | +--rw prefix-limit 7113 | | | | +--rw max-prefixes? uint32 7114 | | | | +--rw shutdown-threshold-pct? 7115 | | | | | rt-types:percentage 7116 | | | | +--rw restart-timer? uint32 7117 | | | +--rw l2vpn-vpls 7118 | | | | +--rw prefix-limit 7119 | | | | +--rw max-prefixes? uint32 7120 | | | | +--rw shutdown-threshold-pct? 7121 | | | | | rt-types:percentage 7122 | | | | +--rw restart-timer? uint32 7123 | | | +--rw l2vpn-evpn 7124 | | | | +--rw prefix-limit 7125 | | | | +--rw max-prefixes? uint32 7126 | | | | +--rw shutdown-threshold-pct? 7127 | | | | | rt-types:percentage 7128 | | | | +--rw restart-timer? uint32 7129 | | | +--rw use-multiple-paths 7130 | | | +--rw enabled? boolean 7131 | | | +--rw ebgp 7132 | | | +--rw allow-multiple-as? boolean 7133 | | +--rw session-state? enumeration 7134 | | +--ro last-established? yang:date-and-time 7135 | | +--ro negotiated-capabilities* identityref 7136 | | +--ro negotiated-hold-time? uint16 7137 | | +--ro last-error? binary 7138 | | +--ro fsm-established-time? yang:gauge32 7139 | | +--rw treat-as-withdraw? boolean 7140 | | +--ro erroneous-update-messages? uint32 7141 | | +--rw bfd {bt:bfd}? 7142 | | | +--rw enabled? boolean 7143 | | | +--rw local-multiplier? multiplier 7144 | | | +--rw (interval-config-type)? 7145 | | | +--:(tx-rx-intervals) 7146 | | | | +--rw desired-min-tx-interval? uint32 7147 | | | | +--rw required-min-rx-interval? uint32 7148 | | | +--:(single-interval) {single-minimum-interval}? 7149 | | | +--rw min-interval? uint32 7150 | | +--rw statistics 7151 | | +--ro peer-fsm-established-transitions? 7152 | | | yang:counter64 7153 | | +--ro fsm-established-transitions? 7154 | | | yang:counter32 7155 | | +--ro messages 7156 | | | +--ro in-total-messages? yang:counter32 7157 | | | +--ro out-total-messages? yang:counter32 7158 | | | +--ro in-update-elapsed-time? yang:gauge32 7159 | | | +--ro sent 7160 | | | | +--ro updates-received? uint64 7161 | | | | +--ro updates-sent? uint64 7162 | | | | +--ro messages-received? uint64 7163 | | | | +--ro messages-sent? uint64 7164 | | | | +--ro notification? uint64 7165 | | | +--ro received 7166 | | | +--ro updates-received? uint64 7167 | | | +--ro updates-sent? uint64 7168 | | | +--ro messages-received? uint64 7169 | | | +--ro messages-sent? uint64 7170 | | | +--ro notification? uint64 7171 | | +--ro queues 7172 | | | +--ro input? uint32 7173 | | | +--ro output? uint32 7174 | | +---x clear {bt:clear-statistics}? 7175 | | +---w input 7176 | | | +---w clear-at? yang:date-and-time 7177 | | +--ro output 7178 | | +--ro clear-finished-at? yang:date-and-time 7179 | +---n established 7180 | | +-- remote-address? -> ../../neighbor/remote-address 7181 | | +-- last-error? -> ../../neighbor/last-error 7182 | | +-- session-state? -> ../../neighbor/session-state 7183 | +---n backward-transition 7184 | | +-- remote-addr? -> ../../neighbor/remote-address 7185 | | +-- last-error? -> ../../neighbor/last-error 7186 | | +-- session-state? -> ../../neighbor/session-state 7187 | +---x clear {bt:clear-neighbors}? 7188 | +---w input 7189 | | +---w (operation)? 7190 | | | +--:(operation-admin) 7191 | | | | +---w admin? empty 7192 | | | +--:(operation-hard) 7193 | | | | +---w hard? empty 7194 | | | +--:(operation-soft) 7195 | | | | +---w soft? empty 7196 | | | +--:(operation-soft-inbound) 7197 | | | +---w soft-inbound? empty {bt:route-refresh}? 7198 | | +---w clear-at? yang:date-and-time 7199 | +--ro output 7200 | +--ro clear-finished-at? yang:date-and-time 7201 +--rw peer-groups 7202 | +--rw peer-group* [name] 7203 | +--rw name string 7204 | +--rw secure-session-enable? boolean 7205 | +--rw secure-session 7206 | | +--rw (option)? 7207 | | +--:(ao) 7208 | | | +--rw enable-ao? boolean 7209 | | | +--rw send-id? uint8 7210 | | | +--rw recv-id? uint8 7211 | | | +--rw include-tcp-options? boolean 7212 | | | +--rw accept-ao-mismatch? boolean 7213 | | | +--rw ao-keychain? 7214 | | | key-chain:key-chain-ref 7215 | | +--:(md5) 7216 | | | +--rw enable-md5? boolean 7217 | | | +--rw md5-keychain? 7218 | | | key-chain:key-chain-ref 7219 | | +--:(ipsec) 7220 | | +--rw sa? string 7221 | +--rw ttl-security? uint8 {bt:ttl-security}? 7222 | +--rw peer-as? inet:as-number 7223 | +--rw local-as? inet:as-number 7224 | +--rw remove-private-as? 7225 | | bt:remove-private-as-option 7226 | +--rw route-flap-damping {bt:damping}? 7227 | | +--rw enable? boolean 7228 | | +--rw suppress-above? decimal64 7229 | | +--rw reuse-above? decimal64 7230 | | +--rw max-flap? decimal64 7231 | | +--rw reach-decay? uint32 7232 | | +--rw unreach-decay? uint32 7233 | | +--rw keep-history? uint32 7234 | +--rw send-community* identityref 7235 | | {bt:send-communities}? 7236 | +--rw description? string 7237 | +--rw timers 7238 | | +--rw connect-retry-interval? uint16 7239 | | +--rw hold-time? uint16 7240 | | +--rw keepalive? uint16 7241 | | +--rw min-as-origination-interval? uint16 7242 | | +--rw min-route-advertisement-interval? uint16 7243 | +--rw transport 7244 | | +--rw tcp-mss? uint16 7245 | | +--rw mtu-discovery? boolean 7246 | | +--rw passive-mode? boolean 7247 | | +--rw local-address? union 7248 | | +--rw md5-auth-password? string 7249 | | +--rw bfd {bt:bfd}? 7250 | | +--rw enabled? boolean 7251 | | +--rw local-multiplier? multiplier 7252 | | +--rw (interval-config-type)? 7253 | | +--:(tx-rx-intervals) 7254 | | | +--rw desired-min-tx-interval? uint32 7255 | | | +--rw required-min-rx-interval? uint32 7256 | | +--:(single-interval) 7257 | | {single-minimum-interval}? 7258 | | +--rw min-interval? uint32 7259 | +--rw graceful-restart {bt:graceful-restart}? 7260 | | +--rw enabled? boolean 7261 | | +--rw restart-time? uint16 7262 | | +--rw stale-routes-time? uint32 7263 | | +--rw helper-only? boolean 7264 | | +--ro peer-restart-time? uint16 7265 | | +--ro peer-restarting? boolean 7266 | | +--ro local-restarting? boolean 7267 | | +--ro mode? enumeration 7268 | +--rw logging-options 7269 | | +--rw log-neighbor-state-changes? boolean 7270 | +--rw ebgp-multihop 7271 | | +--rw enabled? boolean 7272 | | +--rw multihop-ttl? uint8 7273 | +--rw route-reflector 7274 | | +--rw cluster-id? bt:rr-cluster-id-type 7275 | | +--rw no-client-reflect? boolean 7276 | | +--rw client? boolean 7277 | +--rw as-path-options 7278 | | +--rw allow-own-as? uint8 7279 | | +--rw replace-peer-as? boolean 7280 | +--rw add-paths {bt:add-paths}? 7281 | | +--rw receive? boolean 7282 | | +--rw (send)? 7283 | | | +--:(max) 7284 | | | | +--rw max? uint8 7285 | | | +--:(all) 7286 | | | +--rw all? empty 7287 | | +--rw eligible-prefix-policy? leafref 7288 | +--rw use-multiple-paths 7289 | | +--rw enabled? boolean 7290 | | +--rw ebgp 7291 | | +--rw allow-multiple-as? boolean 7292 | +--rw apply-policy 7293 | | +--rw import-policy* leafref 7294 | | +--rw default-import-policy? default-policy-type 7295 | | +--rw export-policy* leafref 7296 | | +--rw default-export-policy? default-policy-type 7297 | +--rw afi-safis 7298 | +--rw afi-safi* [name] 7299 | +--rw name identityref 7300 | +--rw enabled? boolean 7301 | +--rw graceful-restart {bt:graceful-restart}? 7302 | | +--rw enabled? boolean 7303 | +--rw use-multiple-paths 7304 | | +--rw enabled? boolean 7305 | | +--rw ebgp 7306 | | +--rw allow-multiple-as? boolean 7307 | +--rw apply-policy 7308 | | +--rw import-policy* leafref 7309 | | +--rw default-import-policy? 7310 | | | default-policy-type 7311 | | +--rw export-policy* leafref 7312 | | +--rw default-export-policy? 7313 | | default-policy-type 7314 | +--rw ipv4-unicast 7315 | | +--rw prefix-limit 7316 | | | +--rw max-prefixes? uint32 7317 | | | +--rw shutdown-threshold-pct? 7318 | | | | rt-types:percentage 7319 | | | +--rw restart-timer? uint32 7320 | | +--rw send-default-route? boolean 7321 | +--rw ipv6-unicast 7322 | | +--rw prefix-limit 7323 | | | +--rw max-prefixes? uint32 7324 | | | +--rw shutdown-threshold-pct? 7325 | | | | rt-types:percentage 7326 | | | +--rw restart-timer? uint32 7327 | | +--rw send-default-route? boolean 7328 | +--rw ipv4-labeled-unicast 7329 | | +--rw prefix-limit 7330 | | +--rw max-prefixes? uint32 7331 | | +--rw shutdown-threshold-pct? 7332 | | | rt-types:percentage 7333 | | +--rw restart-timer? uint32 7334 | +--rw ipv6-labeled-unicast 7335 | | +--rw prefix-limit 7336 | | +--rw max-prefixes? uint32 7337 | | +--rw shutdown-threshold-pct? 7338 | | | rt-types:percentage 7339 | | +--rw restart-timer? uint32 7340 | +--rw l3vpn-ipv4-unicast 7341 | | +--rw prefix-limit 7342 | | +--rw max-prefixes? uint32 7343 | | +--rw shutdown-threshold-pct? 7344 | | | rt-types:percentage 7345 | | +--rw restart-timer? uint32 7346 | +--rw l3vpn-ipv6-unicast 7347 | | +--rw prefix-limit 7348 | | +--rw max-prefixes? uint32 7349 | | +--rw shutdown-threshold-pct? 7350 | | | rt-types:percentage 7351 | | +--rw restart-timer? uint32 7352 | +--rw l3vpn-ipv4-multicast 7353 | | +--rw prefix-limit 7354 | | +--rw max-prefixes? uint32 7355 | | +--rw shutdown-threshold-pct? 7356 | | | rt-types:percentage 7357 | | +--rw restart-timer? uint32 7358 | +--rw l3vpn-ipv6-multicast 7359 | | +--rw prefix-limit 7360 | | +--rw max-prefixes? uint32 7361 | | +--rw shutdown-threshold-pct? 7362 | | | rt-types:percentage 7363 | | +--rw restart-timer? uint32 7364 | +--rw l2vpn-vpls 7365 | | +--rw prefix-limit 7366 | | +--rw max-prefixes? uint32 7367 | | +--rw shutdown-threshold-pct? 7368 | | | rt-types:percentage 7369 | | +--rw restart-timer? uint32 7370 | +--rw l2vpn-evpn 7371 | +--rw prefix-limit 7372 | +--rw max-prefixes? uint32 7373 | +--rw shutdown-threshold-pct? 7374 | | rt-types:percentage 7375 | +--rw restart-timer? uint32 7376 +--rw interfaces 7377 | +--rw interface* [name] 7378 | +--rw name if:interface-ref 7379 | +--rw bfd {bt:bfd}? 7380 | +--rw enabled? boolean 7381 +--ro rib 7382 +--ro attr-sets 7383 | +--ro attr-set* [index] 7384 | +--ro index uint64 7385 | +--ro attributes 7386 | +--ro origin? 7387 | | bt:bgp-origin-attr-type 7388 | +--ro atomic-aggregate? boolean 7389 | +--ro next-hop? inet:ip-address 7390 | +--ro link-local-next-hop? inet:ipv6-address 7391 | +--ro med? uint32 7392 | +--ro local-pref? uint32 7393 | +--ro originator-id? yang:dotted-quad 7394 | +--ro cluster-list* yang:dotted-quad 7395 | +--ro aigp-metric? uint64 7396 | +--ro aggregator 7397 | | +--ro as? inet:as-number 7398 | | +--ro address? inet:ipv4-address 7399 | +--ro aggregator4 7400 | | +--ro as4? inet:as-number 7401 | | +--ro address? inet:ipv4-address 7402 | +--ro as-path 7403 | | +--ro segment* [] 7404 | | +--ro type? identityref 7405 | | +--ro member* inet:as-number 7406 | +--ro as4-path 7407 | +--ro segment* [] 7408 | +--ro type? identityref 7409 | +--ro member* inet:as-number 7410 +--ro communities 7411 | +--ro community* [index] 7412 | +--ro index uint64 7413 | +--ro community* union 7414 +--ro ext-communities 7415 | +--ro ext-community* [index] 7416 | +--ro index uint64 7417 | +--ro ext-community* rt:route-target 7418 +--ro large-communities 7419 | +--ro large-community* [index] 7420 | +--ro index uint64 7421 | +--ro large-community* bt:bgp-large-community-type 7422 +--ro afi-safis 7423 +--ro afi-safi* [name] 7424 +--ro name identityref 7425 +--ro ipv4-unicast 7426 | +--ro loc-rib 7427 | | +--ro routes 7428 | | +--ro route* [prefix origin path-id] 7429 | | +--ro prefix 7430 | | | inet:ipv4-prefix 7431 | | +--ro origin union 7432 | | +--ro path-id uint32 7433 | | +--ro attr-index? leafref 7434 | | +--ro community-index? leafref 7435 | | +--ro ext-community-index? leafref 7436 | | +--ro last-modified? 7437 | | | yang:timeticks 7438 | | +--ro eligible-route? boolean 7439 | | +--ro ineligible-reason? identityref 7440 | | +--ro unknown-attributes 7441 | | | +--ro unknown-attribute* [attr-type] 7442 | | | +--ro optional? boolean 7443 | | | +--ro transitive? boolean 7444 | | | +--ro partial? boolean 7445 | | | +--ro extended? boolean 7446 | | | +--ro attr-type uint8 7447 | | | +--ro attr-len? uint16 7448 | | | +--ro attr-value? binary 7449 | | +--ro reject-reason? union 7450 | +--ro neighbors 7451 | +--ro neighbor* [neighbor-address] 7452 | +--ro neighbor-address inet:ip-address 7453 | +--ro adj-rib-in-pre 7454 | | +--ro routes 7455 | | | +--ro route* [prefix path-id] 7456 | | | +--ro prefix 7457 | | | | inet:ipv4-prefix 7458 | | | +--ro path-id uint32 7459 | | | +--ro attr-index? leafref 7460 | | | +--ro community-index? leafref 7461 | | | +--ro ext-community-index? leafref 7462 | | | +--ro last-modified? 7463 | | | | yang:timeticks 7464 | | | +--ro eligible-route? 7465 | | | | boolean 7466 | | | +--ro ineligible-reason? 7467 | | | | identityref 7468 | | | +--ro unknown-attributes 7469 | | | | +--ro unknown-attribute* 7470 | | | | [attr-type] 7471 | | | | +--ro optional? boolean 7472 | | | | +--ro transitive? boolean 7473 | | | | +--ro partial? boolean 7474 | | | | +--ro extended? boolean 7475 | | | | +--ro attr-type uint8 7476 | | | | +--ro attr-len? uint16 7477 | | | | +--ro attr-value? binary 7478 | | | +--ro reject-reason? union 7479 | | +--ro clear-routes {bt:clear-routes}? 7480 | | +---x clear 7481 | | +---w input 7482 | | | +---w clear-at? 7483 | | | yang:date-and-time 7484 | | +--ro output 7485 | | +--ro clear-finished-at? 7486 | | yang:date-and-time 7487 | +--ro adj-rib-in-post 7488 | | +--ro routes 7489 | | | +--ro route* [prefix path-id] 7490 | | | +--ro prefix 7491 | | | | inet:ipv4-prefix 7492 | | | +--ro path-id uint32 7493 | | | +--ro attr-index? leafref 7494 | | | +--ro community-index? leafref 7495 | | | +--ro ext-community-index? leafref 7496 | | | +--ro last-modified? 7497 | | | | yang:timeticks 7498 | | | +--ro eligible-route? 7499 | | | | boolean 7500 | | | +--ro ineligible-reason? 7501 | | | | identityref 7502 | | | +--ro best-path? 7503 | | | | boolean 7504 | | | +--ro unknown-attributes 7505 | | | | +--ro unknown-attribute* 7506 | | | | [attr-type] 7507 | | | | +--ro optional? boolean 7508 | | | | +--ro transitive? boolean 7509 | | | | +--ro partial? boolean 7510 | | | | +--ro extended? boolean 7511 | | | | +--ro attr-type uint8 7512 | | | | +--ro attr-len? uint16 7513 | | | | +--ro attr-value? binary 7514 | | | +--ro reject-reason? union 7515 | | +--ro clear-routes {bt:clear-routes}? 7516 | | +---x clear 7517 | | +---w input 7518 | | | +---w clear-at? 7519 | | | yang:date-and-time 7520 | | +--ro output 7521 | | +--ro clear-finished-at? 7522 | | yang:date-and-time 7523 | +--ro adj-rib-out-pre 7524 | | +--ro routes 7525 | | | +--ro route* [prefix path-id] 7526 | | | +--ro prefix 7527 | | | | inet:ipv4-prefix 7528 | | | +--ro path-id uint32 7529 | | | +--ro attr-index? leafref 7530 | | | +--ro community-index? leafref 7531 | | | +--ro ext-community-index? leafref 7532 | | | +--ro last-modified? 7533 | | | | yang:timeticks 7534 | | | +--ro eligible-route? 7535 | | | | boolean 7536 | | | +--ro ineligible-reason? 7537 | | | | identityref 7538 | | | +--ro unknown-attributes 7539 | | | | +--ro unknown-attribute* 7540 | | | | [attr-type] 7541 | | | | +--ro optional? boolean 7542 | | | | +--ro transitive? boolean 7543 | | | | +--ro partial? boolean 7544 | | | | +--ro extended? boolean 7545 | | | | +--ro attr-type uint8 7546 | | | | +--ro attr-len? uint16 7547 | | | | +--ro attr-value? binary 7548 | | | +--ro reject-reason? union 7549 | | +--ro clear-routes {bt:clear-routes}? 7550 | | +---x clear 7551 | | +---w input 7552 | | | +---w clear-at? 7553 | | | yang:date-and-time 7554 | | +--ro output 7555 | | +--ro clear-finished-at? 7556 | | yang:date-and-time 7557 | +--ro adj-rib-out-post 7558 | +--ro routes 7559 | | +--ro route* [prefix path-id] 7560 | | +--ro prefix 7561 | | | inet:ipv4-prefix 7562 | | +--ro path-id uint32 7563 | | +--ro attr-index? leafref 7564 | | +--ro community-index? leafref 7565 | | +--ro ext-community-index? leafref 7566 | | +--ro last-modified? 7567 | | | yang:timeticks 7568 | | +--ro eligible-route? 7569 | | | boolean 7570 | | +--ro ineligible-reason? 7571 | | | identityref 7572 | | +--ro unknown-attributes 7573 | | | +--ro unknown-attribute* 7574 | | | [attr-type] 7575 | | | +--ro optional? boolean 7576 | | | +--ro transitive? boolean 7577 | | | +--ro partial? boolean 7578 | | | +--ro extended? boolean 7579 | | | +--ro attr-type uint8 7580 | | | +--ro attr-len? uint16 7581 | | | +--ro attr-value? binary 7582 | | +--ro reject-reason? union 7583 | +--ro clear-routes {bt:clear-routes}? 7584 | +---x clear 7585 | +---w input 7586 | | +---w clear-at? 7587 | | yang:date-and-time 7588 | +--ro output 7589 | +--ro clear-finished-at? 7590 | yang:date-and-time 7591 +--ro ipv6-unicast 7592 +--ro loc-rib 7593 | +--ro routes 7594 | +--ro route* [prefix origin path-id] 7595 | +--ro prefix 7596 | | inet:ipv6-prefix 7597 | +--ro origin union 7598 | +--ro path-id uint32 7599 | +--ro attr-index? leafref 7600 | +--ro community-index? leafref 7601 | +--ro ext-community-index? leafref 7602 | +--ro last-modified? 7603 | | yang:timeticks 7604 | +--ro eligible-route? boolean 7605 | +--ro ineligible-reason? identityref 7606 | +--ro unknown-attributes 7607 | | +--ro unknown-attribute* [attr-type] 7608 | | +--ro optional? boolean 7609 | | +--ro transitive? boolean 7610 | | +--ro partial? boolean 7611 | | +--ro extended? boolean 7612 | | +--ro attr-type uint8 7613 | | +--ro attr-len? uint16 7614 | | +--ro attr-value? binary 7615 | +--ro reject-reason? union 7616 +--ro neighbors 7617 +--ro neighbor* [neighbor-address] 7618 +--ro neighbor-address inet:ip-address 7619 +--ro adj-rib-in-pre 7620 | +--ro routes 7621 | | +--ro route* [prefix path-id] 7622 | | +--ro prefix 7623 | | | inet:ipv6-prefix 7624 | | +--ro path-id uint32 7625 | | +--ro attr-index? leafref 7626 | | +--ro community-index? leafref 7627 | | +--ro ext-community-index? leafref 7628 | | +--ro last-modified? 7629 | | | yang:timeticks 7630 | | +--ro eligible-route? 7631 | | | boolean 7632 | | +--ro ineligible-reason? 7633 | | | identityref 7634 | | +--ro unknown-attributes 7635 | | | +--ro unknown-attribute* 7636 | | | [attr-type] 7637 | | | +--ro optional? boolean 7638 | | | +--ro transitive? boolean 7639 | | | +--ro partial? boolean 7640 | | | +--ro extended? boolean 7641 | | | +--ro attr-type uint8 7642 | | | +--ro attr-len? uint16 7643 | | | +--ro attr-value? binary 7644 | | +--ro reject-reason? union 7645 | +--ro clear-routes {bt:clear-routes}? 7646 | +---x clear 7647 | +---w input 7648 | | +---w clear-at? 7649 | | yang:date-and-time 7650 | +--ro output 7651 | +--ro clear-finished-at? 7652 | yang:date-and-time 7653 +--ro adj-rib-in-post 7654 | +--ro routes 7655 | | +--ro route* [prefix path-id] 7656 | | +--ro prefix 7657 | | | inet:ipv6-prefix 7658 | | +--ro path-id uint32 7659 | | +--ro attr-index? leafref 7660 | | +--ro community-index? leafref 7661 | | +--ro ext-community-index? leafref 7662 | | +--ro last-modified? 7663 | | | yang:timeticks 7664 | | +--ro eligible-route? 7665 | | | boolean 7666 | | +--ro ineligible-reason? 7667 | | | identityref 7668 | | +--ro best-path? 7669 | | | boolean 7670 | | +--ro unknown-attributes 7671 | | | +--ro unknown-attribute* 7672 | | | [attr-type] 7673 | | | +--ro optional? boolean 7674 | | | +--ro transitive? boolean 7675 | | | +--ro partial? boolean 7676 | | | +--ro extended? boolean 7677 | | | +--ro attr-type uint8 7678 | | | +--ro attr-len? uint16 7679 | | | +--ro attr-value? binary 7680 | | +--ro reject-reason? union 7681 | +--ro clear-routes {bt:clear-routes}? 7682 | +---x clear 7683 | +---w input 7684 | | +---w clear-at? 7685 | | yang:date-and-time 7686 | +--ro output 7687 | +--ro clear-finished-at? 7688 | yang:date-and-time 7689 +--ro adj-rib-out-pre 7690 | +--ro routes 7691 | | +--ro route* [prefix path-id] 7692 | | +--ro prefix 7693 | | | inet:ipv6-prefix 7694 | | +--ro path-id uint32 7695 | | +--ro attr-index? leafref 7696 | | +--ro community-index? leafref 7697 | | +--ro ext-community-index? leafref 7698 | | +--ro last-modified? 7699 | | | yang:timeticks 7700 | | +--ro eligible-route? 7701 | | | boolean 7702 | | +--ro ineligible-reason? 7703 | | | identityref 7704 | | +--ro unknown-attributes 7705 | | | +--ro unknown-attribute* 7706 | | | [attr-type] 7707 | | | +--ro optional? boolean 7708 | | | +--ro transitive? boolean 7709 | | | +--ro partial? boolean 7710 | | | +--ro extended? boolean 7711 | | | +--ro attr-type uint8 7712 | | | +--ro attr-len? uint16 7713 | | | +--ro attr-value? binary 7714 | | +--ro reject-reason? union 7715 | +--ro clear-routes {bt:clear-routes}? 7716 | +---x clear 7717 | +---w input 7718 | | +---w clear-at? 7719 | | yang:date-and-time 7720 | +--ro output 7721 | +--ro clear-finished-at? 7722 | yang:date-and-time 7723 +--ro adj-rib-out-post 7724 +--ro routes 7725 | +--ro route* [prefix path-id] 7726 | +--ro prefix 7727 | | inet:ipv6-prefix 7728 | +--ro path-id uint32 7729 | +--ro attr-index? leafref 7730 | +--ro community-index? leafref 7731 | +--ro ext-community-index? leafref 7732 | +--ro last-modified? 7733 | | yang:timeticks 7734 | +--ro eligible-route? 7735 | | boolean 7736 | +--ro ineligible-reason? 7737 | | identityref 7738 | +--ro unknown-attributes 7739 | | +--ro unknown-attribute* 7740 | | [attr-type] 7741 | | +--ro optional? boolean 7742 | | +--ro transitive? boolean 7743 | | +--ro partial? boolean 7744 | | +--ro extended? boolean 7745 | | +--ro attr-type uint8 7746 | | +--ro attr-len? uint16 7747 | | +--ro attr-value? binary 7748 | +--ro reject-reason? union 7749 +--ro clear-routes {bt:clear-routes}? 7750 +---x clear 7751 +---w input 7752 | +---w clear-at? 7753 | yang:date-and-time 7754 +--ro output 7755 +--ro clear-finished-at? 7756 yang:date-and-time 7758 Appendix E. Complete policy tree diagram 7760 Here is a complete tree diagram for the policy portion of the model. 7762 module: ietf-bgp-policy 7764 augment /rt-pol:routing-policy/rt-pol:defined-sets: 7765 +--rw bgp-defined-sets 7766 +--rw community-sets 7767 | +--rw community-set* [name] 7768 | +--rw name string 7769 | +--rw member* union 7770 +--rw ext-community-sets 7771 | +--rw ext-community-set* [name] 7772 | +--rw name string 7773 | +--rw member* union 7774 +--rw large-community-sets 7775 | +--rw large-community-set* [name] 7776 | +--rw name string 7777 | +--rw member* union 7778 +--rw as-path-sets 7779 | +--rw as-path-set* [name] 7780 | +--rw name string 7781 | +--rw member* string 7782 +--rw next-hop-sets 7783 +--rw next-hop-set* [name] 7784 +--rw name string 7785 +--rw next-hop* bgp-next-hop-type 7786 augment /rt-pol:routing-policy/rt-pol:policy-definitions 7787 /rt-pol:policy-definition/rt-pol:statements 7788 /rt-pol:statement/rt-pol:conditions: 7789 +--rw bgp-conditions 7790 +--rw med-eq? uint32 7791 +--rw origin-eq? bt:bgp-origin-attr-type 7792 +--rw next-hop-in-eq* inet:ip-address-no-zone 7793 +--rw afi-safi-in* identityref 7794 +--rw local-pref-eq? uint32 7795 +--rw neighbor-eq* inet:ip-address 7796 +--rw route-type? enumeration 7797 +--rw community-count 7798 | +--rw community-count? uint32 7799 | +--rw (operation)? 7800 | +--:(eq) 7801 | | +--rw eq? empty 7802 | +--:(lt-or-eq) 7803 | | +--rw lt-or-eq? empty 7804 | +--:(gt-or-eq) 7805 | +--rw gt-or-eq? empty 7806 +--rw as-path-length 7807 | +--rw as-path-length? uint32 7808 | +--rw (operation)? 7809 | +--:(eq) 7810 | | +--rw eq? empty 7811 | +--:(lt-or-eq) 7812 | | +--rw lt-or-eq? empty 7813 | +--:(gt-or-eq) 7814 | +--rw gt-or-eq? empty 7815 +--rw match-community-set 7816 | +--rw community-set? leafref 7817 | +--rw match-set-options? match-set-options-type 7818 +--rw match-ext-community-set 7819 | +--rw ext-community-set? leafref 7820 | +--rw match-set-options? match-set-options-type 7821 +--rw match-large-community-set 7822 | +--rw ext-community-set? leafref 7823 | +--rw match-set-options? match-set-options-type 7824 +--rw match-as-path-set 7825 | +--rw as-path-set? leafref 7826 | +--rw match-set-options? match-set-options-type 7827 +--rw match-next-hop-set 7828 +--rw next-hop-set? leafref 7829 +--rw match-set-options? match-set-options-type 7830 augment /rt-pol:routing-policy/rt-pol:policy-definitions 7831 /rt-pol:policy-definition/rt-pol:statements 7832 /rt-pol:statement/rt-pol:actions: 7833 +--rw bgp-actions 7834 +--rw set-route-origin? bt:bgp-origin-attr-type 7835 +--rw set-local-pref? uint32 7836 +--rw set-next-hop? bgp-next-hop-type 7837 +--rw set-med? bgp-set-med-type 7838 +--rw set-as-path-prepend 7839 | +--rw repeat-n? uint8 7840 +--rw set-community 7841 | +--rw options? 7842 | | bgp-set-community-option-type 7843 | +--rw (method)? 7844 | +--:(inline) 7845 | | +--rw communities* union 7846 | +--:(reference) 7847 | +--rw community-set-ref? leafref 7848 +--rw set-ext-community 7849 | +--rw options? 7850 | | bgp-set-community-option-type 7851 | +--rw (method)? 7852 | +--:(inline) 7853 | | +--rw communities* rt-types:route-target 7854 | +--:(reference) 7855 | +--rw ext-community-set-ref? leafref 7856 +--rw set-large-community 7857 +--rw options? 7858 | bgp-set-community-option-type 7859 +--rw (method)? 7860 +--:(inline) 7861 | +--rw communities* 7862 | bt:bgp-large-community-type 7863 +--:(reference) 7864 +--rw large-community-set-ref? leafref 7866 Authors' Addresses 7868 Mahesh Jethanandani 7869 Kloud Services 7870 Email: mjethanandani@gmail.com 7872 Keyur Patel 7873 Arrcus 7874 CA 7875 United States of America 7876 Email: keyur@arrcus.com 7878 Susan Hares 7879 Huawei 7880 7453 Hickory Hill 7881 Saline, MI 48176 7882 United States of America 7883 Email: shares@ndzh.com 7885 Jeffrey Haas 7886 Juniper Networks 7887 Email: jhaas@pfrc.org