idnits 2.17.1 draft-ietf-idr-bgp-model-08.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 : ---------------------------------------------------------------------------- -- 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 413 has weird spacing: '...fi-name ide...' == Line 423 has weird spacing: '...address ine...' == Line 441 has weird spacing: '...address ine...' == Line 2202 has weird spacing: '...unicast speci...' -- The document date (February 25, 2020) is 1516 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) == Outdated reference: A later version (-06) exists of draft-scharf-tcpm-yang-tcp-04 == Outdated reference: A later version (-31) exists of draft-ietf-rtgwg-policy-model-08 Summary: 0 errors (**), 0 flaws (~~), 7 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 VMware 4 Intended status: Standards Track K. Patel 5 Expires: August 28, 2020 Arrcus 6 S. Hares 7 Huawei 8 J. Haas 9 Juniper Networks 10 February 25, 2020 12 BGP YANG Model for Service Provider Networks 13 draft-ietf-idr-bgp-model-08 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 August 28, 2020. 39 Copyright Notice 41 Copyright (c) 2020 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 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 57 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3 58 1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4 59 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 60 1.4. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 5 61 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 5 62 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 6 63 2.2. Policy configuration overview . . . . . . . . . . . . . . 9 64 2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 10 65 2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 12 66 2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 12 67 2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 12 68 2.3.4. Pre route advertisements per-neighbor . . . . . . . . 12 69 2.3.5. Post route advertisements per-neighbor . . . . . . . 12 70 3. Relation to other YANG data models . . . . . . . . . . . . . 12 71 4. Security Considerations . . . . . . . . . . . . . . . . . . . 13 72 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 73 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 14 74 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 14 75 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 14 76 7. Structure of the YANG modules . . . . . . . . . . . . . . . . 15 77 7.1. Main module and submodules for base items . . . . . . . . 16 78 7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 64 79 7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 77 80 7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 87 81 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 120 82 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 120 83 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 120 84 10.1. Normative references . . . . . . . . . . . . . . . . . . 120 85 10.2. Informative references . . . . . . . . . . . . . . . . . 124 86 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 125 87 A.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 125 88 A.2. Neighbor Address Family Configuration . . . . . . . . . . 126 89 A.3. IPv6 Neighbor Configuration . . . . . . . . . . . . . . . 128 90 A.4. VRF Configuration . . . . . . . . . . . . . . . . . . . . 129 91 Appendix B. How to add a new AFI and Augment a Module . . . . . 131 92 Appendix C. How to deviate a module . . . . . . . . . . . . . . 133 93 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 133 95 1. Introduction 97 This document describes a YANG [RFC7950] data model for the BGP-4 98 [RFC4271] protocol, including various protocol extensions, policy 99 configuration, as well as defining key operational state data, 100 including Routing Information Base (RIB). The model is intended to 101 be vendor-neutral, in order to allow operators to manage BGP 102 configuration in heterogeneous environments with routers supplied by 103 multiple vendors. The model is also intended to be readily mapped to 104 existing implementations to facilitate support from as large a set of 105 routing hardware and software vendors as possible. This module does 106 not support previous versions of BGP, and cannot support establishing 107 and maintaining state information of neighbors with previous versions 108 of BGP. 110 1.1. Goals and approach 112 The model covers the base BGP features that are deployed across major 113 implementations and the common BGP configurations in use across a 114 number of operator network deployments. In particular, this model 115 attempts to cover BGP features defined in BGP [RFC4271], BGP 116 Communities Attribute [RFC1997], BGP Route Reflection [RFC4456], 117 Multiprotocol Extensions for BGP-4 [RFC4760], Autonomous System 118 Confederations for BGP [RFC5065], BGP Route Flap Damping [RFC2439], 119 Graceful Restart Mechanism for BGP [RFC4724], BGP Prefix Origin 120 Validation [RFC6811], and Advertisement of Multiple Paths in BGP 121 [RFC7911]. 123 Along with configuration of base BGP features, this model also 124 addresses policy configuration, by providing "hooks" for applying 125 policies, and also defining BGP-specific policy features. The BGP 126 policy features are intended to be used with the general routing 127 policy model defined in A YANG Data Model for Routing Policy 128 Management [I-D.ietf-rtgwg-policy-model]. The model conforms to the 129 NMDA [RFC8342] architecture and has support for configuring 130 Bidirectional Forward Detection (BFD) [RFC5880] for fast next hop 131 liveliness check. 133 For the base BGP features, the focus of the model described in this 134 document is on providing configuration and operational state 135 information relating to: 137 o The global BGP instance, and neighbors whose configuration is 138 specified individually, or templated with the use of peer-groups. 140 o The address families that are supported by peers, and the global 141 configuration which relates to them. 143 o The policy configuration "hooks" and BGP-specific policy features 144 that relate to a neighbor - controlling the import and export of 145 NLRIs. 147 o RIB contents. 149 As mentioned earlier, any configuration items that are deemed to be 150 widely available in existing major BGP implementations are included 151 in the model. Additional, more esoteric, configuration items that 152 are not commonly used, or only available from a single 153 implementation, are omitted from the model with an expectation that 154 they will be available in companion modules that augment or extend 155 the current model. This allows clarity in identifying data that is 156 part of the vendor-neutral base model. 158 Where possible, naming in the model follows conventions used in 159 available standards documents, and otherwise tries to be self- 160 explanatory with sufficient descriptions of the intended behavior. 161 Similarly, configuration data value constraints and default values, 162 where used, are based on recommendations in current standards 163 documentation, or those commonly used in multiple implementations. 164 Since implementations can vary widely in this respect, this version 165 of the model specifies only a limited set of defaults and ranges with 166 the expectation of being more prescriptive in future versions based 167 on actual operator use. 169 1.2. Note to RFC Editor 171 This document uses several placeholder values throughout the 172 document. Please replace them as follows and remove this note before 173 publication. 175 RFC XXXX, where XXXX is the number assigned to this document at the 176 time of publication. 178 2020-02-24 with the actual date of the publication of this document. 180 RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for 181 Routing Policy Management [I-D.ietf-rtgwg-policy-model]. 183 RFC AAAA, where AAAA is the number assigned to BGP Monitoring 184 Protocol [RFC7854]. 186 RFC BBBB, where BBBB is the number assigned to YANG Data Model for 187 Bidirectional Forward Detection [I-D.ietf-bfd-yang]. 189 1.3. Terminology 191 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 192 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 193 "OPTIONAL" in this document are to be interpreted as described in BCP 194 14 [RFC2119] [RFC8174] when, and only when, they appear in all 195 capitals, as shown here. 197 1.4. Abbreviations 199 +--------------+-------------------------------------------+ 200 | Abbreviation | | 201 +--------------+-------------------------------------------+ 202 | AFI | Address Family Identifier | 203 | | | 204 | BFD | Bidirectional Forward Detection | 205 | | | 206 | NLRI | Network Layer Reachability Information | 207 | | | 208 | NMDA | Network Management Datastore Architecture | 209 | | | 210 | RIB | Routing Information Base | 211 | | | 212 | SAFI | Subsequent Address Family Identifier | 213 | | | 214 | VRF | Virtual Routing and Forwarding | 215 +--------------+-------------------------------------------+ 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 o base protocol configuration -- configuration affecting BGP 223 protocol-related operations, defined at various levels of 224 hierarchy. 226 o multiprotocol configuration -- configuration affecting individual 227 address-families within BGP Multiprotocol Extensions for BGP-4 228 [RFC4760]. 230 o neighbor configuration -- configuration affecting an individual 231 neighbor within BGP. 233 o neighbor multiprotocol configuration -- configuration affecting 234 individual address-families for a neighbor within BGP. 236 o policy configuration -- hooks for application of the policies 237 defined in A YANG Data Model for Routing Policy Management 238 [I-D.ietf-rtgwg-policy-model] that act on routes sent (received) 239 to (from) peers or other routing protocols and BGP-specific policy 240 features. 242 o operational state -- variables used for monitoring and management 243 of BGP operations. 245 These modules also make use of standard Internet types, such as IP 246 addresses and prefixes, autonomous system numbers, etc., defined in 247 Common YANG Data Types [RFC6991]. 249 2.1. BGP protocol configuration 251 The BGP protocol configuration model is organized hierarchically, 252 much like the majority of router implementations. That is, 253 configuration items can be specified at multiple levels, as shown 254 below. 256 module: ietf-bgp 258 augment /rt:routing/rt:control-plane-protocols/rt:control-plane-proto 259 col: 260 +--rw bgp 261 +--rw global! 262 | +--rw as inet:as-number 263 | +--rw identifier? yang:dotted-quad 264 | +--rw distance 265 | +--rw confederation 266 | +--rw graceful-restart {bt:graceful-restart}? 267 | +--rw use-multiple-paths 268 | +--rw route-selection-options 269 | +--rw afi-safis 270 | +--rw apply-policy 271 | +--ro total-paths? uint32 272 | +--ro total-prefixes? uint32 273 +--rw neighbors 274 | +--rw neighbor* [remote-address] 275 | +---n established 276 | +---n backward-transition 277 | +---x clear {bt:clear-neighbors}? 278 +--rw peer-groups 279 | +--rw peer-group* [peer-group-name] 280 +--rw interfaces 281 | +--rw interface* [name] 282 +--ro rib 283 +--ro attr-sets 284 +--ro communities 285 +--ro ext-communities 286 +--ro afi-safis 288 Users may specify configuration at a higher level and have it apply 289 to all lower-level items, or provide overriding configuration at a 290 lower level of the hierarchy. Overriding configuration items are 291 optional, with neighbor specific configuration being the most 292 specific or lowest level, followed by peer-group, and finally global. 293 Global configuration options reflect a subset of the peer-group or 294 neighbor specific configuration options which are relevant to the 295 entire BGP instance. 297 The model makes the simplifying assumption that most of the 298 configuration items are available at all levels of the hierarchy. 299 That is, very little configuration is specific to a particular level 300 in the hierarchy, other than obvious items such as "group-name" only 301 being available for the peer group-level configuration. A notable 302 exception is for sub-address family configuration where some items 303 are only applicable for a given AFI-SAFI combination. 305 In order to allow common configuration to be applied to a set of 306 neighbors, all neighbor configuration options are available within a 307 peer-group. A neighbor is associated to a particular peer-group 308 through the use of a peer-group leaf (which provides a reference to a 309 configured item in the peer-group list). 311 Address-family configuration is made available in multiple points 312 within the model - primarily within the global container, where 313 instance-wide configuration can be set (for example, global protocol 314 parameters, the BGP best path route selection options, or global 315 policies relating to the address-family); and on a per-neighbor or 316 per-peer-group basis, where address-families can be enabled or 317 disabled, and policy associated with the parent entity applied. 318 Within the afi-safi container, generic configuration that applies to 319 all address-families (e.g., whether the AFI-SAFI is enabled) is 320 presented at the top-level, with address-family specific containers 321 made available for options relating to only that AFI-SAFI. Within 322 the current revision of the model a generic set of address-families, 323 and common configuration and state options are included - further 324 work is expected to add additional parameters to this area of the 325 model. 327 The following address-families are currently supported by the model: 329 +--rw bgp 330 +--rw global! 331 +--rw afi-safis 332 +--rw afi-safi* [afi-safi-name] 333 +--rw afi-safi-name identityref 334 | 335 +--rw ipv4-unicast 336 | ... 337 +--rw ipv6-unicast 338 | ... 339 +--rw ipv4-labeled-unicast 340 | ... 341 +--rw ipv6-labeled-unicast 342 | ... 343 +--rw l3vpn-ipv4-unicast 344 | ... 345 +--rw l3vpn-ipv6-unicast 346 | ... 347 +--rw l3vpn-ipv4-multicast 348 | ... 349 +--rw l3vpn-ipv6-multicast 350 | ... 351 +--rw l2vpn-vpls 352 | ... 353 +--rw l2vpn-evpn 354 | ... 356 2.2. Policy configuration overview 358 The BGP policy configuration model augments the generic YANG routing 359 policy model described in A YANG Data Model for Routing Policy 360 Management [I-D.ietf-rtgwg-policy-model], which represents a 361 condition-action policy framework for routing. This model adds BGP- 362 specific conditions (e.g., matching on the community attribute), and 363 actions (e.g., setting local preference) to the generic policy 364 framework. 366 Policies that are defined in the routing-policy model are referenced 367 in multiple places within the model: 369 o within the global instance, where a policy applies to all address- 370 families for all peers. 372 o on a global AFI-SAFI basis, where policies apply to all peers for 373 a particular address-family. 375 o on a per-peer-group or per-neighbor basis - where the policy 376 applies to all address-families for the particular group or 377 neighbor. 379 o on a per-afi-safi basis within a neighbor or peer-group context, 380 where the policy is specific to the AFI-SAFI for a a specific 381 neighbor or group. 383 module: ietf-bgp-policy 384 augment /rpol:routing-policy/rpol:defined-sets: 385 +--rw bgp-defined-sets 386 ... 387 augment /rpol:routing-policy/rpol:policy-definitions 388 /rpol:policy-definition/rpol:statements/rpol:statement 389 /rpol:conditions: 390 +--rw bgp-conditions 391 ... 392 augment /rpol:routing-policy/rpol:policy-definitions 393 /rpol:policy-definition/rpol:statements/rpol:statement 394 /rpol:actions: 395 +--rw bgp-actions 396 ... 398 2.3. BGP RIB overview 400 The RIB data model represents the BGP RIB contents. The model 401 supports five logical RIBs per address family. 403 A abridged version of the tree shows the RIB portion of the tree 404 diagram. 406 module: ietf-bgp 407 augment /rt:routing/rt:control-plane-protocols 408 /rt:control-plane-protocol: 409 +--rw bgp 410 +--ro rib 411 +--ro afi-safis 412 +--ro afi-safi* [afi-safi-name] 413 +--ro afi-safi-name identityref 414 +--ro ipv4-unicast 415 | +--ro loc-rib 416 | | +--ro routes 417 | | +--ro route* [prefix origin path-id] 418 | | | ... 419 | | +--ro clear-routes {bt:clear-routes}? 420 | | ... 421 | +--ro neighbors 422 | +--ro neighbor* [neighbor-address] 423 | +--ro neighbor-address inet:ip-address 424 | +--ro adj-rib-in-pre 425 | | ... 426 | +--ro adj-rib-in-post 427 | | ... 428 | +--ro adj-rib-out-pre 429 | | ... 430 | +--ro adj-rib-out-post 431 | ... 432 +--ro ipv6-unicast 433 +--ro loc-rib 434 | +--ro routes 435 | +--ro route* [prefix origin path-id] 436 | | ... 437 | +--ro clear-routes {bt:clear-routes}? 438 | ... 439 +--ro neighbors 440 +--ro neighbor* [neighbor-address] 441 +--ro neighbor-address inet:ip-address 442 +--ro adj-rib-in-pre 443 | ... 444 +--ro adj-rib-in-post 445 | ... 446 +--ro adj-rib-out-pre 447 | ... 448 +--ro adj-rib-out-post 449 ... 451 2.3.1. Local Routing 453 The loc-rib is the main BGP routing table for the local routing 454 instance, containing best-path selections for each prefix. The loc- 455 rib table may contain multiple routes for a given prefix, with an 456 attribute to indicate which was selected as the best path. Note that 457 multiple paths may be used or advertised even if only one path is 458 marked as best, e.g., when using BGP add-paths. An implementation 459 may choose to mark multiple paths in the RIB as best path by setting 460 the flag to true for multiple entries. 462 2.3.2. Pre updates per-neighbor 464 The adj-rib-in-pre table is a per-neighbor table containing the NLRI 465 updates received from the neighbor before any local input policy 466 rules or filters have been applied. This can be considered the 'raw' 467 updates from a given neighbor. 469 2.3.3. Post updates per-neighbor 471 The adj-rib-in-post table is a per-neighbor table containing the 472 routes received from the neighbor that are eligible for best-path 473 selection after local input policy rules have been applied. 475 2.3.4. Pre route advertisements per-neighbor 477 The adj-rib-out-pre table is a per-neighbor table containing routes 478 eligible for sending (advertising) to the neighbor before output 479 policy rules have been applied. 481 2.3.5. Post route advertisements per-neighbor 483 The adj-rib-out-post table is a per-neighbor table containing routes 484 eligible for sending (advertising) to the neighbor after output 485 policy rules have been applied 487 3. Relation to other YANG data models 489 The BGP model augments the Routing Management model A YANG Data Model 490 for Routing Management [RFC8349] which defines the notion of routing, 491 routing protocols, and RIBs. The notion of Virtual Routing and 492 Forwarding (VRF) is derived by using the YANG Schema Mount [RFC8528] 493 to mount the Routing Management module under the YANG Data Model for 494 Network Instances [RFC8529]. 496 4. Security Considerations 498 The YANG module specified in this document defines a schema for data 499 that is designed to be accessed via network management protocols such 500 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 501 is the secure transport layer, and the mandatory-to-implement secure 502 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 503 is HTTPS, and the mandatory-to-implement secure transport is TLS 504 [RFC8446]. The NETCONF Access Control Model (NACM) [RFC8341] 505 provides the means to restrict access for particular NETCONF or 506 RESTCONF users to a preconfigured subset of all available NETCONF or 507 RESTCONF protocol operations and content. 509 There are a number of data nodes defined in this YANG module that are 510 writable/creatable/deletable (i.e., config true, which is the 511 default). These data nodes may be considered sensitive or vulnerable 512 in some network environments. Write operations (e.g., edit-config) 513 to these data nodes without proper protection can have a negative 514 effect on network operations. These are the subtrees and data nodes 515 and their sensitivity/vulnerability: 517 Some of the readable data nodes in this YANG module may be considered 518 sensitive or vulnerable in some network environments. It is thus 519 important to control read access (e.g., via get, get-config, or 520 notification) to these data nodes. These are the subtrees and data 521 nodes and their sensitivity/vulnerability: 523 Some of the RPC operations in this YANG module may be considered 524 sensitive or vulnerable in some network environments. It is thus 525 important to control access to these operations. These are the 526 operations and their sensitivity/vulnerability: 528 BGP OPSEC [RFC7454] describes several policies that can be used to 529 secure a BGP. In particular, it recommends securing the underlying 530 TCP session and to use Generalized TTL Security Mechanism (GTSM) 531 [RFC5082] capability to make it harder to spoof a BGP session. This 532 module allows implementations that want to support the capability to 533 configure a TTL value, under a feature flag. It also defines a 534 container 'secure-session' that can be augmented with TCP- 535 Authentication Option (TCP-AO) [RFC5925], or other methods to secure 536 a BGP session, and will be developed in a future version of this 537 draft. 539 5. IANA Considerations 541 This document registers three URIs and three YANG modules. 543 5.1. URI Registration 545 in the IETF XML registry [RFC3688] [RFC3688]. Following the format 546 in RFC 3688, the following registration is requested to be made: 548 URI: urn:ietf:params:xml:ns:yang:ietf-bgp 549 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 550 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-types 552 Registrant Contact: The IESG. XML: N/A, the requested URI is an XML 553 namespace. 555 5.2. YANG Module Name Registration 557 This document registers three YANG module in the YANG Module Names 558 registry YANG [RFC6020]. 560 name: ietf-bgp 561 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp 562 prefix: bgp 563 reference: RFC XXXX 565 name: ietf-bgp-policy 566 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 567 prefix: bp 568 reference: RFC XXXX 570 name: ietf-bgp-types 571 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-types 572 prefix: bt 573 reference: RFC XXXX 575 6. YANG modules 577 The modules comprising the BGP configuration and operational model 578 are described by the YANG modules and submodules in the sections 579 below. 581 The main module, ietf-bgp.yang, includes the following submodules: 583 o ietf-bgp-common - defines the groupings that are common across 584 more than one context (where contexts are neighbor, group, global) 586 o ietf-bgp-common-multiprotocol - defines the groupings that are 587 common across more than one context, and relate to multiprotocol 588 BGP 590 o ietf-bgp-common-structure - defines groupings that are shared by 591 multiple contexts, but are used only to create structural 592 elements, i.e., containers (leaf nodes are defined in separate 593 groupings) 595 o ietf-bgp-global - groupings with data specific to the global 596 context 598 o ietf-bgp-peer-group - groupings with data specific to the peer 599 group context 601 o ietf-bgp-neighbor - groupings with data specific to the neighbor 602 context 604 o ietf-bgp-rib - grouping for representing BGP RIB. 606 Additionally, modules include: 608 o ietf-bgp-types - common type and identity definitions for BGP, 609 including BGP policy 611 o ietf-bgp-policy - BGP-specific policy data definitions for use 612 with [I-D.ietf-rtgwg-policy-model] (described in more detail 613 Section 2.2) 615 7. Structure of the YANG modules 617 The YANG model can be subdivided between the main module for base 618 items, types, policy data, and the RIB module. It references BGP 619 Communities Attribute [RFC1997], , Route Refresh Capability for BGP-4 620 [RFC2918], , NOPEER Community for BGP [RFC3765], BGP/MPLS IP Virtual 621 Private Networks (VPNs) [RFC4364], BGP-MPLS IP Virtual Private 622 Network (VPN) Extension for IPv6 VPN [RFC4659], Graceful Restart 623 Mechanism for BGP [RFC4724], Multiprotocol Extenstions for BGP-4 624 [RFC4760], Virtual Private LAN Service (VPLS) Using BGP for Auto- 625 Discovery and Signaling [RFC4761], Autonomous System Configuration 626 for BGP [RFC5065], The Generalized TTL Security Mechanism (GTSM) 627 [RFC5082], Bidirectional Forward Detection (BFD) [RFC5880], 628 Bidirectional Forward Detection for IPv4 and IPv6 (Single Hop) 629 [RFC5881], Bidirectional Forwarding Detection (BFD) for Multihop 630 Paths [RFC5883], The TCP Authentication Option [RFC5925], BGP 631 Encodings and Procedures for Multicast in MPLS/BGP IP VPNs [RFC6514], 632 BGP Support for Four-Octet Autonomous System (AS) Number Space 633 [RFC6793], Advertisement of Multiple Paths in BGP [RFC7911], YANG Key 634 Chain [RFC8177], and Carrying Label Information in BGP-4 [RFC8277] 635 YANG Model for Transmission Control Protocol (TCP) Configuration 636 [I-D.scharf-tcpm-yang-tcp]. 638 7.1. Main module and submodules for base items 640 file "ietf-bgp@2020-02-24.yang" 641 module ietf-bgp { 642 yang-version 1.1; 643 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp"; 644 prefix bgp; 646 /* 647 * Import and Include 648 */ 650 import ietf-routing { 651 prefix rt; 652 reference 653 "RFC 8349, A YANG Data Model for Routing Management 654 (NMDA Version)"; 655 } 656 import ietf-routing-policy { 657 prefix rpol; 658 reference 659 "RFC ZZZZ, A YANG Data Model for Routing Policy Management"; 660 } 661 import ietf-interfaces { 662 prefix if; 663 reference 664 "RFC 8343, A YANG Data Model for Interface Management."; 665 } 666 import ietf-bgp-types { 667 prefix bt; 668 reference 669 "RFC XXXX, BGP YANG Model for Service Provider Network."; 670 } 671 import ietf-bfd-types { 672 prefix bfd; 673 reference 674 "RFC BBBB, YANG Data Model for Bidirectional Forward Detection."; 675 } 676 import ietf-inet-types { 677 prefix inet; 678 reference 679 "RFC 6991: Common YANG Data Types."; 680 } 681 import ietf-yang-types { 682 prefix yang; 683 reference 684 "RFC 6991: Common YANG Data Types."; 685 } 686 import ietf-key-chain { 687 prefix kc; 688 reference 689 "RFC 8177: YANG Key Chain."; 690 } 691 import ietf-tcp { 692 prefix tcp; 693 reference 694 "I-D.scharf-tcpm-yang-tcp: Transmission Control Protocol (TCP) 695 YANG Model."; 696 } 697 include ietf-bgp-common { 698 revision-date 2020-02-24; 699 } 700 include ietf-bgp-common-multiprotocol { 701 revision-date 2020-02-24; 702 } 703 include ietf-bgp-common-structure { 704 revision-date 2020-02-24; 705 } 706 include ietf-bgp-neighbor { 707 revision-date 2020-02-24; 708 } 709 include ietf-bgp-peer-group { 710 revision-date 2020-02-24; 711 } 712 include ietf-bgp-rib-types { 713 revision-date 2020-02-24; 714 } 715 include ietf-bgp-rib { 716 revision-date 2020-02-24; 717 } 718 include ietf-bgp-rib-ext { 719 revision-date 2020-02-24; 720 } 721 include ietf-bgp-rib-attributes { 722 revision-date 2020-02-24; 723 } 724 include ietf-bgp-rib-table-attributes { 725 revision-date 2020-02-24; 726 } 727 include ietf-bgp-rib-tables { 728 revision-date 2020-02-24; 729 } 731 organization 732 "IETF IDR Working Group"; 733 contact 734 "WG Web: 735 WG List: 737 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 738 Keyur Patel (keyur at arrcus.com), 739 Susan Hares (shares at ndzh.com), 740 Jeffrey Haas (jhaas at pfrc.org)."; 741 description 742 "This module describes a YANG model for BGP protocol 743 configuration. It is a limited subset of all of the configuration 744 parameters available in the variety of vendor implementations, 745 hence it is expected that it would be augmented with vendor- 746 specific configuration data as needed. Additional modules or 747 submodules to handle other aspects of BGP configuration, 748 including policy, VRFs, VPNs, and additional address families 749 are also expected. 751 This model supports the following BGP configuration level 752 hierarchy: 754 BGP 755 | 756 +-> [ global BGP configuration ] 757 +-> AFI / SAFI global 758 +-> peer group 759 +-> [ peer group config ] 760 +-> AFI / SAFI [ per-AFI overrides ] 761 +-> neighbor 762 +-> [ neighbor config ] 763 +-> [ optional pointer to peer-group ] 764 +-> AFI / SAFI [ per-AFI overrides ] 766 Copyright (c) 2019 IETF Trust and the persons identified as 767 authors of the code. All rights reserved. 769 Redistribution and use in source and binary forms, with or 770 without modification, is permitted pursuant to, and subject to 771 the license terms contained in, the Simplified BSD License set 772 forth in Section 4.c of the IETF Trust's Legal Provisions 773 Relating to IETF Documents 774 (https://trustee.ietf.org/license-info). 776 This version of this YANG module is part of RFC XXXX 777 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 778 for full legal notices. 780 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 781 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 782 'MAY', and 'OPTIONAL' in this document are to be interpreted as 783 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 784 they appear in all capitals, as shown here."; 786 revision 2020-02-24 { 787 description 788 "Initial Version"; 789 reference 790 "RFC XXXX, BGP Model for Service Provider Network "; 791 } 793 /* 794 * Identity 795 */ 797 identity bgp { 798 base rt:routing-protocol; 799 description 800 "BGP protocol."; 801 } 803 /* 804 * Containers 805 */ 807 augment "/rt:routing/rt:control-plane-protocols/" 808 + "rt:control-plane-protocol" { 809 when "derived-from-or-self(rt:type, 'bgp')" { 810 description 811 "This augmentation is valid for a routing protocol 812 instance of BGP."; 813 } 814 description 815 "BGP protocol augmentation of ietf-routing module 816 control-plane-protocol."; 817 container bgp { 818 description 819 "Top-level configuration for the BGP router"; 820 container global { 821 presence "Enables global configuration of BGP"; 822 description 823 "Global configuration for the BGP router"; 824 leaf as { 825 type inet:as-number; 826 mandatory true; 827 description 828 "Local autonomous system number of the router. Uses 829 the 32-bit as-number type from the model in RFC 6991."; 831 } 832 leaf identifier { 833 type yang:dotted-quad; 834 description 835 "BGP Identifier of the router - an unsigned 32-bit, 836 non-zero integer that should be unique within an AS. 837 The value of the BGP Identifier for a BGP speaker is 838 determined upon startup and is the same for every local 839 interface and BGP peer."; 840 reference 841 "RFC 6286: AS-Wide Unique BGP ID for BGP-4. Section 2.1"; 842 } 843 container distance { 844 description 845 "Administrative distance (or preference) assigned to 846 routes received from different sources 847 (external, internal, and local)."; 848 leaf external { 849 type uint8 { 850 range "1..255"; 851 } 852 description 853 "Administrative distance for routes learned from 854 external BGP (eBGP)."; 855 } 856 leaf internal { 857 type uint8 { 858 range "1..255"; 859 } 860 description 861 "Administrative distance for routes learned from 862 internal BGP (iBGP)."; 863 } 864 } 865 container confederation { 866 description 867 "Configuration options specifying parameters when the 868 local router is within an autonomous system which is 869 part of a BGP confederation."; 870 leaf enabled { 871 type boolean; 872 description 873 "When this leaf is set to true it indicates that 874 the local-AS is part of a BGP confederation"; 875 } 876 leaf identifier { 877 type inet:as-number; 878 description 879 "Confederation identifier for the autonomous system."; 880 } 881 leaf-list member-as { 882 type inet:as-number; 883 description 884 "Remote autonomous systems that are to be treated 885 as part of the local confederation."; 886 } 887 } 888 container graceful-restart { 889 if-feature "bt:graceful-restart"; 890 description 891 "Parameters relating the graceful restart mechanism for 892 BGP"; 893 uses graceful-restart-config; 894 } 895 uses global-group-use-multiple-paths; 896 uses route-selection-options; 897 container afi-safis { 898 description 899 "List of address-families associated with the BGP 900 instance"; 901 list afi-safi { 902 key "afi-safi-name"; 903 description 904 "AFI,SAFI configuration available for the 905 neighbour or group"; 906 uses mp-afi-safi-config; 907 uses state; 908 container graceful-restart { 909 if-feature "bt:graceful-restart"; 910 description 911 "Parameters relating to BGP graceful-restart"; 912 uses mp-afi-safi-graceful-restart-config; 913 } 914 uses route-selection-options; 915 uses global-group-use-multiple-paths; 916 uses mp-all-afi-safi-list-contents; 917 } 918 } 919 uses rpol:apply-policy-group; 920 uses state; 921 } 923 container neighbors { 924 description 925 "Configuration for BGP neighbors"; 927 list neighbor { 928 key "remote-address"; 930 description 931 "List of BGP neighbors configured on the local system, 932 uniquely identified by remote IPv[46] address"; 934 leaf local-address { 935 type inet:ip-address; 936 config false; 937 description 938 "The local IP address of this entry's BGP connection."; 939 } 941 leaf local-port { 942 type inet:port-number { 943 range "0..65535"; 944 } 945 config false; 946 description 947 "The local port for the TCP connection between 948 the BGP peers."; 949 } 951 leaf peer-type { 952 type bt:peer-type; 953 config false; 954 description 955 "The type of peering session associated with this 956 neighbor."; 957 reference 958 "RFC 4271: A Border Gateway Protocol 4 (BGP-4) 959 Section 1.1 for iBGP and eBGP. 960 RFC 5065: Autonomous System Configuration 961 for Confederation internal and external."; 962 } 964 leaf peer-group { 965 type leafref { 966 path "../../../peer-groups/peer-group/peer-group-name"; 967 } 968 description 969 "The peer-group with which this neighbor is associated"; 970 } 972 leaf identifier { 973 type yang:dotted-quad; 974 config false; 975 description 976 "The BGP Identifier of this entry's BGP peer. 977 This entry MUST be 0.0.0.0 unless the 978 sessionstate is in the openconfirm or the 979 established state."; 980 reference 981 "RFC 4271, Section 4.2, 'BGP Identifier'."; 982 } 984 leaf remote-address { 985 type inet:ip-address; 986 description 987 "The remote IP address of this entry's BGP peer."; 988 } 990 leaf remote-port { 991 type inet:port-number { 992 range "0..65535"; 993 } 994 config false; 995 description 996 "The remote port for the TCP connection 997 between the BGP peers. Note that the 998 objects local-addr, local-port, remote-addr, and 999 reemote-port provide the appropriate 1000 reference to the standard MIB TCP 1001 connection table."; 1002 } 1004 leaf enabled { 1005 type boolean; 1006 default "true"; 1007 description 1008 "Whether the BGP peer is enabled. In cases where the 1009 enabled leaf is set to false, the local system should 1010 not initiate connections to the neighbor, and should 1011 not respond to TCP connections attempts from the 1012 neighbor. If the state of the BGP session is 1013 ESTABLISHED at the time that this leaf is set to false, 1014 the BGP session should be ceased. 1016 A transition from 'false' to 'true' will cause 1017 the BGP Manual Start Event to be generated. 1018 A transition from 'true' to 'false' will cause 1019 the BGP Manual Stop Event to be generated. 1020 This parameter can be used to restart BGP peer 1021 connections. Care should be used in providing 1022 write access to this object without adequate 1023 authentication."; 1024 reference 1025 "RFC 4271, Section 8.1.2."; 1026 } 1028 leaf secure-session-enable { 1029 type boolean; 1030 default "false"; 1031 description 1032 "Does this session need to be secured?"; 1033 } 1035 container secure-session { 1036 when "../secure-session-enable = 'true'"; 1037 description 1038 "Container for describing how a particular BGP session 1039 is to be secured."; 1041 choice option { 1042 case ao { 1043 uses tcp:ao; 1044 leaf ao-keychain { 1045 type kc:key-chain-ref; 1046 description 1047 "Reference to the key chain that will be used by 1048 this model. Applicable for TCP-AO and TCP-MD5 1049 only"; 1050 reference 1051 "RFC 8177: YANG Key Chain."; 1052 } 1053 description 1054 "Uses TCP-AO to secure the session. Parameters for 1055 those are defined as a grouping in the TCP YANG 1056 model."; 1057 reference 1058 "RFC 5925 - The TCP Authentication Option."; 1059 } 1061 case md5 { 1062 uses tcp:md5; 1063 leaf md5-keychain { 1064 type kc:key-chain-ref; 1065 description 1066 "Reference to the key chain that will be used by 1067 this model. Applicable for TCP-AO and TCP-MD5 1068 only"; 1069 reference 1070 "RFC 8177: YANG Key Chain."; 1072 } 1073 description 1074 "Uses TCP-MD5 to secure the session. Parameters for 1075 those are defined as a grouping in the TCP YANG 1076 model."; 1077 reference 1078 "RFC 5925 - The TCP Authentication Option."; 1079 } 1081 case ipsec { 1082 leaf sa { 1083 type string; 1084 description 1085 "Security Association (SA) name."; 1086 } 1087 description 1088 "Currently, the IPsec/IKE YANG model has no 1089 grouping defined that this model can use. When 1090 such a grouping is defined, this model can import 1091 the grouping to add the key parameters 1092 needed to kick of IKE."; 1093 } 1094 description 1095 "Choice of authentication options."; 1096 } 1097 } 1098 leaf ttl-security { 1099 if-feature "bt:ttl-security"; 1100 type uint8; 1101 default "255"; 1102 description 1103 "BGP Time To Live (TTL) security check."; 1104 reference 1105 "RFC 5082: The Genaralized TTL Security Mechanism 1106 (GTSM), 1107 RFC 7454: BGP Operations and Security."; 1108 } 1109 uses neighbor-group-config; 1110 uses route-selection-options; 1111 leaf session-state { 1112 type enumeration { 1113 enum idle { 1114 description 1115 "Neighbor is down, and in the Idle state of the FSM"; 1116 } 1117 enum connect { 1118 description 1119 "Neighbor is down, and the session is waiting for the 1120 underlying transport session to be established"; 1121 } 1122 enum active { 1123 description 1124 "Neighbor is down, and the local system is awaiting a 1125 connection from the remote peer"; 1126 } 1127 enum opensent { 1128 description 1129 "Neighbor is in the process of being established. The 1130 local system has sent an OPEN message"; 1131 } 1132 enum openconfirm { 1133 description 1134 "Neighbor is in the process of being established. 1135 The local system is awaiting a NOTIFICATION or 1136 KEEPALIVE message"; 1137 } 1138 enum established { 1139 description 1140 "Neighbor is up - the BGP session with the peer is 1141 established"; 1142 } 1143 } 1144 // notification does not like a non-config statement. 1145 // config false; 1146 description 1147 "The BGP peer connection state."; 1148 reference 1149 "RFC 4271, Section 8.1.2."; 1150 } 1151 leaf last-established { 1152 type uint64; 1153 config false; 1154 description 1155 "This timestamp indicates the time that the BGP session 1156 last transitioned in or out of the Established state. 1157 The value is the timestamp in seconds relative to the 1158 Unix Epoch (Jan 1, 1970 00:00:00 UTC). 1160 The BGP session uptime can be computed by clients as 1161 the difference between this value and the current time 1162 in UTC (assuming the session is in the ESTABLISHED 1163 state, per the session-state leaf)."; 1164 } 1165 leaf-list supported-capabilities { 1166 type identityref { 1167 base bt:bgp-capability; 1169 } 1170 config false; 1171 description 1172 "BGP capabilities negotiated as supported with the peer"; 1173 } 1174 leaf negotiated-hold-time { 1175 type decimal64 { 1176 fraction-digits 2; 1177 } 1178 config false; 1179 description 1180 "The negotiated hold-time for the BGP session"; 1181 } 1182 leaf last-error { 1183 type binary { 1184 length "2"; 1185 } 1186 // notification does not like non-config statement. 1187 // config false; 1188 description 1189 "The last error code and subcode seen by this 1190 peer on this connection. If no error has 1191 occurred, this field is zero. Otherwise, the 1192 first byte of this two byte OCTET STRING 1193 contains the error code, and the second byte 1194 contains the subcode."; 1195 reference 1196 "RFC 4271, Section 4.5."; 1197 } 1198 leaf fsm-established-time { 1199 type yang:gauge32; 1200 units "seconds"; 1201 config false; 1202 description 1203 "This timer indicates how long (in 1204 seconds) this peer has been in the 1205 established state or how long 1206 since this peer was last in the 1207 established state. It is set to zero when 1208 a new peer is configured or when the router is 1209 booted."; 1210 reference 1211 "RFC 4271, Section 8."; 1212 } 1213 container timers { 1214 description 1215 "Timers related to a BGP neighbor"; 1216 uses neighbor-group-timers-config; 1218 } 1219 container transport { 1220 description 1221 "Transport session parameters for the BGP neighbor"; 1222 uses neighbor-group-transport-config; 1223 } 1224 leaf treat-as-withdraw { 1225 type boolean; 1226 default "false"; 1227 description 1228 "Specify whether erroneous UPDATE messages for which 1229 the NLRI can be extracted are treated as though the 1230 NLRI is withdrawn - avoiding session reset"; 1231 reference 1232 "RFC 7606: Revised Error Handling for BGP UPDATE 1233 Messages."; 1234 } 1235 leaf erroneous-update-messages { 1236 type uint32; 1237 config false; 1238 description 1239 "The number of BGP UPDATE messages for which the 1240 treat-as-withdraw mechanism has been applied based on 1241 erroneous message contents"; 1242 } 1243 container graceful-restart { 1244 if-feature "bt:graceful-restart"; 1245 description 1246 "Parameters relating the graceful restart mechanism for 1247 BGP"; 1248 uses graceful-restart-config; 1249 leaf peer-restart-time { 1250 type uint16 { 1251 range "0..4096"; 1252 } 1253 config false; 1254 description 1255 "The period of time (advertised by the peer) that the 1256 peer expects a restart of a BGP session to take"; 1257 } 1258 leaf peer-restarting { 1259 type boolean; 1260 config false; 1261 description 1262 "This flag indicates whether the remote neighbor is 1263 currently in the process of restarting, and hence 1264 received routes are currently stale"; 1265 } 1266 leaf local-restarting { 1267 type boolean; 1268 config false; 1269 description 1270 "This flag indicates whether the local neighbor is 1271 currently restarting. The flag is unset after all NLRI 1272 have been advertised to the peer, and the End-of-RIB 1273 (EOR) marker has been unset"; 1274 } 1275 leaf mode { 1276 type enumeration { 1277 enum helper-only { 1278 description 1279 "The local router is operating in helper-only 1280 mode, and hence will not retain forwarding state 1281 during a local session restart, but will do so 1282 during a restart of the remote peer"; 1283 } 1284 enum bilateral { 1285 description 1286 "The local router is operating in both helper 1287 mode, and hence retains forwarding state during 1288 a remote restart, and also maintains forwarding 1289 state during local session restart"; 1290 } 1291 enum remote-helper { 1292 description 1293 "The local system is able to retain routes during 1294 restart but the remote system is only able to 1295 act as a helper"; 1296 } 1297 } 1298 config false; 1299 description 1300 "This leaf indicates the mode of operation of BGP 1301 graceful restart with the peer"; 1302 } 1303 } 1304 uses structure-neighbor-group-logging-options; 1305 uses structure-neighbor-group-ebgp-multihop; 1306 uses structure-neighbor-group-route-reflector; 1307 uses structure-neighbor-group-as-path-options; 1308 uses structure-neighbor-group-add-paths; 1309 uses bgp-neighbor-use-multiple-paths; 1310 uses rpol:apply-policy-group; 1311 container afi-safis { 1312 description 1313 "Per-address-family configuration parameters associated 1314 with the neighbor"; 1315 uses bgp-neighbor-afi-safi-list; 1316 } 1317 container statistics { 1318 description 1319 "Statistics per neighbor."; 1321 leaf established-transitions { 1322 type yang:counter64; 1323 config false; 1324 description 1325 "Number of transitions to the Established state for 1326 the neighbor session. This value is analogous to the 1327 bgpPeerFsmEstablishedTransitions object from the 1328 standard BGP-4 MIB"; 1329 reference 1330 "RFC 4273 - Definitions of Managed Objects for BGP-4"; 1331 } 1332 leaf fsm-established-transitions { 1333 type yang:counter32; 1334 config false; 1335 description 1336 "The total number of times the BGP FSM 1337 transitioned into the established state 1338 for this peer."; 1339 reference 1340 "RFC 4271, Section 8."; 1341 } 1342 container messages { 1343 config false; 1344 description 1345 "Counters for BGP messages sent and received from the 1346 neighbor"; 1347 leaf in-total-messages { 1348 type yang:counter32; 1349 config false; 1350 description 1351 "The total number of messages received 1352 from the remote peer on this connection."; 1353 reference 1354 "RFC 4271, Section 4."; 1355 } 1356 leaf out-total-messages { 1357 type yang:counter32; 1358 config false; 1359 description 1360 "The total number of messages transmitted to 1361 the remote peer on this connection."; 1363 reference 1364 "RFC 4271, Section 4."; 1365 } 1366 leaf in-update-elapsed-time { 1367 type yang:gauge32; 1368 units "seconds"; 1369 config false; 1370 description 1371 "Elapsed time (in seconds) since the last BGP 1372 UPDATE message was received from the peer. 1373 Each time in-updates is incremented, 1374 the value of this object is set to zero (0)."; 1375 reference 1376 "RFC 4271, Section 4.3. 1377 RFC 4271, Section 8.2.2, Established state."; 1378 } 1379 container sent { 1380 description 1381 "Counters relating to BGP messages sent to the 1382 neighbor"; 1383 uses bgp-neighbor-counters-message-types-state; 1384 } 1385 container received { 1386 description 1387 "Counters for BGP messages received from the 1388 neighbor"; 1389 uses bgp-neighbor-counters-message-types-state; 1390 } 1391 } 1392 container queues { 1393 config false; 1394 description 1395 "Counters related to queued messages associated with 1396 the BGP neighbor"; 1397 leaf input { 1398 type uint32; 1399 description 1400 "The number of messages received from the peer 1401 currently queued"; 1402 } 1403 leaf output { 1404 type uint32; 1405 description 1406 "The number of messages queued to be sent to the 1407 peer"; 1408 } 1409 } 1410 action clear { 1411 if-feature "bt:clear-statistics"; 1412 description 1413 "Clear statistics action command."; 1415 input { 1416 leaf clear-at { 1417 type yang:date-and-time; 1418 description 1419 "Time when the clear action needs to be 1420 executed."; 1421 } 1422 } 1423 output { 1424 leaf clear-finished-at { 1425 type yang:date-and-time; 1426 description 1427 "Time when the clear action command completed."; 1428 } 1429 } 1430 } 1431 } 1432 } 1433 notification established { 1434 leaf remote-address { 1435 type leafref { 1436 path "../../neighbor/remote-address"; 1437 } 1438 description 1439 "IP address of the neighbor that went into established 1440 state."; 1441 } 1442 leaf last-error { 1443 type leafref { 1444 path "../../neighbor/last-error"; 1445 } 1446 description 1447 "The last error code and subcode seen by this 1448 peer on this connection. If no error has 1449 occurred, this field is zero. Otherwise, the 1450 first byte of this two byte OCTET STRING 1451 contains the error code, and the second byte 1452 contains the subcode."; 1453 reference 1454 "RFC 4271, Section 4.5."; 1455 } 1456 leaf session-state { 1457 type leafref { 1458 path "../../neighbor/session-state"; 1460 } 1461 description 1462 "The BGP peer connection state."; 1463 reference 1464 "RFC 4271, Section 8.2.2."; 1465 } 1466 description 1467 "The established event is generated 1468 when the BGP FSM enters the established state."; 1469 } 1471 notification backward-transition { 1472 leaf remote-addr { 1473 type leafref { 1474 path "../../neighbor/remote-address"; 1475 } 1476 description 1477 "IP address of the neighbor that went away from 1478 established state."; 1479 } 1480 leaf last-error { 1481 type leafref { 1482 path "../../neighbor/last-error"; 1483 } 1484 description 1485 "The last error code and subcode seen by this 1486 peer on this connection. If no error has 1487 occurred, this field is zero. Otherwise, the 1488 first byte of this two byte OCTET STRING 1489 contains the error code, and the second byte 1490 contains the subcode."; 1491 reference 1492 "RFC 4271, Section 4.5."; 1493 } 1494 leaf session-state { 1495 type leafref { 1496 path "../../neighbor/session-state"; 1497 } 1498 description 1499 "The BGP peer connection state."; 1500 reference 1501 "RFC 4271, Section 8.2.2."; 1502 } 1503 description 1504 "The backward-transition event is 1505 generated when the BGP FSM moves from a higher 1506 numbered state to a lower numbered state."; 1507 } 1508 action clear { 1509 if-feature "bt:clear-neighbors"; 1510 description 1511 "Clear neighbors action."; 1513 input { 1514 leaf clear-at { 1515 type yang:date-and-time; 1516 description 1517 "Time when the clear action command needs to be 1518 executed."; 1519 } 1520 } 1521 output { 1522 leaf clear-finished-at { 1523 type yang:date-and-time; 1524 description 1525 "Time when the clear action command completed."; 1526 } 1527 } 1528 } 1529 } 1530 container peer-groups { 1531 description 1532 "Configuration for BGP peer-groups"; 1533 uses bgp-peer-group-list; 1534 } 1535 container interfaces { 1536 list interface { 1537 key "name"; 1538 leaf name { 1539 type if:interface-ref; 1540 description 1541 "Reference to the interface within the routing instance."; 1542 } 1543 container bfd { 1544 if-feature "bt:bfd"; 1545 uses bfd:client-cfg-parms; 1546 description 1547 "BFD client configuration."; 1548 reference 1549 "RFC BBBB - YANG Data Model for Bidirectional Forwarding 1550 Detection."; 1551 } 1552 description 1553 "List of interfaces within the routing instance."; 1554 } 1555 description 1556 "Interface specific parameters."; 1557 } 1558 uses rib; 1559 } 1560 } 1561 } 1562 1564 file "ietf-bgp-common@2020-02-24.yang" 1565 submodule ietf-bgp-common { 1566 yang-version 1.1; 1567 belongs-to ietf-bgp { 1568 prefix bgp; 1569 } 1571 import ietf-bgp-types { 1572 prefix bt; 1573 reference 1574 "RFC XXXX: BGP Model for Service Provider Network."; 1575 } 1576 import ietf-inet-types { 1577 prefix inet; 1578 reference 1579 "RFC 6991: Common YANG Data Types."; 1580 } 1581 import ietf-yang-types { 1582 prefix yang; 1583 reference 1584 "RFC 6991: Common YANG Data Types."; 1585 } 1587 organization 1588 "IETF IDR Working Group"; 1589 contact 1590 "WG Web: 1591 WG List: 1593 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 1594 Keyur Patel (keyur at arrcus.com), 1595 Susan Hares (shares at ndzh.com, 1596 Jeffrey Haas (jhaas at pfrc.org)."; 1597 description 1598 "This sub-module contains common groupings that are common across 1599 multiple contexts within the BGP module. That is to say that 1600 they may be application to a subset of global, peer-group or 1601 neighbor contexts. 1603 Copyright (c) 2019 IETF Trust and the persons identified as 1604 authors of the code. All rights reserved. 1606 Redistribution and use in source and binary forms, with or 1607 without modification, is permitted pursuant to, and subject to 1608 the license terms contained in, the Simplified BSD License set 1609 forth in Section 4.c of the IETF Trust's Legal Provisions 1610 Relating to IETF Documents 1611 (https://trustee.ietf.org/license-info). 1613 This version of this YANG module is part of RFC XXXX 1614 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 1615 for full legal notices. 1617 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 1618 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 1619 'MAY', and 'OPTIONAL' in this document are to be interpreted as 1620 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 1621 they appear in all capitals, as shown here."; 1623 revision 2020-02-24 { 1624 description 1625 "Initial Version"; 1626 reference 1627 "RFC XXXX, BGP Model for Service Provider Network."; 1628 } 1630 grouping neighbor-group-timers-config { 1631 description 1632 "Config parameters related to timers associated with the BGP 1633 peer"; 1634 leaf connect-retry-interval { 1635 type uint16 { 1636 range "1..max"; 1637 } 1638 units "seconds"; 1639 default "120"; 1640 description 1641 "Time interval (in seconds) for the ConnectRetryTimer. The 1642 suggested value for this timer is 120 seconds."; 1643 reference 1644 "RFC 4271, Section 8.2.2. This is the value used 1645 to initialize the 'ConnectRetryTimer'."; 1646 } 1647 leaf hold-time { 1648 type uint16 { 1649 range "0 | 3..65535"; 1650 } 1651 units "seconds"; 1652 default "90"; 1653 description 1654 "Time interval (in seconds) for the HoldTimer established 1655 with the peer. When read as operational data (ro), the 1656 value of this object is calculated by this BGP speaker, 1657 using the smaller of the values in hold-time that was 1658 configured (rw) in the running datastore and the Hold Time 1659 received in the OPEN message. 1661 This value must be at least three seconds 1662 if it is not zero (0). 1664 If the Hold Timer has not been established 1665 with the peer this object MUST have a value 1666 of zero (0). 1668 If the configured value of hold-time object was 1669 a value of (0), then when read this object MUST have a 1670 value of (0) also."; 1671 reference 1672 "RFC 4271, Section 4.2. 1673 RFC 4271, Section 10."; 1674 } 1675 leaf keepalive { 1676 type uint16 { 1677 range "0..21845"; 1678 } 1679 units "seconds"; 1680 default "30"; 1681 description 1682 "When used as a configuration (rw) value, this Time interval 1683 (in seconds) for the KeepAlive timer configured for this BGP 1684 speaker with this peer. The value of this object will only 1685 determine the KEEPALIVE messages' frequency relative to 1686 the value specified in configured value for hold-time. 1688 If the value of this object is zero (0), no periodical 1689 KEEPALIVE messages are sent to the peer after the BGP 1690 connection has been established. The suggested value for 1691 this timer is 30 seconds.; 1693 The actual time interval for the KEEPALIVE messages is 1694 indicated by operational value of keepalive. That value 1695 of this object is calculated by this BGP speaker such that, 1696 when compared with hold-time, it has the same proportion 1697 that keepalive has, compared with hold-time. A 1698 reasonable maximum value for this timer would be one third 1699 of that of hold-time."; 1700 reference 1701 "RFC 4271, Section 4.4. 1702 RFC 4271, Section 10."; 1703 } 1704 leaf min-as-origination-interval { 1705 type uint16 { 1706 range "0..max"; 1707 } 1708 units "seconds"; 1709 default "15"; 1710 description 1711 "Time interval (in seconds) for the MinASOriginationInterval 1712 timer. The suggested value for this timer is 15 seconds."; 1713 reference 1714 "RFC 4271, Section 9.2.1.2. 1715 RFC 4271, Section 10."; 1716 } 1717 leaf min-route-advertisement-interval { 1718 type uint16 { 1719 range "0..max"; 1720 } 1721 units "seconds"; 1722 description 1723 "Time interval (in seconds) for the 1724 MinRouteAdvertisementInterval timer. 1725 The suggested value for this timer is 30 1726 seconds for EBGP connections and 5 1727 seconds for IBGP connections."; 1728 reference 1729 "RFC 4271, Section 9.2.1.1. 1730 RFC 4271, Section 10."; 1731 } 1732 } 1734 grouping neighbor-group-config { 1735 description 1736 "Neighbor level configuration items."; 1737 leaf remote-as { 1738 type inet:as-number; 1739 description 1740 "The remote autonomous system number received in 1741 the BGP OPEN message."; 1742 reference 1743 "RFC 4271, Section 4.2."; 1744 } 1745 leaf peer-as { 1746 type inet:as-number; 1747 description 1748 "AS number of the peer."; 1749 } 1750 leaf local-as { 1751 type inet:as-number; 1752 description 1753 "The local autonomous system number that is to be used when 1754 establishing sessions with the remote peer or peer group, if 1755 this differs from the global BGP router autonomous system 1756 number."; 1757 } 1759 leaf remove-private-as { 1760 // could also make this a container with a flag to enable 1761 // remove-private and separate option. here, option implies 1762 // remove-private is enabled. 1763 type bt:remove-private-as-option; 1764 description 1765 "Remove private AS numbers from updates sent to peers - when 1766 this leaf is not specified, the AS_PATH attribute should be 1767 sent to the peer unchanged"; 1768 } 1769 container route-flap-damping { 1770 if-feature "bt:damping"; 1771 leaf enable { 1772 type boolean; 1773 default "false"; 1774 description 1775 "Enable route flap damping."; 1776 } 1777 leaf suppress-above { 1778 type decimal64 { 1779 fraction-digits 1; 1780 } 1781 default "3.0"; 1782 description 1783 "This is the value of the instability metric at which 1784 route suppression takes place. A route is not installed 1785 in the forwarding information base (FIB), or announced 1786 even if it is reachable during the period that it is 1787 suppressed."; 1788 } 1789 leaf reuse-above { 1790 type decimal64 { 1791 fraction-digits 1; 1792 } 1793 default "2.0"; 1794 description 1795 "This is the value of the instability metric at which a 1796 suppressed route becomes unsuppressed if it is reachable 1797 but currently suppressed. The value assigned to 1798 reuse-below must be less than suppress-above."; 1799 } 1800 leaf max-flap { 1801 type decimal64 { 1802 fraction-digits 1; 1803 } 1804 default "16.0"; 1805 description 1806 "This is the upper limit of the instability metric. This 1807 value must be greater than the larger of 1 and 1808 suppress-above."; 1809 } 1810 leaf reach-decay { 1811 type yang:gauge32; 1812 units "seconds"; 1813 default "300"; 1814 description 1815 "This value specifies the time desired for the instability 1816 metric value to reach one-half of its current value when 1817 the route is reachable. This half-life value determines 1818 the rate at which the metric value is decayed. A smaller 1819 half-life value makes a suppressed route reusable sooner 1820 than a larger value."; 1821 } 1822 leaf unreach-decay { 1823 type yang:gauge32; 1824 units "seconds"; 1825 default "900"; 1826 description 1827 "This value acts the same as reach-decay except that it 1828 specifies the rate at which the instability metric is 1829 decayed when a route is unreachable. It should have a 1830 value greater than or equal to reach-decay."; 1831 } 1832 leaf keep-history { 1833 type yang:gauge32; 1834 units "seconds"; 1835 default "1800"; 1836 description 1837 "This value specifies the period over which the route 1838 flapping history is to be maintained for a given route. 1839 The size of the configuration arrays described below is 1840 directly affected by this value."; 1841 } 1842 description 1843 "Routes learned via BGP are subject to weighted route 1844 dampening."; 1845 } 1846 leaf send-community { 1847 if-feature "bt:send-communities"; 1848 type bt:community-type; 1849 description 1850 "When supported, this tells the router to propogate any 1851 prefixes that are attached to this community. The value 1852 of 0 implies 'none'."; 1853 } 1854 leaf description { 1855 type string; 1856 description 1857 "An optional textual description (intended primarily for use 1858 with a peer or group"; 1859 } 1860 } 1862 grouping neighbor-group-transport-config { 1863 description 1864 "Configuration parameters relating to the transport protocol 1865 used by the BGP session to the peer"; 1866 leaf tcp-mss { 1867 type uint16; 1868 description 1869 "Sets the max segment size for BGP TCP sessions."; 1870 } 1871 leaf mtu-discovery { 1872 type boolean; 1873 default "false"; 1874 description 1875 "Turns path mtu discovery for BGP TCP sessions on (true) or 1876 off (false)"; 1877 } 1878 leaf passive-mode { 1879 type boolean; 1880 default "false"; 1881 description 1882 "Wait for peers to issue requests to open a BGP session, 1883 rather than initiating sessions from the local router."; 1884 } 1885 leaf local-address { 1886 type union { 1887 type inet:ip-address; 1888 type leafref { 1889 path "../../../../interfaces/interface/name"; 1890 } 1892 } 1893 description 1894 "Set the local IP (either IPv4 or IPv6) address to use for 1895 the session when sending BGP update messages. This may be 1896 expressed as either an IP address or reference to the name 1897 of an interface."; 1898 } 1899 // TODO: Better form of authentication of the BGP session should 1900 // be added here. It can be in the form of TCP-AO [RFC 5925], 1901 // IPsec, or any other protocol deemed desirable. 1902 leaf auth-password { 1903 type string; 1904 description 1905 "Configures an MD5 authentication password for use with 1906 neighboring devices."; 1907 } 1908 } 1910 grouping graceful-restart-config { 1911 description 1912 "Configuration parameters relating to BGP graceful restart."; 1913 leaf enabled { 1914 type boolean; 1915 description 1916 "Enable or disable the graceful-restart capability."; 1917 } 1918 leaf restart-time { 1919 type uint16 { 1920 range "0..4096"; 1921 } 1922 description 1923 "Estimated time (in seconds) for the local BGP speaker to 1924 restart a session. This value is advertise in the graceful 1925 restart BGP capability. This is a 12-bit value, referred to 1926 as Restart Time in RFC4724. Per RFC4724, the suggested 1927 default value is <= the hold-time value."; 1928 reference 1929 "RFC 4724: Graceful Restart Mechanism for BGP."; 1930 } 1931 leaf stale-routes-time { 1932 type uint32; 1933 description 1934 "An upper-bound on the time that stale routes will be 1935 retained by a router after a session is restarted. If an 1936 End-of-RIB (EOR) marker is received prior to this timer 1937 expiring stale-routes will be flushed upon its receipt - if 1938 no EOR is received, then when this timer expires stale paths 1939 will be purged. This timer is referred to as the 1940 Selection_Deferral_Timer in RFC4724"; 1941 reference 1942 "RFC 4724: Graceful Restart Mechanism for BGP."; 1943 } 1944 leaf helper-only { 1945 type boolean; 1946 default "true"; 1947 description 1948 "Enable graceful-restart in helper mode only. When this leaf 1949 is set, the local system does not retain forwarding its own 1950 state during a restart, but supports procedures for the 1951 receiving speaker, as defined in RFC4724."; 1952 reference 1953 "RFC 4724: Graceful Restart Mechanism for BGP."; 1954 } 1955 } 1957 grouping global-group-use-multiple-paths { 1958 description 1959 "Common grouping used for both global and groups which provides 1960 configuration and state parameters relating to use of multiple 1961 paths"; 1962 container use-multiple-paths { 1963 description 1964 "Parameters related to the use of multiple paths for the 1965 same NLRI"; 1966 leaf enabled { 1967 type boolean; 1968 default "false"; 1969 description 1970 "Whether the use of multiple paths for the same NLRI is 1971 enabled for the neighbor. This value is overridden by any 1972 more specific configuration value."; 1973 } 1974 container ebgp { 1975 description 1976 "Multi-Path parameters for eBGP"; 1977 leaf allow-multiple-as { 1978 type boolean; 1979 default "false"; 1980 description 1981 "Allow multi-path to use paths from different neighboring 1982 ASes. The default is to only consider multiple paths 1983 from the same neighboring AS."; 1984 } 1985 leaf maximum-paths { 1986 type uint32; 1987 default "1"; 1988 description 1989 "Maximum number of parallel paths to consider when using 1990 BGP multi-path. The default is use a single path."; 1991 } 1992 } 1993 container ibgp { 1994 description 1995 "Multi-Path parameters for iBGP"; 1996 leaf maximum-paths { 1997 type uint32; 1998 default "1"; 1999 description 2000 "Maximum number of parallel paths to consider when using 2001 iBGP multi-path. The default is to use a single path"; 2002 } 2003 } 2004 } 2005 } 2007 grouping route-selection-options { 2008 description 2009 "Configuration and state relating to route selection options"; 2010 container route-selection-options { 2011 description 2012 "Parameters relating to options for route selection"; 2013 leaf always-compare-med { 2014 type boolean; 2015 default "false"; 2016 description 2017 "Compare multi-exit discriminator (MED) value from 2018 different ASes when selecting the best route. The default 2019 behavior is to only compare MEDs for paths received from 2020 the same AS."; 2021 } 2022 leaf ignore-as-path-length { 2023 type boolean; 2024 default "false"; 2025 description 2026 "Ignore the AS path length when selecting the best path. 2027 The default is to use the AS path length and prefer paths 2028 with shorter length."; 2029 } 2030 leaf external-compare-router-id { 2031 type boolean; 2032 default "true"; 2033 description 2034 "When comparing similar routes received from external BGP 2035 peers, use the router-id as a criterion to select the 2036 active path."; 2037 } 2038 leaf advertise-inactive-routes { 2039 type boolean; 2040 default "false"; 2041 description 2042 "Advertise inactive routes to external peers. The default 2043 is to only advertise active routes."; 2044 reference 2045 "I-D.ietf-idr-best-external: Advertisement of the best 2046 external route in BGP."; 2047 } 2048 leaf enable-aigp { 2049 type boolean; 2050 default "false"; 2051 description 2052 "Flag to enable sending / receiving accumulated IGP 2053 attribute in routing updates"; 2054 reference 2055 "RFC 7311: AIGP Metric Attribute for BGP."; 2056 } 2057 leaf ignore-next-hop-igp-metric { 2058 type boolean; 2059 default "false"; 2060 description 2061 "Ignore the IGP metric to the next-hop when calculating BGP 2062 best-path. The default is to select the route for which 2063 the metric to the next-hop is lowest"; 2064 } 2065 leaf enable-med { 2066 type boolean; 2067 default "false"; 2068 description 2069 "Flag to enable sending/receiving of MED metric attribute 2070 in routing updates."; 2071 } 2072 } 2073 } 2075 grouping state { 2076 description 2077 "Grouping containing common counters relating to prefixes and 2078 paths"; 2079 leaf total-paths { 2080 type uint32; 2081 config false; 2082 description 2083 "Total number of BGP paths within the context"; 2085 } 2086 leaf total-prefixes { 2087 type uint32; 2088 config false; 2089 description 2090 "Total number of BGP prefixes received within the context"; 2091 } 2092 } 2093 } 2094 2096 file "ietf-bgp-common-multiprotocol@2020-02-24.yang" 2097 submodule ietf-bgp-common-multiprotocol { 2098 yang-version 1.1; 2099 belongs-to ietf-bgp { 2100 prefix bgp; 2101 } 2103 import ietf-bgp-types { 2104 prefix bt; 2105 } 2106 import ietf-routing-policy { 2107 prefix rpol; 2108 } 2109 include ietf-bgp-common; 2111 // meta 2113 organization 2114 "IETF IDR Working Group"; 2115 contact 2116 "WG Web: 2117 WG List: 2119 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2120 Keyur Patel (keyur at arrcus.com), 2121 Susan Hares (shares at ndzh.com)"; 2122 description 2123 "This sub-module contains groupings that are related to support 2124 for multiple protocols in BGP. The groupings are common across 2125 multiple contexts. 2127 Copyright (c) 2019 IETF Trust and the persons identified as 2128 authors of the code. All rights reserved. 2130 Redistribution and use in source and binary forms, with or 2131 without modification, is permitted pursuant to, and subject to 2132 the license terms contained in, the Simplified BSD License set 2133 forth in Section 4.c of the IETF Trust's Legal Provisions 2134 Relating to IETF Documents 2135 (https://trustee.ietf.org/license-info). 2137 This version of this YANG module is part of RFC XXXX 2138 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2139 for full legal notices. 2141 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2142 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2143 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2144 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2145 they appear in all capitals, as shown here."; 2147 revision 2020-02-24 { 2148 description 2149 "Initial Version"; 2150 reference 2151 "RFC XXX, BGP Model for Service Provider Network."; 2152 } 2154 grouping mp-afi-safi-graceful-restart-config { 2155 description 2156 "BGP graceful restart parameters that apply on a per-AFI-SAFI 2157 basis"; 2158 leaf enabled { 2159 type boolean; 2160 default "false"; 2161 description 2162 "This leaf indicates whether graceful-restart is enabled for 2163 this AFI-SAFI"; 2164 } 2165 } 2167 grouping mp-afi-safi-config { 2168 description 2169 "Configuration parameters used for all BGP AFI-SAFIs"; 2170 leaf afi-safi-name { 2171 type identityref { 2172 base bt:afi-safi-type; 2173 } 2174 description 2175 "AFI,SAFI"; 2176 } 2177 leaf enabled { 2178 type boolean; 2179 default "false"; 2180 description 2181 "This leaf indicates whether the IPv4 Unicast AFI,SAFI is 2182 enabled for the neighbour or group"; 2183 } 2184 } 2186 grouping mp-all-afi-safi-list-contents { 2187 description 2188 "A common grouping used for contents of the list that is used 2189 for AFI-SAFI entries"; 2190 // import and export policy included for the afi/safi 2191 uses rpol:apply-policy-group; 2192 container ipv4-unicast { 2193 when "../afi-safi-name = 'bt:ipv4-unicast'" { 2194 description 2195 "Include this container for IPv4 Unicast specific 2196 configuration"; 2197 } 2198 description 2199 "IPv4 unicast configuration options"; 2200 // include common IPv[46] unicast options 2201 uses mp-ipv4-ipv6-unicast-common; 2202 // placeholder for IPv4 unicast specific configuration 2203 } 2204 container ipv6-unicast { 2205 when "../afi-safi-name = 'bt:ipv6-unicast'" { 2206 description 2207 "Include this container for IPv6 Unicast specific 2208 configuration"; 2209 } 2210 description 2211 "IPv6 unicast configuration options"; 2212 // include common IPv[46] unicast options 2213 uses mp-ipv4-ipv6-unicast-common; 2214 // placeholder for IPv6 unicast specific configuration 2215 // options 2216 } 2217 container ipv4-labeled-unicast { 2218 when "../afi-safi-name = 'bt:ipv4-labeled-unicast'" { 2219 description 2220 "Include this container for IPv4 Labeled Unicast specific 2221 configuration"; 2222 } 2223 description 2224 "IPv4 Labeled Unicast configuration options"; 2225 uses mp-all-afi-safi-common; 2226 // placeholder for IPv4 Labeled Unicast specific config 2227 // options 2229 } 2230 container ipv6-labeled-unicast { 2231 when "../afi-safi-name = 'bt:ipv6-labeled-unicast'" { 2232 description 2233 "Include this container for IPv6 Labeled Unicast specific 2234 configuration"; 2235 } 2236 description 2237 "IPv6 Labeled Unicast configuration options"; 2238 uses mp-all-afi-safi-common; 2239 // placeholder for IPv6 Labeled Unicast specific config 2240 // options. 2241 } 2242 container l3vpn-ipv4-unicast { 2243 when "../afi-safi-name = 'bt:l3vpn-ipv4-unicast'" { 2244 description 2245 "Include this container for IPv4 Unicast L3VPN specific 2246 configuration"; 2247 } 2248 description 2249 "Unicast IPv4 L3VPN configuration options"; 2250 // include common L3VPN configuration options 2251 uses mp-l3vpn-ipv4-ipv6-unicast-common; 2252 // placeholder for IPv4 Unicast L3VPN specific config options. 2253 } 2254 container l3vpn-ipv6-unicast { 2255 when "../afi-safi-name = 'bt:l3vpn-ipv6-unicast'" { 2256 description 2257 "Include this container for unicast IPv6 L3VPN specific 2258 configuration"; 2259 } 2260 description 2261 "Unicast IPv6 L3VPN configuration options"; 2262 // include common L3VPN configuration options 2263 uses mp-l3vpn-ipv4-ipv6-unicast-common; 2264 // placeholder for IPv6 Unicast L3VPN specific configuration 2265 // options 2266 } 2267 container l3vpn-ipv4-multicast { 2268 when "../afi-safi-name = 'bt:l3vpn-ipv4-multicast'" { 2269 description 2270 "Include this container for multicast IPv6 L3VPN specific 2271 configuration"; 2272 } 2273 description 2274 "Multicast IPv4 L3VPN configuration options"; 2275 // include common L3VPN multicast options 2276 uses mp-l3vpn-ipv4-ipv6-multicast-common; 2277 // placeholder for IPv4 Multicast L3VPN specific configuration 2278 // options 2279 } 2280 container l3vpn-ipv6-multicast { 2281 when "../afi-safi-name = 'bt:l3vpn-ipv6-multicast'" { 2282 description 2283 "Include this container for multicast IPv6 L3VPN specific 2284 configuration"; 2285 } 2286 description 2287 "Multicast IPv6 L3VPN configuration options"; 2288 // include common L3VPN multicast options 2289 uses mp-l3vpn-ipv4-ipv6-multicast-common; 2290 // placeholder for IPv6 Multicast L3VPN specific configuration 2291 // options 2292 } 2293 container l2vpn-vpls { 2294 when "../afi-safi-name = 'bt:l2vpn-vpls'" { 2295 description 2296 "Include this container for BGP-signalled VPLS specific 2297 configuration"; 2298 } 2299 description 2300 "BGP-signalled VPLS configuration options"; 2301 // include common L2VPN options 2302 uses mp-l2vpn-common; 2303 // placeholder for BGP-signalled VPLS specific configuration 2304 // options 2305 } 2306 container l2vpn-evpn { 2307 when "../afi-safi-name = 'bt:l2vpn-evpn'" { 2308 description 2309 "Include this container for BGP EVPN specific 2310 configuration"; 2311 } 2312 description 2313 "BGP EVPN configuration options"; 2314 // include common L2VPN options 2315 uses mp-l2vpn-common; 2316 // placeholder for BGP EVPN specific configuration options 2317 } 2318 } 2320 // Common groupings across multiple AFI,SAFIs 2322 grouping mp-all-afi-safi-common { 2323 description 2324 "Grouping for configuration common to all AFI,SAFI"; 2326 container prefix-limit { 2327 description 2328 "Parameters relating to the prefix limit for the AFI-SAFI"; 2329 leaf max-prefixes { 2330 type uint32; 2331 description 2332 "Maximum number of prefixes that will be accepted from the 2333 neighbour"; 2334 } 2335 leaf shutdown-threshold-pct { 2336 type bt:percentage; 2337 description 2338 "Threshold on number of prefixes that can be received from 2339 a neighbour before generation of warning messages or log 2340 entries. Expressed as a percentage of max-prefixes"; 2341 } 2342 leaf restart-timer { 2343 type uint32; 2344 units "seconds"; 2345 description 2346 "Time interval in seconds after which the BGP session is 2347 re-established after being torn down due to exceeding the 2348 max-prefix limit."; 2349 } 2350 } 2351 } 2353 grouping mp-ipv4-ipv6-unicast-common { 2354 description 2355 "Common configuration that is applicable for IPv4 and IPv6 2356 unicast"; 2357 // include common afi-safi options. 2358 uses mp-all-afi-safi-common; 2359 // configuration options that are specific to IPv[46] unicast 2360 leaf send-default-route { 2361 type boolean; 2362 default "false"; 2363 description 2364 "If set to true, send the default-route to the neighbour(s)"; 2365 } 2366 } 2368 grouping mp-l3vpn-ipv4-ipv6-unicast-common { 2369 description 2370 "Common configuration applied across L3VPN for IPv4 2371 and IPv6"; 2372 // placeholder -- specific configuration options that are generic 2373 // across IPv[46] unicast address families. 2375 uses mp-all-afi-safi-common; 2376 } 2378 grouping mp-l3vpn-ipv4-ipv6-multicast-common { 2379 description 2380 "Common configuration applied across L3VPN for IPv4 2381 and IPv6"; 2382 // placeholder -- specific configuration options that are 2383 // generic across IPv[46] multicast address families. 2384 uses mp-all-afi-safi-common; 2385 } 2387 grouping mp-l2vpn-common { 2388 description 2389 "Common configuration applied across L2VPN address 2390 families"; 2391 // placeholder -- specific configuration options that are 2392 // generic across L2VPN address families 2393 uses mp-all-afi-safi-common; 2394 } 2396 // Config groupings for common groups 2398 grouping mp-all-afi-safi-common-prefix-limit-config { 2399 description 2400 "Configuration parameters relating to prefix-limits for an 2401 AFI-SAFI"; 2402 } 2403 } 2404 2406 file "ietf-bgp-common-structure@2020-02-24.yang" 2407 submodule ietf-bgp-common-structure { 2408 yang-version 1.1; 2409 belongs-to ietf-bgp { 2410 prefix bgp; 2411 } 2413 import ietf-routing-policy { 2414 prefix rpol; 2415 reference 2416 "RFC ZZZZ, A YANG Data Model for Routing Policy Management"; 2417 } 2418 import ietf-bgp-types { 2419 prefix bt; 2420 reference 2421 "RFC XXXX, BGP YANG Model for Service Provider Network."; 2423 } 2424 include ietf-bgp-common-multiprotocol; 2425 include ietf-bgp-common; 2427 // meta 2429 organization 2430 "IETF IDR Working Group"; 2431 contact 2432 "WG Web: 2433 WG List: 2435 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2436 Keyur Patel (keyur at arrcus.com), 2437 Susan Hares (shares at ndzh.com), 2438 Jeffrey Haas (jhaas at pfrc.org)."; 2439 description 2440 "This sub-module contains groupings that are common across 2441 multiple BGP contexts and provide structure around other 2442 primitive groupings. 2444 Copyright (c) 2019 IETF Trust and the persons identified as 2445 authors of the code. All rights reserved. 2447 Redistribution and use in source and binary forms, with or 2448 without modification, is permitted pursuant to, and subject to 2449 the license terms contained in, the Simplified BSD License set 2450 forth in Section 4.c of the IETF Trust's Legal Provisions 2451 Relating to IETF Documents 2452 (https://trustee.ietf.org/license-info). 2454 This version of this YANG module is part of RFC XXXX 2455 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2456 for full legal notices. 2458 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2459 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2460 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2461 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2462 they appear in all capitals, as shown here."; 2464 revision 2020-02-24 { 2465 description 2466 "Initial Version"; 2467 reference 2468 "RFC XXX, BGP Model for Service Provider Network."; 2469 } 2470 grouping structure-neighbor-group-logging-options { 2471 description 2472 "Structural grouping used to include error handling 2473 configuration and state for both BGP neighbors and groups"; 2474 container logging-options { 2475 description 2476 "Logging options for events related to the BGP neighbor or 2477 group"; 2478 leaf log-neighbor-state-changes { 2479 type boolean; 2480 default "true"; 2481 description 2482 "Configure logging of peer state changes. Default is to 2483 enable logging of peer state changes. 2485 Note: Documenting out of ESTABLISHED state is desirable, 2486 but documenting all backward transitions is 2487 problematic, and should be avoided."; 2488 } 2489 } 2490 } 2492 grouping structure-neighbor-group-ebgp-multihop { 2493 description 2494 "Structural grouping used to include eBGP multi-hop 2495 configuration and state for both BGP neighbors and peer 2496 groups"; 2497 container ebgp-multihop { 2498 description 2499 "eBGP multi-hop parameters for the BGPgroup"; 2500 leaf enabled { 2501 type boolean; 2502 default "false"; 2503 description 2504 "When enabled the referenced group or neighbors are 2505 permitted to be indirectly connected - including cases 2506 where the TTL can be decremented between the BGP peers"; 2507 } 2508 leaf multihop-ttl { 2509 type uint8; 2510 description 2511 "Time-to-live value to use when packets are sent to the 2512 referenced group or neighbors and ebgp-multihop is 2513 enabled"; 2514 } 2515 } 2516 } 2517 grouping structure-neighbor-group-route-reflector { 2518 description 2519 "Structural grouping used to include route reflector 2520 configuration and state for both BGP neighbors and peer 2521 groups"; 2522 container route-reflector { 2523 description 2524 "Route reflector parameters for the BGPgroup"; 2525 reference 2526 "RFC 4456: BGP Route Reflection."; 2527 leaf route-reflector-cluster-id { 2528 when "../route-reflector-client = 'false'"; 2529 type bt:rr-cluster-id-type; 2530 description 2531 "Route Reflector cluster id to use when local router is 2532 configured as a route reflector. Commonly set at the 2533 group level, but allows a different cluster id to be set 2534 for each neighbor."; 2535 reference 2536 "RFC 4456: BGP Route Reflection: An Alternative to 2537 Full Mesh."; 2538 } 2539 leaf no-client-reflect { 2540 type boolean; 2541 default "false"; 2542 description 2543 "When set to 'true', this disables route redistribution 2544 by the Route Reflector. It is set 'true' when the client is 2545 fully meshed to prevent sending of redundant route 2546 advertisements."; 2547 reference 2548 "TODO: Add reference when IETF writes a draft describing 2549 this."; 2550 } 2551 leaf route-reflector-client { 2552 type boolean; 2553 default "false"; 2554 description 2555 "Configure the neighbor as a route reflector client."; 2556 reference 2557 "RFC 4456: BGP Route Reflection: An Alternative to 2558 Full Mesh."; 2559 } 2560 } 2561 } 2563 grouping structure-neighbor-group-as-path-options { 2564 description 2565 "Structural grouping used to include AS_PATH manipulation 2566 configuration and state for both BGP neighbors and peer 2567 groups"; 2568 container as-path-options { 2569 description 2570 "AS_PATH manipulation parameters for the BGP neighbor or 2571 group"; 2572 leaf allow-own-as { 2573 type uint8; 2574 default "0"; 2575 description 2576 "Specify the number of occurrences of the local BGP 2577 speaker's AS that can occur within the AS_PATH before it 2578 is rejected."; 2579 } 2580 leaf replace-peer-as { 2581 type boolean; 2582 default "false"; 2583 description 2584 "Replace occurrences of the peer's AS in the AS_PATH with 2585 the local autonomous system number"; 2586 } 2587 } 2588 } 2590 grouping structure-neighbor-group-add-paths { 2591 description 2592 "Structural grouping used to include ADD-PATHs configuration 2593 and state for both BGP neighbors and peer groups"; 2594 container add-paths { 2595 if-feature "bt:add-paths"; 2596 description 2597 "Parameters relating to the advertisement and receipt of 2598 multiple paths for a single NLRI (add-paths)"; 2599 reference 2600 "RFC 7911: Advertisements of Multiple Paths in BGP."; 2601 leaf receive { 2602 type boolean; 2603 default "false"; 2604 description 2605 "Enable ability to receive multiple path advertisements for 2606 an NLRI from the neighbor or group"; 2607 } 2608 choice send { 2609 default "all"; 2610 description 2611 "Choice of sending the max. number of paths or to send all."; 2612 case max { 2613 leaf max { 2614 type uint8; 2615 description 2616 "The maximum number of paths to advertise to neighbors 2617 for a single NLRI"; 2618 } 2619 } 2620 case all { 2621 leaf all { 2622 type empty; 2623 description 2624 "Send all the path advertisements to neighbors for a 2625 single NLRI."; 2626 } 2627 } 2628 } 2629 leaf eligible-prefix-policy { 2630 type leafref { 2631 path "/rpol:routing-policy/rpol:policy-definitions/" 2632 + "rpol:policy-definition/rpol:name"; 2633 } 2634 description 2635 "A reference to a routing policy which can be used to 2636 restrict the prefixes for which add-paths is enabled"; 2637 } 2638 } 2639 } 2640 } 2641 2643 file "ietf-bgp-peer-group@2020-02-24.yang" 2644 submodule ietf-bgp-peer-group { 2645 yang-version 1.1; 2646 belongs-to ietf-bgp { 2647 prefix bgp; 2648 } 2650 import ietf-routing-policy { 2651 prefix rpol; 2652 } 2653 import ietf-bgp-types { 2654 prefix bt; 2655 reference 2656 "RFC XXXX, BGP Model for Service Provider Network."; 2657 } 2659 // Include the common submodule 2660 include ietf-bgp-common; 2661 include ietf-bgp-common-multiprotocol; 2662 include ietf-bgp-common-structure; 2664 // meta 2666 organization 2667 "IETF IDR Working Group"; 2668 contact 2669 "WG Web: 2670 WG List: 2672 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2673 Keyur Patel (keyur at arrcus.com), 2674 Susan Hares (shares at ndzh.com), 2675 Jeffrey Haas (jhaas at pfrc.org)."; 2676 description 2677 "This sub-module contains groupings that are specific to the 2678 peer-group context of the BGP module. 2680 Copyright (c) 2019 IETF Trust and the persons identified as 2681 authors of the code. All rights reserved. 2683 Redistribution and use in source and binary forms, with or 2684 without modification, is permitted pursuant to, and subject to 2685 the license terms contained in, the Simplified BSD License set 2686 forth in Section 4.c of the IETF Trust's Legal Provisions 2687 Relating to IETF Documents 2688 (https://trustee.ietf.org/license-info). 2690 This version of this YANG module is part of RFC XXXX 2691 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2692 for full legal notices. 2694 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2695 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2696 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2697 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2698 they appear in all capitals, as shown here."; 2700 revision 2020-02-24 { 2701 description 2702 "Initial Version"; 2703 reference 2704 "RFC XXX, BGP Model for Service Provider Network."; 2705 } 2707 grouping bgp-peer-group-afi-safi-list { 2708 description 2709 "List of address-families associated with the BGP peer-group"; 2710 list afi-safi { 2711 key "afi-safi-name"; 2712 description 2713 "AFI, SAFI configuration available for the 2714 neighbour or group"; 2715 uses mp-afi-safi-config; 2716 container graceful-restart { 2717 if-feature "bt:graceful-restart"; 2718 description 2719 "Parameters relating to BGP graceful-restart"; 2720 uses mp-afi-safi-graceful-restart-config; 2721 } 2722 uses route-selection-options; 2723 uses global-group-use-multiple-paths; 2724 uses mp-all-afi-safi-list-contents; 2725 } 2726 } 2728 grouping bgp-peer-group-base { 2729 description 2730 "Parameters related to a BGP group."; 2731 leaf peer-group-name { 2732 type string; 2733 description 2734 "Name of the BGP peer-group"; 2735 } 2736 uses neighbor-group-config; 2737 container timers { 2738 description 2739 "Timers related to a BGP peer-group."; 2740 uses neighbor-group-timers-config; 2741 } 2742 container transport { 2743 description 2744 "Transport session parameters for the BGP peer-group."; 2745 uses neighbor-group-transport-config; 2746 } 2747 container graceful-restart { 2748 if-feature "bt:graceful-restart"; 2749 description 2750 "Parameters relating the graceful restart mechanism for BGP."; 2751 uses graceful-restart-config; 2752 } 2753 uses structure-neighbor-group-ebgp-multihop; 2754 uses structure-neighbor-group-route-reflector; 2755 uses structure-neighbor-group-as-path-options; 2756 uses structure-neighbor-group-add-paths; 2757 uses global-group-use-multiple-paths; 2758 uses rpol:apply-policy-group; 2759 container afi-safis { 2760 description 2761 "Per-address-family configuration parameters associated with 2762 the group."; 2763 uses bgp-peer-group-afi-safi-list; 2764 } 2765 } 2767 grouping bgp-peer-group-list { 2768 description 2769 "The list of BGP peer groups"; 2770 list peer-group { 2771 key "peer-group-name"; 2772 description 2773 "List of BGP peer-groups configured on the local system - 2774 uniquely identified by peer-group name"; 2775 uses bgp-peer-group-base; 2776 } 2777 } 2778 } 2779 2781 file "ietf-bgp-neighbor@2020-02-24.yang" 2782 submodule ietf-bgp-neighbor { 2783 yang-version 1.1; 2784 belongs-to ietf-bgp { 2785 prefix bgp; 2786 } 2788 import ietf-bgp-types { 2789 prefix bt; 2790 reference 2791 "RFC XXXX, BGP Model for Service Provider Network."; 2792 } 2794 // Include the common submodule 2796 include ietf-bgp-common; 2797 include ietf-bgp-common-multiprotocol; 2798 include ietf-bgp-peer-group; 2799 include ietf-bgp-common-structure; 2801 // meta 2802 organization 2803 "IETF IDR Working Group"; 2804 contact 2805 "WG Web: 2806 WG List: 2808 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2809 Keyur Patel (keyur at arrcus.com), 2810 Susan Hares (shares at ndzh.com), 2811 Jeffrey Haas (jhaas at pfrc.org)."; 2812 description 2813 "This sub-module contains groupings that are specific to the 2814 neighbor context of the BGP module. 2816 Copyright (c) 2019 IETF Trust and the persons identified as 2817 authors of the code. All rights reserved. 2819 Redistribution and use in source and binary forms, with or 2820 without modification, is permitted pursuant to, and subject to 2821 the license terms contained in, the Simplified BSD License set 2822 forth in Section 4.c of the IETF Trust's Legal Provisions 2823 Relating to IETF Documents 2824 (https://trustee.ietf.org/license-info). 2826 This version of this YANG module is part of RFC XXXX 2827 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 2828 for full legal notices. 2830 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 2831 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 2832 'MAY', and 'OPTIONAL' in this document are to be interpreted as 2833 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 2834 they appear in all capitals, as shown here."; 2836 revision 2020-02-24 { 2837 description 2838 "Initial Version"; 2839 reference 2840 "RFC XXX, BGP Model for Service Provider Network."; 2841 } 2843 grouping bgp-neighbor-use-multiple-paths { 2844 description 2845 "Multi-path configuration and state applicable to a BGP 2846 neighbor"; 2847 container use-multiple-paths { 2848 description 2849 "Parameters related to the use of multiple-paths for the same 2850 NLRI when they are received only from this neighbor"; 2851 leaf enabled { 2852 type boolean; 2853 default "false"; 2854 description 2855 "Whether the use of multiple paths for the same NLRI is 2856 enabled for the neighbor. This value is overridden by any 2857 more specific configuration value."; 2858 } 2859 container ebgp { 2860 description 2861 "Multi-path configuration for eBGP"; 2862 leaf allow-multiple-as { 2863 type boolean; 2864 default "false"; 2865 description 2866 "Allow multi-path to use paths from different neighboring 2867 ASes. The default is to only consider multiple paths 2868 from the same neighboring AS."; 2869 } 2870 } 2871 } 2872 } 2874 grouping bgp-neighbor-counters-message-types-state { 2875 description 2876 "Grouping of BGP message types, included for re-use across 2877 counters"; 2878 leaf updates-received { 2879 type uint64; 2880 description 2881 "Number of BGP UPDATE messages received from this neighbor."; 2882 reference 2883 "RFC 4273: bgpPeerInUpdates."; 2884 } 2885 leaf updates-sent { 2886 type uint64; 2887 description 2888 "Number of BGP UPDATE messages sent to this neighbor"; 2889 reference 2890 "RFC 4273 - bgpPeerOutUpdates"; 2891 } 2892 leaf messages-received { 2893 type uint64; 2894 description 2895 "Number of BGP messages received from thsi neighbor"; 2896 reference 2897 "RFC 4273 - bgpPeerInTotalMessages"; 2899 } 2900 leaf messages-sent { 2901 type uint64; 2902 description 2903 "Number of BGP messages received from thsi neighbor"; 2904 reference 2905 "RFC 4273 - bgpPeerOutTotalMessages"; 2906 } 2907 leaf notification { 2908 type uint64; 2909 description 2910 "Number of BGP NOTIFICATION messages indicating an error 2911 condition has occurred exchanged."; 2912 } 2913 } 2915 grouping bgp-neighbor-afi-safi-list { 2916 description 2917 "List of address-families associated with the BGP neighbor"; 2918 list afi-safi { 2919 key "afi-safi-name"; 2920 description 2921 "AFI, SAFI configuration available for the neighbor or 2922 group"; 2923 uses mp-afi-safi-config; 2924 leaf active { 2925 type boolean; 2926 config false; 2927 description 2928 "This value indicates whether a particular AFI-SAFI has 2929 been successfully negotiated with the peer. An AFI-SAFI may 2930 be enabled in the current running configuration, but a 2931 session restart may be required in order to negotiate the 2932 new capability."; 2933 } 2934 container prefixes { 2935 config false; 2936 description 2937 "Prefix counters for the BGP session"; 2938 leaf received { 2939 type uint32; 2940 description 2941 "The number of prefixes received from the neighbor"; 2942 } 2943 leaf sent { 2944 type uint32; 2945 description 2946 "The number of prefixes advertised to the neighbor"; 2948 } 2949 leaf installed { 2950 type uint32; 2951 description 2952 "The number of advertised prefixes installed in the 2953 Loc-RIB"; 2954 } 2955 } 2956 container graceful-restart { 2957 if-feature "bt:graceful-restart"; 2958 description 2959 "Parameters relating to BGP graceful-restart"; 2960 uses mp-afi-safi-graceful-restart-config; 2961 leaf received { 2962 type boolean; 2963 config false; 2964 description 2965 "This leaf indicates whether the neighbor advertised the 2966 ability to support graceful-restart for this AFI-SAFI"; 2967 } 2968 leaf advertised { 2969 type boolean; 2970 config false; 2971 description 2972 "This leaf indicates whether the ability to support 2973 graceful-restart has been advertised to the peer"; 2974 } 2975 } 2976 uses mp-all-afi-safi-list-contents; 2977 uses bgp-neighbor-use-multiple-paths; 2978 } 2979 } 2980 } 2981 2983 7.2. BGP types 2985 file "ietf-bgp-types@2020-02-24.yang" 2986 module ietf-bgp-types { 2987 yang-version 1.1; 2988 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types"; 2989 prefix bt; 2991 import ietf-inet-types { 2992 prefix inet; 2993 } 2994 // meta 2996 organization 2997 "IETF IDR Working Group"; 2998 contact 2999 "WG Web: 3000 WG List: 3002 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3003 Keyur Patel (keyur at arrcus.com), 3004 Susan Hares (shares at ndzh.com), 3005 Jeffrey Haas (jhaas at pfrc.org)."; 3006 description 3007 "This module contains general data definitions for use in BGP 3008 policy. It can be imported by modules that make use of BGP 3009 attributes"; 3011 revision 2020-02-24 { 3012 description 3013 "Initial Version"; 3014 reference 3015 "RFC XXX, BGP Model for Service Provider Network."; 3016 } 3018 /* 3019 * Features. 3020 */ 3022 feature graceful-restart { 3023 description 3024 "Graceful restart as defined in RFC 4724 is supported."; 3025 } 3027 feature clear-neighbors { 3028 description 3029 "Clearing of BGP neighbors is supported."; 3030 } 3032 feature clear-statistics { 3033 description 3034 "Clearing of BGP statistics is supported."; 3035 } 3037 feature send-communities { 3038 description 3039 "Enable the propogation of communities."; 3040 } 3041 feature ttl-security { 3042 description 3043 "BGP Time To Live (TTL) security check support."; 3044 reference 3045 "RFC 5082, The Generalized TTL Security Mechanism (GTSM)."; 3046 } 3048 feature bfd { 3049 description 3050 "Support for BFD detection of BGP neighbor reachability."; 3051 reference 3052 "RFC 5880, Bidirectional Forward Detection (BFD), 3053 RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6 3054 (Single Hop), 3055 RFC 5883, Bidirectional Forwarding Detection (BFD) for Multihop 3056 Paths."; 3057 } 3059 feature damping { 3060 description 3061 "Weighted route dampening is supported."; 3062 } 3064 feature clear-routes { 3065 description 3066 "Clearing of BGP routes is supported."; 3067 } 3069 feature add-paths { 3070 description 3071 "Advertisement of multiple paths for the same address prefix 3072 without the new paths implicitly replacing any previous ones."; 3073 reference 3074 "RFC 7911: Advertisement of Multiple Paths in BGP."; 3075 } 3077 /* 3078 * Identities. 3079 */ 3081 identity bgp-capability { 3082 description 3083 "Base identity for a BGP capability"; 3084 } 3086 identity mp-bgp { 3087 base bgp-capability; 3088 description 3089 "Multi-protocol extensions to BGP"; 3090 reference 3091 "RFC 4760: Multiprotocol Extenstions for BGP-4."; 3092 } 3094 identity route-refresh { 3095 base bgp-capability; 3096 description 3097 "The BGP route-refresh functionality"; 3098 reference 3099 "RFC 2918: Route Refresh Capability for BGP-4."; 3100 } 3102 identity asn32 { 3103 base bgp-capability; 3104 description 3105 "4-byte (32-bit) AS number functionality"; 3106 reference 3107 "RFC6793: BGP Support for Four-Octet Autonomous System (AS) 3108 Number Space."; 3109 } 3111 identity graceful-restart { 3112 if-feature "graceful-restart"; 3113 base bgp-capability; 3114 description 3115 "Graceful restart functionality"; 3116 reference 3117 "RFC 4724: Graceful Restart Mechanism for BGP."; 3118 } 3120 identity add-paths { 3121 if-feature "add-paths"; 3122 base bgp-capability; 3123 description 3124 "Advertisement of multiple paths for the same address prefix 3125 without the new paths implicitly replacing any previous ones."; 3126 reference 3127 "RFC 7911: Advertisement of Multiple Paths in BGP."; 3128 } 3130 identity afi-safi-type { 3131 description 3132 "Base identity type for AFI,SAFI tuples for BGP-4"; 3133 reference 3134 "RFC4760: Multi-protocol extensions for BGP-4"; 3135 } 3136 identity ipv4-unicast { 3137 base afi-safi-type; 3138 description 3139 "IPv4 unicast (AFI,SAFI = 1,1)"; 3140 reference 3141 "RFC4760: Multi-protocol extensions for BGP-4"; 3142 } 3144 identity ipv6-unicast { 3145 base afi-safi-type; 3146 description 3147 "IPv6 unicast (AFI,SAFI = 2,1)"; 3148 reference 3149 "RFC4760: Multi-protocol extensions for BGP-4"; 3150 } 3152 identity ipv4-labeled-unicast { 3153 base afi-safi-type; 3154 description 3155 "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; 3156 reference 3157 "RFC 3107: Carrying Label Information in BGP-4."; 3158 } 3160 identity ipv6-labeled-unicast { 3161 base afi-safi-type; 3162 description 3163 "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; 3164 reference 3165 "RFC 3107: Carrying Label Information in BGP-4."; 3166 } 3168 identity l3vpn-ipv4-unicast { 3169 base afi-safi-type; 3170 description 3171 "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; 3172 reference 3173 "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; 3174 } 3176 identity l3vpn-ipv6-unicast { 3177 base afi-safi-type; 3178 description 3179 "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; 3180 reference 3181 "RFC 4659: BGP-MPLS IP Virtual Private Network (VPN) Extension 3182 for IPv6 VPN."; 3183 } 3184 identity l3vpn-ipv4-multicast { 3185 base afi-safi-type; 3186 description 3187 "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; 3188 reference 3189 "RFC 6514: BGP Encodings and Procedures for Multicast in 3190 MPLS/BGP IP VPNs."; 3191 } 3193 identity l3vpn-ipv6-multicast { 3194 base afi-safi-type; 3195 description 3196 "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; 3197 reference 3198 "RFC 6514: BGP Encodings and Procedures for Multicast in 3199 MPLS/BGP IP VPNs."; 3200 } 3202 identity l2vpn-vpls { 3203 base afi-safi-type; 3204 description 3205 "BGP-signalled VPLS (AFI,SAFI = 25,65)"; 3206 reference 3207 "RFC 4761: Virtual Private LAN Service (VPLS) Using BGP for 3208 Auto-Discovery and Signaling."; 3209 } 3211 identity l2vpn-evpn { 3212 base afi-safi-type; 3213 description 3214 "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; 3215 } 3217 identity bgp-well-known-std-community { 3218 description 3219 "Base identity for reserved communities within the standard 3220 community space defined by RFC1997. These communities must 3221 fall within the range 0xFFFF0000 to 0xFFFFFFFF"; 3222 reference 3223 "RFC 1997: BGP Communities Attribute."; 3224 } 3226 identity no-export { 3227 base bgp-well-known-std-community; 3228 description 3229 "Do not export NLRI received carrying this community outside 3230 the bounds of this autonomous system, or this confederation if 3231 the local autonomous system is a confederation member AS. This 3232 community has a value of 0xFFFFFF01."; 3233 reference 3234 "RFC 1997: BGP Communities Attribute."; 3235 } 3237 identity no-advertise { 3238 base bgp-well-known-std-community; 3239 description 3240 "All NLRI received carrying this community must not be 3241 advertised to other BGP peers. This community has a value of 3242 0xFFFFFF02."; 3243 reference 3244 "RFC 1997: BGP Communities Attribute."; 3245 } 3247 identity no-export-subconfed { 3248 base bgp-well-known-std-community; 3249 description 3250 "All NLRI received carrying this community must not be 3251 advertised to external BGP peers - including over confederation 3252 sub-AS boundaries. This community has a value of 0xFFFFFF03."; 3253 reference 3254 "RFC 1997: BGP Communities Attribute."; 3255 } 3257 identity no-peer { 3258 base bgp-well-known-std-community; 3259 description 3260 "An autonomous system receiving NLRI tagged with this community 3261 is advised not to re-advertise the NLRI to external bi-lateral 3262 peer autonomous systems. An AS may also filter received NLRI 3263 from bilateral peer sessions when they are tagged with this 3264 community value"; 3265 reference 3266 "RFC 3765: NOPEER Community for BGP."; 3267 } 3269 identity as-path-segment-type { 3270 description 3271 "Base AS Path Segment Type. In [BGP-4], the path segment type 3272 is a 1-octet field with the following values defined."; 3273 reference 3274 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3275 } 3277 identity as-set { 3278 base as-path-segment-type; 3279 description 3280 "Unordered set of autonomous systems that a route in the UPDATE 3281 message has traversed."; 3282 reference 3283 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3284 } 3286 identity as-sequence { 3287 base as-path-segment-type; 3288 description 3289 "Ordered set of autonomous systems that a route in the UPDATE 3290 message has traversed."; 3291 reference 3292 "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3."; 3293 } 3295 identity as-confed-sequence { 3296 base as-path-segment-type; 3297 description 3298 "Ordered set of Member Autonomous Systems in the local 3299 confederation that the UPDATE message has traversed."; 3300 reference 3301 "RFC 5065, Autonomous System Configuration for BGP."; 3302 } 3304 identity as-confed-set { 3305 base as-path-segment-type; 3306 description 3307 "Unordered set of Member Autonomous Systems in the local 3308 confederation that the UPDATE message has traversed."; 3309 reference 3310 "RFC 5065, Autonomous System Configuration for BGP."; 3311 } 3313 /* 3314 * Typedefs. 3315 */ 3317 typedef bgp-session-direction { 3318 type enumeration { 3319 enum INBOUND { 3320 description 3321 "Refers to all NLRI received from the BGP peer"; 3322 } 3323 enum OUTBOUND { 3324 description 3325 "Refers to all NLRI advertised to the BGP peer"; 3326 } 3327 } 3328 description 3329 "Type to describe the direction of NLRI transmission"; 3330 } 3332 typedef bgp-well-known-community-type { 3333 type identityref { 3334 base bgp-well-known-std-community; 3335 } 3336 description 3337 "Type definition for well-known IETF community attribute 3338 values"; 3339 reference 3340 "IANA Border Gateway Protocol (BGP) Well Known Communities"; 3341 } 3343 typedef bgp-std-community-type { 3344 // TODO: further refine restrictions and allowed patterns 3345 // 4-octet value: 3346 // 2 octets 3347 // 2 octets 3348 type union { 3349 type uint32 { 3350 // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - 3351 // 0xFFFFFFFF are reserved 3352 range "65536..4294901759"; 3353 // 0x00010000..0xFFFEFFFF 3354 } 3355 type string { 3356 pattern '([0-9]+:[0-9]+)'; 3357 } 3358 } 3359 description 3360 "Type definition for standard community attributes"; 3361 reference 3362 "RFC 1997 - BGP Communities Attribute"; 3363 } 3365 typedef bgp-ext-community-type { 3366 // TODO: needs more work to make this more precise given the 3367 // variability of extended community attribute specifications 3368 // 8-octet value: 3369 // 2 octects 3370 // 6 octets 3371 type union { 3372 type string { 3373 // Type 1: 2-octet global and 4-octet local 3374 // (AS number) (Integer) 3375 pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3376 + '[1-9][0-9]{1,4}|[0-9]):' 3377 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3378 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3379 } 3380 type string { 3381 // Type 2: 4-octet global and 2-octet local 3382 // (ipv4-address) (integer) 3383 pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3384 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3385 + '2[0-4][0-9]|25[0-5]):' 3386 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3387 + '[1-9][0-9]{1,4}|[0-9])'; 3388 } 3389 type string { 3390 // route-target with Type 1 3391 // route-target:(ASN):(local-part) 3392 pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' 3393 + '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' 3394 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3395 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3396 } 3397 type string { 3398 // route-target with Type 2 3399 // route-target:(IPv4):(local-part) 3400 pattern 'route\-target:' 3401 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3402 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3403 + '2[0-4][0-9]|25[0-5]):' 3404 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3405 + '[1-9][0-9]{1,4}|[0-9])'; 3406 } 3407 type string { 3408 // route-origin with Type 1 3409 pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' 3410 + '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' 3411 + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' 3412 + '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3413 } 3414 type string { 3415 // route-origin with Type 2 3416 pattern 'route\-origin:' 3417 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' 3418 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' 3419 + '2[0-4][0-9]|25[0-5]):' 3420 + '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' 3421 + '[1-9][0-9]{1,4}|[0-9])'; 3422 } 3423 } 3424 description 3425 "Type definition for extended community attributes"; 3426 reference 3427 "RFC 4360 - BGP Extended Communities Attribute"; 3428 } 3430 typedef bgp-community-regexp-type { 3431 // TODO: needs more work to decide what format these regexps can 3432 // take. 3433 type string; 3434 description 3435 "Type definition for communities specified as regular 3436 expression patterns"; 3437 } 3439 typedef bgp-origin-attr-type { 3440 type enumeration { 3441 enum igp { 3442 description 3443 "Origin of the NLRI is internal"; 3444 } 3445 enum egp { 3446 description 3447 "Origin of the NLRI is EGP"; 3448 } 3449 enum incomplete { 3450 description 3451 "Origin of the NLRI is neither IGP or EGP"; 3452 } 3453 } 3454 description 3455 "Type definition for standard BGP origin attribute"; 3456 reference 3457 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3"; 3458 } 3460 typedef peer-type { 3461 type enumeration { 3462 enum internal { 3463 description 3464 "Internal (iBGP) peer"; 3465 } 3466 enum external { 3467 description 3468 "External (eBGP) peer"; 3469 } 3470 enum confederation { 3471 description 3472 "Confederation as peer"; 3473 } 3474 } 3475 description 3476 "Labels a peer or peer group as explicitly internal, 3477 external or confederation."; 3478 } 3480 identity REMOVE_PRIVATE_AS_OPTION { 3481 description 3482 "Base identity for options for removing private autonomous 3483 system numbers from the AS_PATH attribute"; 3484 } 3486 identity PRIVATE_AS_REMOVE_ALL { 3487 base REMOVE_PRIVATE_AS_OPTION; 3488 description 3489 "Strip all private autonomous system numbers from the AS_PATH. 3490 This action is performed regardless of the other content of the 3491 AS_PATH attribute, and for all instances of private AS numbers 3492 within that attribute."; 3493 } 3495 identity PRIVATE_AS_REPLACE_ALL { 3496 base REMOVE_PRIVATE_AS_OPTION; 3497 description 3498 "Replace all instances of private autonomous system numbers in 3499 the AS_PATH with the local BGP speaker's autonomous system 3500 number. This action is performed regardless of the other 3501 content of the AS_PATH attribute, and for all instances of 3502 private AS number within that attribute."; 3503 } 3505 typedef remove-private-as-option { 3506 type identityref { 3507 base REMOVE_PRIVATE_AS_OPTION; 3508 } 3509 description 3510 "Set of options for configuring how private AS path numbers 3511 are removed from advertisements"; 3512 } 3514 typedef percentage { 3515 type uint8 { 3516 range "0..100"; 3517 } 3518 description 3519 "Integer indicating a percentage value"; 3521 } 3523 typedef rr-cluster-id-type { 3524 type union { 3525 type uint32; 3526 type inet:ipv4-address; 3527 } 3528 description 3529 "Union type for route reflector cluster ids: 3530 option 1: 4-byte number 3531 option 2: IP address"; 3532 } 3534 typedef community-type { 3535 type bits { 3536 bit standard { 3537 position 0; 3538 description 3539 "Send only standard communities."; 3540 reference 3541 "RFC 1997: BGP Communities Attribute."; 3542 } 3543 bit extended { 3544 description 3545 "Send only extended communities."; 3546 reference 3547 "RFC 4360: BGP Extended Communities Attribute."; 3548 } 3549 bit large { 3550 description 3551 "Send only large communities."; 3552 reference 3553 "RFC 8092: BGP Large Communities Attribute."; 3554 } 3555 } 3556 description 3557 "Type describing variations of community attributes. 3558 The community types can be combined and a value of 0 3559 implies 'none'"; 3560 } 3561 } 3562 3564 7.3. BGP policy data 3566 file "ietf-bgp-policy@2020-02-24.yang" 3567 module ietf-bgp-policy { 3568 yang-version 1.1; 3569 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; 3570 prefix bp; 3572 // import some basic types 3574 import ietf-inet-types { 3575 prefix inet; 3576 } 3577 import ietf-routing-policy { 3578 prefix rpol; 3579 } 3580 import ietf-bgp-types { 3581 prefix bt; 3582 } 3583 import ietf-routing-types { 3584 prefix rt-types; 3585 } 3587 organization 3588 "IETF IDR Working Group"; 3589 contact 3590 "WG Web: 3591 WG List: 3593 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3594 Keyur Patel (keyur at arrcus.com), 3595 Susan Hares (shares at ndzh.com), 3596 Jeffrey Haas (jhaas at pfrc.org)."; 3597 description 3598 "This module contains data definitions for BGP routing policy. 3599 It augments the base routing-policy module with BGP-specific 3600 options for conditions and actions."; 3602 revision 2020-02-24 { 3603 description 3604 "Initial Version"; 3605 reference 3606 "RFC XXX, BGP Model for Service Provider Network."; 3607 } 3609 // typedef statements 3611 typedef bgp-set-community-option-type { 3612 type enumeration { 3613 enum add { 3614 description 3615 "Add the specified communities to the existing 3616 community attribute"; 3617 } 3618 enum remove { 3619 description 3620 "Remove the specified communities from the 3621 existing community attribute"; 3622 } 3623 enum replace { 3624 description 3625 "Replace the existing community attribute with 3626 the specified communities. If an empty set is 3627 specified, this removes the community attribute 3628 from the route."; 3629 } 3630 } 3631 description 3632 "Type definition for options when setting the community 3633 attribute in a policy action"; 3634 } 3636 typedef bgp-next-hop-type { 3637 type union { 3638 type inet:ip-address-no-zone; 3639 type enumeration { 3640 enum self { 3641 description 3642 "Special designation for local router's own 3643 address, i.e., next-hop-self"; 3644 } 3645 } 3646 } 3647 description 3648 "Type definition for specifying next-hop in policy actions"; 3649 } 3651 typedef bgp-set-med-type { 3652 type union { 3653 type uint32; 3654 type string { 3655 pattern '^[+-]([0-9]{1,8}|[0-3][0-9]{1,9}|4[0-1][0-9]{1,8}|' 3656 + '428[0-9]{1,7}|429[0-3][0-9]{1,6}|42948[0-9]{1,5}|' 3657 + '42949[0-5][0-9]{1,4}|429496[0-6][0-9]{1,3}|' 3658 + '4294971[0-9]{1,2}|42949728[0-9]|42949729[0-5])$'; 3659 } 3660 type enumeration { 3661 enum igp { 3662 description 3663 "Set the MED value to the IGP cost toward the 3664 next hop for the route"; 3665 } 3666 enum med-plus-igp { 3667 description 3668 "Before comparing MED values for path selection, adds to 3669 the MED the cost of the IGP route to the BGP next-hop 3670 destination. 3672 This option replaces the MED value for the router, 3673 but does not affect the IGP metric comparison. As a 3674 result, when multiple routes have the same value 3675 after the MED-plus-IPG comparison, and route selection 3676 continues, the IGP route metric is also compared, even 3677 though it was added to the MED value and compared 3678 earlier in the selection process. 3680 Useful when the downstream AS requires the complete 3681 cost of a certain route that is received across 3682 multiple ASs."; 3683 } 3684 } 3685 } 3686 description 3687 "Type definition for specifying how the BGP MED can 3688 be set in BGP policy actions. The three choices are to set 3689 the MED directly, increment/decrement using +/- notation, 3690 and setting it to the IGP cost (predefined value)."; 3691 reference 3692 "None. WG needs to decide if this is going to be a standard."; 3693 } 3695 // augment statements 3697 augment "/rpol:routing-policy/rpol:defined-sets" { 3698 description 3699 "Adds BGP defined sets container to routing policy model."; 3700 container bgp-defined-sets { 3701 description 3702 "BGP-related set definitions for policy match conditions"; 3703 container community-sets { 3704 description 3705 "Enclosing container for list of defined BGP community sets"; 3706 list community-set { 3707 key "name"; 3708 description 3709 "List of defined BGP community sets"; 3710 leaf name { 3711 type string; 3712 mandatory true; 3713 description 3714 "Name / label of the community set -- this is used to 3715 reference the set in match conditions"; 3716 } 3717 leaf-list member { 3718 type union { 3719 type bt:bgp-std-community-type; 3720 type bt:bgp-community-regexp-type; 3721 type bt:bgp-well-known-community-type; 3722 } 3723 description 3724 "Members of the community set"; 3725 } 3726 } 3727 } 3728 container ext-community-sets { 3729 description 3730 "Enclosing container for list of extended BGP community 3731 sets"; 3732 list ext-community-set { 3733 key "name"; 3734 description 3735 "List of defined extended BGP community sets"; 3736 leaf name { 3737 type string; 3738 description 3739 "Name / label of the extended community set -- this is 3740 used to reference the set in match conditions"; 3741 } 3742 leaf-list member { 3743 type union { 3744 type rt-types:route-target; 3745 type bt:bgp-community-regexp-type; 3746 } 3747 description 3748 "Members of the extended community set"; 3749 } 3750 } 3751 } 3752 container as-path-sets { 3753 description 3754 "Enclosing container for list of define AS path sets"; 3755 list as-path-set { 3756 key "name"; 3757 description 3758 "List of defined AS path sets"; 3759 leaf name { 3760 type string; 3761 description 3762 "Name of the AS path set -- this is used to reference the 3763 set in match conditions"; 3764 } 3765 leaf-list member { 3766 type string; 3767 description 3768 "AS path expression -- list of ASes in the set"; 3769 } 3770 } 3771 } 3772 } 3773 } 3775 grouping set-community-action-common { 3776 description 3777 "Common leaves for set-community and set-ext-community 3778 actions"; 3779 leaf method { 3780 type enumeration { 3781 enum inline { 3782 description 3783 "The extended communities are specified inline as a 3784 list"; 3785 } 3786 enum reference { 3787 description 3788 "The extended communities are specified by referencing a 3789 defined ext-community set"; 3790 } 3791 } 3792 description 3793 "Indicates the method used to specify the extended 3794 communities for the set-ext-community action"; 3795 } 3796 leaf options { 3797 type bgp-set-community-option-type; 3798 description 3799 "Options for modifying the community attribute with 3800 the specified values. These options apply to both 3801 methods of setting the community attribute."; 3802 } 3803 } 3804 augment "/rpol:routing-policy/rpol:policy-definitions/" 3805 + "rpol:policy-definition/rpol:statements/rpol:statement/" 3806 + "rpol:conditions" { 3807 description 3808 "BGP policy conditions added to routing policy module"; 3809 container bgp-conditions { 3810 description 3811 "Top-level container for BGP specific policy conditions "; 3812 leaf med-eq { 3813 type uint32; 3814 description 3815 "Condition to check if the received MED value is equal to 3816 the specified value"; 3817 } 3818 leaf origin-eq { 3819 type bt:bgp-origin-attr-type; 3820 description 3821 "Condition to check if the route origin is equal to the 3822 specified value"; 3823 } 3824 leaf-list next-hop-in { 3825 type inet:ip-address-no-zone; 3826 description 3827 "List of next hop addresses to check for in the route 3828 update"; 3829 } 3830 leaf-list afi-safi-in { 3831 type identityref { 3832 base bt:afi-safi-type; 3833 } 3834 description 3835 "List of address families which the NLRI may be within"; 3836 } 3837 leaf local-pref-eq { 3838 type uint32; 3839 // TODO: add support for other comparisons if needed 3840 description 3841 "Condition to check if the local pref attribute is equal to 3842 the specified value"; 3843 } 3844 leaf route-type { 3845 // TODO: verify extent of vendor support for this comparison 3846 type enumeration { 3847 enum internal { 3848 description 3849 "route type is internal"; 3850 } 3851 enum external { 3852 description 3853 "route type is external"; 3854 } 3855 } 3856 description 3857 "Condition to check the route type in the route update"; 3858 } 3859 container community-count { 3860 description 3861 "Value and comparison operations for conditions based on the 3862 number of communities in the route update"; 3863 } 3864 container as-path-length { 3865 description 3866 "Value and comparison operations for conditions based on the 3867 length of the AS path in the route update. 3869 The as-path-length SHALL be calculated and SHALL follow 3870 RFC 4271 rules."; 3871 reference 3872 "RFC 4271: BGP-4."; 3873 } 3874 container match-community-set { 3875 description 3876 "Top-level container for match conditions on communities. 3877 Match a referenced community-set according to the logic 3878 defined in the match-set-options leaf"; 3879 leaf community-set { 3880 type leafref { 3881 path "/rpol:routing-policy/rpol:defined-sets/" 3882 + "bp:bgp-defined-sets/bp:community-sets/" 3883 + "bp:community-set/bp:name"; 3884 } 3885 description 3886 "References a defined community set"; 3887 } 3888 uses rpol:match-set-options-group; 3889 } 3890 container match-ext-community-set { 3891 description 3892 "Match a referenced extended community-set according to the 3893 logic defined in the match-set-options leaf"; 3894 leaf ext-community-set { 3895 type leafref { 3896 path "/rpol:routing-policy/rpol:defined-sets/" 3897 + "bp:bgp-defined-sets/bp:ext-community-sets/" 3898 + "bp:ext-community-set/bp:name"; 3899 } 3900 description 3901 "References a defined extended community set"; 3902 } 3903 uses rpol:match-set-options-group; 3904 } 3905 container match-as-path-set { 3906 description 3907 "Match a referenced as-path set according to the logic 3908 defined in the match-set-options leaf"; 3909 leaf as-path-set { 3910 type leafref { 3911 path "/rpol:routing-policy/rpol:defined-sets/" 3912 + "bp:bgp-defined-sets/bp:as-path-sets/" 3913 + "bp:as-path-set/bp:name"; 3914 } 3915 description 3916 "References a defined AS path set"; 3917 } 3918 uses rpol:match-set-options-group; 3919 } 3920 } 3921 } 3923 augment "/rpol:routing-policy/rpol:policy-definitions/" 3924 + "rpol:policy-definition/rpol:statements/rpol:statement/" 3925 + "rpol:actions" { 3926 description 3927 "BGP policy actions added to routing policy module."; 3928 container bgp-actions { 3929 description 3930 "Top-level container for BGP-specific actions"; 3931 leaf set-route-origin { 3932 type bt:bgp-origin-attr-type; 3933 description 3934 "Set the origin attribute to the specified value"; 3935 } 3936 leaf set-local-pref { 3937 type uint32; 3938 description 3939 "Set the local pref attribute on the route update"; 3940 } 3941 leaf set-next-hop { 3942 type bgp-next-hop-type; 3943 description 3944 "Set the next-hop attribute in the route update"; 3945 } 3946 leaf set-med { 3947 type bgp-set-med-type; 3948 description 3949 "Set the med metric attribute in the route update"; 3950 } 3951 container set-as-path-prepend { 3952 description 3953 "Action to prepend local AS number to the AS-path a 3954 specified number of times"; 3955 leaf repeat-n { 3956 type uint8 { 3957 range "1..max"; 3958 } 3959 description 3960 "Number of times to prepend the local AS number to the AS 3961 path. The value should be between 1 and the maximum 3962 supported by the implementation."; 3963 } 3964 } 3965 container set-community { 3966 description 3967 "Action to set the community attributes of the route, along 3968 with options to modify how the community is modified. 3969 Communities may be set using an inline list OR 3970 reference to an existing defined set (not both)."; 3971 uses set-community-action-common; 3972 container inline { 3973 when "../method = 'inline'" { 3974 description 3975 "Active only when the set-community method is inline"; 3976 } 3977 description 3978 "Set the community values for the action inline with 3979 a list."; 3980 leaf-list communities { 3981 type union { 3982 type bt:bgp-std-community-type; 3983 type bt:bgp-well-known-community-type; 3984 } 3985 description 3986 "Set the community values for the update inline with a 3987 list."; 3988 } 3989 } 3990 container reference { 3991 when "../method = 'reference'" { 3992 description 3993 "Active only when the set-community method is reference"; 3994 } 3995 description 3996 "Provide a reference to a defined community set for the 3997 set-community action"; 3998 leaf community-set-ref { 3999 type leafref { 4000 path "/rpol:routing-policy/rpol:defined-sets/" 4001 + "bp:bgp-defined-sets/" 4002 + "bp:community-sets/bp:community-set/bp:name"; 4003 } 4004 description 4005 "References a defined community set by name"; 4006 } 4007 } 4008 } 4009 container set-ext-community { 4010 description 4011 "Action to set the extended community attributes of the 4012 route, along with options to modify how the community is 4013 modified. Extended communities may be set using an inline 4014 list OR a reference to an existing defined set (but not 4015 both)."; 4016 uses set-community-action-common; 4017 container inline { 4018 when "../method = 'inline'" { 4019 description 4020 "Active only when the set-community method is inline"; 4021 } 4022 description 4023 "Set the extended community values for the action inline 4024 with a list."; 4025 leaf-list communities { 4026 type union { 4027 type rt-types:route-target; 4028 type bt:bgp-well-known-community-type; 4029 } 4030 description 4031 "Set the extended community values for the update inline 4032 with a list."; 4033 } 4034 } 4035 container reference { 4036 when "../method = 'reference'" { 4037 description 4038 "Active only when the set-community method is reference"; 4039 } 4040 description 4041 "Provide a reference to an extended community set for the 4042 set-ext-community action"; 4043 leaf ext-community-set-ref { 4044 type leafref { 4045 path "/rpol:routing-policy/rpol:defined-sets/" 4046 + "bp:bgp-defined-sets/bp:ext-community-sets/" 4047 + "bp:ext-community-set/bp:name"; 4048 } 4049 description 4050 "References a defined extended community set by name"; 4051 } 4052 } 4053 } 4054 } 4055 } 4057 // rpc statements 4058 // notification statements 4059 } 4060 4062 7.4. RIB modules 4064 file "ietf-bgp-rib@2020-02-24.yang" 4065 submodule ietf-bgp-rib { 4066 yang-version 1.1; 4067 belongs-to ietf-bgp { 4068 prefix br; 4069 } 4071 /* 4072 * Import and Include 4073 */ 4075 import ietf-bgp-types { 4076 prefix bt; 4077 reference 4078 "RFC XXXX: BGP YANG Model for Service Provider Networks."; 4079 } 4080 import ietf-inet-types { 4081 prefix inet; 4082 reference 4083 "RFC 6991: Common YANG Types."; 4084 } 4085 import ietf-yang-types { 4086 prefix yang; 4087 reference 4088 "RFC 6991: Common YANG Types."; 4089 } 4090 import ietf-routing-types { 4091 prefix rt; 4092 reference 4093 "RFC 8294: Routing Area YANG Types."; 4094 } 4095 include ietf-bgp-rib-types; 4096 include ietf-bgp-rib-tables; 4098 // groupings of attributes in three categories: 4099 // - shared across multiple routes 4100 // - common to LOC-RIB and Adj-RIB, but not shared across routes 4101 // - specific to LOC-RIB or Adj-RIB 4103 include ietf-bgp-rib-attributes; 4105 // groupings of annotations for each route or table 4107 include ietf-bgp-rib-table-attributes; 4109 organization 4110 "IETF IDR Working Group"; 4111 contact 4112 "WG Web: 4113 WG List: 4115 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4116 Keyur Patel (keyur at arrcus.com), 4117 Susan Hares (shares at ndzh.com)"; 4118 description 4119 "Defines a submodule for representing BGP routing table (RIB) 4120 contents. The submodule supports 5 logical RIBs per address 4121 family: 4123 loc-rib: This is the main BGP routing table for the local routing 4124 instance, containing best-path selections for each prefix. The 4125 loc-rib table may contain multiple routes for a given prefix, 4126 with an attribute to indicate which was selected as the best 4127 path. Note that multiple paths may be used or advertised even if 4128 only one path is marked as best, e.g., when using BGP 4129 add-paths. An implementation may choose to mark multiple 4130 paths in the RIB as best path by setting the flag to true for 4131 multiple entries. 4133 adj-rib-in-pre: This is a per-neighbor table containing the NLRI 4134 updates received from the neighbor before any local input policy 4135 rules or filters have been applied. This can be considered the 4136 'raw' updates from a given neighbor. 4138 adj-rib-in-post: This is a per-neighbor table containing the 4139 routes received from the neighbor that are eligible for 4140 best-path selection after local input policy rules have been 4141 applied. 4143 adj-rib-out-pre: This is a per-neighbor table containing routes 4144 eligible for sending (advertising) to the neighbor before output 4145 policy rules have been applied. 4147 adj-rib-out-post: This is a per-neighbor table containing routes 4148 eligible for sending (advertising) to the neighbor after output 4149 policy rules have been applied. 4151 Copyright (c) 2019 IETF Trust and the persons identified as 4152 authors of the code. All rights reserved. 4154 Redistribution and use in source and binary forms, with or 4155 without modification, is permitted pursuant to, and subject to 4156 the license terms contained in, the Simplified BSD License set 4157 forth in Section 4.c of the IETF Trust's Legal Provisions 4158 Relating to IETF Documents 4159 (https://trustee.ietf.org/license-info). 4161 This version of this YANG module is part of RFC XXXX 4162 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4163 for full legal notices. 4165 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4166 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4167 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4168 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4169 they appear in all capitals, as shown here."; 4171 revision 2020-02-24 { 4172 description 4173 "Initial Version"; 4174 reference 4175 "RFC XXXX, BGP YANG Model for Service Provider Network."; 4176 } 4178 grouping rib { 4179 description 4180 "Grouping for rib."; 4181 container rib { 4182 config false; 4183 container attr-sets { 4184 description 4185 "Enclosing container for the list of path attribute sets"; 4186 list attr-set { 4187 key "index"; 4188 description 4189 "List of path attributes that may be in use by multiple 4190 routes in the table"; 4191 leaf index { 4192 type uint64; 4193 description 4194 "System generated index for each attribute set. The 4195 index is used to reference an attribute set from a 4196 specific path. Multiple paths may reference the same 4197 attribute set."; 4198 } 4199 leaf origin { 4200 type bt:bgp-origin-attr-type; 4201 description 4202 "BGP attribute defining the origin of the path 4203 information."; 4204 } 4205 leaf atomic-aggregate { 4206 type boolean; 4207 description 4208 "BGP attribute indicating that the prefix is an atomic 4209 aggregate; i.e., the peer selected a less specific 4210 route without selecting a more specific route that is 4211 included in it."; 4212 reference 4213 "RFC 4271: Section 5.1.6."; 4214 } 4215 leaf next-hop { 4216 type inet:ip-address; 4217 description 4218 "BGP next hop attribute defining the IP address of the 4219 router that should be used as the next hop to the 4220 destination"; 4221 reference 4222 "RFC 4271: Section 5.1.3."; 4223 } 4224 leaf med { 4225 type uint32; 4226 description 4227 "BGP multi-exit discriminator attribute used in BGP route 4228 selection process"; 4229 reference 4230 "RFC 4271: Section 5.1.4."; 4231 } 4232 leaf local-pref { 4233 type uint32; 4234 description 4235 "BGP local preference attribute sent to internal peers to 4236 indicate the degree of preference for externally learned 4237 routes. The route with the highest local preference 4238 value is preferred."; 4239 reference 4240 "RFC 4271: Section 5.1.5."; 4241 } 4242 leaf originator-id { 4243 type yang:dotted-quad; 4244 description 4245 "BGP attribute that provides the id as an IPv4 address 4246 of the originator of the announcement."; 4247 reference 4248 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4249 Mesh Internal BGP (IBGP)"; 4250 } 4251 leaf-list cluster-list { 4252 type yang:dotted-quad; 4253 description 4254 "Represents the reflection path that the route has 4255 passed."; 4256 reference 4257 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4258 Mesh Internal BGP (IBGP)"; 4259 } 4260 leaf aigp-metric { 4261 type uint64; 4262 description 4263 "BGP path attribute representing the accumulated IGP 4264 metric for the path"; 4265 reference 4266 "RFC 7311 - The Accumulated IGP Metric Attribute for BGP"; 4267 } 4268 container aggregator { 4269 config false; 4270 description 4271 "BGP attribute indicating the prefix has been 4272 aggregated by the specified AS and router."; 4273 reference 4274 "RFC 4271: Section 5.1.7."; 4275 leaf as { 4276 type inet:as-number; 4277 description 4278 "AS number of the autonomous system that performed the 4279 aggregation."; 4280 } 4281 leaf as4 { 4282 type inet:as-number; 4283 description 4284 "AS number of the autonomous system that performed the 4285 aggregation (4-octet representation). This value is 4286 populated if an upstream router is not 4-octet capable. 4287 Its semantics are similar to the AS4_PATH optional 4288 transitive attribute"; 4289 reference 4290 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4291 } 4292 leaf address { 4293 type inet:ipv4-address; 4294 description 4295 "IP address of the router that performed the 4296 aggregation."; 4297 } 4298 } 4299 container as-path { 4300 description 4301 "Enclosing container for the list of AS path segments. 4303 In the Adj-RIB-In or Adj-RIB-Out, this list should show 4304 the received or sent AS_PATH, respectively. For 4305 example, if the local router is not 4-byte capable, this 4306 value should consist of 2-octet ASNs or the AS_TRANS 4307 (AS 23456) values received or sent in route updates. 4309 In the Loc-RIB, this list should reflect the effective 4310 AS path for the route, e.g., a 4-octet value if the 4311 local router is 4-octet capable."; 4312 reference 4313 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4) 4314 RFC 6793 - BGP Support for Four-octet AS Number Space 4315 RFC 5065 - Autonomous System Confederations for BGP"; 4316 list segment { 4317 key "type"; 4318 config false; 4319 uses bgp-as-path-attr; 4320 description 4321 "List of AS PATH segments"; 4322 } 4323 } 4324 container as4-path { 4325 description 4326 "This is the path encoded with 4-octet 4327 AS numbers in the optional transitive AS4_PATH attribute. 4328 This value is populated with the received or sent 4329 attribute in Adj-RIB-In or Adj-RIB-Out, respectively. 4330 It should not be populated in Loc-RIB since the Loc-RIB 4331 is expected to store the effective AS-Path in the 4332 as-path leaf regardless of being 4-octet or 2-octet."; 4333 reference 4334 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4335 list segment { 4336 key "type"; 4337 config false; 4338 uses bgp-as-path-attr; 4339 description 4340 "List of AS PATH segments"; 4341 } 4342 } 4343 } 4344 } 4345 container communities { 4346 description 4347 "Enclosing container for the list of community attribute 4348 sets"; 4349 list community { 4350 key "index"; 4351 config false; 4352 description 4353 "List of path attributes that may be in use by multiple 4354 routes in the table"; 4355 leaf index { 4356 type uint64; 4357 description 4358 "System generated index for each attribute set. The 4359 index is used to reference an attribute set from a 4360 specific path. Multiple paths may reference the same 4361 attribute set."; 4362 } 4363 uses bgp-community-attr-state; 4364 } 4365 } 4366 container ext-communities { 4367 description 4368 "Enclosing container for the list of extended community 4369 attribute sets"; 4370 list ext-community { 4371 key "index"; 4372 config false; 4373 description 4374 "List of path attributes that may be in use by multiple 4375 routes in the table"; 4376 leaf index { 4377 type uint64; 4378 description 4379 "System generated index for each attribute set. The 4380 index is used to reference an attribute set from a 4381 specific path. Multiple paths may reference the same 4382 attribute set."; 4383 } 4384 leaf-list ext-community { 4385 type rt:route-target; 4386 description 4387 "List of BGP extended community attributes. The received 4388 extended community may be an explicitly modeled 4389 type or unknown, represented by an 8-octet value 4390 formatted according to RFC 4360."; 4391 reference 4392 "RFC 4360 - BGP Extended Communities Attribute"; 4393 } 4394 } 4395 } 4396 container afi-safis { 4397 config false; 4398 description 4399 "Enclosing container for address family list"; 4400 list afi-safi { 4401 key "afi-safi-name"; 4402 description 4403 "List of afi-safi types."; 4404 leaf afi-safi-name { 4405 type identityref { 4406 base bt:afi-safi-type; 4407 } 4408 description 4409 "AFI,SAFI name."; 4410 } 4411 container ipv4-unicast { 4412 when "../afi-safi-name = 'bt:ipv4-unicast'" { 4413 description 4414 "Include this container for IPv4 unicast RIB"; 4415 } 4416 description 4417 "Routing tables for IPv4 unicast -- active when the 4418 afi-safi name is ipv4-unicast"; 4419 uses ipv4-loc-rib; 4420 uses ipv4-adj-rib; 4421 } 4422 container ipv6-unicast { 4423 when "../afi-safi-name = 'bt:ipv6-unicast'" { 4424 description 4425 "Include this container for IPv6 unicast RIB"; 4426 } 4427 description 4428 "Routing tables for IPv6 unicast -- active when the 4429 afi-safi name is ipv6-unicast"; 4430 uses ipv6-loc-rib; 4431 uses ipv6-adj-rib; 4432 } 4433 } 4434 } 4435 description 4436 "Top level container for BGP RIB"; 4437 } 4438 } 4439 } 4440 4442 file "ietf-bgp-rib-ext@2020-02-24.yang" 4443 submodule ietf-bgp-rib-ext { 4444 yang-version 1.1; 4445 belongs-to ietf-bgp { 4446 prefix bre; 4447 } 4449 include ietf-bgp-rib-types; 4451 organization 4452 "IETF IDR Working Group"; 4453 contact 4454 "WG Web: 4455 WG List: 4457 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4458 Keyur Patel (keyur at arrcus.com), 4459 Susan Hares (shares at ndzh.com), 4460 Jeffrey Haas (jhaas at pfrc.org)."; 4461 description 4462 "Defines additional data nodes for the BGP RIB model. 4463 These items reflect extensions that are desirable features but 4464 are not currently supported in a majority of BGP 4465 implementations. 4467 Copyright (c) 2019 IETF Trust and the persons identified as 4468 authors of the code. All rights reserved. 4470 Redistribution and use in source and binary forms, with or 4471 without modification, is permitted pursuant to, and subject to 4472 the license terms contained in, the Simplified BSD License set 4473 forth in Section 4.c of the IETF Trust's Legal Provisions 4474 Relating to IETF Documents 4475 (https://trustee.ietf.org/license-info). 4477 This version of this YANG module is part of RFC XXXX 4478 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4479 for full legal notices. 4481 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4482 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4483 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4484 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4485 they appear in all capitals, as shown here."; 4487 revision 2020-02-24 { 4488 description 4489 "Initial Revision."; 4490 reference 4491 "RFC XXXX: BGP YANG Model for Service Providers."; 4492 } 4494 grouping rib-ext-route-annotations { 4495 description 4496 "Extended annotations for routes in the routing tables"; 4497 leaf reject-reason { 4498 type union { 4499 type identityref { 4500 base bgp-not-selected-bestpath; 4501 } 4502 type identityref { 4503 base bgp-not-selected-policy; 4504 } 4505 } 4506 description 4507 "Indicates the reason the route is not used, either due to 4508 policy filtering or bestpath selection"; 4509 } 4510 } 4511 } 4512 4514 file "ietf-bgp-rib-types@2020-02-24.yang" 4515 submodule ietf-bgp-rib-types { 4516 yang-version 1.1; 4517 belongs-to ietf-bgp { 4518 prefix br; 4519 } 4521 organization 4522 "IETF IDR Working Group"; 4523 contact 4524 "WG Web: 4525 WG List: 4527 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4528 Keyur Patel (keyur at arrcus.com), 4529 Susan Hares (shares at ndzh.com), 4530 Jeffrey Haas (jhaas at pfrc.org)."; 4531 description 4532 "Defines identity and type definitions associated with 4533 the BGP RIB modules. 4535 Copyright (c) 2019 IETF Trust and the persons identified as 4536 authors of the code. All rights reserved. 4538 Redistribution and use in source and binary forms, with or 4539 without modification, is permitted pursuant to, and subject to 4540 the license terms contained in, the Simplified BSD License set 4541 forth in Section 4.c of the IETF Trust's Legal Provisions 4542 Relating to IETF Documents 4543 (https://trustee.ietf.org/license-info). 4545 This version of this YANG module is part of RFC XXXX 4546 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4547 for full legal notices. 4549 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4550 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4551 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4552 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4553 they appear in all capitals, as shown here."; 4555 revision 2020-02-24 { 4556 description 4557 "Initial Version"; 4558 reference 4559 "RFC XXXX, BGP Model for Service Provider Network."; 4560 } 4562 identity invalid-route-reason { 4563 description 4564 "Base identity for reason code for routes that are rejected as 4565 invalid. Some derived entities are based on BMP v3"; 4566 reference 4567 "RFC 7854: BGP Monitoring Protocol."; 4568 } 4569 identity invalid-cluster-loop { 4570 base invalid-route-reason; 4571 description 4572 "Route was invalid due to CLUSTER_LIST loop"; 4573 } 4575 identity invalid-as-loop { 4576 base invalid-route-reason; 4577 description 4578 "Route was invalid due to AS_PATH loop"; 4579 } 4581 identity invalid-originator { 4582 base invalid-route-reason; 4583 description 4584 "Route was invalid due to ORIGINATOR_ID, e.g., update has 4585 local router as originator"; 4586 } 4588 identity invalid-confed { 4589 base invalid-route-reason; 4590 description 4591 "Route was invalid due to a loop in the AS_CONFED_SEQUENCE or 4592 AS_CONFED_SET attributes"; 4593 } 4595 identity bgp-not-selected-bestpath { 4596 description 4597 "Base identity for indicating reason a route was was not 4598 selected by BGP route selection algorithm"; 4599 reference 4600 "RFC 4271 - Section 9.1"; 4601 } 4603 identity local-pref-lower { 4604 base bgp-not-selected-bestpath; 4605 description 4606 "Route has a lower localpref attribute than current best path"; 4607 reference 4608 "RFC 4271 - Section 9.1.2"; 4609 } 4611 identity as-path-longer { 4612 base bgp-not-selected-bestpath; 4613 description 4614 "Route has a longer AS path attribute than current best path"; 4615 reference 4616 "RFC 4271 - Section 9.1.2.2 (a)"; 4618 } 4620 identity origin-type-higher { 4621 base bgp-not-selected-bestpath; 4622 description 4623 "Route has a higher origin type, i.e., IGP origin is preferred 4624 over EGP or incomplete"; 4625 reference 4626 "RFC 4271 - Section 9.1.2.2 (b)"; 4627 } 4629 identity med-higher { 4630 base bgp-not-selected-bestpath; 4631 description 4632 "Route has a higher MED, or metric, attribute than the current 4633 best path"; 4634 reference 4635 "RFC 4271 - Section 9.1.2.2 (c)"; 4636 } 4638 identity prefer-external { 4639 base bgp-not-selected-bestpath; 4640 description 4641 "Route source is via IGP, rather than EGP."; 4642 reference 4643 "RFC 4271 - Section 9.1.2.2 (d)"; 4644 } 4646 identity nexthop-cost-higher { 4647 base bgp-not-selected-bestpath; 4648 description 4649 "Route has a higher interior cost to the next hop."; 4650 reference 4651 "RFC 4271 - Section 9.1.2.2 (e)"; 4652 } 4654 identity higher-router-id { 4655 base bgp-not-selected-bestpath; 4656 description 4657 "Route was sent by a peer with a higher BGP Identifier value, 4658 or router id"; 4659 reference 4660 "RFC 4271 - Section 9.1.2.2 (f)"; 4661 } 4663 identity higher-peer-address { 4664 base bgp-not-selected-bestpath; 4665 description 4666 "Route was sent by a peer with a higher IP address"; 4667 reference 4668 "RFC 4271 - Section 9.1.2.2 (g)"; 4669 } 4671 identity bgp-not-selected-policy { 4672 description 4673 "Base identity for reason code for routes that are rejected 4674 due to policy"; 4675 } 4677 identity rejected-import-policy { 4678 base bgp-not-selected-policy; 4679 description 4680 "Route was rejected after apply import policies"; 4681 } 4682 } 4683 4685 file "ietf-bgp-rib-attributes@2020-02-24.yang" 4686 submodule ietf-bgp-rib-attributes { 4687 yang-version 1.1; 4688 belongs-to ietf-bgp { 4689 prefix br; 4690 } 4692 // import some basic types 4694 import ietf-bgp-types { 4695 prefix bgpt; 4696 } 4697 import ietf-inet-types { 4698 prefix inet; 4699 } 4700 include ietf-bgp-rib-types; 4702 // meta 4704 organization 4705 "IETF IDR Working Group"; 4706 contact 4707 "WG Web: 4708 WG List: 4710 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4711 Keyur Patel (keyur at arrcus.com), 4712 Susan Hares (shares at ndzh.com)"; 4714 description 4715 "This submodule contains common data definitions for BGP 4716 attributes for use in BGP RIB tables. 4718 Copyright (c) 2019 IETF Trust and the persons identified as 4719 authors of the code. All rights reserved. 4721 Redistribution and use in source and binary forms, with or 4722 without modification, is permitted pursuant to, and subject to 4723 the license terms contained in, the Simplified BSD License set 4724 forth in Section 4.c of the IETF Trust's Legal Provisions 4725 Relating to IETF Documents 4726 (https://trustee.ietf.org/license-info). 4728 This version of this YANG module is part of RFC XXXX 4729 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4730 for full legal notices. 4732 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4733 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4734 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4735 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4736 they appear in all capitals, as shown here."; 4738 revision 2020-02-24 { 4739 description 4740 "Initial version"; 4741 reference 4742 "RFC XXXX: BGP YANG Model for Service Provider Network"; 4743 } 4745 grouping bgp-as-path-attr { 4746 description 4747 "Data for representing BGP AS-PATH attribute"; 4748 leaf type { 4749 type identityref { 4750 base bgpt:as-path-segment-type; 4751 } 4752 description 4753 "The type of AS-PATH segment"; 4754 } 4755 leaf-list member { 4756 type inet:as-number; 4757 description 4758 "List of the AS numbers in the AS-PATH segment"; 4759 } 4760 } 4761 grouping bgp-community-attr-state { 4762 description 4763 "Common definition of BGP community attributes"; 4764 leaf-list community { 4765 type union { 4766 type bgpt:bgp-well-known-community-type; 4767 type bgpt:bgp-std-community-type; 4768 } 4769 description 4770 "List of standard or well-known BGP community 4771 attributes."; 4772 } 4773 } 4775 grouping bgp-unknown-attr-flags-state { 4776 description 4777 "Operational state data for path attribute flags"; 4778 leaf optional { 4779 type boolean; 4780 description 4781 "Defines whether the attribute is optional (if 4782 set to true) or well-known (if set to false). 4783 Set in the high-order bit of the BGP attribute 4784 flags octet."; 4785 reference 4786 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4787 } 4788 leaf transitive { 4789 type boolean; 4790 description 4791 "Defines whether an optional attribute is transitive 4792 (if set to true) or non-transitive (if set to false). For 4793 well-known attributes, the transitive flag must be set to 4794 true. Set in the second high-order bit of the BGP attribute 4795 flags octet."; 4796 reference 4797 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4798 } 4799 leaf partial { 4800 type boolean; 4801 description 4802 "Defines whether the information contained in the optional 4803 transitive attribute is partial (if set to true) or complete 4804 (if set to false). For well-known attributes and for 4805 optional non-transitive attributes, the partial flag 4806 must be set to false. Set in the third high-order bit of 4807 the BGP attribute flags octet."; 4808 reference 4809 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4810 } 4811 leaf extended { 4812 type boolean; 4813 description 4814 "Defines whether the attribute length is one octet 4815 (if set to false) or two octets (if set to true). Set in 4816 the fourth high-order bit of the BGP attribute flags 4817 octet."; 4818 reference 4819 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4820 } 4821 } 4823 grouping bgp-unknown-attr-state { 4824 description 4825 "Operational state data for path attributes not shared 4826 across route entries, common to LOC-RIB and Adj-RIB"; 4827 leaf attr-type { 4828 type uint8; 4829 description 4830 "1-octet value encoding the attribute type code"; 4831 reference 4832 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4833 } 4834 leaf attr-len { 4835 type uint16; 4836 description 4837 "One or two octet attribute length field indicating the 4838 length of the attribute data in octets. If the Extended 4839 Length attribute flag is set, the length field is 2 octets, 4840 otherwise it is 1 octet"; 4841 reference 4842 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4843 } 4844 leaf attr-value { 4845 type binary { 4846 length "0..65535"; 4847 } 4848 description 4849 "Raw attribute value, not including the attribute 4850 flags, type, or length. The maximum length 4851 of the attribute value data is 2^16-1 per the max value 4852 of the attr-len field (2 octets)."; 4853 reference 4854 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4855 } 4856 } 4857 grouping bgp-unknown-attr-top { 4858 description 4859 "Unknown path attributes that are not expected to be shared 4860 across route entries, common to LOC-RIB and Adj-RIB"; 4861 container unknown-attributes { 4862 description 4863 "Unknown path attributes that were received in the UPDATE 4864 message which contained the prefix."; 4865 list unknown-attribute { 4866 key "attr-type"; 4867 description 4868 "This list contains received attributes that are unrecognized 4869 or unsupported by the local router. The list may be empty."; 4870 uses bgp-unknown-attr-flags-state; 4871 uses bgp-unknown-attr-state; 4872 } 4873 } 4874 } 4876 grouping bgp-loc-rib-attr-state { 4877 description 4878 "Path attributes that are not expected to be shared across 4879 route entries, specific to LOC-RIB"; 4880 } 4882 grouping bgp-adj-rib-attr-state { 4883 description 4884 "Path attributes that are not expected to be shared across 4885 route entries, specific to Adj-RIB"; 4886 leaf path-id { 4887 type uint32; 4888 description 4889 "When the BGP speaker supports advertisement of multiple 4890 paths for a prefix, the path identifier is used to 4891 uniquely identify a route based on the combination of the 4892 prefix and path id. In the Adj-RIB-In, the path-id value is 4893 the value received in the update message. In the Loc-RIB, 4894 if used, it should represent a locally generated path-id 4895 value for the corresponding route. In Adj-RIB-Out, it 4896 should be the value sent to a neighbor when add-paths is 4897 used, i.e., the capability has been negotiated."; 4898 reference 4899 "RFC 7911: Advertisement of Multiple Paths in BGP"; 4900 } 4901 } 4902 } 4903 4904 file "ietf-bgp-rib-table-attributes@2020-02-24.yang" 4905 submodule ietf-bgp-rib-table-attributes { 4906 yang-version 1.1; 4907 belongs-to ietf-bgp { 4908 prefix br; 4909 } 4911 // import some basic types 4913 import ietf-yang-types { 4914 prefix types; 4915 reference 4916 "RFC 6991, Common YANG Data Types."; 4917 } 4918 include ietf-bgp-rib-types; 4920 organization 4921 "IETF IDR Working Group"; 4922 contact 4923 "WG Web: 4924 WG List: 4926 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4927 Keyur Patel (keyur at arrcus.com), 4928 Susan Hares (shares at ndzh.com"; 4929 description 4930 "This submodule contains common data definitions for data 4931 related to a RIB entry, or RIB table. 4933 Copyright (c) 2019 IETF Trust and the persons identified as 4934 authors of the code. All rights reserved. 4936 Redistribution and use in source and binary forms, with or 4937 without modification, is permitted pursuant to, and subject to 4938 the license terms contained in, the Simplified BSD License set 4939 forth in Section 4.c of the IETF Trust's Legal Provisions 4940 Relating to IETF Documents 4941 (https://trustee.ietf.org/license-info). 4943 This version of this YANG module is part of RFC XXXX 4944 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 4945 for full legal notices. 4947 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 4948 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 4949 'MAY', and 'OPTIONAL' in this document are to be interpreted as 4950 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 4951 they appear in all capitals, as shown here."; 4953 revision 2020-02-24 { 4954 description 4955 "Initial version."; 4956 reference 4957 "RFC XXXX: BGP YANG Model for Service Provider Network."; 4958 } 4960 grouping bgp-common-route-annotations-state { 4961 description 4962 "Data definitions for flags and other information attached 4963 to routes in both LOC-RIB and Adj-RIB"; 4964 leaf last-modified { 4965 type types:timeticks; 4966 description 4967 "Timestamp when this path was last modified. 4969 The value is the timestamp in seconds relative to 4970 the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; 4971 } 4972 leaf valid-route { 4973 type boolean; 4974 description 4975 "Indicates that the route is considered valid by the 4976 local router"; 4977 } 4978 leaf invalid-reason { 4979 type identityref { 4980 base invalid-route-reason; 4981 } 4982 description 4983 "If the route is rejected as invalid, this indicates the 4984 reason."; 4985 } 4986 } 4988 grouping bgp-loc-rib-route-annotations-state { 4989 description 4990 "Data definitions for information attached to routes in the 4991 LOC-RIB"; 4992 // placeholder for route metadata specific to the LOC-RIB 4993 } 4995 grouping bgp-adj-rib-in-post-route-annotations-state { 4996 description 4997 "Data definitions for information attached to routes in the 4998 Adj-RIB-in post-policy table"; 4999 leaf best-path { 5000 type boolean; 5001 description 5002 "Current path was selected as the best path."; 5003 } 5004 } 5006 grouping bgp-common-table-attrs-state { 5007 description 5008 "Common attributes attached to all routing tables"; 5009 // placeholder for metadata associated with all tables 5010 } 5012 grouping bgp-common-table-attrs-top { 5013 // no enclosing container as this data will fit under an 5014 // existing LOC-RIB container 5015 uses bgp-common-table-attrs-state; 5016 description 5017 "Operational state data for data related to the entire 5018 LOC-RIB"; 5019 } 5020 } 5021 5023 file "ietf-bgp-rib-tables@2020-02-24.yang" 5024 submodule ietf-bgp-rib-tables { 5025 yang-version 1.1; 5026 belongs-to ietf-bgp { 5027 prefix br; 5028 } 5030 // import some basic types 5032 import ietf-inet-types { 5033 prefix inet; 5034 reference 5035 "RFC 6991: Common YANG Data Types."; 5036 } 5037 import ietf-yang-types { 5038 prefix yang; 5039 reference 5040 "RFC 6991: Common YANG Data Types."; 5041 } 5042 import ietf-routing { 5043 prefix rt; 5044 reference 5045 "RFC 8022: A YANG Data Model for Routing Management"; 5046 } 5047 import ietf-bgp-types { 5048 prefix bt; 5049 reference 5050 "RFC XXXX: BGP YANG Model for Service Provider Network."; 5051 } 5052 include ietf-bgp-rib-ext; 5053 include ietf-bgp-rib-attributes; 5054 include ietf-bgp-rib-table-attributes; 5056 organization 5057 "IETF IDR Working Group"; 5058 contact 5059 "WG Web: 5060 WG List: 5062 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 5063 Authors: Keyur Patel, 5064 Mahesh Jethanandani, 5065 Susan Hares"; 5066 description 5067 "This submodule contains structural data definitions for 5068 BGP routing tables. 5070 Copyright (c) 2019 IETF Trust and the persons identified as 5071 authors of the code. All rights reserved. 5073 Redistribution and use in source and binary forms, with or 5074 without modification, is permitted pursuant to, and subject to 5075 the license terms contained in, the Simplified BSD License set 5076 forth in Section 4.c of the IETF Trust's Legal Provisions 5077 Relating to IETF Documents 5078 (https://trustee.ietf.org/license-info). 5080 This version of this YANG module is part of RFC XXXX 5081 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 5082 for full legal notices. 5084 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 5085 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 5086 'MAY', and 'OPTIONAL' in this document are to be interpreted as 5087 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 5088 they appear in all capitals, as shown here."; 5090 revision 2020-02-24 { 5091 description 5092 "Initial Version"; 5093 reference 5094 "RFC XXXX, BGP YANG Model for Service Provider Network."; 5095 } 5096 grouping bgp-adj-rib-common-attr-refs { 5097 description 5098 "Definitions of common references to attribute sets for 5099 multiple AFI-SAFIs for Adj-RIB tables"; 5100 leaf attr-index { 5101 type leafref { 5102 path "../../../../../../../../../attr-sets/" 5103 + "attr-set/index"; 5104 } 5105 description 5106 "Reference to the common attribute group for the 5107 route"; 5108 } 5109 leaf community-index { 5110 type leafref { 5111 path "../../../../../../../../../communities/community/" 5112 + "index"; 5113 } 5114 description 5115 "Reference to the community attribute for the route"; 5116 } 5117 leaf ext-community-index { 5118 type leafref { 5119 path "../../../../../../../../../ext-communities/" 5120 + "ext-community/index"; 5121 } 5122 description 5123 "Reference to the extended community attribute for the 5124 route"; 5125 } 5126 } 5128 grouping bgp-loc-rib-common-attr-refs { 5129 description 5130 "Definitions of common references to attribute sets for 5131 multiple AFI-SAFIs for LOC-RIB tables"; 5132 leaf attr-index { 5133 type leafref { 5134 path "../../../../../../../attr-sets/attr-set/" 5135 + "index"; 5136 } 5137 description 5138 "Reference to the common attribute group for the 5139 route"; 5140 } 5141 leaf community-index { 5142 type leafref { 5143 path "../../../../../../../communities/community/" 5144 + "index"; 5145 } 5146 description 5147 "Reference to the community attribute for the route"; 5148 } 5149 leaf ext-community-index { 5150 type leafref { 5151 path "../../../../../../../ext-communities/" 5152 + "ext-community/index"; 5153 } 5154 description 5155 "Reference to the extended community attribute for the 5156 route"; 5157 } 5158 } 5160 grouping bgp-loc-rib-common-keys { 5161 description 5162 "Common references used in keys for IPv4 and IPv6 5163 LOC-RIB entries"; 5164 leaf origin { 5165 type union { 5166 type inet:ip-address; 5167 type identityref { 5168 base rt:routing-protocol; 5169 } 5170 } 5171 description 5172 "Indicates the origin of the route. If the route is learned 5173 from a neighbor, this value is the neighbor address. If 5174 the route was injected or redistributed from another 5175 protocol, the origin indicates the source protocol for the 5176 route."; 5177 } 5178 leaf path-id { 5179 type uint32; 5180 description 5181 "If the route is learned from a neighbor, the path-id 5182 corresponds to the path-id for the route in the 5183 corresponding adj-rib-in-post table. If the route is 5184 injected from another protocol, or the neighbor does not 5185 support BGP add-paths, the path-id should be set 5186 to zero, also the default value. 5188 However, YANG does not allow default values to be set 5189 for parameters that form the key, so a default value 5190 cannot be set here."; 5191 } 5193 } 5195 grouping clear-routes { 5196 description 5197 "Action to clear BGP routes."; 5198 container clear-routes { 5199 if-feature "bt:clear-routes"; 5200 action clear { 5201 input { 5202 leaf clear-at { 5203 type yang:date-and-time; 5204 description 5205 "The time, in the future when the clear operation will 5206 be initiated."; 5207 } 5208 } 5209 output { 5210 leaf clear-finished-at { 5211 type yang:date-and-time; 5212 description 5213 "The time when the clear operation finished."; 5214 } 5215 } 5216 } 5217 description 5218 "Action commands to clear routes governed by a if-feature."; 5219 } 5220 } 5222 grouping ipv4-loc-rib { 5223 description 5224 "Top-level grouping for IPv4 routing tables"; 5225 container loc-rib { 5226 config false; 5227 description 5228 "Container for the IPv4 BGP LOC-RIB data"; 5229 uses bgp-common-table-attrs-top; 5230 container routes { 5231 description 5232 "Enclosing container for list of routes in the routing 5233 table."; 5234 list route { 5235 key "prefix origin path-id"; 5236 description 5237 "List of routes in the table, keyed by the route 5238 prefix, the route origin, and path-id. The route 5239 origin can be either the neighbor address from which 5240 the route was learned, or the source protocol that 5241 injected the route. The path-id distinguishes routes 5242 for the same prefix received from a neighbor (e.g., 5243 if add-paths is enabled)."; 5244 leaf prefix { 5245 type inet:ipv4-prefix; 5246 description 5247 "The IPv4 prefix corresponding to the route"; 5248 } 5249 uses bgp-loc-rib-common-keys; 5250 uses bgp-loc-rib-common-attr-refs; 5251 uses bgp-loc-rib-attr-state; 5252 uses bgp-common-route-annotations-state; 5253 uses bgp-loc-rib-route-annotations-state; 5254 uses bgp-unknown-attr-top; 5255 uses rib-ext-route-annotations; 5256 } 5257 uses clear-routes; 5258 } 5259 } 5260 } 5262 grouping ipv6-loc-rib { 5263 description 5264 "Top-level grouping for IPv6 routing tables"; 5265 container loc-rib { 5266 config false; 5267 description 5268 "Container for the IPv6 BGP LOC-RIB data"; 5269 uses bgp-common-table-attrs-top; 5270 container routes { 5271 description 5272 "Enclosing container for list of routes in the routing 5273 table."; 5274 list route { 5275 key "prefix origin path-id"; 5276 description 5277 "List of routes in the table, keyed by the route 5278 prefix, the route origin, and path-id. The route 5279 origin can be either the neighbor address from which 5280 the route was learned, or the source protocol that 5281 injected the route. The path-id distinguishes routes 5282 for the same prefix received from a neighbor (e.g., 5283 if add-paths is enabled)."; 5284 leaf prefix { 5285 type inet:ipv6-prefix; 5286 description 5287 "The IPv6 prefix corresponding to the route"; 5288 } 5289 uses bgp-loc-rib-common-keys; 5290 uses bgp-loc-rib-common-attr-refs; 5291 uses bgp-loc-rib-attr-state; 5292 uses bgp-common-route-annotations-state; 5293 uses bgp-loc-rib-route-annotations-state; 5294 uses bgp-unknown-attr-top; 5295 uses rib-ext-route-annotations; 5296 } 5297 uses clear-routes; 5298 } 5299 } 5300 } 5302 grouping ipv4-adj-rib-common { 5303 description 5304 "Common structural grouping for each IPv4 adj-RIB table"; 5305 uses bgp-common-table-attrs-top; 5306 container routes { 5307 config false; 5308 description 5309 "Enclosing container for list of routes in the routing 5310 table."; 5311 list route { 5312 key "prefix path-id"; 5313 description 5314 "List of routes in the table, keyed by a combination of 5315 the route prefix and path-id to distinguish multiple 5316 routes received from a neighbor for the same prefix, 5317 e.g., when BGP add-paths is enabled."; 5318 leaf prefix { 5319 type inet:ipv4-prefix; 5320 description 5321 "Prefix for the route"; 5322 } 5323 uses bgp-adj-rib-attr-state; 5324 uses bgp-adj-rib-common-attr-refs; 5325 uses bgp-common-route-annotations-state; 5326 uses bgp-unknown-attr-top; 5327 uses rib-ext-route-annotations; 5328 } 5329 uses clear-routes; 5330 } 5331 } 5333 grouping ipv4-adj-rib-in-post { 5334 description 5335 "Common structural grouping for the IPv4 adj-rib-in 5336 post-policy table"; 5338 uses bgp-common-table-attrs-top; 5339 container routes { 5340 config false; 5341 description 5342 "Enclosing container for list of routes in the routing 5343 table."; 5344 list route { 5345 key "prefix path-id"; 5346 description 5347 "List of routes in the table, keyed by a combination of 5348 the route prefix and path-id to distinguish multiple 5349 routes received from a neighbor for the same prefix, 5350 e.g., when BGP add-paths is enabled."; 5351 leaf prefix { 5352 type inet:ipv4-prefix; 5353 description 5354 "Prefix for the route"; 5355 } 5356 uses bgp-adj-rib-attr-state; 5357 uses bgp-adj-rib-common-attr-refs; 5358 uses bgp-common-route-annotations-state; 5359 uses bgp-adj-rib-in-post-route-annotations-state; 5360 uses bgp-unknown-attr-top; 5361 uses rib-ext-route-annotations; 5362 } 5363 } 5364 } 5366 grouping ipv4-adj-rib { 5367 description 5368 "Top-level grouping for Adj-RIB table"; 5369 container neighbors { 5370 config false; 5371 description 5372 "Enclosing container for neighbor list"; 5373 list neighbor { 5374 key "neighbor-address"; 5375 description 5376 "List of neighbors (peers) of the local BGP speaker"; 5377 leaf neighbor-address { 5378 type inet:ip-address; 5379 description 5380 "IP address of the BGP neighbor or peer"; 5381 } 5382 container adj-rib-in-pre { 5383 description 5384 "Per-neighbor table containing the NLRI updates 5385 received from the neighbor before any local input 5386 policy rules or filters have been applied. This can 5387 be considered the 'raw' updates from the neighbor."; 5388 uses ipv4-adj-rib-common; 5389 } 5390 container adj-rib-in-post { 5391 description 5392 "Per-neighbor table containing the paths received from 5393 the neighbor that are eligible for best-path selection 5394 after local input policy rules have been applied."; 5395 uses ipv4-adj-rib-in-post; 5396 } 5397 container adj-rib-out-pre { 5398 description 5399 "Per-neighbor table containing paths eligble for 5400 sending (advertising) to the neighbor before output 5401 policy rules have been applied"; 5402 uses ipv4-adj-rib-common; 5403 } 5404 container adj-rib-out-post { 5405 description 5406 "Per-neighbor table containing paths eligble for 5407 sending (advertising) to the neighbor after output 5408 policy rules have been applied"; 5409 uses ipv4-adj-rib-common; 5410 } 5411 } 5412 } 5413 } 5415 grouping ipv6-adj-rib-common { 5416 description 5417 "Common structural grouping for each IPv6 adj-RIB table"; 5418 uses bgp-common-table-attrs-state; 5419 container routes { 5420 config false; 5421 description 5422 "Enclosing container for list of routes in the routing 5423 table."; 5424 list route { 5425 key "prefix path-id"; 5426 description 5427 "List of routes in the table"; 5428 leaf prefix { 5429 type inet:ipv6-prefix; 5430 description 5431 "Prefix for the route"; 5432 } 5433 uses bgp-adj-rib-attr-state; 5434 uses bgp-adj-rib-common-attr-refs; 5435 uses bgp-common-route-annotations-state; 5436 uses bgp-unknown-attr-top; 5437 uses rib-ext-route-annotations; 5438 } 5439 uses clear-routes; 5440 } 5441 } 5443 grouping ipv6-adj-rib-in-post { 5444 description 5445 "Common structural grouping for the IPv6 adj-rib-in 5446 post-policy table"; 5447 uses bgp-common-table-attrs-state; 5448 container routes { 5449 config false; 5450 description 5451 "Enclosing container for list of routes in the routing 5452 table."; 5453 list route { 5454 key "prefix path-id"; 5455 description 5456 "List of routes in the table"; 5457 leaf prefix { 5458 type inet:ipv6-prefix; 5459 description 5460 "Prefix for the route"; 5461 } 5462 uses bgp-adj-rib-attr-state; 5463 uses bgp-adj-rib-common-attr-refs; 5464 uses bgp-common-route-annotations-state; 5465 uses bgp-adj-rib-in-post-route-annotations-state; 5466 uses bgp-unknown-attr-top; 5467 uses rib-ext-route-annotations; 5468 } 5469 } 5470 } 5472 grouping ipv6-adj-rib { 5473 description 5474 "Top-level grouping for Adj-RIB table"; 5475 container neighbors { 5476 config false; 5477 description 5478 "Enclosing container for neighbor list"; 5479 list neighbor { 5480 key "neighbor-address"; 5481 description 5482 "List of neighbors (peers) of the local BGP speaker"; 5483 leaf neighbor-address { 5484 type inet:ip-address; 5485 description 5486 "IP address of the BGP neighbor or peer"; 5487 } 5488 container adj-rib-in-pre { 5489 description 5490 "Per-neighbor table containing the NLRI updates 5491 received from the neighbor before any local input 5492 policy rules or filters have been applied. This can 5493 be considered the 'raw' updates from the neighbor."; 5494 uses ipv6-adj-rib-common; 5495 } 5496 container adj-rib-in-post { 5497 description 5498 "Per-neighbor table containing the paths received from 5499 the neighbor that are eligible for best-path selection 5500 after local input policy rules have been applied."; 5501 uses ipv6-adj-rib-in-post; 5502 } 5503 container adj-rib-out-pre { 5504 description 5505 "Per-neighbor table containing paths eligble for 5506 sending (advertising) to the neighbor before output 5507 policy rules have been applied"; 5508 uses ipv6-adj-rib-common; 5509 } 5510 container adj-rib-out-post { 5511 description 5512 "Per-neighbor table containing paths eligble for 5513 sending (advertising) to the neighbor after output 5514 policy rules have been applied"; 5515 uses ipv6-adj-rib-common; 5516 } 5517 } 5518 } 5519 } 5520 } 5521 5523 file "ietf-bgp-rib-table-attributes@2020-02-24.yang" 5524 submodule ietf-bgp-rib-table-attributes { 5525 yang-version 1.1; 5526 belongs-to ietf-bgp { 5527 prefix br; 5528 } 5529 // import some basic types 5531 import ietf-yang-types { 5532 prefix types; 5533 reference 5534 "RFC 6991, Common YANG Data Types."; 5535 } 5536 include ietf-bgp-rib-types; 5538 organization 5539 "IETF IDR Working Group"; 5540 contact 5541 "WG Web: 5542 WG List: 5544 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5545 Keyur Patel (keyur at arrcus.com), 5546 Susan Hares (shares at ndzh.com"; 5547 description 5548 "This submodule contains common data definitions for data 5549 related to a RIB entry, or RIB table. 5551 Copyright (c) 2019 IETF Trust and the persons identified as 5552 authors of the code. All rights reserved. 5554 Redistribution and use in source and binary forms, with or 5555 without modification, is permitted pursuant to, and subject to 5556 the license terms contained in, the Simplified BSD License set 5557 forth in Section 4.c of the IETF Trust's Legal Provisions 5558 Relating to IETF Documents 5559 (https://trustee.ietf.org/license-info). 5561 This version of this YANG module is part of RFC XXXX 5562 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 5563 for full legal notices. 5565 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 5566 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 5567 'MAY', and 'OPTIONAL' in this document are to be interpreted as 5568 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 5569 they appear in all capitals, as shown here."; 5571 revision 2020-02-24 { 5572 description 5573 "Initial version."; 5574 reference 5575 "RFC XXXX: BGP YANG Model for Service Provider Network."; 5576 } 5577 grouping bgp-common-route-annotations-state { 5578 description 5579 "Data definitions for flags and other information attached 5580 to routes in both LOC-RIB and Adj-RIB"; 5581 leaf last-modified { 5582 type types:timeticks; 5583 description 5584 "Timestamp when this path was last modified. 5586 The value is the timestamp in seconds relative to 5587 the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; 5588 } 5589 leaf valid-route { 5590 type boolean; 5591 description 5592 "Indicates that the route is considered valid by the 5593 local router"; 5594 } 5595 leaf invalid-reason { 5596 type identityref { 5597 base invalid-route-reason; 5598 } 5599 description 5600 "If the route is rejected as invalid, this indicates the 5601 reason."; 5602 } 5603 } 5605 grouping bgp-loc-rib-route-annotations-state { 5606 description 5607 "Data definitions for information attached to routes in the 5608 LOC-RIB"; 5609 // placeholder for route metadata specific to the LOC-RIB 5610 } 5612 grouping bgp-adj-rib-in-post-route-annotations-state { 5613 description 5614 "Data definitions for information attached to routes in the 5615 Adj-RIB-in post-policy table"; 5616 leaf best-path { 5617 type boolean; 5618 description 5619 "Current path was selected as the best path."; 5620 } 5621 } 5623 grouping bgp-common-table-attrs-state { 5624 description 5625 "Common attributes attached to all routing tables"; 5626 // placeholder for metadata associated with all tables 5627 } 5629 grouping bgp-common-table-attrs-top { 5630 // no enclosing container as this data will fit under an 5631 // existing LOC-RIB container 5632 uses bgp-common-table-attrs-state; 5633 description 5634 "Operational state data for data related to the entire 5635 LOC-RIB"; 5636 } 5637 } 5638 5640 8. Contributors 5642 Previous versions of this document saw contributions from Anees 5643 Shaikh, Rob Shakir, Kevin D'Souza, Alexander Clemm, Aleksandr 5644 Zhadkin, and Xyfeng Liu. 5646 9. Acknowledgements 5648 The authors are grateful for valuable contributions to this document 5649 and the associated models from: Ebben Aires, Pavan Beeram, Chris 5650 Chase, Ed Crabbe, Luyuan Fang, Bill Fenner, Akshay Gattani, Josh 5651 George, Vijay Gill, Matt John, Jeff Haas, Dhanendra Jain, Acee 5652 Lindem, Ina Minei, Carl Moberg, Ashok Narayanan, Einar Nilsen- 5653 Nygaard, Adam Simpson, Puneet Sood, Jason Sterne, Jeff Tantsura, Jim 5654 Uttaro, and Gunter Vandevelde. 5656 Credit is also due to authors of the OpenConfig, whose model was 5657 relied upon to come up with this model. 5659 Special thanks to Robert Wilton who helped convert the YANG models to 5660 a NMDA compatible model. 5662 10. References 5664 10.1. Normative references 5666 [I-D.scharf-tcpm-yang-tcp] 5667 Scharf, M., Murgai, V., and M. Jethanandani, "YANG Model 5668 for Transmission Control Protocol (TCP) Configuration", 5669 draft-scharf-tcpm-yang-tcp-04 (work in progress), February 5670 2020. 5672 [RFC1997] Chandra, R., Traina, P., and T. Li, "BGP Communities 5673 Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996, 5674 . 5676 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 5677 Requirement Levels", BCP 14, RFC 2119, 5678 DOI 10.17487/RFC2119, March 1997, 5679 . 5681 [RFC2439] Villamizar, C., Chandra, R., and R. Govindan, "BGP Route 5682 Flap Damping", RFC 2439, DOI 10.17487/RFC2439, November 5683 1998, . 5685 [RFC2918] Chen, E., "Route Refresh Capability for BGP-4", RFC 2918, 5686 DOI 10.17487/RFC2918, September 2000, 5687 . 5689 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 5690 DOI 10.17487/RFC3688, January 2004, 5691 . 5693 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 5694 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 5695 DOI 10.17487/RFC4271, January 2006, 5696 . 5698 [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private 5699 Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February 5700 2006, . 5702 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 5703 Reflection: An Alternative to Full Mesh Internal BGP 5704 (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, 5705 . 5707 [RFC4659] De Clercq, J., Ooms, D., Carugi, M., and F. Le Faucheur, 5708 "BGP-MPLS IP Virtual Private Network (VPN) Extension for 5709 IPv6 VPN", RFC 4659, DOI 10.17487/RFC4659, September 2006, 5710 . 5712 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 5713 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 5714 DOI 10.17487/RFC4724, January 2007, 5715 . 5717 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 5718 "Multiprotocol Extensions for BGP-4", RFC 4760, 5719 DOI 10.17487/RFC4760, January 2007, 5720 . 5722 [RFC4761] Kompella, K., Ed. and Y. Rekhter, Ed., "Virtual Private 5723 LAN Service (VPLS) Using BGP for Auto-Discovery and 5724 Signaling", RFC 4761, DOI 10.17487/RFC4761, January 2007, 5725 . 5727 [RFC5065] Traina, P., McPherson, D., and J. Scudder, "Autonomous 5728 System Confederations for BGP", RFC 5065, 5729 DOI 10.17487/RFC5065, August 2007, 5730 . 5732 [RFC5880] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 5733 (BFD)", RFC 5880, DOI 10.17487/RFC5880, June 2010, 5734 . 5736 [RFC5881] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 5737 (BFD) for IPv4 and IPv6 (Single Hop)", RFC 5881, 5738 DOI 10.17487/RFC5881, June 2010, 5739 . 5741 [RFC5883] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 5742 (BFD) for Multihop Paths", RFC 5883, DOI 10.17487/RFC5883, 5743 June 2010, . 5745 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 5746 the Network Configuration Protocol (NETCONF)", RFC 6020, 5747 DOI 10.17487/RFC6020, October 2010, 5748 . 5750 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 5751 and A. Bierman, Ed., "Network Configuration Protocol 5752 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 5753 . 5755 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 5756 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 5757 . 5759 [RFC6514] Aggarwal, R., Rosen, E., Morin, T., and Y. Rekhter, "BGP 5760 Encodings and Procedures for Multicast in MPLS/BGP IP 5761 VPNs", RFC 6514, DOI 10.17487/RFC6514, February 2012, 5762 . 5764 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 5765 Autonomous System (AS) Number Space", RFC 6793, 5766 DOI 10.17487/RFC6793, December 2012, 5767 . 5769 [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. 5770 Austein, "BGP Prefix Origin Validation", RFC 6811, 5771 DOI 10.17487/RFC6811, January 2013, 5772 . 5774 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 5775 RFC 6991, DOI 10.17487/RFC6991, July 2013, 5776 . 5778 [RFC7911] Walton, D., Retana, A., Chen, E., and J. Scudder, 5779 "Advertisement of Multiple Paths in BGP", RFC 7911, 5780 DOI 10.17487/RFC7911, July 2016, 5781 . 5783 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 5784 RFC 7950, DOI 10.17487/RFC7950, August 2016, 5785 . 5787 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 5788 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 5789 . 5791 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 5792 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 5793 May 2017, . 5795 [RFC8177] Lindem, A., Ed., Qu, Y., Yeung, D., Chen, I., and J. 5796 Zhang, "YANG Data Model for Key Chains", RFC 8177, 5797 DOI 10.17487/RFC8177, June 2017, 5798 . 5800 [RFC8277] Rosen, E., "Using BGP to Bind MPLS Labels to Address 5801 Prefixes", RFC 8277, DOI 10.17487/RFC8277, October 2017, 5802 . 5804 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 5805 Access Control Model", STD 91, RFC 8341, 5806 DOI 10.17487/RFC8341, March 2018, 5807 . 5809 [RFC8349] Lhotka, L., Lindem, A., and Y. Qu, "A YANG Data Model for 5810 Routing Management (NMDA Version)", RFC 8349, 5811 DOI 10.17487/RFC8349, March 2018, 5812 . 5814 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 5815 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 5816 . 5818 [RFC8528] Bjorklund, M. and L. Lhotka, "YANG Schema Mount", 5819 RFC 8528, DOI 10.17487/RFC8528, March 2019, 5820 . 5822 [RFC8529] Berger, L., Hopps, C., Lindem, A., Bogdanovic, D., and X. 5823 Liu, "YANG Data Model for Network Instances", RFC 8529, 5824 DOI 10.17487/RFC8529, March 2019, 5825 . 5827 10.2. Informative references 5829 [I-D.ietf-bfd-yang] 5830 Rahman, R., Zheng, L., Jethanandani, M., Pallagatti, S., 5831 and G. Mirsky, "YANG Data Model for Bidirectional 5832 Forwarding Detection (BFD)", draft-ietf-bfd-yang-17 (work 5833 in progress), August 2018. 5835 [I-D.ietf-rtgwg-policy-model] 5836 Qu, Y., Tantsura, J., Lindem, A., and X. Liu, "A YANG Data 5837 Model for Routing Policy Management", draft-ietf-rtgwg- 5838 policy-model-08 (work in progress), January 2020. 5840 [RFC3765] Huston, G., "NOPEER Community for Border Gateway Protocol 5841 (BGP) Route Scope Control", RFC 3765, 5842 DOI 10.17487/RFC3765, April 2004, 5843 . 5845 [RFC5082] Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C. 5846 Pignataro, "The Generalized TTL Security Mechanism 5847 (GTSM)", RFC 5082, DOI 10.17487/RFC5082, October 2007, 5848 . 5850 [RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP 5851 Authentication Option", RFC 5925, DOI 10.17487/RFC5925, 5852 June 2010, . 5854 [RFC7454] Durand, J., Pepelnjak, I., and G. Doering, "BGP Operations 5855 and Security", BCP 194, RFC 7454, DOI 10.17487/RFC7454, 5856 February 2015, . 5858 [RFC7854] Scudder, J., Ed., Fernando, R., and S. Stuart, "BGP 5859 Monitoring Protocol (BMP)", RFC 7854, 5860 DOI 10.17487/RFC7854, June 2016, 5861 . 5863 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 5864 and R. Wilton, "Network Management Datastore Architecture 5865 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 5866 . 5868 Appendix A. Examples 5870 This section tries to show some examples in how the model can be 5871 used. 5873 A.1. Creating BGP Instance 5875 This example shows how to enable BGP with the IPv4 unicast address 5876 family, while adding one network to advertise. 5878 [note: '\' line wrapping for formatting only] 5880 5881 5882 5884 5885 5886 bgpm:bgp 5888 5889 BGP 5890 5892 5893 64496 5894 5895 5896 5899 bt:ipv4-unicast 5900 5901 5902 5903 5904 5905 5906 5907 5908 5910 A.2. Neighbor Address Family Configuration 5912 This example shows how to configure a BGP peer, where the remote 5913 address is 192.0.2.1, the remote AS number is 64497, and the address 5914 family of the peer is IPv4 unicast. 5916 [note: '\' line wrapping for formatting only] 5918 5922 5923 5924 5926 5927 5928 bgp:bgp 5930 5931 name:BGP 5932 5934 5935 64496 5936 5937 5938 5941 bt:ipv4-unicast 5942 5943 5944 5945 5946 5947 5948 192.0.2.1 5949 64497 5950 5951 true 5952 4.0 5953 3.0 5954 15.0 5955 100 5956 500 5957 1000 5958 5959 "Peer Router B" 5960 5961 5962 5965 bt:ipv4-unicast 5966 5967 5968 5969 5970 5971 5972 5974 5975 5976 5978 A.3. IPv6 Neighbor Configuration 5980 This example shows how to configure a BGP peer, where the remote peer 5981 has a IPv6 address, uses TCP-AO to secure the session with the peer, 5982 and uses non-default timers for hold-time and keepalive. 5984 [note: '\' line wrapping for formatting only] 5986 5987 5988 5990 5991 bgp-key-chain 5992 5993 5994 5996 5997 5998 bgp:bgp 6000 6001 name:BGP 6002 6004 6005 64496 6006 6007 6008 6011 bt:ipv6-unicast 6012 6013 6014 6015 6016 6017 6018 2001:db8:: 6019 true 6020 true 6021 6022 bgp-key-chain 6023 6024 64497 6025 "Peer Router B" 6026 6027 120 6028 70 6029 6030 6031 6032 6035 bt:ipv6-unicast 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6047 A.4. VRF Configuration 6049 This example shows how BGP can be configured for two VRFs, red and 6050 blue. In this case, the two network instances share a common AS, and 6051 distinguish between the instances using the router id. 6053 [note: '\' line wrapping for formatting only] 6055 6056 6057 6059 6060 vrf-red 6061 6062 6064 192.0.2.1 6065 6066 6067 bgpm:bgp 6070 6071 BGP 6072 6074 6075 64496 6076 6077 6078 6081 bt:ipv4-unicast 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 vrf-blue 6094 6095 6097 192.0.2.2 6098 6099 6100 bgpm:bgp 6103 6104 BGP 6105 6107 6108 64496 6109 6110 6111 6114 bt:ipv4-unicast 6115 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6129 Appendix B. How to add a new AFI and Augment a Module 6131 This section explains how a new AFI can be defined in a new module 6132 and how that module can then be augmented. Assume that the new AFI 6133 being defined is called 'foo' which extends the base identity of 6134 'afi-safi-type', and the augmentation is to add a new container for 6135 'foo' under two different XPaths. The example shows how the base 6136 identity can be extended to add this new AFI, and then use the 6137 augmented containers be used to add 'foo' specific information. 6139 module example-newafi-bgp { 6140 yang-version 1.1; 6141 namespace "http://example.com/ns/example-newafi-bgp"; 6142 prefix example-newafi-bgp; 6144 import ietf-routing { 6145 prefix rt; 6146 reference 6147 "RFC 8349, A YANG Data Model for Routing Management 6148 (NMDA Version)"; 6149 } 6151 import ietf-bgp { 6152 prefix "bgp"; 6153 reference 6154 "RFC XXXX: BGP YANG module for Service Provider Network."; 6155 } 6157 import ietf-bgp-types { 6158 prefix "bt"; 6159 } 6161 organization 6162 "Newafi model group."; 6164 contact 6165 "abc@newafi.com"; 6166 description 6167 "This YANG module defines and uses new AFI."; 6169 revision 2020-02-24 { 6170 description 6171 "Creating new AFI and using in this model"; 6173 reference 6174 "RFC XXXX: BGP YANG Model for Service Provider Network."; 6175 } 6177 identity foo { 6178 base bt:afi-safi-type; 6179 description 6180 "New AFI type foo."; 6181 } 6183 augment "/rt:routing/rt:control-plane-protocols/" + 6184 "rt:control-plane-protocol/bgp:bgp/bgp:global/" + 6185 "bgp:afi-safis/bgp:afi-safi" { 6186 when "derived-from-or-self(bgp:afi-safi-name, 'foo')" { 6187 description 6188 "This augmentation is valid for a AFI/SAFI instance 6189 of 'foo'"; 6190 } 6191 container foo { 6192 description 6193 "Container to add 'foo' specific AFI/SAFI information."; 6194 } 6195 } 6197 augment "/rt:routing/rt:control-plane-protocols/" + 6198 "rt:control-plane-protocol/bgp:bgp/" + 6199 "bgp:rib/bgp:afi-safis/bgp:afi-safi" { 6200 when "derived-from-or-self(bgp:afi-safi-name, 'foo')" { 6201 description 6202 "This augmentation is valid for a AFI/SAFI instance 6203 of 'foo'"; 6204 } 6205 container foo { 6206 description 6207 "Container to add 'foo' rib specific information."; 6208 } 6209 } 6210 } 6212 Appendix C. How to deviate a module 6214 This example shows how the BGP can be deviated to indicate two nodes 6215 that the particular implementation is choosing not to support. 6217 module example-newco-bgp { 6218 yang-version 1.1; 6219 namespace "http://example.com/ns/example-newco-bgp"; 6220 prefix example-newco-bgp; 6222 import ietf-bgp { 6223 prefix "bgp"; 6224 } 6226 organization 6227 "Newco model group."; 6229 contact 6230 "abc@newco.com"; 6231 description 6232 "This YANG module deviates IETF BGP YANG module."; 6234 revision 2020-02-24 { 6235 description 6236 "Creating NewCo deviations to ietf-bgp model"; 6238 reference 6239 "RFC XXXX: BGP YANG module for Service Provider Network."; 6240 } 6242 deviation "/bgp:bgp/bgp:global/bgp:graceful-restart/" + 6243 "bgp:restart-time" { 6244 deviate not-supported; 6245 } 6247 deviation "/bgp:bgp/bgp:global/bgp:graceful-restart/" + 6248 "bgp:stale-route-time" { 6249 deviate not-supported; 6250 } 6251 } 6253 Authors' Addresses 6255 Mahesh Jethanandani 6256 VMware 6258 Email: mjethanandani@gmail.com 6259 Keyur Patel 6260 Arrcus 6261 CA 6262 USA 6264 Email: keyur@arrcus.com 6266 Susan Hares 6267 Huawei 6268 7453 Hickory Hill 6269 Saline, MI 48176 6270 USA 6272 Email: shares@ndzh.com 6274 Jeffrey Haas 6275 Juniper Networks 6277 Email: jhaas@pfrc.org