idnits 2.17.1 draft-ietf-idr-bgp-model-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 3 instances of too long lines in the document, the longest one being 11 characters in excess of 72. == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 378 has weird spacing: '...ndpoint ine...' == Line 381 has weird spacing: '...ance-id uin...' == Line 443 has weird spacing: '...address ine...' == Line 566 has weird spacing: '...address ine...' == Line 688 has weird spacing: '...address ine...' == (3 more instances...) -- The document date (February 25, 2019) is 1886 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 (-31) exists of draft-ietf-rtgwg-policy-model-05 Summary: 1 error (**), 0 flaws (~~), 9 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Interdomain Routing K. Patel 3 Internet-Draft Arrcus 4 Intended status: Standards Track M. Jethanandani 5 Expires: August 29, 2019 VMware 6 S. Hares 7 Huawei 8 February 25, 2019 10 BGP YANG Model for Service Provider Networks 11 draft-ietf-idr-bgp-model-04 13 Abstract 15 This document defines a YANG data model for configuring and managing 16 BGP, including protocol, policy, and operational aspects based on 17 data center, carrier and content provider operational requirements. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on August 29, 2019. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3 55 1.2. Note to RFC Editor . . . . . . . . . . . . . . . . . . . 4 56 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 4 57 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 5 58 2.2. Policy configuration overview . . . . . . . . . . . . . . 7 59 2.3. BGP RIB overview . . . . . . . . . . . . . . . . . . . . 8 60 2.3.1. Local Routing . . . . . . . . . . . . . . . . . . . . 20 61 2.3.2. Pre updates per-neighbor . . . . . . . . . . . . . . 20 62 2.3.3. Post updates per-neighbor . . . . . . . . . . . . . . 20 63 2.3.4. Pre route advertisements per-neighbor . . . . . . . . 20 64 2.3.5. Post route advertisements per-neighbor . . . . . . . 20 65 3. Relation to other YANG data models . . . . . . . . . . . . . 21 66 4. Security Considerations . . . . . . . . . . . . . . . . . . . 21 67 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 68 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 21 69 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 22 70 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 23 71 7. Structure of the YANG modules . . . . . . . . . . . . . . . . 23 72 7.1. Main module and submodules for base items . . . . . . . . 23 73 7.2. BGP types . . . . . . . . . . . . . . . . . . . . . . . . 60 74 7.3. BGP policy data . . . . . . . . . . . . . . . . . . . . . 70 75 7.4. RIB modules . . . . . . . . . . . . . . . . . . . . . . . 81 76 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 132 77 8.1. Creating BGP Instance . . . . . . . . . . . . . . . . . . 132 78 8.2. Neighbor Address Family Configuration . . . . . . . . . . 133 79 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 135 80 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 135 81 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 135 82 11.1. Normative references . . . . . . . . . . . . . . . . . . 135 83 11.2. Informative references . . . . . . . . . . . . . . . . . 137 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 137 86 1. Introduction 88 This document describes a YANG [RFC7950] data model for the BGP 89 [RFC4271] protocol, including various protocol extensions, policy 90 configuration, as well as defining key operational state data, 91 including Routing Information Base (RIB). The model is intended to 92 be vendor-neutral, in order to allow operators to manage BGP 93 configuration in heterogeneous environments with routers supplied by 94 multiple vendors. The model is also intended to be readily mapped to 95 existing implementations to facilitate support from as large a set of 96 routing hardware and software vendors as possible. 98 1.1. Goals and approach 100 The model covers the base BGP features that are deployed across major 101 implementations and the common BGP configurations in use across a 102 number of operator network deployments. In particular, this model 103 attempts to cover BGP features defined in BGP [RFC4271], BGP 104 Communities Attribute [RFC1997], BGP Route Reflection [RFC4456], 105 Multiprotocol Extensions for BGP-4 [RFC4760], Autonomous System 106 Confederations for BGP [RFC5065], BGP Route Flap Damping [RFC2439], 107 Graceful Restart Mechanism for BGP [RFC4724], and BGP Prefix Origin 108 Validation [RFC6811]. 110 Along with configuration of base BGP features, this model also 111 addresses policy configuration, by providing "hooks" for applying 112 policies, and also defining BGP-specific policy features. The BGP 113 policy features are intended to be used with the general routing 114 policy model defined in A YANG Data Model for Routing Policy 115 Management [I-D.ietf-rtgwg-policy-model]. The model conforms to the 116 NMDA [RFC8342] architecture. 118 For the base BGP features, the focus of the model described in this 119 document is on providing configuration and operational state 120 information relating to: 122 o The global BGP instance, and neighbors whose configuration is 123 specified individually, or templated with the use of peer-groups. 125 o The address families that are supported by peers, and the global 126 configuration which relates to them. 128 o The policy configuration "hooks" and BGP-specific policy features 129 that relate to a neighbor - controlling the import and export of 130 NLRIs. 132 o RIB contents. 134 As mentioned earlier, any configuration items that are deemed to be 135 widely available in existing major BGP implementations are included 136 in the model. Additional, more esoteric, configuration items that 137 are not commonly used, or only available from a single 138 implementation, are omitted from the model with an expectation that 139 they will be available in companion modules that augment or extend 140 the current model. This allows clarity in identifying data that is 141 part of the vendor-neutral base model. 143 Where possible, naming in the model follows conventions used in 144 available standards documents, and otherwise tries to be self- 145 explanatory with sufficient descriptions of the intended behavior. 146 Similarly, configuration data value constraints and default values, 147 where used, are based on recommendations in current standards 148 documentation, or those commonly used in multiple implementations. 149 Since implementations can vary widely in this respect, this version 150 of the model specifies only a limited set of defaults and ranges with 151 the expectation of being more prescriptive in future versions based 152 on actual operator use. 154 1.2. Note to RFC Editor 156 This document uses several placeholder values throughout the 157 document. Please replace them as follows and remove this note before 158 publication. 160 RFC XXXX, where XXXX is the number assigned to this document at the 161 time of publication. 163 2019-02-25 with the actual date of the publication of this document. 165 RFC ZZZZ, where ZZZZ is the number assigned to A YANG Data Model for 166 Routing Policy Management [I-D.ietf-rtgwg-policy-model]. 168 2. Model overview 170 The BGP model is defined across several YANG modules and submodules, 171 but at a high level is organized into six elements: 173 o base protocol configuration -- configuration affecting BGP 174 protocol-related operations, defined at various levels of 175 hierarchy. 177 o multiprotocol configuration -- configuration affecting individual 178 address-families within BGP Multiprotocol Extensions for BGP-4 179 [RFC4760]. 181 o neighbor configuration -- configuration affecting an individual 182 neighbor within BGP. 184 o neighbor multiprotocol configuration -- configuration affecting 185 individual address-families for a neighbor within BGP. 187 o policy configuration -- hooks for application of the policies 188 defined in A YANG Data Model for Routing Policy Management 189 [I-D.ietf-rtgwg-policy-model] that act on routes sent (received) 190 to (from) peers or other routing protocols and BGP-specific policy 191 features. 193 o operational state -- variables used for monitoring and management 194 of BGP operations. 196 These modules also make use of standard Internet types, such as IP 197 addresses and prefixes, autonomous system numbers, etc., defined in 198 Common YANG Data Types [RFC6991]. 200 2.1. BGP protocol configuration 202 The BGP protocol configuration model is organized hierarchically, 203 much like the majority of router implementations. That is, 204 configuration items can be specified at multiple levels, as shown 205 below. 207 +--rw bgp 208 +--rw global! 209 | +-- (global-configuration-options) 210 +--rw neighbors 211 | +--rw neighbor* [neighbor-address] 212 | +-- (neighbor-configuration-options) 213 +--rw peer-groups 214 +--rw peer-group* [peer-group-name] 215 +-- (neighbor-configuration-options) 217 Users may specify configuration at a higher level and have it apply 218 to all lower-level items, or provide overriding configuration at a 219 lower level of the hierarchy. Overriding configuration items are 220 optional, with neighbor specific configuration being the most 221 specific or lowest level, followed by peer-group, and finally global. 222 Global configuration options reflect a subset of the peer-group or 223 neighbor specific configuration options which are relevant to the 224 entire BGP instance. 226 The model makes the simplifying assumption that most of the 227 configuration items are available at all levels of the hierarchy. 228 That is, very little configuration is specific to a particular level 229 in the hierarchy, other than obvious items such as "group-name" only 230 being available for the peer group-level config. A notable exception 231 is for sub-address family configuration where some items are only 232 applicable for a given AFI-SAFI combination. 234 In order to allow common configuration to be applied to a set of 235 neighbors, all neighbor configuration options are available within a 236 peer-group. A neighbor is associated to a particular peer-group 237 through the use of a peer-group leaf (which provides a reference to a 238 configured item in the peer-group list). 240 Address-family configuration is made available in multiple points 241 within the model - primarily within the global container, where 242 instance-wide configuration can be set (for example, global protocol 243 parameters, the BGP best path route selection options, or global 244 policies relating to the address-family); and on a per-neighbor or 245 per-peer-group basis, where address-families can be enabled or 246 disabled, and policy associated with the parent entity applied. 247 Within the afi-safi container, generic configuration that applies to 248 all address-families (e.g., whether the AFI-SAFI is enabled) is 249 presented at the top-level, with address-family specific containers 250 made available for options relating to only that AFI-SAFI. Within 251 the current revision of the model a generic set of address-families, 252 and common configuration and state options are included - further 253 work is expected to add additional parameters to this area of the 254 model. 256 The following address-families are currently supported by the model: 258 +--rw bgp 259 +--rw global! 260 +--rw afi-safis 261 +--rw afi-safi* [afi-safi-name] 262 +--rw afi-safi-name identityref 263 | 264 +--rw ipv4-unicast 265 | ... 266 +--rw ipv6-unicast 267 | ... 268 +--rw ipv4-labeled-unicast 269 | ... 270 +--rw ipv6-labeled-unicast 271 | ... 272 +--rw l3vpn-ipv4-unicast 273 | ... 274 +--rw l3vpn-ipv6-unicast 275 | ... 276 +--rw l3vpn-ipv4-multicast 277 | ... 278 +--rw l3vpn-ipv6-multicast 279 | ... 280 +--rw l2vpn-vpls 281 | ... 282 +--rw l2vpn-evpn 283 | ... 285 2.2. Policy configuration overview 287 The BGP policy configuration model augments the generic YANG routing 288 policy model described in A YANG Data Model for Routing Policy 289 Management [I-D.ietf-rtgwg-policy-model], which represents a 290 condition-action policy framework for routing. This model adds BGP- 291 specific conditions (e.g., matching on the community attribute), and 292 actions (e.g., setting local preference) to the generic policy 293 framework. 295 Policies that are defined in the routing-policy model are referenced 296 in multiple places within the model: 298 o within the global instance, where a policy applies to all address- 299 families for all peers. 301 o on a global AFI-SAFI basis, where policies apply to all peers for 302 a particular address-family. 304 o on a per-peer-group or per-neighbor basis - where the policy 305 applies to all address-families for the particular group or 306 neighbor. 308 o on a per-afi-safi basis within a neighbor or peer-group context, 309 where the policy is specific to the AFI-SAFI for a a specific 310 neighbor or group. 312 +--rw bgp 313 +--rw global! 314 | +--rw afi-safis 315 | +--rw afi-safi 316 | | +--rw afi-safi* [afi-safi-name] 317 | | +--rw apply-policy 318 | +--rw apply-policy 319 +--rw neighbors 320 | +--rw neighbor* [neighbor-address] 321 | +--rw afi-safi 322 | | +--rw afi-safi* [afi-safi-name] 323 | | +--rw apply-policy 324 | +--rw apply-policy 325 +--rw peer-groups 326 +--rw peer-group* [peer-group-name] 327 +--rw afi-safi 328 | +--rw afi-safi* [afi-safi-name] 329 | +--rw apply-policy 330 +--rw apply-policy 332 2.3. BGP RIB overview 334 The RIB data model represents the BGP RIB contents. The model 335 supports five logical RIBs per address family. 337 A version of the tree showing the five logical RIBs is shown below. 339 module: ietf-bgp-rib 340 augment /rt:routing/rt:ribs: 341 +--ro rib 342 +--ro attr-sets 343 | +--ro attr-set* [index] 344 | +--ro index uint64 345 | +--ro origin? bgpt:bgp-origin-attr-type 346 | +--ro atomic-aggregate? boolean 347 | +--ro next-hop? inet:ip-address 348 | +--ro med? uint32 349 | +--ro local-pref? uint32 350 | +--ro originator-id? inet:ipv4-address 351 | +--ro cluster-list* inet:ipv4-address 352 | +--ro aigp? uint64 353 | +--ro aggregator 354 | | +--ro as? inet:as-number 355 | | +--ro as4? inet:as-number 356 | | +--ro address? inet:ipv4-address 357 | +--ro as-path 358 | | +--ro segment* [type] 359 | | +--ro type identityref 360 | | +--ro member* inet:as-number 361 | +--ro as4-path 362 | | +--ro segment* [type] 363 | | +--ro type identityref 364 | | +--ro member* inet:as-number 365 | +--ro tunnel-encapsulation 366 | +--ro tunnels 367 | +--ro tunnel* [type] 368 | +--ro type identityref 369 | +--ro subtlvs 370 | +--ro subtlv* [type] 371 | +--ro type identityref 372 | +--ro colors* uint32 373 | +--ro preference? uint32 374 | +--ro binding-sid? string 375 | +--ro remote-endpoints 376 | | +--ro remote-endpoint* [endpoint] 377 | | +--ro as? inet:as-number 378 | | +--ro endpoint inet:ip-address 379 | +--ro segment-lists 380 | +--ro segment-list* [instance-id] 381 | +--ro instance-id uint64 382 | +--ro weight? uint32 383 | +--ro segments 384 | +--ro segment* [index] 385 | +--ro index 386 | | uint64 387 | +--ro type? 388 | | enumeration 389 | +--ro sid? 390 | | string 391 | +--ro mpls-tc? 392 | | uint8 393 | +--ro mpls-bos? 394 | | boolean 395 | +--ro mpls-ttl? 396 | | uint8 397 | +--ro remote-ipv4-address? 398 | | inet:ipv4-address 399 | +--ro local-ipv4-address? 400 | | inet:ipv4-address 401 | +--ro remote-ipv6-address? 402 | | inet:ipv6-address 403 | +--ro local-ipv6-address? 404 | | inet:ipv6-address 405 | +--ro local-interface-id? 406 | uint32 407 +--ro communities 408 | +--ro community* [index] 409 | +--ro index uint64 410 | +--ro community* union 411 +--ro ext-communities 412 | +--ro ext-community* [index] 413 | +--ro index uint64 414 | +--ro ext-community* bgpt:bgp-ext-community-type 415 +--ro afi-safis 416 +--ro afi-safi* [afi-safi-name] 417 +--ro afi-safi-name identityref 418 +--ro ipv4-unicast 419 | +--ro loc-rib 420 | | +--ro routes 421 | | +--ro route* [prefix origin path-id] 422 | | +--ro prefix 423 | | | inet:ipv4-prefix 424 | | +--ro origin union 425 | | +--ro path-id uint32 426 | | +--ro attr-index? leafref 427 | | +--ro community-index? leafref 428 | | +--ro ext-community-index? leafref 429 | | +--ro last-modified? types:timeticks 430 | | +--ro valid-route? boolean 431 | | +--ro invalid-reason? identityref 432 | | +--ro unknown-attributes 433 | | +--ro unknown-attribute* [attr-type] 434 | | +--ro optional? boolean 435 | | +--ro transitive? boolean 436 | | +--ro partial? boolean 437 | | +--ro extended? boolean 438 | | +--ro attr-type uint8 439 | | +--ro attr-len? uint16 440 | | +--ro attr-value? binary 441 | +--ro neighbors 442 | +--ro neighbor* [neighbor-address] 443 | +--ro neighbor-address inet:ip-address 444 | +--ro adj-rib-in-pre 445 | | +--ro routes 446 | | +--ro route* [prefix path-id] 447 | | +--ro prefix 448 | | | inet:ipv4-prefix 449 | | +--ro path-id uint32 450 | | +--ro attr-index? leafref 451 | | +--ro community-index? leafref 452 | | +--ro ext-community-index? leafref 453 | | +--ro last-modified? 454 | | | types:timeticks 455 | | +--ro valid-route? boolean 456 | | +--ro invalid-reason? 457 | | | identityref 458 | | +--ro unknown-attributes 459 | | +--ro unknown-attribute* 460 | | [attr-type] 461 | | +--ro optional? boolean 462 | | +--ro transitive? boolean 463 | | +--ro partial? boolean 464 | | +--ro extended? boolean 465 | | +--ro attr-type uint8 466 | | +--ro attr-len? uint16 467 | | +--ro attr-value? binary 468 | +--ro adj-rib-in-post 469 | | +--ro routes 470 | | +--ro route* [prefix path-id] 471 | | +--ro prefix 472 | | | inet:ipv4-prefix 473 | | +--ro path-id uint32 474 | | +--ro attr-index? leafref 475 | | +--ro community-index? leafref 476 | | +--ro ext-community-index? leafref 477 | | +--ro last-modified? 478 | | | types:timeticks 479 | | +--ro valid-route? boolean 480 | | +--ro invalid-reason? 481 | | | identityref 482 | | +--ro best-path? boolean 483 | | +--ro unknown-attributes 484 | | +--ro unknown-attribute* 485 | | [attr-type] 486 | | +--ro optional? boolean 487 | | +--ro transitive? boolean 488 | | +--ro partial? boolean 489 | | +--ro extended? boolean 490 | | +--ro attr-type uint8 491 | | +--ro attr-len? uint16 492 | | +--ro attr-value? binary 493 | +--ro adj-rib-out-pre 494 | | +--ro routes 495 | | +--ro route* [prefix path-id] 496 | | +--ro prefix 497 | | | inet:ipv4-prefix 498 | | +--ro path-id uint32 499 | | +--ro attr-index? leafref 500 | | +--ro community-index? leafref 501 | | +--ro ext-community-index? leafref 502 | | +--ro last-modified? 503 | | | types:timeticks 504 | | +--ro valid-route? boolean 505 | | +--ro invalid-reason? 506 | | | identityref 507 | | +--ro unknown-attributes 508 | | +--ro unknown-attribute* 509 | | [attr-type] 510 | | +--ro optional? boolean 511 | | +--ro transitive? boolean 512 | | +--ro partial? boolean 513 | | +--ro extended? boolean 514 | | +--ro attr-type uint8 515 | | +--ro attr-len? uint16 516 | | +--ro attr-value? binary 517 | +--ro adj-rib-out-post 518 | +--ro routes 519 | +--ro route* [prefix path-id] 520 | +--ro prefix 521 | | inet:ipv4-prefix 522 | +--ro path-id uint32 523 | +--ro attr-index? leafref 524 | +--ro community-index? leafref 525 | +--ro ext-community-index? leafref 526 | +--ro last-modified? 527 | | types:timeticks 528 | +--ro valid-route? boolean 529 | +--ro invalid-reason? 530 | | identityref 531 | +--ro unknown-attributes 532 | +--ro unknown-attribute* 533 | [attr-type] 534 | +--ro optional? boolean 535 | +--ro transitive? boolean 536 | +--ro partial? boolean 537 | +--ro extended? boolean 538 | +--ro attr-type uint8 539 | +--ro attr-len? uint16 540 | +--ro attr-value? binary 541 +--ro ipv6-unicast 542 | +--ro loc-rib 543 | | +--ro routes 544 | | +--ro route* [prefix origin path-id] 545 | | +--ro prefix 546 | | | inet:ipv6-prefix 547 | | +--ro origin union 548 | | +--ro path-id uint32 549 | | +--ro attr-index? leafref 550 | | +--ro community-index? leafref 551 | | +--ro ext-community-index? leafref 552 | | +--ro last-modified? types:timeticks 553 | | +--ro valid-route? boolean 554 | | +--ro invalid-reason? identityref 555 | | +--ro unknown-attributes 556 | | +--ro unknown-attribute* [attr-type] 557 | | +--ro optional? boolean 558 | | +--ro transitive? boolean 559 | | +--ro partial? boolean 560 | | +--ro extended? boolean 561 | | +--ro attr-type uint8 562 | | +--ro attr-len? uint16 563 | | +--ro attr-value? binary 564 | +--ro neighbors 565 | +--ro neighbor* [neighbor-address] 566 | +--ro neighbor-address inet:ip-address 567 | +--ro adj-rib-in-pre 568 | | +--ro routes 569 | | +--ro route* [prefix path-id] 570 | | +--ro prefix 571 | | | inet:ipv6-prefix 572 | | +--ro path-id uint32 573 | | +--ro attr-index? leafref 574 | | +--ro community-index? leafref 575 | | +--ro ext-community-index? leafref 576 | | +--ro last-modified? 577 | | | types:timeticks 578 | | +--ro valid-route? boolean 579 | | +--ro invalid-reason? 580 | | | identityref 581 | | +--ro unknown-attributes 582 | | +--ro unknown-attribute* 583 | | [attr-type] 584 | | +--ro optional? boolean 585 | | +--ro transitive? boolean 586 | | +--ro partial? boolean 587 | | +--ro extended? boolean 588 | | +--ro attr-type uint8 589 | | +--ro attr-len? uint16 590 | | +--ro attr-value? binary 591 | +--ro adj-rib-in-post 592 | | +--ro routes 593 | | +--ro route* [prefix path-id] 594 | | +--ro prefix 595 | | | inet:ipv6-prefix 596 | | +--ro path-id uint32 597 | | +--ro attr-index? leafref 598 | | +--ro community-index? leafref 599 | | +--ro ext-community-index? leafref 600 | | +--ro last-modified? 601 | | | types:timeticks 602 | | +--ro valid-route? boolean 603 | | +--ro invalid-reason? 604 | | | identityref 605 | | +--ro best-path? boolean 606 | | +--ro unknown-attributes 607 | | +--ro unknown-attribute* 608 | | [attr-type] 609 | | +--ro optional? boolean 610 | | +--ro transitive? boolean 611 | | +--ro partial? boolean 612 | | +--ro extended? boolean 613 | | +--ro attr-type uint8 614 | | +--ro attr-len? uint16 615 | | +--ro attr-value? binary 616 | +--ro adj-rib-out-pre 617 | | +--ro routes 618 | | +--ro route* [prefix path-id] 619 | | +--ro prefix 620 | | | inet:ipv6-prefix 621 | | +--ro path-id uint32 622 | | +--ro attr-index? leafref 623 | | +--ro community-index? leafref 624 | | +--ro ext-community-index? leafref 625 | | +--ro last-modified? 626 | | | types:timeticks 627 | | +--ro valid-route? boolean 628 | | +--ro invalid-reason? 629 | | | identityref 630 | | +--ro unknown-attributes 631 | | +--ro unknown-attribute* 632 | | [attr-type] 633 | | +--ro optional? boolean 634 | | +--ro transitive? boolean 635 | | +--ro partial? boolean 636 | | +--ro extended? boolean 637 | | +--ro attr-type uint8 638 | | +--ro attr-len? uint16 639 | | +--ro attr-value? binary 640 | +--ro adj-rib-out-post 641 | +--ro routes 642 | +--ro route* [prefix path-id] 643 | +--ro prefix 644 | | inet:ipv6-prefix 645 | +--ro path-id uint32 646 | +--ro attr-index? leafref 647 | +--ro community-index? leafref 648 | +--ro ext-community-index? leafref 649 | +--ro last-modified? 650 | | types:timeticks 651 | +--ro valid-route? boolean 652 | +--ro invalid-reason? 653 | | identityref 654 | +--ro unknown-attributes 655 | +--ro unknown-attribute* 656 | [attr-type] 657 | +--ro optional? boolean 658 | +--ro transitive? boolean 659 | +--ro partial? boolean 660 | +--ro extended? boolean 661 | +--ro attr-type uint8 662 | +--ro attr-len? uint16 663 | +--ro attr-value? binary 664 +--ro ipv4-srte-policy 665 | +--ro loc-rib 666 | | +--ro routes 667 | | +--ro route* [path-id endpoint color] 668 | | +--ro path-id uint32 669 | | +--ro endpoint inet:ip-address 670 | | +--ro color uint32 671 | | +--ro attr-index? leafref 672 | | +--ro community-index? leafref 673 | | +--ro ext-community-index? leafref 674 | | +--ro last-modified? types:timeticks 675 | | +--ro valid-route? boolean 676 | | +--ro invalid-reason? identityref 677 | | +--ro unknown-attributes 678 | | +--ro unknown-attribute* [attr-type] 679 | | +--ro optional? boolean 680 | | +--ro transitive? boolean 681 | | +--ro partial? boolean 682 | | +--ro extended? boolean 683 | | +--ro attr-type uint8 684 | | +--ro attr-len? uint16 685 | | +--ro attr-value? binary 686 | +--ro neighbors 687 | +--ro neighbor* [neighbor-address] 688 | +--ro neighbor-address inet:ip-address 689 | +--ro adj-rib-in-pre 690 | | +--ro routes 691 | | +--ro route* [path-id endpoint color] 692 | | +--ro path-id uint32 693 | | +--ro endpoint 694 | | | inet:ip-address 695 | | +--ro color uint32 696 | | +--ro attr-index? leafref 697 | | +--ro community-index? leafref 698 | | +--ro ext-community-index? leafref 699 | | +--ro last-modified? 700 | | | types:timeticks 701 | | +--ro valid-route? boolean 702 | | +--ro invalid-reason? 703 | | | identityref 704 | | +--ro unknown-attributes 705 | | +--ro unknown-attribute* 706 | | [attr-type] 707 | | +--ro optional? boolean 708 | | +--ro transitive? boolean 709 | | +--ro partial? boolean 710 | | +--ro extended? boolean 711 | | +--ro attr-type uint8 712 | | +--ro attr-len? uint16 713 | | +--ro attr-value? binary 714 | +--ro adj-rib-in-post 715 | | +--ro routes 716 | | +--ro route* [path-id endpoint color] 717 | | +--ro path-id uint32 718 | | +--ro endpoint 719 | | | inet:ip-address 720 | | +--ro color uint32 721 | | +--ro attr-index? leafref 722 | | +--ro community-index? leafref 723 | | +--ro ext-community-index? leafref 724 | | +--ro last-modified? 725 | | | types:timeticks 726 | | +--ro valid-route? boolean 727 | | +--ro invalid-reason? 728 | | | identityref 729 | | +--ro best-path? boolean 730 | | +--ro unknown-attributes 731 | | +--ro unknown-attribute* 732 | | [attr-type] 733 | | +--ro optional? boolean 734 | | +--ro transitive? boolean 735 | | +--ro partial? boolean 736 | | +--ro extended? boolean 737 | | +--ro attr-type uint8 738 | | +--ro attr-len? uint16 739 | | +--ro attr-value? binary 740 | +--ro adj-rib-out-pre 741 | | +--ro routes 742 | | +--ro route* [path-id endpoint color] 743 | | +--ro path-id uint32 744 | | +--ro endpoint 745 | | | inet:ip-address 746 | | +--ro color uint32 747 | | +--ro attr-index? leafref 748 | | +--ro community-index? leafref 749 | | +--ro ext-community-index? leafref 750 | | +--ro last-modified? 751 | | | types:timeticks 752 | | +--ro valid-route? boolean 753 | | +--ro invalid-reason? 754 | | | identityref 755 | | +--ro unknown-attributes 756 | | +--ro unknown-attribute* 757 | | [attr-type] 758 | | +--ro optional? boolean 759 | | +--ro transitive? boolean 760 | | +--ro partial? boolean 761 | | +--ro extended? boolean 762 | | +--ro attr-type uint8 763 | | +--ro attr-len? uint16 764 | | +--ro attr-value? binary 765 | +--ro adj-rib-out-post 766 | +--ro routes 767 | +--ro route* [path-id endpoint color] 768 | +--ro path-id uint32 769 | +--ro endpoint 770 | | inet:ip-address 771 | +--ro color uint32 772 | +--ro attr-index? leafref 773 | +--ro community-index? leafref 774 | +--ro ext-community-index? leafref 775 | +--ro last-modified? 776 | | types:timeticks 777 | +--ro valid-route? boolean 778 | +--ro invalid-reason? 779 | | identityref 780 | +--ro unknown-attributes 781 | +--ro unknown-attribute* 782 | [attr-type] 783 | +--ro optional? boolean 784 | +--ro transitive? boolean 785 | +--ro partial? boolean 786 | +--ro extended? boolean 787 | +--ro attr-type uint8 788 | +--ro attr-len? uint16 789 | +--ro attr-value? binary 790 +--ro ipv6-srte-policy 791 +--ro loc-rib 792 | +--ro routes 793 | +--ro route* [path-id endpoint color] 794 | +--ro path-id uint32 795 | +--ro endpoint inet:ip-address 796 | +--ro color uint32 797 | +--ro attr-index? leafref 798 | +--ro community-index? leafref 799 | +--ro ext-community-index? leafref 800 | +--ro last-modified? types:timeticks 801 | +--ro valid-route? boolean 802 | +--ro invalid-reason? identityref 803 | +--ro unknown-attributes 804 | +--ro unknown-attribute* [attr-type] 805 | +--ro optional? boolean 806 | +--ro transitive? boolean 807 | +--ro partial? boolean 808 | +--ro extended? boolean 809 | +--ro attr-type uint8 810 | +--ro attr-len? uint16 811 | +--ro attr-value? binary 812 +--ro neighbors 813 +--ro neighbor* [neighbor-address] 814 +--ro neighbor-address inet:ip-address 815 +--ro adj-rib-in-pre 816 | +--ro routes 817 | +--ro route* [path-id endpoint color] 818 | +--ro path-id uint32 819 | +--ro endpoint 820 | | inet:ip-address 821 | +--ro color uint32 822 | +--ro attr-index? leafref 823 | +--ro community-index? leafref 824 | +--ro ext-community-index? leafref 825 | +--ro last-modified? 826 | | types:timeticks 827 | +--ro valid-route? boolean 828 | +--ro invalid-reason? 829 | | identityref 830 | +--ro unknown-attributes 831 | +--ro unknown-attribute* 832 | [attr-type] 833 | +--ro optional? boolean 834 | +--ro transitive? boolean 835 | +--ro partial? boolean 836 | +--ro extended? boolean 837 | +--ro attr-type uint8 838 | +--ro attr-len? uint16 839 | +--ro attr-value? binary 840 +--ro adj-rib-in-post 841 | +--ro routes 842 | +--ro route* [path-id endpoint color] 843 | +--ro path-id uint32 844 | +--ro endpoint 845 | | inet:ip-address 846 | +--ro color uint32 847 | +--ro attr-index? leafref 848 | +--ro community-index? leafref 849 | +--ro ext-community-index? leafref 850 | +--ro last-modified? 851 | | types:timeticks 852 | +--ro valid-route? boolean 853 | +--ro invalid-reason? 854 | | identityref 855 | +--ro best-path? boolean 856 | +--ro unknown-attributes 857 | +--ro unknown-attribute* 858 | [attr-type] 859 | +--ro optional? boolean 860 | +--ro transitive? boolean 861 | +--ro partial? boolean 862 | +--ro extended? boolean 863 | +--ro attr-type uint8 864 | +--ro attr-len? uint16 865 | +--ro attr-value? binary 866 +--ro adj-rib-out-pre 867 | +--ro routes 868 | +--ro route* [path-id endpoint color] 869 | +--ro path-id uint32 870 | +--ro endpoint 871 | | inet:ip-address 872 | +--ro color uint32 873 | +--ro attr-index? leafref 874 | +--ro community-index? leafref 875 | +--ro ext-community-index? leafref 876 | +--ro last-modified? 877 | | types:timeticks 878 | +--ro valid-route? boolean 879 | +--ro invalid-reason? 880 | | identityref 881 | +--ro unknown-attributes 882 | +--ro unknown-attribute* 883 | [attr-type] 884 | +--ro optional? boolean 885 | +--ro transitive? boolean 886 | +--ro partial? boolean 887 | +--ro extended? boolean 888 | +--ro attr-type uint8 889 | +--ro attr-len? uint16 890 | +--ro attr-value? binary 891 +--ro adj-rib-out-post 892 +--ro routes 893 +--ro route* [path-id endpoint color] 894 +--ro path-id uint32 895 +--ro endpoint 896 | inet:ip-address 897 +--ro color uint32 898 +--ro attr-index? leafref 899 +--ro community-index? leafref 900 +--ro ext-community-index? leafref 901 +--ro last-modified? 902 | types:timeticks 903 +--ro valid-route? boolean 904 +--ro invalid-reason? 905 | identityref 906 +--ro unknown-attributes 907 +--ro unknown-attribute* 908 [attr-type] 909 +--ro optional? boolean 910 +--ro transitive? boolean 911 +--ro partial? boolean 912 +--ro extended? boolean 913 +--ro attr-type uint8 914 +--ro attr-len? uint16 915 +--ro attr-value? binary 917 2.3.1. Local Routing 919 The loc-rib is the main BGP routing table for the local routing 920 instance, containing best-path selections for each prefix. The loc- 921 rib table may contain multiple routes for a given prefix, with an 922 attribute to indicate which was selected as the best path. Note that 923 multiple paths may be used or advertised even if only one path is 924 marked as best, e.g., when using BGP add-paths. An implementation 925 may choose to mark multiple paths in the RIB as best path by setting 926 the flag to true for multiple entries. 928 2.3.2. Pre updates per-neighbor 930 The adj-rib-in-pre table is a per-neighbor table containing the NLRI 931 updates received from the neighbor before any local input policy 932 rules or filters have been applied. This can be considered the 'raw' 933 updates from a given neighbor. 935 2.3.3. Post updates per-neighbor 937 The adj-rib-in-post table is a per-neighbor table containing the 938 routes received from the neighbor that are eligible for best-path 939 selection after local input policy rules have been applied. 941 2.3.4. Pre route advertisements per-neighbor 943 The adj-rib-out-pre table is a per-neighbor table containing routes 944 eligible for sending (advertising) to the neighbor before output 945 policy rules have been applied. 947 2.3.5. Post route advertisements per-neighbor 949 The adj-rib-out-post table is a per-neighbor table containing routes 950 eligible for sending (advertising) to the neighbor after output 951 policy rules have been applied 953 3. Relation to other YANG data models 955 The BGP model augments the Routing Management model A YANG Data Model 956 for Routing Management [RFC8349] which defines the notion of routing, 957 routing protocols, routing instances, or VRFs, and RIBs. 959 4. Security Considerations 961 The YANG module specified in this document defines a schema for data 962 that is designed to be accessed via network management protocols such 963 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 964 is the secure transport layer, and the mandatory-to-implement secure 965 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 966 is HTTPS, and the mandatory-to-implement secure transport is TLS 967 [RFC8446]. The NETCONF Access Control Model (NACM) [RFC8341] 968 provides the means to restrict access for particular NETCONF or 969 RESTCONF users to a preconfigured subset of all available NETCONF or 970 RESTCONF protocol operations and content. 972 There are a number of data nodes defined in this YANG module that are 973 writable/creatable/deletable (i.e., config true, which is the 974 default). These data nodes may be considered sensitive or vulnerable 975 in some network environments. Write operations (e.g., edit-config) 976 to these data nodes without proper protection can have a negative 977 effect on network operations. These are the subtrees and data nodes 978 and their sensitivity/vulnerability: 980 Some of the readable data nodes in this YANG module may be considered 981 sensitive or vulnerable in some network environments. It is thus 982 important to control read access (e.g., via get, get-config, or 983 notification) to these data nodes. These are the subtrees and data 984 nodes and their sensitivity/vulnerability: 986 Some of the RPC operations in this YANG module may be considered 987 sensitive or vulnerable in some network environments. It is thus 988 important to control access to these operations. These are the 989 operations and their sensitivity/vulnerability: 991 5. IANA Considerations 993 This document registers six URIs and six YANG modules. 995 5.1. URI Registration 997 in the IETF XML registry [RFC3688] [RFC3688]. Following the format 998 in RFC 3688, the following registration is requested to be made: 1000 URI: urn:ietf:params:xml:ns:yang:ietf-bgp 1001 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 1002 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-types 1003 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib 1004 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext 1005 URI: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types 1007 Registrant Contact: The IESG. XML: N/A, the requested URI is an XML 1008 namespace. 1010 5.2. YANG Module Name Registration 1012 This document registers three YANG module in the YANG Module Names 1013 registry YANG [RFC6020]. 1015 name: ietf-bgp 1016 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp 1017 prefix: bgp 1018 reference: RFC XXXX 1020 name: ietf-bgp-policy 1021 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-policy 1022 prefix: bp 1023 reference: RFC XXXX 1025 name: ietf-bgp-types 1026 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-types 1027 prefix: bt 1028 reference: RFC XXXX 1030 name: ietf-bgp-rib 1031 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib 1032 prefix: br 1033 reference: RFC XXXX 1035 name: ietf-bgp-rib-ext 1036 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext 1037 prefix: bre 1038 reference: RFC XXXX 1040 name: ietf-bgp-rib-types 1041 namespace: urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types 1042 prefix: brt 1043 reference: RFC XXXX 1045 6. YANG modules 1047 The modules comprising the BGP configuration and operational model 1048 are described by the YANG modules and submodules in the sections 1049 below. 1051 The main module, ietf-bgp.yang, includes the following submodules: 1053 o ietf-bgp-common - defines the groupings that are common across 1054 more than one context (where contexts are neighbor, group, global) 1056 o ietf-bgp-common-multiprotocol - defines the groupings that are 1057 common across more than one context, and relate to multiprotocol 1058 BGP 1060 o ietf-bgp-common-structure - defines groupings that are shared by 1061 multiple contexts, but are used only to create structural 1062 elements, i.e., containers (leaf nodes are defined in separate 1063 groupings) 1065 o ietf-bgp-global - groupings with data specific to the global 1066 context 1068 o ietf-bgp-peer-group - groupings with data specific to the peer 1069 group context 1071 o ietf-bgp-neighbor - groupings with data specific to the neighbor 1072 context 1074 Additional modules include: 1076 o ietf-bgp-types - common type and identity definitions for BGP, 1077 including BGP policy 1079 o ietf-bgp-policy - BGP-specific policy data definitions for use 1080 with [I-D.ietf-rtgwg-policy-model] (described in more detail 1081 Section 2.2) 1083 7. Structure of the YANG modules 1085 The YANG model can be subdivided between the main module for base 1086 items, types, policy data, and the RIB module. 1088 7.1. Main module and submodules for base items 1090 file "ietf-bgp-common@2019-02-25.yang" 1091 submodule ietf-bgp-common { 1092 yang-version "1.1"; 1093 belongs-to ietf-bgp { 1094 prefix "bgp"; 1095 } 1097 import ietf-bgp-types { 1098 prefix bt; 1099 } 1100 import ietf-inet-types { 1101 prefix inet; 1102 } 1104 organization 1105 "IETF IDR Working Group"; 1107 contact 1108 "WG Web: 1109 WG List: 1111 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 1112 Keyur Patel (keyur at arrcus.com), 1113 Susan Hares (shares at ndzh.com"; 1115 description 1116 "This sub-module contains common groupings that are common across 1117 multiple contexts within the BGP module. That is to say that 1118 they may be application to a subset of global, peer-group or 1119 neighbor contexts."; 1121 revision "2019-02-25" { 1122 description 1123 "Initial Version"; 1124 reference 1125 "RFC XXXX, BGP Model for Service Provider Network."; 1126 } 1128 grouping neighbor-group-timers-config { 1129 description 1130 "Config parameters related to timers associated with the BGP 1131 peer"; 1133 leaf connect-retry { 1134 type decimal64 { 1135 fraction-digits 2; 1136 } 1137 default 30; 1138 description 1139 "Time interval in seconds between attempts to establish a 1140 session with the peer."; 1142 } 1144 leaf hold-time { 1145 type decimal64 { 1146 fraction-digits 2; 1147 } 1148 default 90; 1149 description 1150 "Time interval in seconds that a BGP session will be 1151 considered active in the absence of keepalive or other 1152 messages from the peer. The hold-time is typically set to 1153 3x the keepalive-interval."; 1154 reference 1155 "RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; 1156 } 1158 leaf keepalive-interval { 1159 type decimal64 { 1160 fraction-digits 2; 1161 } 1162 default 30; 1163 description 1164 "Time interval in seconds between transmission of keepalive 1165 messages to the neighbor. Typically set to 1/3 the 1166 hold-time."; 1167 } 1169 leaf minimum-advertisement-interval { 1170 type decimal64 { 1171 fraction-digits 2; 1172 } 1173 default 30; 1174 description 1175 "Minimum time which must elapse between subsequent UPDATE 1176 messages relating to a common set of NLRI being transmitted 1177 to a peer. This timer is referred to as 1178 MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to 1179 reduce the number of UPDATE messages transmitted when a 1180 particular set of NLRI exhibit instability."; 1181 reference 1182 "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; 1183 } 1184 } 1186 grouping neighbor-group-config { 1187 description 1188 "Neighbor level configuration items."; 1190 leaf peer-as { 1191 type inet:as-number; 1192 description 1193 "AS number of the peer."; 1194 } 1196 leaf local-as { 1197 type inet:as-number; 1198 description 1199 "The local autonomous system number that is to be used when 1200 establishing sessions with the remote peer or peer group, if 1201 this differs from the global BGP router autonomous system 1202 number."; 1203 } 1205 leaf peer-type { 1206 type bt:peer-type; 1207 description 1208 "Explicitly designate the peer or peer group as internal 1209 (iBGP) or external (eBGP)."; 1210 } 1212 leaf auth-password { 1213 type string; 1214 description 1215 "Configures an MD5 authentication password for use with 1216 neighboring devices."; 1217 } 1219 leaf remove-private-as { 1220 // could also make this a container with a flag to enable 1221 // remove-private and separate option. here, option implies 1222 // remove-private is enabled. 1223 type bt:remove-private-as-option; 1224 description 1225 "Remove private AS numbers from updates sent to peers - when 1226 this leaf is not specified, the AS_PATH attribute should be 1227 sent to the peer unchanged"; 1228 } 1230 leaf route-flap-damping { 1231 type boolean; 1232 default false; 1233 description 1234 "Enable route flap damping."; 1235 } 1237 leaf send-community { 1238 type bt:community-type; 1239 default "NONE"; 1240 description 1241 "Specify which types of community should be sent to the 1242 neighbor or group. The default is to not send the community 1243 attribute"; 1244 } 1246 leaf description { 1247 type string; 1248 description 1249 "An optional textual description (intended primarily for use 1250 with a peer or group"; 1251 } 1252 } 1254 grouping neighbor-group-transport-config { 1255 description 1256 "Configuration parameters relating to the transport protocol 1257 used by the BGP session to the peer"; 1259 leaf tcp-mss { 1260 type uint16; 1261 description 1262 "Sets the max segment size for BGP TCP sessions."; 1263 } 1265 leaf mtu-discovery { 1266 type boolean; 1267 default false; 1268 description 1269 "Turns path mtu discovery for BGP TCP sessions on (true) or 1270 off (false)"; 1271 } 1273 leaf passive-mode { 1274 type boolean; 1275 default false; 1276 description 1277 "Wait for peers to issue requests to open a BGP session, 1278 rather than initiating sessions from the local router."; 1279 } 1281 leaf local-address { 1282 type union { 1283 type inet:ip-address; 1284 type string; 1285 } 1286 //TODO: the string should be converted to a leafref type 1287 //to point to an interface when YANG 1.1 is available with 1288 //leafrefs in union types. 1289 description 1290 "Set the local IP (either IPv4 or IPv6) address to use for 1291 the session when sending BGP update messages. This may be 1292 expressed as either an IP address or reference to the name 1293 of an interface."; 1294 } 1295 } 1297 grouping neighbor-group-error-handling-config { 1298 description 1299 "Configuration parameters relating to enhanced error handling 1300 behaviors for BGP"; 1302 leaf treat-as-withdraw { 1303 type boolean; 1304 default "false"; 1305 description 1306 "Specify whether erroneous UPDATE messages for which the NLRI 1307 can be extracted are treated as though the NLRI is withdrawn 1308 - avoiding session reset"; 1309 reference "draft-ietf-idr-error-handling-16"; 1310 } 1311 } 1313 grouping graceful-restart-config { 1314 description 1315 "Configuration parameters relating to BGP graceful restart."; 1317 leaf enabled { 1318 type boolean; 1319 description 1320 "Enable or disable the graceful-restart capability."; 1321 } 1323 leaf restart-time { 1324 type uint16 { 1325 range 0..4096; 1326 } 1327 description 1328 "Estimated time (in seconds) for the local BGP speaker to 1329 restart a session. This value is advertise in the graceful 1330 restart BGP capability. This is a 12-bit value, referred to 1331 as Restart Time in RFC4724. Per RFC4724, the suggested 1332 default value is <= the hold-time value."; 1333 } 1334 leaf stale-routes-time { 1335 type decimal64 { 1336 fraction-digits 2; 1337 } 1338 description 1339 "An upper-bound on the time that stale routes will be 1340 retained by a router after a session is restarted. If an 1341 End-of-RIB (EOR) marker is received prior to this timer 1342 expiring stale-routes will be flushed upon its receipt - if 1343 no EOR is received, then when this timer expires stale paths 1344 will be purged. This timer is referred to as the 1345 Selection_Deferral_Timer in RFC4724"; 1346 } 1348 leaf helper-only { 1349 type boolean; 1350 description 1351 "Enable graceful-restart in helper mode only. When this leaf 1352 is set, the local system does not retain forwarding its own 1353 state during a restart, but supports procedures for the 1354 receiving speaker, as defined in RFC4724."; 1355 } 1356 } 1358 grouping use-multiple-paths-config { 1359 description 1360 "Generic configuration options relating to use of multiple 1361 paths for a referenced AFI-SAFI, group or neighbor"; 1363 leaf enabled { 1364 type boolean; 1365 default false; 1366 description 1367 "Whether the use of multiple paths for the same NLRI is 1368 enabled for the neighbor. This value is overridden by any 1369 more specific configuration value."; 1370 } 1371 } 1373 grouping use-multiple-paths-ebgp-as-options-config { 1374 description 1375 "Configuration parameters specific to eBGP multi-path applicable 1376 to all contexts"; 1378 leaf allow-multiple-as { 1379 type boolean; 1380 default "false"; 1381 description 1382 "Allow multi-path to use paths from different neighboring ASes. 1383 The default is to only consider multiple paths from the same 1384 neighboring AS."; 1385 } 1386 } 1388 grouping global-group-use-multiple-paths { 1389 description 1390 "Common grouping used for both global and groups which provides 1391 configuration and state parameters relating to use of multiple 1392 paths"; 1394 container use-multiple-paths { 1395 description 1396 "Parameters related to the use of multiple paths for the 1397 same NLRI"; 1399 uses use-multiple-paths-config; 1401 container ebgp { 1402 description 1403 "Multi-Path parameters for eBGP"; 1405 leaf allow-multiple-as { 1406 type boolean; 1407 default "false"; 1408 description 1409 "Allow multi-path to use paths from different neighboring 1410 ASes. The default is to only consider multiple paths 1411 from the same neighboring AS."; 1412 } 1414 leaf maximum-paths { 1415 type uint32; 1416 default 1; 1417 description 1418 "Maximum number of parallel paths to consider when using 1419 BGP multi-path. The default is use a single path."; 1420 } 1421 } 1423 container ibgp { 1424 description 1425 "Multi-Path parameters for iBGP"; 1427 leaf maximum-paths { 1428 type uint32; 1429 default 1; 1430 description 1431 "Maximum number of parallel paths to consider when using 1432 iBGP multi-path. The default is to use a single path"; 1433 } 1434 } 1435 } 1436 } 1438 grouping route-selection-options { 1439 description 1440 "Configuration and state relating to route selection options"; 1442 container route-selection-options { 1443 description 1444 "Parameters relating to options for route selection"; 1446 leaf always-compare-med { 1447 type boolean; 1448 default "false"; 1449 description 1450 "Compare multi-exit discriminator (MED) value from 1451 different ASes when selecting the best route. The default 1452 behavior is to only compare MEDs for paths received from 1453 the same AS."; 1454 } 1456 leaf ignore-as-path-length { 1457 type boolean; 1458 default "false"; 1459 description 1460 "Ignore the AS path length when selecting the best path. 1461 The default is to use the AS path length and prefer paths 1462 with shorter length."; 1463 } 1465 leaf external-compare-router-id { 1466 type boolean; 1467 default "true"; 1468 description 1469 "When comparing similar routes received from external BGP 1470 peers, use the router-id as a criterion to select the 1471 active path."; 1472 } 1474 leaf advertise-inactive-routes { 1475 type boolean; 1476 default "false"; 1477 description 1478 "Advertise inactive routes to external peers. The default 1479 is to only advertise active routes."; 1480 } 1482 leaf enable-aigp { 1483 type boolean; 1484 default false; 1485 description 1486 "Flag to enable sending / receiving accumulated IGP 1487 attribute in routing updates"; 1488 } 1490 leaf ignore-next-hop-igp-metric { 1491 type boolean; 1492 default "false"; 1493 description 1494 "Ignore the IGP metric to the next-hop when calculating BGP 1495 best-path. The default is to select the route for which 1496 the metric to the next-hop is lowest"; 1497 } 1498 } 1499 } 1501 grouping state { 1502 description 1503 "Grouping containing common counters relating to prefixes and 1504 paths"; 1506 leaf total-paths { 1507 type uint32; 1508 config false; 1509 description 1510 "Total number of BGP paths within the context"; 1511 } 1513 leaf total-prefixes { 1514 type uint32; 1515 config false; 1516 description 1517 "Total number of BGP prefixes received within the context"; 1518 } 1519 } 1520 } 1521 1523 file "ietf-bgp-common-multiprotocol@2019-02-25.yang" 1524 submodule ietf-bgp-common-multiprotocol { 1525 yang-version "1.1"; 1526 belongs-to ietf-bgp { 1527 prefix "bgp"; 1528 } 1530 import ietf-bgp-types { 1531 prefix bt; 1532 } 1533 import ietf-routing-policy { 1534 prefix rpol; 1535 } 1537 include ietf-bgp-common; 1539 // meta 1540 organization 1541 "IETF IDR Working Group"; 1543 contact 1544 "WG Web: 1545 WG List: 1547 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 1548 Keyur Patel (keyur at arrcus.com), 1549 Susan Hares (shares at ndzh.com"; 1551 description 1552 "This sub-module contains groupings that are related to support 1553 for multiple protocols in BGP. The groupings are common across 1554 multiple contexts."; 1556 revision "2019-02-25" { 1557 description 1558 "Initial Version"; 1559 reference 1560 "RFC XXX, BGP Model for Service Provider Network."; 1561 } 1563 grouping mp-afi-safi-graceful-restart-config { 1564 description 1565 "BGP graceful restart parameters that apply on a per-AFI-SAFI 1566 basis"; 1568 leaf enabled { 1569 type boolean; 1570 default false; 1571 description 1572 "This leaf indicates whether graceful-restart is enabled for 1573 this AFI-SAFI"; 1574 } 1575 } 1577 grouping mp-afi-safi-config { 1578 description 1579 "Configuration parameters used for all BGP AFI-SAFIs"; 1581 leaf afi-safi-name { 1582 type identityref { 1583 base "bt:afi-safi-type"; 1584 } 1585 description "AFI,SAFI"; 1586 } 1588 leaf enabled { 1589 type boolean; 1590 default false; 1591 description 1592 "This leaf indicates whether the IPv4 Unicast AFI,SAFI is 1593 enabled for the neighbour or group"; 1594 } 1595 } 1597 grouping mp-all-afi-safi-list-contents { 1598 description 1599 "A common grouping used for contents of the list that is used 1600 for AFI-SAFI entries"; 1602 // import and export policy included for the afi/safi 1603 uses rpol:apply-policy-group; 1605 container ipv4-unicast { 1606 when "../afi-safi-name = 'bt:IPV4_UNICAST'" { 1607 description 1608 "Include this container for IPv4 Unicast specific 1609 configuration"; 1610 } 1612 description 1613 "IPv4 unicast configuration options"; 1615 // include common IPv[46] unicast options 1616 uses mp-ipv4-ipv6-unicast-common; 1618 // placeholder for IPv4 unicast specific configuration 1619 } 1620 container ipv6-unicast { 1621 when "../afi-safi-name = 'bt:IPV6_UNICAST'" { 1622 description 1623 "Include this container for IPv6 Unicast specific 1624 configuration"; 1625 } 1627 description 1628 "IPv6 unicast configuration options"; 1630 // include common IPv[46] unicast options 1631 uses mp-ipv4-ipv6-unicast-common; 1633 // placeholder for IPv6 unicast specific configuration 1634 // options 1635 } 1637 container ipv4-labeled-unicast { 1638 when "../afi-safi-name = 'bt:IPV4_LABELED_UNICAST'" { 1639 description 1640 "Include this container for IPv4 Labeled Unicast specific 1641 configuration"; 1642 } 1644 description 1645 "IPv4 Labeled Unicast configuration options"; 1647 uses mp-all-afi-safi-common; 1649 // placeholder for IPv4 Labeled Unicast specific config 1650 // options 1651 } 1653 container ipv6-labeled-unicast { 1654 when "../afi-safi-name = 'bt:IPV6_LABELED_UNICAST'" { 1655 description 1656 "Include this container for IPv6 Labeled Unicast specific 1657 configuration"; 1658 } 1660 description 1661 "IPv6 Labeled Unicast configuration options"; 1663 uses mp-all-afi-safi-common; 1665 // placeholder for IPv6 Labeled Unicast specific config 1666 // options. 1667 } 1668 container l3vpn-ipv4-unicast { 1669 when "../afi-safi-name = 'bt:L3VPN_IPV4_UNICAST'" { 1670 description 1671 "Include this container for IPv4 Unicast L3VPN specific 1672 configuration"; 1673 } 1675 description 1676 "Unicast IPv4 L3VPN configuration options"; 1678 // include common L3VPN configuration options 1679 uses mp-l3vpn-ipv4-ipv6-unicast-common; 1681 // placeholder for IPv4 Unicast L3VPN specific config options. 1682 } 1684 container l3vpn-ipv6-unicast { 1685 when "../afi-safi-name = 'bt:L3VPN_IPV6_UNICAST'" { 1686 description 1687 "Include this container for unicast IPv6 L3VPN specific 1688 configuration"; 1689 } 1691 description 1692 "Unicast IPv6 L3VPN configuration options"; 1694 // include common L3VPN configuration options 1695 uses mp-l3vpn-ipv4-ipv6-unicast-common; 1697 // placeholder for IPv6 Unicast L3VPN specific configuration 1698 // options 1699 } 1701 container l3vpn-ipv4-multicast { 1702 when "../afi-safi-name = 'bt:L3VPN_IPV4_MULTICAST'" { 1703 description 1704 "Include this container for multicast IPv6 L3VPN specific 1705 configuration"; 1706 } 1708 description 1709 "Multicast IPv4 L3VPN configuration options"; 1711 // include common L3VPN multicast options 1712 uses mp-l3vpn-ipv4-ipv6-multicast-common; 1714 // placeholder for IPv4 Multicast L3VPN specific configuration 1715 // options 1717 } 1719 container l3vpn-ipv6-multicast { 1720 when "../afi-safi-name = 'bt:L3VPN_IPV6_MULTICAST'" { 1721 description 1722 "Include this container for multicast IPv6 L3VPN specific 1723 configuration"; 1724 } 1725 description 1726 "Multicast IPv6 L3VPN configuration options"; 1728 // include common L3VPN multicast options 1729 uses mp-l3vpn-ipv4-ipv6-multicast-common; 1731 // placeholder for IPv6 Multicast L3VPN specific configuration 1732 // options 1733 } 1735 container l2vpn-vpls { 1736 when "../afi-safi-name = 'bt:L2VPN_VPLS'" { 1737 description 1738 "Include this container for BGP-signalled VPLS specific 1739 configuration"; 1740 } 1742 description 1743 "BGP-signalled VPLS configuration options"; 1745 // include common L2VPN options 1746 uses mp-l2vpn-common; 1748 // placeholder for BGP-signalled VPLS specific configuration 1749 // options 1750 } 1752 container l2vpn-evpn { 1753 when "../afi-safi-name = 'bt:L2VPN_EVPN'" { 1754 description 1755 "Include this container for BGP EVPN specific 1756 configuration"; 1757 } 1759 description 1760 "BGP EVPN configuration options"; 1762 // include common L2VPN options 1763 uses mp-l2vpn-common; 1764 // placeholder for BGP EVPN specific configuration options 1765 } 1766 } 1768 // Common groupings across multiple AFI,SAFIs 1769 grouping mp-all-afi-safi-common { 1770 description 1771 "Grouping for configuration common to all AFI,SAFI"; 1773 container prefix-limit { 1774 description 1775 "Parameters relating to the prefix limit for the AFI-SAFI"; 1776 leaf max-prefixes { 1777 type uint32; 1778 description 1779 "Maximum number of prefixes that will be accepted from the 1780 neighbour"; 1781 } 1782 leaf shutdown-threshold-pct { 1783 type bt:percentage; 1784 description 1785 "Threshold on number of prefixes that can be received from 1786 a neighbour before generation of warning messages or log 1787 entries. Expressed as a percentage of max-prefixes"; 1788 } 1790 leaf restart-timer { 1791 type decimal64 { 1792 fraction-digits 2; 1793 } 1794 units "seconds"; 1795 description 1796 "Time interval in seconds after which the BGP session is 1797 re-established after being torn down due to exceeding the 1798 max-prefix limit."; 1799 } 1800 } 1801 } 1803 grouping mp-ipv4-ipv6-unicast-common { 1804 description 1805 "Common configuration that is applicable for IPv4 and IPv6 1806 unicast"; 1808 // include common afi-safi options. 1809 uses mp-all-afi-safi-common; 1811 // configuration options that are specific to IPv[46] unicast 1812 leaf send-default-route { 1813 type boolean; 1814 default "false"; 1815 description 1816 "If set to true, send the default-route to the neighbour(s)"; 1817 } 1818 } 1820 grouping mp-l3vpn-ipv4-ipv6-unicast-common { 1821 description 1822 "Common configuration applied across L3VPN for IPv4 1823 and IPv6"; 1825 // placeholder -- specific configuration options that are generic 1826 // across IPv[46] unicast address families. 1827 uses mp-all-afi-safi-common; 1828 } 1830 grouping mp-l3vpn-ipv4-ipv6-multicast-common { 1831 description 1832 "Common configuration applied across L3VPN for IPv4 1833 and IPv6"; 1835 // placeholder -- specific configuration options that are 1836 // generic across IPv[46] multicast address families. 1837 uses mp-all-afi-safi-common; 1838 } 1840 grouping mp-l2vpn-common { 1841 description 1842 "Common configuration applied across L2VPN address 1843 families"; 1845 // placeholder -- specific configuration options that are 1846 // generic across L2VPN address families 1847 uses mp-all-afi-safi-common; 1848 } 1850 // Config groupings for common groups 1851 grouping mp-all-afi-safi-common-prefix-limit-config { 1852 description 1853 "Configuration parameters relating to prefix-limits for an 1854 AFI-SAFI"; 1856 } 1857 } 1858 1859 file "ietf-bgp-common-structure@2019-02-25.yang" 1860 submodule ietf-bgp-common-structure { 1861 yang-version "1.1"; 1862 belongs-to ietf-bgp { 1863 prefix "bgp"; 1864 } 1866 import ietf-bgp-types { prefix bt; } 1867 import ietf-routing-policy { prefix rpol; } 1868 include ietf-bgp-common-multiprotocol; 1869 include ietf-bgp-common; 1871 // meta 1872 organization 1873 "IETF IDR Working Group"; 1875 contact 1876 "WG Web: 1877 WG List: 1879 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 1880 Keyur Patel (keyur at arrcus.com), 1881 Susan Hares (shares at ndzh.com"; 1883 description 1884 "This sub-module contains groupings that are common across 1885 multiple BGP contexts and provide structure around other 1886 primitive groupings."; 1888 revision "2019-02-25" { 1889 description 1890 "Initial Version"; 1891 reference 1892 "RFC XXX, BGP Model for Service Provider Network."; 1893 } 1895 grouping structure-neighbor-group-logging-options { 1896 description 1897 "Structural grouping used to include error handling 1898 configuration and state for both BGP neighbors and groups"; 1900 container logging-options { 1901 description 1902 "Logging options for events related to the BGP neighbor or 1903 group"; 1905 leaf log-neighbor-state-changes { 1906 type boolean; 1907 default "true"; 1908 description 1909 "Configure logging of peer state changes. Default is to 1910 enable logging of peer state changes."; 1911 } 1912 } 1913 } 1914 grouping structure-neighbor-group-ebgp-multihop { 1915 description 1916 "Structural grouping used to include eBGP multi-hop 1917 configuration and state for both BGP neighbors and peer 1918 groups"; 1920 container ebgp-multihop { 1921 description 1922 "eBGP multi-hop parameters for the BGPgroup"; 1924 leaf enabled { 1925 type boolean; 1926 default "false"; 1927 description 1928 "When enabled the referenced group or neighbors are 1929 permitted to be indirectly connected - including cases 1930 where the TTL can be decremented between the BGP peers"; 1931 } 1933 leaf multihop-ttl { 1934 type uint8; 1935 description 1936 "Time-to-live value to use when packets are sent to the 1937 referenced group or neighbors and ebgp-multihop is 1938 enabled"; 1939 } 1940 } 1941 } 1943 grouping structure-neighbor-group-route-reflector { 1944 description 1945 "Structural grouping used to include route reflector 1946 configuration and state for both BGP neighbors and peer 1947 groups"; 1949 container route-reflector { 1950 description 1951 "Route reflector parameters for the BGPgroup"; 1953 leaf route-reflector-cluster-id { 1954 type bt:rr-cluster-id-type; 1955 description 1956 "route-reflector cluster id to use when local router is 1957 configured as a route reflector. Commonly set at the 1958 group level, but allows a different cluster id to be set 1959 for each neighbor."; 1960 } 1962 leaf route-reflector-client { 1963 type boolean; 1964 default "false"; 1965 description 1966 "Configure the neighbor as a route reflector client."; 1967 } 1968 } 1969 } 1971 grouping structure-neighbor-group-as-path-options { 1972 description 1973 "Structural grouping used to include AS_PATH manipulation 1974 configuration and state for both BGP neighbors and peer 1975 groups"; 1977 container as-path-options { 1978 description 1979 "AS_PATH manipulation parameters for the BGP neighbor or 1980 group"; 1981 leaf allow-own-as { 1982 type uint8; 1983 default 0; 1984 description 1985 "Specify the number of occurrences of the local BGP 1986 speaker's AS that can occur within the AS_PATH before it 1987 is rejected."; 1988 } 1990 leaf replace-peer-as { 1991 type boolean; 1992 default "false"; 1993 description 1994 "Replace occurrences of the peer's AS in the AS_PATH with 1995 the local autonomous system number"; 1996 } 1997 } 1998 } 2000 grouping structure-neighbor-group-add-paths { 2001 description 2002 "Structural grouping used to include ADD-PATHs configuration 2003 and state for both BGP neighbors and peer groups"; 2005 container add-paths { 2006 description 2007 "Parameters relating to the advertisement and receipt of 2008 multiple paths for a single NLRI (add-paths)"; 2010 leaf receive { 2011 type boolean; 2012 default false; 2013 description 2014 "Enable ability to receive multiple path advertisements for 2015 an NLRI from the neighbor or group"; 2016 } 2018 leaf send-max { 2019 type uint8; 2020 description 2021 "The maximum number of paths to advertise to neighbors for 2022 a single NLRI"; 2023 } 2024 leaf eligible-prefix-policy { 2025 type leafref { 2026 path "/rpol:routing-policy/rpol:policy-definitions/" + 2027 "rpol:policy-definition/rpol:name"; 2028 } 2029 description 2030 "A reference to a routing policy which can be used to 2031 restrict the prefixes for which add-paths is enabled"; 2032 } 2033 } 2034 } 2035 } 2036 2038 file "ietf-bgp-peer-group@2019-02-25.yang" 2039 submodule ietf-bgp-peer-group { 2040 yang-version "1.1"; 2041 belongs-to ietf-bgp { 2042 prefix "bgp"; 2043 } 2045 import ietf-routing-policy { 2046 prefix rpol; 2047 } 2048 // Include the common submodule 2049 include ietf-bgp-common; 2050 include ietf-bgp-common-multiprotocol; 2051 include ietf-bgp-common-structure; 2053 // meta 2054 organization 2055 "IETF IDR Working Group"; 2057 contact 2058 "WG Web: 2059 WG List: 2061 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2062 Keyur Patel (keyur at arrcus.com), 2063 Susan Hares (shares at ndzh.com"; 2065 description 2066 "This sub-module contains groupings that are specific to the 2067 peer-group context of the OpenConfig BGP module."; 2069 revision "2019-02-25" { 2070 description 2071 "Initial Version"; 2072 reference 2073 "RFC XXX, BGP Model for Service Provider Network."; 2074 } 2076 grouping bgp-peer-group-config { 2077 description 2078 "Configuration parameters relating to a base BGP peer group 2079 that are not also applicable to any other context (e.g., 2080 neighbor)"; 2082 leaf peer-group-name { 2083 type string; 2084 description 2085 "Name of the BGP peer-group"; 2086 } 2088 } 2090 grouping bgp-peer-group-afi-safi-list { 2091 description 2092 "List of address-families associated with the BGP peer-group"; 2094 list afi-safi { 2095 key "afi-safi-name"; 2096 description 2097 "AFI,SAFI configuration available for the 2098 neighbour or group"; 2100 uses mp-afi-safi-config; 2102 container graceful-restart { 2103 description 2104 "Parameters relating to BGP graceful-restart"; 2106 uses mp-afi-safi-graceful-restart-config; 2107 } 2109 uses route-selection-options; 2110 uses global-group-use-multiple-paths; 2111 uses mp-all-afi-safi-list-contents; 2112 } 2113 } 2115 grouping bgp-peer-group-base { 2116 description 2117 "Parameters related to a BGP group"; 2119 uses bgp-peer-group-config; 2120 uses neighbor-group-config; 2121 uses state; 2123 container timers { 2124 description 2125 "Timers related to a BGP peer-group"; 2127 uses neighbor-group-timers-config; 2128 } 2130 container transport { 2131 description 2132 "Transport session parameters for the BGP peer-group"; 2134 uses neighbor-group-transport-config; 2135 } 2137 container error-handling { 2138 description 2139 "Error handling parameters used for the BGP peer-group"; 2141 uses neighbor-group-error-handling-config; 2142 } 2143 container graceful-restart { 2144 description 2145 "Parameters relating the graceful restart mechanism for BGP"; 2147 uses graceful-restart-config; 2148 } 2150 uses structure-neighbor-group-logging-options; 2151 uses structure-neighbor-group-ebgp-multihop; 2152 uses structure-neighbor-group-route-reflector; 2153 uses structure-neighbor-group-as-path-options; 2154 uses structure-neighbor-group-add-paths; 2155 uses global-group-use-multiple-paths; 2156 uses rpol:apply-policy-group; 2158 container afi-safis { 2159 description 2160 "Per-address-family configuration parameters associated with 2161 thegroup"; 2162 uses bgp-peer-group-afi-safi-list; 2163 } 2164 } 2166 grouping bgp-peer-group-list { 2167 description 2168 "The list of BGP peer groups"; 2170 list peer-group { 2171 key "peer-group-name"; 2172 description 2173 "List of BGP peer-groups configured on the local system - 2174 uniquely identified by peer-group name"; 2176 uses bgp-peer-group-base; 2177 } 2178 } 2179 } 2180 2182 file "ietf-bgp-neighbor@2019-02-25.yang" 2183 submodule ietf-bgp-neighbor { 2184 yang-version "1.1"; 2185 belongs-to ietf-bgp { 2186 prefix "bgp"; 2187 } 2189 import ietf-routing-policy { 2190 prefix rpol; 2191 } 2192 import ietf-bgp-types { 2193 prefix bt; 2194 } 2195 import ietf-inet-types { 2196 prefix inet; 2197 } 2198 import ietf-yang-types { 2199 prefix yang; 2200 } 2202 // Include the common submodule 2203 include ietf-bgp-common; 2204 include ietf-bgp-common-multiprotocol; 2205 include ietf-bgp-peer-group; 2206 include ietf-bgp-common-structure; 2208 // meta 2209 organization 2210 "IETF IDR Working Group"; 2212 contact 2213 "WG Web: 2214 WG List: 2216 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2217 Keyur Patel (keyur at arrcus.com), 2218 Susan Hares (shares at ndzh.com"; 2220 description 2221 "This sub-module contains groupings that are specific to the 2222 neighbor context of the OpenConfig BGP module."; 2224 revision "2019-02-25" { 2225 description 2226 "Initial Version"; 2227 reference 2228 "RFC XXX, BGP Model for Service Provider Network."; 2229 } 2231 grouping bgp-neighbor-use-multiple-paths { 2232 description 2233 "Multi-path configuration and state applicable to a BGP 2234 neighbor"; 2236 container use-multiple-paths { 2237 description 2238 "Parameters related to the use of multiple-paths for the same 2239 NLRI when they are received only from this neighbor"; 2241 uses use-multiple-paths-config; 2243 container ebgp { 2244 description 2245 "Multi-path configuration for eBGP"; 2246 uses use-multiple-paths-ebgp-as-options-config; 2247 } 2248 } 2249 } 2251 grouping bgp-neighbor-counters-message-types-state { 2252 description 2253 "Grouping of BGP message types, included for re-use across 2254 counters"; 2256 leaf UPDATE { 2257 type uint64; 2258 description 2259 "Number of BGP UPDATE messages announcing, withdrawing or 2260 modifying paths exchanged."; 2261 } 2263 leaf NOTIFICATION { 2264 type uint64; 2265 description 2266 "Number of BGP NOTIFICATION messages indicating an error 2267 condition has occurred exchanged."; 2268 } 2269 } 2271 grouping bgp-neighbor-afi-safi-list { 2272 description 2273 "List of address-families associated with the BGP neighbor"; 2275 list afi-safi { 2276 key "afi-safi-name"; 2278 description 2279 "AFI,SAFI configuration available for the neighbour or 2280 group"; 2282 uses mp-afi-safi-config; 2284 leaf active { 2285 type boolean; 2286 config false; 2287 description 2288 "This value indicates whether a particular AFI-SAFI has 2289 been successfully negotiated with the peer. An AFI-SAFI may 2290 be enabled in the current running configuration, but a 2291 session restart may be required in order to negotiate the 2292 new capability."; 2293 } 2295 container prefixes { 2296 config false; 2297 description "Prefix counters for the BGP session"; 2298 leaf received { 2299 type uint32; 2300 description 2301 "The number of prefixes received from the neighbor"; 2302 } 2304 leaf sent { 2305 type uint32; 2306 description 2307 "The number of prefixes advertised to the neighbor"; 2308 } 2310 leaf installed { 2311 type uint32; 2312 description 2313 "The number of advertised prefixes installed in the 2314 Loc-RIB"; 2315 } 2316 } 2318 container graceful-restart { 2319 description 2320 "Parameters relating to BGP graceful-restart"; 2322 uses mp-afi-safi-graceful-restart-config; 2324 leaf received { 2325 type boolean; 2326 config false; 2327 description 2328 "This leaf indicates whether the neighbor advertised the 2329 ability to support graceful-restart for this AFI-SAFI"; 2330 } 2332 leaf advertised { 2333 type boolean; 2334 config false; 2335 description 2336 "This leaf indicates whether the ability to support 2337 graceful-restart has been advertised to the peer"; 2338 } 2339 } 2341 uses mp-all-afi-safi-list-contents; 2342 uses bgp-neighbor-use-multiple-paths; 2343 } 2344 } 2346 grouping bgp-neighbor-base { 2347 description 2348 "Parameters related to a BGP neighbor"; 2350 leaf peer-group { 2351 type leafref { 2352 path "../../../peer-groups/peer-group/peer-group-name"; 2353 } 2354 description 2355 "The peer-group with which this neighbor is associated"; 2356 } 2358 leaf neighbor-address { 2359 type inet:ip-address; 2360 description 2361 "Address of the BGP peer, either in IPv4 or IPv6"; 2362 } 2364 leaf enabled { 2365 type boolean; 2366 default true; 2367 description 2368 "Whether the BGP peer is enabled. In cases where the enabled 2369 leaf is set to false, the local system should not initiate 2370 connections to the neighbor, and should not respond to TCP 2371 connections attempts from the neighbor. If the state of the 2372 BGP session is ESTABLISHED at the time that this leaf is set 2373 to false, the BGP session should be ceased."; 2374 } 2376 uses neighbor-group-config; 2378 leaf session-state { 2379 type enumeration { 2380 enum IDLE { 2381 description 2382 "neighbor is down, and in the Idle state of the FSM"; 2383 } 2384 enum CONNECT { 2385 description 2386 "neighbor is down, and the session is waiting for the 2387 underlying transport session to be established"; 2388 } 2389 enum ACTIVE { 2390 description 2391 "neighbor is down, and the local system is awaiting a 2392 connection from the remote peer"; 2393 } 2394 enum OPENSENT { 2395 description 2396 "neighbor is in the process of being established. The 2397 local system has sent an OPEN message"; 2398 } 2399 enum OPENCONFIRM { 2400 description 2401 "neighbor is in the process of being established. The 2402 local system is awaiting a NOTIFICATION or KEEPALIVE 2403 message"; 2404 } 2405 enum ESTABLISHED { 2406 description 2407 "neighbor is up - the BGP session with the peer is 2408 established"; 2409 } 2410 } 2411 config false; 2412 description 2413 "Operational state of the BGP peer"; 2414 } 2416 leaf last-established { 2417 // Was oc-types:timeticks64 2418 type uint64; 2419 config false; 2420 description 2421 "This timestamp indicates the time that the BGP session last 2422 transitioned in or out of the Established state. The value 2423 is the timestamp in seconds relative to the Unix Epoch (Jan 2424 1, 1970 00:00:00 UTC). 2426 The BGP session uptime can be computed by clients as the 2427 difference between this value and the current time in UTC 2428 (assuming the session is in the ESTABLISHED state, per the 2429 session-state leaf)."; 2431 } 2433 leaf established-transitions { 2434 type yang:counter64; 2435 config false; 2436 description 2437 "Number of transitions to the Established state for the 2438 neighbor session. This value is analogous to the 2439 bgpPeerFsmEstablishedTransitions object from the standard 2440 BGP-4 MIB"; 2441 reference 2442 "RFC 4273 - Definitions of Managed Objects for BGP-4"; 2443 } 2445 leaf-list supported-capabilities { 2446 type identityref { 2447 base bt:BGP_CAPABILITY; 2448 } 2449 config false; 2450 description 2451 "BGP capabilities negotiated as supported with the peer"; 2452 } 2454 container messages { 2455 config false; 2456 description 2457 "Counters for BGP messages sent and received from the 2458 neighbor"; 2459 container sent { 2460 description 2461 "Counters relating to BGP messages sent to the neighbor"; 2462 uses bgp-neighbor-counters-message-types-state; 2463 } 2465 container received { 2466 description 2467 "Counters for BGP messages received from the neighbor"; 2468 uses bgp-neighbor-counters-message-types-state; 2469 } 2470 } 2472 container queues { 2473 config false; 2474 description 2475 "Counters related to queued messages associated with the BGP 2476 neighbor"; 2478 leaf input { 2479 type uint32; 2480 description 2481 "The number of messages received from the peer currently 2482 queued"; 2483 } 2485 leaf output { 2486 type uint32; 2487 description 2488 "The number of messages queued to be sent to the peer"; 2489 } 2490 } 2492 container timers { 2493 description 2494 "Timers related to a BGP neighbor"; 2496 uses neighbor-group-timers-config; 2498 leaf negotiated-hold-time { 2499 type decimal64 { 2500 fraction-digits 2; 2501 } 2502 config false; 2503 description 2504 "The negotiated hold-time for the BGP session"; 2505 } 2506 } 2508 container transport { 2509 description 2510 "Transport session parameters for the BGP neighbor"; 2512 uses neighbor-group-transport-config; 2514 leaf local-port { 2515 type inet:port-number; 2516 config false; 2517 description 2518 "Local TCP port being used for the TCP session supporting 2519 the BGP session"; 2520 } 2522 leaf remote-address { 2523 type inet:ip-address; 2524 config false; 2525 description 2526 "Remote address to which the BGP session has been 2527 established"; 2528 } 2530 leaf remote-port { 2531 type inet:port-number; 2532 config false; 2533 description 2534 "Remote port being used by the peer for the TCP session 2535 supporting the BGP session"; 2536 } 2537 } 2539 container error-handling { 2540 description 2541 "Error handling parameters used for the BGP neighbor or 2542 group"; 2543 uses neighbor-group-error-handling-config; 2545 leaf erroneous-update-messages { 2546 type uint32; 2547 config false; 2548 description 2549 "The number of BGP UPDATE messages for which the 2550 treat-as-withdraw mechanism has been applied based on 2551 erroneous message contents"; 2552 } 2553 } 2555 container graceful-restart { 2556 description 2557 "Parameters relating the graceful restart mechanism for BGP"; 2559 uses graceful-restart-config; 2561 leaf peer-restart-time { 2562 type uint16 { 2563 range 0..4096; 2564 } 2565 config false; 2566 description 2567 "The period of time (advertised by the peer) that the peer 2568 expects a restart of a BGP session to take"; 2569 } 2571 leaf peer-restarting { 2572 type boolean; 2573 config false; 2574 description 2575 "This flag indicates whether the remote neighbor is 2576 currently in the process of restarting, and hence received 2577 routes are currently stale"; 2578 } 2580 leaf local-restarting { 2581 type boolean; 2582 config false; 2583 description 2584 "This flag indicates whether the local neighbor is 2585 currently restarting. The flag is unset after all NLRI 2586 have been advertised to the peer, and the End-of-RIB (EOR) 2587 marker has been unset"; 2588 } 2590 leaf mode { 2591 type enumeration { 2592 enum HELPER_ONLY { 2593 description 2594 "The local router is operating in helper-only mode, and 2595 hence will not retain forwarding state during a local 2596 session restart, but will do so during a restart of 2597 the remote peer"; 2598 } 2599 enum BILATERAL { 2600 description 2601 "The local router is operating in both helper mode, and 2602 hence retains forwarding state during a remote 2603 restart, and also maintains forwarding state during 2604 local session restart"; 2605 } 2606 enum REMOTE_HELPER { 2607 description 2608 "The local system is able to retain routes during 2609 restart but the remote system is only able to act as a 2610 helper"; 2611 } 2612 } 2613 config false; 2614 description 2615 "This leaf indicates the mode of operation of BGP graceful 2616 restart with the peer"; 2617 } 2618 } 2620 uses structure-neighbor-group-logging-options; 2621 uses structure-neighbor-group-ebgp-multihop; 2622 uses structure-neighbor-group-route-reflector; 2623 uses structure-neighbor-group-as-path-options; 2624 uses structure-neighbor-group-add-paths; 2625 uses bgp-neighbor-use-multiple-paths; 2626 uses rpol:apply-policy-group; 2628 container afi-safis { 2629 description 2630 "Per-address-family configuration parameters associated with 2631 the neighbor"; 2632 uses bgp-neighbor-afi-safi-list; 2633 } 2634 } 2636 grouping bgp-neighbor-list { 2637 description 2638 "The list of BGP neighbors"; 2640 list neighbor { 2641 key "neighbor-address"; 2642 description 2643 "List of BGP neighbors configured on the local system, 2644 uniquely identified by peer IPv[46] address"; 2646 uses bgp-neighbor-base; 2647 } 2648 } 2649 } 2650 2652 file "ietf-bgp-global@2019-02-25.yang" 2653 submodule ietf-bgp-global { 2654 yang-version "1.1"; 2655 belongs-to ietf-bgp { 2656 prefix bgp; 2657 } 2659 import ietf-inet-types { 2660 prefix inet; 2661 } 2662 import ietf-yang-types { 2663 prefix yang; 2664 } 2666 include ietf-bgp-common; 2667 include ietf-bgp-common-multiprotocol; 2669 organization 2670 "IETF IDR Working Group"; 2672 contact 2673 "WG Web: 2674 WG List: 2676 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2677 Keyur Patel (keyur at arrcus.com), 2678 Susan Hares (shares at ndzh.com"; 2680 description 2681 "This sub-module contains groupings that are specific to the 2682 global context of the BGP module"; 2684 revision "2019-02-25" { 2685 description 2686 "Initial Version"; 2687 reference 2688 "RFC XXX, BGP Model for Service Provider Network."; 2689 } 2691 grouping bgp-global-config { 2692 description 2693 "Global configuration options for the BGP router."; 2695 leaf as { 2696 type inet:as-number; 2697 mandatory true; 2698 description 2699 "Local autonomous system number of the router. Uses 2700 the 32-bit as-number type from the model in RFC 6991."; 2701 } 2703 leaf router-id { 2704 type yang:dotted-quad; 2705 description 2706 "Router id of the router - an unsigned 32-bit integer 2707 expressed in dotted quad notation."; 2708 reference 2709 "RFC4271 - A Border Gateway Protocol 4 (BGP-4), 2710 Section 4.2"; 2711 } 2712 } 2714 grouping bgp-global-state { 2715 description 2716 "Operational state parameters for the BGP neighbor"; 2718 uses state; 2719 } 2721 grouping bgp-global-default-route-distance-config { 2722 description 2723 "Configuration options relating to the administrative distance 2724 (or preference) assigned to routes received from different 2725 sources (external, internal, and local)."; 2727 leaf external-route-distance { 2728 type uint8 { 2729 range "1..255"; 2730 } 2731 description 2732 "Administrative distance for routes learned from external 2733 BGP (eBGP)."; 2734 } 2735 leaf internal-route-distance { 2736 type uint8 { 2737 range "1..255"; 2738 } 2739 description 2740 "Administrative distance for routes learned from internal 2741 BGP (iBGP)."; 2742 } 2743 } 2745 grouping bgp-global-confederation-config { 2746 description 2747 "Configuration options specifying parameters when the local 2748 router is within an autonomous system which is part of a BGP 2749 confederation."; 2751 leaf enabled { 2752 type boolean; 2753 description 2754 "When this leaf is set to true it indicates that 2755 the local-AS is part of a BGP confederation"; 2756 } 2758 leaf identifier { 2759 type inet:as-number; 2760 description 2761 "Confederation identifier for the autonomous system."; 2762 } 2764 leaf-list member-as { 2765 type inet:as-number; 2766 description 2767 "Remote autonomous systems that are to be treated 2768 as part of the local confederation."; 2769 } 2770 } 2772 grouping bgp-global-afi-safi-list { 2773 description 2774 "List of address-families associated with the BGP instance"; 2776 list afi-safi { 2777 key "afi-safi-name"; 2779 description 2780 "AFI,SAFI configuration available for the 2781 neighbour or group"; 2783 uses mp-afi-safi-config; 2784 uses state; 2786 container graceful-restart { 2787 description 2788 "Parameters relating to BGP graceful-restart"; 2790 uses mp-afi-safi-graceful-restart-config; 2791 } 2793 uses route-selection-options; 2794 uses global-group-use-multiple-paths; 2795 uses mp-all-afi-safi-list-contents; 2796 } 2797 } 2799 // Structural groupings 2800 grouping bgp-global-base { 2801 description 2802 "Global configuration parameters for the BGP router"; 2804 uses bgp-global-config; 2805 uses bgp-global-state; 2807 container default-route-distance { 2808 description 2809 "Administrative distance (or preference) assigned to 2810 routes received from different sources 2811 (external, internal, and local)."; 2813 uses bgp-global-default-route-distance-config; 2815 } 2817 container confederation { 2818 description 2819 "Parameters indicating whether the local system acts as part 2820 of a BGP confederation"; 2822 uses bgp-global-confederation-config; 2823 } 2825 container graceful-restart { 2826 description 2827 "Parameters relating the graceful restart mechanism for BGP"; 2828 uses graceful-restart-config; 2829 } 2831 uses global-group-use-multiple-paths; 2832 uses route-selection-options; 2834 container afi-safis { 2835 description 2836 "Address family specific configuration"; 2837 uses bgp-global-afi-safi-list; 2838 } 2839 } 2841 } 2842 2844 7.2. BGP types 2846 file "ietf-bgp-types@2019-02-25.yang" 2847 module ietf-bgp-types { 2848 yang-version "1.1"; 2849 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types"; 2851 prefix "bt"; 2853 import ietf-inet-types { 2854 prefix inet; 2855 } 2857 // meta 2858 organization 2859 "IETF IDR Working Group"; 2861 contact 2862 "WG Web: 2863 WG List: 2865 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 2866 Keyur Patel (keyur at arrcus.com), 2867 Susan Hares (shares at ndzh.com"; 2869 description 2870 "This module contains general data definitions for use in BGP 2871 policy. It can be imported by modules that make use of BGP 2872 attributes"; 2874 revision "2019-02-25" { 2875 description 2876 "Initial Version"; 2877 reference 2878 "RFC XXX, BGP Model for Service Provider Network."; 2879 } 2881 identity BGP_CAPABILITY { 2882 description "Base identity for a BGP capability"; 2883 } 2885 identity MPBGP { 2886 base BGP_CAPABILITY; 2887 description 2888 "Multi-protocol extensions to BGP"; 2889 reference "RFC2858"; 2890 } 2892 identity ROUTE_REFRESH { 2893 base BGP_CAPABILITY; 2894 description 2895 "The BGP route-refresh functionality"; 2896 reference "RFC2918"; 2897 } 2899 identity ASN32 { 2900 base BGP_CAPABILITY; 2901 description 2902 "4-byte (32-bit) AS number functionality"; 2903 reference "RFC6793"; 2904 } 2906 identity GRACEFUL_RESTART { 2907 base BGP_CAPABILITY; 2908 description 2909 "Graceful restart functionality"; 2911 reference "RFC4724"; 2912 } 2914 identity ADD_PATHS { 2915 base BGP_CAPABILITY; 2916 description 2917 "BGP add-paths"; 2918 reference "draft-ietf-idr-add-paths"; 2919 } 2921 identity afi-safi-type { 2922 description 2923 "Base identity type for AFI,SAFI tuples for BGP-4"; 2924 reference "RFC4760 - multi-protocol extensions for BGP-4"; 2925 } 2927 identity ipv4-unicast { 2928 base afi-safi-type; 2929 description 2930 "IPv4 unicast (AFI,SAFI = 1,1)"; 2931 reference "RFC4760"; 2932 } 2934 identity ipv6-unicast { 2935 base afi-safi-type; 2936 description 2937 "IPv6 unicast (AFI,SAFI = 2,1)"; 2938 reference "RFC4760"; 2939 } 2941 identity IPV4_LABELED_UNICAST { 2942 base afi-safi-type; 2943 description 2944 "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; 2945 reference "RFC3107"; 2946 } 2948 identity IPV6_LABELED_UNICAST { 2949 base afi-safi-type; 2950 description 2951 "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; 2952 reference "RFC3107"; 2953 } 2955 identity L3VPN_IPV4_UNICAST { 2956 base afi-safi-type; 2957 description 2958 "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; 2960 reference "RFC4364"; 2961 } 2963 identity L3VPN_IPV6_UNICAST { 2964 base afi-safi-type; 2965 description 2966 "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; 2967 reference "RFC4659"; 2968 } 2970 identity L3VPN_IPV4_MULTICAST { 2971 base afi-safi-type; 2972 description 2973 "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; 2974 reference "RFC6514"; 2975 } 2977 identity L3VPN_IPV6_MULTICAST { 2978 base afi-safi-type; 2979 description 2980 "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; 2981 reference "RFC6514"; 2982 } 2984 identity L2VPN_VPLS { 2985 base afi-safi-type; 2986 description 2987 "BGP-signalled VPLS (AFI,SAFI = 25,65)"; 2988 reference "RFC4761"; 2989 } 2991 identity L2VPN_EVPN { 2992 base afi-safi-type; 2993 description 2994 "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; 2995 } 2997 identity BGP_WELL_KNOWN_STD_COMMUNITY { 2998 description 2999 "Reserved communities within the standard community space 3000 defined by RFC1997. These communities must fall within the 3001 range 0x00000000 to 0xFFFFFFFF"; 3002 reference "RFC1997"; 3003 } 3005 identity NO_EXPORT { 3006 base BGP_WELL_KNOWN_STD_COMMUNITY; 3007 description 3008 "Do not export NLRI received carrying this community outside 3009 the bounds of this autonomous system, or this confederation if 3010 the local autonomous system is a confederation member AS. This 3011 community has a value of 0xFFFFFF01."; 3012 reference "RFC1997"; 3013 } 3015 identity NO_ADVERTISE { 3016 base BGP_WELL_KNOWN_STD_COMMUNITY; 3017 description 3018 "All NLRI received carrying this community must not be 3019 advertised to other BGP peers. This community has a value of 3020 0xFFFFFF02."; 3021 reference "RFC1997"; 3022 } 3024 identity NO_EXPORT_SUBCONFED { 3025 base BGP_WELL_KNOWN_STD_COMMUNITY; 3026 description 3027 "All NLRI received carrying this community must not be 3028 advertised to external BGP peers - including over confederation 3029 sub-AS boundaries. This community has a value of 0xFFFFFF03."; 3030 reference "RFC1997"; 3031 } 3033 identity NOPEER { 3034 base BGP_WELL_KNOWN_STD_COMMUNITY; 3035 description 3036 "An autonomous system receiving NLRI tagged with this community 3037 is advised not to re-advertise the NLRI to external bi-lateral 3038 peer autonomous systems. An AS may also filter received NLRI 3039 from bilateral peer sessions when they are tagged with this 3040 community value"; 3041 reference "RFC3765"; 3042 } 3044 identity as-path-segment-type { 3045 description 3046 "Base AS Path Segment Type. In [BGP-4], the path segment type 3047 is a 1-octet field with the following values defined."; 3048 reference 3049 "RFC 5065"; 3050 } 3052 identity as-set { 3053 base as-path-segment-type; 3054 description 3055 "Unordered set of autonomous systems that a route in the UPDATE 3056 message has traversed."; 3057 reference 3058 "RFC 5065"; 3059 } 3061 identity as-sequence { 3062 base as-path-segment-type; 3063 description 3064 "Ordered set of autonomous systems that a route in the UPDATE 3065 message has traversed."; 3066 reference 3067 "RFC 5065"; 3068 } 3070 identity as-confed-sequence { 3071 base as-path-segment-type; 3072 description 3073 "Ordered set of Member Autonomous Systems in the local 3074 confederation that the UPDATE message has traversed."; 3075 reference 3076 "RFC 5065"; 3077 } 3079 identity as-confed-set { 3080 base as-path-segment-type; 3081 description 3082 "Unordered set of Member Autonomous Systems in the local 3083 confederation that the UPDATE message has traversed."; 3084 reference 3085 "RFC 5065"; 3086 } 3088 typedef bgp-session-direction { 3089 type enumeration { 3090 enum INBOUND { 3091 description 3092 "Refers to all NLRI received from the BGP peer"; 3093 } 3094 enum OUTBOUND { 3095 description 3096 "Refers to all NLRI advertised to the BGP peer"; 3097 } 3098 } 3099 description 3100 "Type to describe the direction of NLRI transmission"; 3101 } 3103 typedef bgp-well-known-community-type { 3104 type identityref { 3105 base BGP_WELL_KNOWN_STD_COMMUNITY; 3106 } 3107 description 3108 "Type definition for well-known IETF community attribute 3109 values"; 3110 reference 3111 "IANA Border Gateway Protocol (BGP) Well Known Communities"; 3112 } 3114 typedef bgp-std-community-type { 3115 // TODO: further refine restrictions and allowed patterns 3116 // 4-octet value: 3117 // 2 octets 3118 // 2 octets 3119 type union { 3120 type uint32 { 3121 // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - 3122 // 0xFFFFFFFF are reserved 3123 range "65536..4294901759"; // 0x00010000..0xFFFEFFFF 3124 } 3125 type string { 3126 pattern '([0-9]+:[0-9]+)'; 3127 } 3128 } 3129 description 3130 "Type definition for standard community attributes"; 3131 reference "RFC 1997 - BGP Communities Attribute"; 3132 } 3134 typedef bgp-ext-community-type { 3135 // TODO: needs more work to make this more precise given the 3136 // variability of extended community attribute specifications 3137 // 8-octet value: 3138 // 2 octects 3139 // 6 octets 3141 type union { 3142 type string { 3143 // Type 1: 2-octet global and 4-octet local 3144 // (AS number) (Integer) 3145 pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 3146 '[1-9][0-9]{1,4}|[0-9]):' + 3147 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 3148 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3149 } 3150 type string { 3151 // Type 2: 4-octet global and 2-octet local 3152 // (ipv4-address) (integer) 3153 pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 3154 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 3155 '2[0-4][0-9]|25[0-5]):' + 3156 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 3157 '[1-9][0-9]{1,4}|[0-9])'; 3158 } 3159 type string { 3160 // route-target with Type 1 3161 // route-target:(ASN):(local-part) 3162 pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' + 3163 '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + 3164 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 3165 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3166 } 3167 type string { 3168 // route-target with Type 2 3169 // route-target:(IPv4):(local-part) 3170 pattern 'route\-target:' + 3171 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 3172 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 3173 '2[0-4][0-9]|25[0-5]):' + 3174 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 3175 '[1-9][0-9]{1,4}|[0-9])'; 3176 } 3177 type string { 3178 // route-origin with Type 1 3179 pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' + 3180 '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + 3181 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 3182 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 3183 } 3184 type string { 3185 // route-origin with Type 2 3186 pattern 'route\-origin:' + 3187 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 3188 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 3189 '2[0-4][0-9]|25[0-5]):' + 3190 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 3191 '[1-9][0-9]{1,4}|[0-9])'; 3192 } 3193 } 3194 description 3195 "Type definition for extended community attributes"; 3196 reference "RFC 4360 - BGP Extended Communities Attribute"; 3197 } 3198 typedef bgp-community-regexp-type { 3199 // TODO: needs more work to decide what format these regexps can 3200 // take. 3201 //type oc-types:std-regexp; 3202 type string; 3203 description 3204 "Type definition for communities specified as regular 3205 expression patterns"; 3206 } 3208 typedef bgp-origin-attr-type { 3209 type enumeration { 3210 enum IGP { 3211 description "Origin of the NLRI is internal"; 3212 } 3213 enum EGP { 3214 description "Origin of the NLRI is EGP"; 3215 } 3216 enum INCOMPLETE { 3217 description "Origin of the NLRI is neither IGP or EGP"; 3218 } 3219 } 3220 description 3221 "Type definition for standard BGP origin attribute"; 3222 reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), 3223 Sec 4.3"; 3224 } 3226 typedef peer-type { 3227 type enumeration { 3228 enum INTERNAL { 3229 description "internal (iBGP) peer"; 3230 } 3231 enum EXTERNAL { 3232 description "external (eBGP) peer"; 3233 } 3234 } 3235 description 3236 "labels a peer or peer group as explicitly internal or 3237 external"; 3238 } 3240 identity REMOVE_PRIVATE_AS_OPTION { 3241 description 3242 "Base identity for options for removing private autonomous 3243 system numbers from the AS_PATH attribute"; 3244 } 3245 identity PRIVATE_AS_REMOVE_ALL { 3246 base REMOVE_PRIVATE_AS_OPTION; 3247 description 3248 "Strip all private autonomous system numbers from the AS_PATH. 3249 This action is performed regardless of the other content of the 3250 AS_PATH attribute, and for all instances of private AS numbers 3251 within that attribute."; 3252 } 3254 identity PRIVATE_AS_REPLACE_ALL { 3255 base REMOVE_PRIVATE_AS_OPTION; 3256 description 3257 "Replace all instances of private autonomous system numbers in 3258 the AS_PATH with the local BGP speaker's autonomous system 3259 number. This action is performed regardless of the other 3260 content of the AS_PATH attribute, and for all instances of 3261 private AS number within that attribute."; 3262 } 3264 typedef remove-private-as-option { 3265 type identityref { 3266 base REMOVE_PRIVATE_AS_OPTION; 3267 } 3268 description 3269 "set of options for configuring how private AS path numbers 3270 are removed from advertisements"; 3271 } 3273 typedef percentage { 3274 type uint8 { 3275 range "0..100"; 3276 } 3277 description 3278 "Integer indicating a percentage value"; 3279 } 3281 typedef rr-cluster-id-type { 3282 type union { 3283 type uint32; 3284 type inet:ipv4-address; 3285 } 3286 description 3287 "union type for route reflector cluster ids: 3288 option 1: 4-byte number 3289 option 2: IP address"; 3290 } 3292 typedef community-type { 3293 type enumeration { 3294 enum STANDARD { 3295 description "send only standard communities"; 3296 } 3297 enum EXTENDED { 3298 description "send only extended communities"; 3299 } 3300 enum BOTH { 3301 description "send both standard and extended communities"; 3302 } 3303 enum NONE { 3304 description "do not send any community attribute"; 3305 } 3306 } 3307 description 3308 "type describing variations of community attributes: 3309 STANDARD: standard BGP community [rfc1997] 3310 EXTENDED: extended BGP community [rfc4360] 3311 BOTH: both standard and extended community"; 3312 } 3313 } 3314 3316 7.3. BGP policy data 3318 file "ietf-bgp-policy@2019-02-25.yang" 3319 module ietf-bgp-policy { 3320 yang-version "1.1"; 3321 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; 3322 prefix "bp"; 3324 // import some basic types 3325 import ietf-inet-types { 3326 prefix inet; 3327 } 3328 import ietf-routing-policy { 3329 prefix rpol; 3330 } 3331 import ietf-bgp-types { 3332 prefix bt; 3333 } 3335 import ietf-routing-types { 3336 prefix rt-types; 3337 } 3339 organization 3340 "IETF IDR Working Group"; 3342 contact 3343 "WG Web: 3344 WG List: 3346 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3347 Keyur Patel (keyur at arrcus.com), 3348 Susan Hares (shares at ndzh.com"; 3350 description 3351 "This module contains data definitions for BGP routing policy. 3352 It augments the base routing-policy module with BGP-specific 3353 options for conditions and actions."; 3355 revision "2019-02-25" { 3356 description 3357 "Initial Version"; 3358 reference 3359 "RFC XXX, BGP Model for Service Provider Network."; 3360 } 3362 // typedef statements 3364 typedef bgp-set-community-option-type { 3365 type enumeration { 3366 enum ADD { 3367 description 3368 "add the specified communities to the existing 3369 community attribute"; 3370 } 3371 enum REMOVE { 3372 description 3373 "remove the specified communities from the 3374 existing community attribute"; 3375 } 3376 enum REPLACE { 3377 description 3378 "replace the existing community attribute with 3379 the specified communities. If an empty set is 3380 specified, this removes the community attribute 3381 from the route."; 3382 } 3383 } 3384 description 3385 "Type definition for options when setting the community 3386 attribute in a policy action"; 3387 } 3388 typedef bgp-next-hop-type { 3389 type union { 3390 type inet:ip-address-no-zone; 3391 type enumeration { 3392 enum SELF { 3393 description "special designation for local router's own 3394 address, i.e., next-hop-self"; 3395 } 3396 } 3397 } 3398 description 3399 "type definition for specifying next-hop in policy actions"; 3400 } 3402 typedef bgp-set-med-type { 3403 type union { 3404 type uint32; 3405 type string { 3406 pattern "^[+-][0-9]+"; 3407 } 3408 type enumeration { 3409 enum IGP { 3410 description "set the MED value to the IGP cost toward the 3411 next hop for the route"; 3412 } 3413 } 3414 } 3415 description 3416 "Type definition for specifying how the BGP MED can 3417 be set in BGP policy actions. The three choices are to set 3418 the MED directly, increment/decrement using +/- notation, 3419 and setting it to the IGP cost (predefined value)."; 3420 } 3422 // augment statements 3424 augment "/rpol:routing-policy/rpol:defined-sets" { 3425 description 3426 "Adds BGP defined sets container to routing policy model."; 3428 container bgp-defined-sets { 3429 description 3430 "BGP-related set definitions for policy match conditions"; 3432 container community-sets { 3433 description 3434 "Enclosing container for list of defined BGP community sets"; 3436 list community-set { 3437 key "community-set-name"; 3438 description 3439 "List of defined BGP community sets"; 3441 leaf community-set-name { 3442 type string; 3443 mandatory true; 3444 description 3445 "name / label of the community set -- this is used to 3446 reference the set in match conditions"; 3447 } 3449 leaf-list community-member { 3450 type union { 3451 type bt:bgp-std-community-type; 3452 type bt:bgp-community-regexp-type; 3453 type bt:bgp-well-known-community-type; 3454 } 3455 description 3456 "members of the community set"; 3457 } 3458 } 3459 } 3461 container ext-community-sets { 3462 description 3463 "Enclosing container for list of extended BGP community 3464 sets"; 3465 list ext-community-set { 3466 key "ext-community-set-name"; 3467 description 3468 "List of defined extended BGP community sets"; 3470 leaf ext-community-set-name { 3471 type string; 3472 description 3473 "name / label of the extended community set -- this is 3474 used to reference the set in match conditions"; 3475 } 3477 leaf-list ext-community-member { 3478 type union { 3479 type rt-types:route-target; 3480 type bt:bgp-community-regexp-type; 3481 } 3482 description 3483 "members of the extended community set"; 3485 } 3486 } 3487 } 3489 container as-path-sets { 3490 description 3491 "Enclosing container for list of define AS path sets"; 3493 list as-path-set { 3494 key "as-path-set-name"; 3495 description 3496 "List of defined AS path sets"; 3498 leaf as-path-set-name { 3499 type string; 3500 description 3501 "name of the AS path set -- this is used to reference the 3502 set in match conditions"; 3503 } 3505 leaf-list as-path-set-member { 3506 // TODO: need to refine typedef for AS path expressions 3507 type string; 3508 description 3509 "AS path expression -- list of ASes in the set"; 3510 } 3511 } 3512 } 3513 } 3514 } 3516 grouping as-path-prepend-top { 3517 description 3518 "Top-level grouping for the AS path prepend action"; 3520 } 3522 grouping set-community-action-common { 3523 description 3524 "Common leaves for set-community and set-ext-community 3525 actions"; 3527 leaf method { 3528 type enumeration { 3529 enum INLINE { 3530 description 3531 "The extended communities are specified inline as a 3532 list"; 3533 } 3534 enum REFERENCE { 3535 description 3536 "The extended communities are specified by referencing a 3537 defined ext-community set"; 3538 } 3539 } 3540 description 3541 "Indicates the method used to specify the extended 3542 communities for the set-ext-community action"; 3543 } 3545 leaf options { 3546 type bgp-set-community-option-type; 3547 description 3548 "Options for modifying the community attribute with 3549 the specified values. These options apply to both 3550 methods of setting the community attribute."; 3551 } 3552 } 3554 augment "/rpol:routing-policy/rpol:policy-definitions/" + 3555 "rpol:policy-definition/rpol:statements/rpol:statement/" + 3556 "rpol:conditions" { 3557 description 3558 "BGP policy conditions added to routing policy module"; 3560 container bgp-conditions { 3561 description 3562 "Top-level container for BGP specific policy conditions "; 3564 leaf med-eq { 3565 type uint32; 3566 description 3567 "Condition to check if the received MED value is equal to 3568 the specified value"; 3569 } 3571 leaf origin-eq { 3572 type bt:bgp-origin-attr-type; 3573 description 3574 "Condition to check if the route origin is equal to the 3575 specified value"; 3576 } 3578 leaf-list next-hop-in { 3579 type inet:ip-address-no-zone; 3580 description 3581 "List of next hop addresses to check for in the route 3582 update"; 3583 } 3585 leaf-list afi-safi-in { 3586 type identityref { 3587 base bt:afi-safi-type; 3588 } 3589 description 3590 "List of address families which the NLRI may be within"; 3591 } 3593 leaf local-pref-eq { 3594 type uint32; 3595 // TODO: add support for other comparisons if needed 3596 description 3597 "Condition to check if the local pref attribute is equal to 3598 the specified value"; 3599 } 3601 leaf route-type { 3602 // TODO: verify extent of vendor support for this comparison 3603 type enumeration { 3604 enum INTERNAL { 3605 description "route type is internal"; 3606 } 3607 enum EXTERNAL { 3608 description "route type is external"; 3609 } 3610 } 3611 description 3612 "Condition to check the route type in the route update"; 3613 } 3615 container community-count { 3616 description 3617 "Value and comparison operations for conditions based on the 3618 number of communities in the route update"; 3619 } 3621 container as-path-length { 3622 description 3623 "Value and comparison operations for conditions based on the 3624 length of the AS path in the route update"; 3625 } 3627 container match-community-set { 3628 description 3629 "Top-level container for match conditions on communities. 3630 Match a referenced community-set according to the logic 3631 defined in the match-set-options leaf"; 3633 leaf community-set { 3634 type leafref { 3635 path 3636 "/rpol:routing-policy/rpol:defined-sets/" + 3637 "bp:bgp-defined-sets/bp:community-sets/" + 3638 "bp:community-set/bp:community-set-name"; 3639 } 3640 description 3641 "References a defined community set"; 3642 } 3644 uses rpol:match-set-options-group; 3645 } 3647 container match-ext-community-set { 3648 description 3649 "Match a referenced extended community-set according to the 3650 logic defined in the match-set-options leaf"; 3652 leaf ext-community-set { 3653 type leafref { 3654 path 3655 "/rpol:routing-policy/rpol:defined-sets/" + 3656 "bp:bgp-defined-sets/bp:ext-community-sets/" + 3657 "bp:ext-community-set/" + 3658 "bp:ext-community-set-name"; 3659 } 3660 description "References a defined extended community set"; 3661 } 3663 uses rpol:match-set-options-group; 3664 } 3666 container match-as-path-set { 3667 description 3668 "Match a referenced as-path set according to the logic 3669 defined in the match-set-options leaf"; 3671 leaf as-path-set { 3672 type leafref { 3673 path "/rpol:routing-policy/rpol:defined-sets/" + 3674 "bp:bgp-defined-sets/bp:as-path-sets/" + 3675 "bp:as-path-set/bp:as-path-set-name"; 3677 } 3678 description 3679 "References a defined AS path set"; 3680 } 3681 uses rpol:match-set-options-group; 3682 } 3683 } 3684 } 3686 augment "/rpol:routing-policy/rpol:policy-definitions/" + 3687 "rpol:policy-definition/rpol:statements/rpol:statement/" + 3688 "rpol:actions" { 3689 description 3690 "BGP policy actions added to routing policy module."; 3692 container bgp-actions { 3693 description 3694 "Top-level container for BGP-specific actions"; 3696 leaf set-route-origin { 3697 type bt:bgp-origin-attr-type; 3698 description 3699 "set the origin attribute to the specified value"; 3700 } 3702 leaf set-local-pref { 3703 type uint32; 3704 description 3705 "set the local pref attribute on the route update"; 3706 } 3708 leaf set-next-hop { 3709 type bgp-next-hop-type; 3710 description 3711 "set the next-hop attribute in the route update"; 3712 } 3714 leaf set-med { 3715 type bgp-set-med-type; 3716 description 3717 "set the med metric attribute in the route update"; 3718 } 3720 container set-as-path-prepend { 3721 description 3722 "action to prepend local AS number to the AS-path a 3723 specified number of times"; 3725 leaf repeat-n { 3726 type uint8 { 3727 range 1..max; 3728 } 3729 description 3730 "Number of times to prepend the local AS number to the AS 3731 path. The value should be between 1 and the maximum 3732 supported by the implementation."; 3733 } 3734 } 3736 container set-community { 3737 description 3738 "Action to set the community attributes of the route, along 3739 with options to modify how the community is modified. 3740 Communities may be set using an inline list OR 3741 reference to an existing defined set (not both)."; 3743 uses set-community-action-common; 3744 container inline { 3745 when "../config/method=INLINE" { 3746 description 3747 "Active only when the set-community method is INLINE"; 3748 } 3749 description 3750 "Set the community values for the action inline with 3751 a list."; 3753 leaf-list communities { 3754 type union { 3755 type bt:bgp-std-community-type; 3756 type bt:bgp-well-known-community-type; 3757 } 3758 description 3759 "Set the community values for the update inline with a 3760 list."; 3761 } 3762 } 3764 container reference { 3765 when "../config/method=REFERENCE" { 3766 description 3767 "Active only when the set-community method is REFERENCE"; 3768 } 3769 description 3770 "Provide a reference to a defined community set for the 3771 set-community action"; 3773 leaf community-set-ref { 3774 type leafref { 3775 path "/rpol:routing-policy/rpol:defined-sets/" + 3776 "bp:bgp-defined-sets/" + 3777 "bp:community-sets/bp:community-set/" + 3778 "bp:community-set-name"; 3779 } 3780 description 3781 "References a defined community set by name"; 3782 } 3783 } 3784 } 3786 container set-ext-community { 3787 description 3788 "Action to set the extended community attributes of the 3789 route, along with options to modify how the community is 3790 modified. Extended communities may be set using an inline 3791 list OR a reference to an existing defined set (but not 3792 both)."; 3794 uses set-community-action-common; 3795 container inline { 3796 when "../config/method=INLINE" { 3797 description 3798 "Active only when the set-community method is INLINE"; 3799 } 3800 description 3801 "Set the extended community values for the action inline 3802 with a list."; 3804 leaf-list communities { 3805 type union { 3806 type rt-types:route-target; 3807 type bt:bgp-well-known-community-type; 3808 } 3809 description 3810 "Set the extended community values for the update inline 3811 with a list."; 3812 } 3813 } 3815 container reference { 3816 when "../config/method=REFERENCE" { 3817 description 3818 "Active only when the set-community method is REFERENCE"; 3819 } 3820 description 3821 "Provide a reference to an extended community set for the 3822 set-ext-community action"; 3824 leaf ext-community-set-ref { 3825 type leafref { 3826 path 3827 "/rpol:routing-policy/rpol:defined-sets/" + 3828 "bp:bgp-defined-sets/bp:ext-community-sets/" + 3829 "bp:ext-community-set/" + 3830 "bp:ext-community-set-name"; 3831 } 3832 description 3833 "References a defined extended community set by name"; 3834 } 3835 } 3836 } 3837 } 3838 } 3840 // rpc statements 3842 // notification statements 3843 } 3844 3846 7.4. RIB modules 3848 file "ietf-bgp-rib@2019-02-25.yang" 3849 module ietf-bgp-rib { 3850 yang-version "1.1"; 3851 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib"; 3852 prefix "br"; 3854 /* 3855 * Import and Include 3856 */ 3857 import ietf-routing { 3858 prefix "rt"; 3859 reference 3860 "RFC 8349: YANG Route Management."; 3861 } 3863 import ietf-bgp-types { 3864 prefix "bt"; 3865 reference 3866 "RFC XXXX: BGP YANG Model for Service Provider Networks."; 3867 } 3868 include ietf-bgp-rib-tables; 3869 include ietf-bgp-rib-shared-attributes; 3871 // groupings of attributes in three categories: 3872 // - shared across multiple routes 3873 // - common to LOC-RIB and Adj-RIB, but not shared across routes 3874 // - specific to LOC-RIB or Adj-RIB 3875 include ietf-bgp-rib-attributes; 3877 // groupings of annotations for each route or table 3878 include ietf-bgp-rib-table-attributes; 3880 organization 3881 "IETF IDR Working Group"; 3883 contact 3884 "WG Web: 3885 WG List: 3887 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 3888 Keyur Patel (keyur at arrcus.com), 3889 Susan Hares (shares at ndzh.com"; 3891 description 3892 "Defines a data model for representing BGP routing table (RIB) 3893 contents. The model supports 5 logical RIBs per address family: 3895 loc-rib: This is the main BGP routing table for the local routing 3896 instance, containing best-path selections for each prefix. The 3897 loc-rib table may contain multiple routes for a given prefix, 3898 with an attribute to indicate which was selected as the best 3899 path. Note that multiple paths may be used or advertised even if 3900 only one path is marked as best, e.g., when using BGP 3901 add-paths. An implementation may choose to mark multiple 3902 paths in the RIB as best path by setting the flag to true for 3903 multiple entries. 3905 adj-rib-in-pre: This is a per-neighbor table containing the NLRI 3906 updates received from the neighbor before any local input policy 3907 rules or filters have been applied. This can be considered the 3908 'raw' updates from a given neighbor. 3910 adj-rib-in-post: This is a per-neighbor table containing the 3911 routes received from the neighbor that are eligible for 3912 best-path selection after local input policy rules have been 3913 applied. 3915 adj-rib-out-pre: This is a per-neighbor table containing routes 3916 eligible for sending (advertising) to the neighbor before output 3917 policy rules have been applied. 3919 adj-rib-out-post: This is a per-neighbor table containing routes 3920 eligible for sending (advertising) to the neighbor after output 3921 policy rules have been applied."; 3923 revision "2019-02-25" { 3924 description 3925 "Initial Version"; 3926 reference 3927 "RFC XXXX, BGP YANG Model for Service Provider Network."; 3928 } 3930 augment "/rt:routing/rt:ribs" { 3931 when "derived-from-or-self(../rt:control-plane-protocols/" + 3932 "rt:control-plane-protocol/rt:type, 'bgp')" { 3933 description 3934 "This augmentation is only valid for routes whose control 3935 plane protocol is BGP."; 3936 } 3937 description 3938 "Support for RIBS."; 3940 container rib { 3941 config false; 3942 description 3943 "Top level container for BGP RIB"; 3945 uses attribute-sets; 3946 uses community-sets; 3947 uses ext-community-sets; 3949 container afi-safis { 3950 config false; 3951 description 3952 "Enclosing container for address family list"; 3954 list afi-safi { 3955 key "afi-safi-name"; 3956 description 3957 "List of afi-safi types."; 3959 leaf afi-safi-name { 3960 type identityref { 3961 base bt:afi-safi-type; 3962 } 3963 description "AFI,SAFI name."; 3965 } 3967 container ipv4-unicast { 3968 when "../afi-safi-name = 'bt:ipv4-unicast'" { 3969 description 3970 "Include this container for IPv4 unicast RIB"; 3971 } 3972 description 3973 "Routing tables for IPv4 unicast -- active when the 3974 afi-safi name is ipv4-unicast"; 3976 uses ipv4-loc-rib; 3977 uses ipv4-adj-rib; 3978 } 3980 container ipv6-unicast { 3981 when "../afi-safi-name = 'bt:ipv6-unicast'" { 3982 description 3983 "Include this container for IPv6 unicast RIB"; 3984 } 3985 description 3986 "Routing tables for IPv6 unicast -- active when the 3987 afi-safi name is ipv6-unicast"; 3989 uses ipv6-loc-rib; 3990 uses ipv6-adj-rib; 3991 } 3993 container ipv4-srte-policy { 3994 when "../afi-safi-name = 'bt:srte-policy-ipv4'" { 3995 description 3996 "Include this container only for the IPv4 AFI, SR-TE 3997 Policy SAFI."; 3998 } 3999 description 4000 "Routing tables for the IPv4 Unicast, SR-TE Policy 4001 SAFI."; 4003 uses ipvX-srte-policy-locrib; 4004 uses ipvX-srte-policy-adjrib; 4005 } 4007 container ipv6-srte-policy { 4008 when "../afi-safi-name = 'bt:srte-policy-ipv6'" { 4009 description 4010 "Include this container only for the IPv6 AFI, 4011 SR-TE Policy SAFI."; 4012 } 4013 description 4014 "Routing tables for the IPv6 Unicast, SR-TE Policy 4015 SAFI."; 4017 uses ipvX-srte-policy-locrib; 4018 uses ipvX-srte-policy-adjrib; 4019 } 4020 } 4021 } 4022 } 4023 } 4024 } 4025 4027 file "ietf-bgp-rib-ext@2019-02-25.yang" 4028 module ietf-bgp-rib-ext { 4029 yang-version "1.1"; 4030 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib-ext"; 4032 prefix "bre"; 4034 import ietf-routing { 4035 prefix "rt"; 4036 reference 4037 "RFC 8349: YANG Routing Management."; 4038 } 4039 import ietf-bgp-rib { 4040 prefix bgprib; 4041 } 4042 import ietf-bgp-rib-types { 4043 prefix bgpribt; 4044 } 4046 organization 4047 "IETF IDR Working Group"; 4049 contact 4050 "WG Web: 4051 WG List: 4053 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4054 Keyur Patel (keyur at arrcus.com), 4055 Susan Hares (shares at ndzh.com"; 4057 description 4058 "Defines additional data nodes for the OpenConfig BGP RIB model. 4059 These items reflect extensions that are desirable features but 4060 are not currently supported in a majority of BGP 4061 implementations."; 4063 revision "2019-02-25" { 4064 description 4065 "Initial Revision."; 4066 reference 4067 "RFC XXXX: BGP YANG Model for Service Providers."; 4068 } 4070 grouping rib-ext-route-annotations { 4071 description 4072 "Extended annotations for routes in the routing tables"; 4074 leaf reject-reason { 4075 type union { 4076 type identityref { 4077 base bgpribt:bgp-not-selected-bestpath; 4078 } 4079 type identityref { 4080 base bgpribt:bgp-not-selected-policy; 4081 } 4082 } 4083 description 4084 "Indicates the reason the route is not used, either due to 4085 policy filtering or bestpath selection"; 4086 } 4087 } 4089 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4090 "bgprib:afi-safi/bgprib:ipv4-unicast/bgprib:loc-rib/" + 4091 "bgprib:routes/bgprib:route" { 4092 description 4093 "Add extended annotations to the Loc-RIB for IPv4"; 4095 uses rib-ext-route-annotations; 4096 } 4098 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4099 "bgprib:afi-safi/bgprib:ipv6-unicast/bgprib:loc-rib/" + 4100 "bgprib:routes/bgprib:route" { 4101 description 4102 "Add extended annotations to the Loc-RIB for IPv6"; 4104 uses rib-ext-route-annotations; 4105 } 4107 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4108 "bgprib:afi-safi/bgprib:ipv4-unicast/" + 4109 "bgprib:neighbors/bgprib:neighbor/" + 4110 "bgprib:adj-rib-in-pre/bgprib:routes/bgprib:route" { 4111 description 4112 "Add extended annotations to Adj-RIB for IPv4"; 4114 uses rib-ext-route-annotations; 4115 } 4117 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4118 "bgprib:afi-safi/bgprib:ipv4-unicast/" + 4119 "bgprib:neighbors/bgprib:neighbor/" + 4120 "bgprib:adj-rib-in-post/bgprib:routes/bgprib:route" { 4121 description 4122 "Add extended annotations to Adj-RIB for IPv4"; 4124 uses rib-ext-route-annotations; 4125 } 4127 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4128 "bgprib:afi-safi/bgprib:ipv4-unicast/" + 4129 "bgprib:neighbors/bgprib:neighbor/" + 4130 "bgprib:adj-rib-out-pre/bgprib:routes/bgprib:route" { 4131 description 4132 "Add extended annotations to Adj-RIB for IPv4"; 4134 uses rib-ext-route-annotations; 4135 } 4137 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4138 "bgprib:afi-safi/bgprib:ipv4-unicast/" + 4139 "bgprib:neighbors/bgprib:neighbor/" + 4140 "bgprib:adj-rib-out-post/bgprib:routes/bgprib:route" { 4141 description 4142 "Add extended annotations to Adj-RIB for IPv4"; 4144 uses rib-ext-route-annotations; 4145 } 4147 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4148 "bgprib:afi-safi/bgprib:ipv6-unicast/" + 4149 "bgprib:neighbors/bgprib:neighbor/" + 4150 "bgprib:adj-rib-in-pre/bgprib:routes/bgprib:route" { 4151 description 4152 "Add extended annotations to Adj-RIB for IPv6"; 4154 uses rib-ext-route-annotations; 4155 } 4156 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4157 "bgprib:afi-safi/bgprib:ipv6-unicast/" + 4158 "bgprib:neighbors/bgprib:neighbor/" + 4159 "bgprib:adj-rib-in-post/bgprib:routes/bgprib:route" { 4160 description 4161 "Add extended annotations to Adj-RIB for IPv6"; 4163 uses rib-ext-route-annotations; 4164 } 4166 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4167 "bgprib:afi-safi/bgprib:ipv6-unicast/" + 4168 "bgprib:neighbors/bgprib:neighbor/" + 4169 "bgprib:adj-rib-out-pre/bgprib:routes/bgprib:route" { 4170 description 4171 "Add extended annotations to Adj-RIB for IPv6"; 4173 uses rib-ext-route-annotations; 4174 } 4176 augment "/rt:routing/rt:ribs/bgprib:rib/bgprib:afi-safis/" + 4177 "bgprib:afi-safi/bgprib:ipv6-unicast/" + 4178 "bgprib:neighbors/bgprib:neighbor/" + 4179 "bgprib:adj-rib-out-post/bgprib:routes/bgprib:route" { 4180 description 4181 "Add extended annotations to Adj-RIB for IPv6"; 4183 uses rib-ext-route-annotations; 4184 } 4185 } 4186 4188 file "ietf-bgp-rib-types@2019-02-25.yang" 4189 module ietf-bgp-rib-types { 4190 yang-version "1.1"; 4191 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-rib-types"; 4192 prefix "brt"; 4194 organization 4195 "IETF IDR Working Group"; 4197 contact 4198 "WG Web: 4199 WG List: 4201 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4202 Keyur Patel (keyur at arrcus.com), 4203 Susan Hares (shares at ndzh.com"; 4205 description 4206 "Defines identity and type definitions associated with 4207 the BGP RIB modules"; 4209 revision "2019-02-25" { 4210 description 4211 "Initial Version"; 4212 reference 4213 "RFC XXX, BGP Model for Service Provider Network."; 4214 } 4216 identity invalid-route-reason { 4217 description 4218 "Base identity for reason code for routes that are rejected as 4219 invalid. Some derived entities are based on BMP v3"; 4220 reference 4221 "BGP Monitoring Protocol (draft-ietf-grow-bmp-07)"; 4222 } 4224 identity invalid-cluster-loop { 4225 base invalid-route-reason; 4226 description 4227 "Route was invalid due to CLUSTER_LIST loop"; 4228 } 4230 identity invalid-as-loop { 4231 base invalid-route-reason; 4232 description 4233 "Route was invalid due to AS_PATH loop"; 4234 } 4236 identity invalid-originator { 4237 base invalid-route-reason; 4238 description 4239 "Route was invalid due to ORIGINATOR_ID, e.g., update has 4240 local router as originator"; 4241 } 4243 identity invalid-confed { 4244 base invalid-route-reason; 4245 description 4246 "Route was invalid due to a loop in the AS_CONFED_SEQUENCE or 4247 AS_CONFED_SET attributes"; 4248 } 4250 identity bgp-not-selected-bestpath { 4251 description 4252 "Base identity for indicating reason a route was was not 4253 selected by BGP route selection algorithm"; 4254 reference 4255 "RFC 4271 - Section 9.1"; 4256 } 4258 identity local-pref-lower { 4259 base bgp-not-selected-bestpath; 4260 description 4261 "Route has a lower localpref attribute than current best path"; 4262 reference 4263 "RFC 4271 - Section 9.1.2"; 4264 } 4266 identity as-path-longer { 4267 base bgp-not-selected-bestpath; 4268 description 4269 "Route has a longer AS path attribute than current best path"; 4270 reference 4271 "RFC 4271 - Section 9.1.2.2 (a)"; 4272 } 4274 identity origin-type-higher { 4275 base bgp-not-selected-bestpath; 4276 description 4277 "Route has a higher origin type, i.e., IGP origin is preferred 4278 over EGP or incomplete"; 4279 reference 4280 "RFC 4271 - Section 9.1.2.2 (b)"; 4281 } 4283 identity med-higher { 4284 base bgp-not-selected-bestpath; 4285 description 4286 "Route has a higher MED, or metric, attribute than the current 4287 best path"; 4288 reference 4289 "RFC 4271 - Section 9.1.2.2 (c)"; 4290 } 4292 identity prefer-external { 4293 base bgp-not-selected-bestpath; 4294 description 4295 "Route source is via IGP, rather than EGP."; 4296 reference 4297 "RFC 4271 - Section 9.1.2.2 (d)"; 4298 } 4299 identity nexthop-cost-higher { 4300 base bgp-not-selected-bestpath; 4301 description 4302 "Route has a higher interior cost to the next hop."; 4303 reference 4304 "RFC 4271 - Section 9.1.2.2 (e)"; 4305 } 4307 identity higher-router-id { 4308 base bgp-not-selected-bestpath; 4309 description 4310 "Route was sent by a peer with a higher BGP Identifier value, 4311 or router id"; 4312 reference 4313 "RFC 4271 - Section 9.1.2.2 (f)"; 4314 } 4316 identity higher-peer-address { 4317 base bgp-not-selected-bestpath; 4318 description 4319 "Route was sent by a peer with a higher IP address"; 4320 reference 4321 "RFC 4271 - Section 9.1.2.2 (g)"; 4322 } 4324 identity bgp-not-selected-policy { 4325 description 4326 "Base identity for reason code for routes that are rejected 4327 due to policy"; 4328 } 4330 identity rejected-import-policy { 4331 base bgp-not-selected-policy; 4332 description 4333 "Route was rejected after apply import policies"; 4334 } 4336 identity tunnel-encapsulation-type { 4337 description 4338 "Types of tunnel encapsulation, as described by the Tunnel 4339 Encapsulation attribute"; 4340 reference 4341 "RFC5512"; 4342 } 4344 identity srte-policy { 4345 description 4346 "Segment Routing Traffic Engineering Policy."; 4348 reference 4349 "TODO: Insert reference here."; 4350 } 4352 identity srte-policy-ipv4 { 4353 base srte-policy; 4354 description 4355 "Segment Routing Traffice Engineering Policy for IPv4."; 4356 reference 4357 "TODO: Insert reference here."; 4358 } 4360 identity srte-policy-ipv6 { 4361 base srte-policy; 4362 description 4363 "Segment Routing Traffic Engineering Policy for IPv6."; 4364 reference 4365 "TODO: Insert reference here."; 4366 } 4368 identity srte-policy-tunnel { 4369 base tunnel-encapsulation-type; 4370 description 4371 "Segment Routing Traffic Engineering Policy tunnel."; 4372 reference 4373 "draft-previdi-idr-segment-routing-te-policy"; 4374 } 4376 identity tunnel-encapsulation-subtlv-type { 4377 description 4378 "SubTLVs of the Tunnel Encapsulation attribute"; 4379 reference 4380 "RFC5512"; 4381 } 4383 identity tunnel-remote-endpoint { 4384 base tunnel-encapsulation-subtlv-type; 4385 description 4386 "Remote endpoint of the tunnel."; 4387 reference 4388 "RFC5512"; 4389 } 4391 identity tunnel-color { 4392 base tunnel-encapsulation-subtlv-type; 4393 description 4394 "Colour of the tunnel"; 4395 reference 4396 "RFC5512"; 4397 } 4399 identity srte-preference { 4400 base tunnel-encapsulation-subtlv-type; 4401 description 4402 "Preference of the SR-TE policy entry described by 4403 the tunnel encapsulation attribute."; 4404 reference 4405 "draft-previdi-idr-segment-routing-te-policy"; 4406 } 4408 identity srte-binding-sid { 4409 base tunnel-encapsulation-subtlv-type; 4410 description 4411 "Binding SID to be used by the SR-TE policy described 4412 by the tunnel encapsulation attribute."; 4413 reference 4414 "draft-previdi-idr-segment-routing-te-policy"; 4415 } 4417 identity srte-segment-list { 4418 base tunnel-encapsulation-subtlv-type; 4419 description 4420 "Segment lists to be used by the SR-TE policy described 4421 by the tunnel encapsulation attribute."; 4422 reference 4423 "draft-previdi-idr-segment-routing-te-policy"; 4424 } 4426 identity srte-segment-list-subtlv { 4427 description 4428 "SubTLVs of the SR-TE Policy Segment List sub-TLV of the 4429 Tunnel Encapsulation attribute."; 4430 reference 4431 "draft-previdi-idr-segment-routing-te-policy"; 4432 } 4434 identity srte-segment-list-weight { 4435 base srte-segment-list-subtlv; 4436 description 4437 "Weight of the segment list within the SR-TE policy"; 4438 reference 4439 "draft-previdi-idr-segment-routing-te-policy"; 4440 } 4442 identity srte-segment-list-segment { 4443 base srte-segment-list-subtlv; 4444 description 4445 "An individual element within the SR-TE Policy Segment 4446 List."; 4447 } 4448 } 4449 4451 file "ietf-bgp-rib-attributes@2019-02-25.yang" 4452 submodule ietf-bgp-rib-attributes { 4453 yang-version "1.1"; 4454 belongs-to ietf-bgp-rib { 4455 prefix "br"; 4456 } 4458 // import some basic types 4459 import ietf-bgp-types { 4460 prefix bgpt; 4461 } 4463 import ietf-bgp-rib-types { 4464 prefix bgprt; 4465 } 4467 import ietf-inet-types { 4468 prefix inet; 4469 } 4471 // meta 4472 organization 4473 "IETF IDR Working Group"; 4475 contact 4476 "WG Web: 4477 WG List: 4479 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 4480 Keyur Patel (keyur at arrcus.com), 4481 Susan Hares (shares at ndzh.com"; 4483 description 4484 "This submodule contains common data definitions for BGP 4485 attributes for use in BGP RIB tables."; 4487 revision "2019-02-25" { 4488 description 4489 "Initial version"; 4491 reference 4492 "RFC XXXX: BGP YANG Model for Service Provider Network"; 4493 } 4495 grouping bgp-as-path-attr { 4496 description 4497 "Data for representing BGP AS-PATH attribute"; 4499 leaf type { 4500 type identityref { 4501 base bgpt:as-path-segment-type; 4502 } 4503 description 4504 "The type of AS-PATH segment"; 4505 } 4507 leaf-list member { 4508 type inet:as-number; 4509 description 4510 "List of the AS numbers in the AS-PATH segment"; 4511 } 4512 } 4514 grouping bgp-as-path-attr-top { 4515 description 4516 "Top-level grouping for AS-PATH attribute data"; 4518 container as-path { 4519 description 4520 "Enclosing container for the list of AS path segments. 4522 In the Adj-RIB-In or Adj-RIB-Out, this list should show 4523 the received or sent AS_PATH, respectively. For 4524 example, if the local router is not 4-byte capable, this 4525 value should consist of 2-octet ASNs or the AS_TRANS 4526 (AS 23456) values received or sent in route updates. 4528 In the Loc-RIB, this list should reflect the effective 4529 AS path for the route, e.g., a 4-octet value if the 4530 local router is 4-octet capable."; 4531 reference 4532 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4) 4533 RFC 6793 - BGP Support for Four-octet AS Number Space 4534 RFC 5065 - Autonomous System Confederations for BGP"; 4536 list segment { 4537 key "type"; 4538 config false; 4539 uses bgp-as-path-attr; 4540 description 4541 "List of AS PATH segments"; 4542 } 4543 } 4544 } 4546 grouping bgp-as4-path-attr-top { 4547 description 4548 "Top-level grouping for AS4-PATH attribute data"; 4550 container as4-path { 4551 description 4552 "This is the path encoded with 4-octet 4553 AS numbers in the optional transitive AS4_PATH attribute. 4554 This value is populated with the received or sent attribute 4555 in Adj-RIB-In or Adj-RIB-Out, respectively. It should not 4556 be populated in Loc-RIB since the Loc-RIB is expected to 4557 store the effective AS-Path in the as-path leaf regardless 4558 of being 4-octet or 2-octet."; 4559 reference 4560 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4562 list segment { 4563 key "type"; 4565 config false; 4566 uses bgp-as-path-attr; 4567 description 4568 "List of AS PATH segments"; 4569 } 4570 } 4571 } 4573 grouping bgp-community-attr-state { 4574 description 4575 "Common definition of BGP community attributes"; 4577 leaf-list community { 4578 type union { 4579 type bgpt:bgp-well-known-community-type; 4580 type bgpt:bgp-std-community-type; 4581 } 4582 description 4583 "List of standard or well-known BGP community 4584 attributes."; 4585 } 4587 } 4589 grouping bgp-extended-community-attr-state { 4590 description 4591 "Common definition of BGP extended community attribute"; 4593 leaf-list ext-community { 4594 // type bgpt:bgp-ext-community-recv-type; 4595 type bgpt:bgp-ext-community-type; 4596 description 4597 "List of BGP extended community attributes. The received 4598 extended community may be an explicitly modeled 4599 type or unknown, represented by an 8-octet value 4600 formatted according to RFC 4360."; 4601 reference 4602 "RFC 4360 - BGP Extended Communities Attribute"; 4603 } 4605 } 4607 grouping bgp-aggregator-attr-top { 4608 description 4609 "Common definition of the BGP aggregator attribute"; 4611 container aggregator { 4612 config false; 4613 description 4614 "BGP attribute indicating the prefix has been aggregated by 4615 the specified AS and router."; 4617 leaf as { 4618 type inet:as-number; 4619 description 4620 "AS number of the autonomous system that performed the 4621 aggregation."; 4622 } 4624 leaf as4 { 4625 type inet:as-number; 4626 description 4627 "AS number of the autonomous system that performed the 4628 aggregation (4-octet representation). This value is 4629 populated if an upstream router is not 4-octet capable. 4630 Its semantics are similar to the AS4_PATH optional 4631 transitive attribute"; 4632 reference 4633 "RFC 6793 - BGP Support for Four-octet AS Number Space"; 4634 } 4635 leaf address { 4636 type inet:ipv4-address; 4637 description 4638 "IP address of the router that performed the 4639 aggregation."; 4640 } 4641 } 4642 } 4644 grouping bgp-shared-common-attr-state { 4645 description 4646 "Route attributes shared across route table entries, 4647 common to both LOC-Rib and Adj-RIB"; 4649 leaf origin { 4650 type bgpt:bgp-origin-attr-type; 4651 description 4652 "BGP attribute defining the origin of the path information."; 4653 } 4655 leaf atomic-aggregate { 4656 type boolean; 4657 description 4658 "BGP attribute indicating that the prefix is an atomic 4659 aggregate, i.e., the peer selected a less specific 4660 route without selecting a more specific route that is 4661 included in it."; 4662 } 4664 leaf next-hop { 4665 type inet:ip-address; 4666 description 4667 "BGP next hop attribute defining the IP address of the router 4668 that should be used as the next hop to the destination"; 4669 } 4671 leaf med { 4672 type uint32; 4673 description 4674 "BGP multi-exit discriminator attribute used in BGP route 4675 selection process"; 4676 } 4678 leaf local-pref { 4679 type uint32; 4680 description 4681 "BGP local preference attribute sent to internal peers to 4682 indicate the degree of preference for externally learned 4683 routes. The route with the highest local preference value 4684 is preferred."; 4685 } 4687 leaf originator-id { 4688 type inet:ipv4-address; 4689 description 4690 "BGP attribute that provides the id as an IPv4 address 4691 of the originator of the announcement."; 4692 reference 4693 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4694 Mesh Internal BGP (IBGP)"; 4695 } 4697 leaf-list cluster-list { 4698 type inet:ipv4-address; 4699 description 4700 "Represents the reflection path that the route has passed."; 4701 reference 4702 "RFC 4456 - BGP Route Reflection: An Alternative to Full 4703 Mesh Internal BGP (IBGP)"; 4704 } 4706 leaf aigp { 4707 type uint64; 4708 description 4709 "BGP path attribute representing the accumulated IGP metric 4710 for the path"; 4711 reference 4712 "RFC 7311 - The Accumulated IGP Metric Attribute for BGP"; 4713 } 4714 } 4716 grouping bgp-unknown-attr-flags-state { 4717 description 4718 "Operational state data for path attribute flags"; 4720 leaf optional { 4721 type boolean; 4722 description 4723 "Defines whether the attribute is optional (if 4724 set to true) or well-known (if set to false). 4725 Set in the high-order bit of the BGP attribute 4726 flags octet."; 4727 reference 4728 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4729 } 4730 leaf transitive { 4731 type boolean; 4732 description 4733 "Defines whether an optional attribute is transitive 4734 (if set to true) or non-transitive (if set to false). For 4735 well-known attributes, the transitive flag must be set to 4736 true. Set in the second high-order bit of the BGP attribute 4737 flags octet."; 4738 reference 4739 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4740 } 4742 leaf partial { 4743 type boolean; 4744 description 4745 "Defines whether the information contained in the optional 4746 transitive attribute is partial (if set to true) or complete 4747 (if set to false). For well-known attributes and for 4748 optional non-transitive attributes, the partial flag 4749 must be set to false. Set in the third high-order bit of 4750 the BGP attribute flags octet."; 4751 reference 4752 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4753 } 4755 leaf extended { 4756 type boolean; 4757 description 4758 "Defines whether the attribute length is one octet 4759 (if set to false) or two octets (if set to true). Set in 4760 the fourth high-order bit of the BGP attribute flags 4761 octet."; 4762 reference 4763 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4764 } 4765 } 4767 grouping bgp-unknown-attr-state { 4768 description 4769 "Operational state data for path attributes not shared 4770 across route entries, common to LOC-RIB and Adj-RIB"; 4772 leaf attr-type { 4773 type uint8; 4774 description 4775 "1-octet value encoding the attribute type code"; 4776 reference 4777 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4779 } 4781 leaf attr-len { 4782 type uint16; 4783 description 4784 "One or two octet attribute length field indicating the 4785 length of the attribute data in octets. If the Extended 4786 Length attribute flag is set, the length field is 2 octets, 4787 otherwise it is 1 octet"; 4788 reference 4789 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4790 } 4792 leaf attr-value { 4793 type binary { 4794 length 1..65535; 4795 } 4796 description 4797 "Raw attribute value, not including the attribute 4798 flags, type, or length. The maximum length 4799 of the attribute value data is 2^16-1 per the max value 4800 of the attr-len field (2 octets)."; 4801 reference 4802 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; 4803 } 4804 } 4806 grouping bgp-unknown-attr-top { 4807 description 4808 "Unknown path attributes that are not expected to be shared 4809 across route entries, common to LOC-RIB and Adj-RIB"; 4811 container unknown-attributes { 4812 description 4813 "Unknown path attributes that were received in the UPDATE 4814 message which contained the prefix."; 4816 list unknown-attribute { 4817 key "attr-type"; 4818 description 4819 "This list contains received attributes that are unrecognized 4820 or unsupported by the local router. The list may be empty."; 4822 uses bgp-unknown-attr-flags-state; 4823 uses bgp-unknown-attr-state; 4824 } 4825 } 4826 } 4827 grouping bgp-loc-rib-attr-state { 4828 description 4829 "Path attributes that are not expected to be shared across 4830 route entries, specific to LOC-RIB"; 4832 } 4834 grouping bgp-adj-rib-attr-state { 4835 description 4836 "Path attributes that are not expected to be shared across 4837 route entries, specific to Adj-RIB"; 4839 leaf path-id { 4840 type uint32; 4841 description 4842 "When the BGP speaker supports advertisement of multiple 4843 paths for a prefix, the path identifier is used to 4844 uniquely identify a route based on the combination of the 4845 prefix and path id. In the Adj-RIB-In, the path-id value is 4846 the value received in the update message. In the Loc-RIB, 4847 if used, it should represent a locally generated path-id 4848 value for the corresponding route. In Adj-RIB-Out, it 4849 should be the value sent to a neighbor when add-paths is 4850 used, i.e., the capability has been negotiated."; 4851 reference 4852 "draft-ietf-idr-add-paths - Advertisement of Multiple Paths 4853 in BGP"; 4854 } 4855 } 4857 grouping bgp-tunnel-encapsulation-attr-top { 4858 description 4859 "Top-level definition of the BGP Tunnel encapsulation 4860 attribute."; 4862 container tunnel-encapsulation { 4863 config false; 4864 description 4865 "The Tunnel Encapsulation attribute specifies a set of 4866 tunnels to a remote destination. The attribute is TLV 4867 based and allows description of a tunnel type, and the 4868 relevant information to create the tunnel to the remote 4869 destination."; 4871 reference "RFC5512, draft-ietf-idr-tunnel-encaps"; 4873 container tunnels { 4874 description 4875 "Surrounding container for the set of tunnels included 4876 within the tunnel encapsulation attribute."; 4878 list tunnel { 4879 key "type"; 4880 description 4881 "List of the tunnels that are specified within the 4882 attribute. Keyed on the type of tunnel that the 4883 TLV describes."; 4885 leaf type { 4886 type identityref { 4887 base "bgprt:tunnel-encapsulation-type"; 4888 } 4889 description 4890 "Type of the tunnel described within the tunnel 4891 encapsulation attribute."; 4892 } 4894 container subtlvs { 4895 description 4896 "Surrounding container for the list of sub-TLVs within 4897 the tunnel encapsulation attribute."; 4899 list subtlv { 4900 key "type"; 4901 description 4902 "List of the subTLVs that are specified within the 4903 TLV instance inside the tunnel encapsulation 4904 attribute."; 4906 leaf type { 4907 type identityref { 4908 base "bgprt:tunnel-encapsulation-subtlv-type"; 4909 } 4910 description 4911 "Type of the sub-TLV within the tunnel encapsulation 4912 attribute"; 4913 } 4915 leaf-list colors { 4916 when "../type = 'bgprt:tunnel-color'" { 4917 description 4918 "Only allow list of colors to be specified when 4919 the sub-TLV specifies colors associated with the 4920 tunnel encapsulation attribute."; 4921 } 4922 type uint32; 4923 description 4924 "The colors associated with the tunnel encapsulation 4925 attribute, as described by RFC5512."; 4926 } 4928 leaf preference { 4929 when "../type = 'bgprt:srte-preference'" { 4930 description 4931 "Only allow the preference to be specified when the 4932 sub-TLV specifies the preference associated with 4933 the tunnel encapsulation attribute."; 4934 } 4935 type uint32; 4936 default 100; 4937 description 4938 "The preference of the SR-TE policy described by the 4939 tunnel encapsulation attribute. If unspecified, the 4940 preference defaults to 100."; 4941 } 4943 leaf binding-sid { 4944 when "../type = 'bgprt:srte-binding-sid'" { 4945 description 4946 "Only allow the binding SID to be specified when the 4947 sub-TLV is specified to be the of the relevant 4948 type."; 4949 } 4950 // type sr:sr-sid-type; 4951 // defining it as string, till we figure what this 4952 // should be. 4953 type string; 4954 description 4955 "Binding SID associated with the SR-TE policy"; 4956 } 4958 container remote-endpoints { 4959 when "../type = 'bgprt:tunnel-remote-endpoint'" { 4960 description 4961 "Only allow the remote endpoint to be specified 4962 when the subTLV is specified to describe remote 4963 endpoints."; 4964 } 4966 description 4967 "The remote endpoints associated with the tunnel 4968 described by the attribute."; 4970 list remote-endpoint { 4971 key "endpoint"; 4972 config false; 4973 description 4974 "List of the remote endpoints described within 4975 the TLV."; 4977 leaf as { 4978 type inet:as-number; 4979 description 4980 "The remote AS to which the IP address of the 4981 remote endpoint belongs."; 4982 } 4984 leaf endpoint { 4985 type inet:ip-address; 4986 description 4987 "IP address of the remote endpoint."; 4988 } 4989 } 4990 } 4992 container segment-lists { 4993 when "../type = 'bgprt:srte-segment-list'" { 4994 description 4995 "Only allow the segment lists to be specified when 4996 the sub-TLV is of the relevant type."; 4997 } 4999 description 5000 "Surrounding container for the list of segment lists 5001 that are associated with a SR-TE Policy tunnel."; 5003 list segment-list { 5004 key "instance-id"; 5005 config false; 5007 description 5008 "List of segment lists that are specified within the 5009 tunnel encapsulation attribute."; 5011 leaf instance-id { 5012 type uint64; 5013 description 5014 "Instance of the segment list within the 5015 sub-TLV"; 5016 } 5018 leaf weight { 5019 type uint32; 5020 description 5021 "The weight given to the path within the set of 5022 segment lists that are included in the tunnel 5023 attribute sub-TLV."; 5024 } 5026 container segments { 5027 description 5028 "Surrounding container for the list of segments 5029 within the SR-TE segment list."; 5031 list segment { 5032 key "index"; 5034 config false; 5035 description 5036 "List of segments within the SR-TE segment 5037 list."; 5039 leaf index { 5040 type uint64; 5041 description 5042 "Index of the segment within the segment 5043 list. The segments are ordered in ascending 5044 order, beginning at 0."; 5045 } 5047 leaf type { 5048 type enumeration { 5049 enum MPLS_SID { 5050 value 1; 5051 description 5052 "The segment is specified as an MPLS 5053 label."; 5054 } 5055 enum IPV6_SID { 5056 value 2; 5057 description 5058 "The segment is specified as an IPv6 5059 address."; 5060 } 5061 enum IPV4_NODE_ADDRESS { 5062 value 3; 5063 description 5064 "The segment is specified as an IPv4 5065 node address with optional SID."; 5066 } 5067 enum IPV6_NODE_ADDRESS { 5068 value 4; 5069 description 5070 "The segment is specified as an IPv6 5071 node address with optional SID."; 5072 } 5073 enum IPV4_LOCAL_INTF_ID { 5074 value 5; 5075 description 5076 "The segment is specified as an IPv4 5077 address with a local interface 5078 identifier along with an ."; 5079 } 5080 enum IPV4_LOCAL_REMOTE_ADDR { 5081 value 6; 5082 description 5083 "The segment is specified as an IPv4 5084 local and remote address with an 5085 optional SID."; 5086 } 5087 enum IPV6_LOCAL_INTF_ID { 5088 value 7; 5089 description 5090 "The segment is specified as an IPv6 5091 address with an index, along with an 5092 optional SID."; 5093 } 5094 enum IPV6_LOCAL_REMOTE_ADDR { 5095 value 8; 5096 description 5097 "The segmetn is specified as an IPv6 5098 local and remote address with an 5099 optional SID."; 5100 } 5101 } 5102 description 5103 "The type of segment specified within the 5104 segment entry."; 5105 } 5107 leaf sid { 5108 // TODO: type sr:sr-sid-type; 5109 // using string till this is resolved. 5110 type string; 5111 description 5112 "SID value for the segment entry, specified 5113 as an MPLS label or IPv6 address."; 5114 } 5115 leaf mpls-tc { 5116 when "../type = 'MPLS_SID'" { 5117 description 5118 "The MPLS TC bits can only be specified 5119 when the segment time is an MPLS label."; 5120 } 5121 type uint8 { 5122 range "0..7"; 5123 } 5124 description 5125 "The MPLS TC bits used when the SID is 5126 specified as an MPLS label. If set to zero, 5127 the receiving system specifies the value of 5128 the TC bits."; 5129 } 5131 leaf mpls-bos { 5132 when "../type = 'MPLS_SID'" { 5133 description 5134 "The MPLS BoS bit can only be specified 5135 when the segment type is an MPLS label."; 5136 } 5137 type boolean; 5138 description 5139 "When this leaf is set to true the MPLS 5140 bottom-of-stack (BoS) bit is set in the 5141 MPLS segment. The BoS bit should always be 5142 set to zero by the sender."; 5143 } 5145 leaf mpls-ttl { 5146 when "../type = 'MPLS_SID'" { 5147 description 5148 "The MPLS TTL can only be set when the 5149 segment type is an MPLS label."; 5150 } 5151 type uint8; 5152 description 5153 "The MPLS time to live (TTL) to be set for 5154 the MPLS segment. If set to 255, the 5155 receiver specifies the TTL value that is 5156 used for packets sent with this segment in 5157 the stack."; 5158 } 5160 leaf remote-ipv4-address { 5161 when "../type = 'IPV4_NODE_ADDRESS' or" + 5162 // "../type='../IPV4_ADDRESS_INDEX' or" + 5163 "../type='IPV4_LOCAL_INTF_ID' or " + 5164 "../type='IPV4_LOCAL_REMOTE_ADDR'" { 5165 description 5166 "An IPv4 address can only be associated 5167 with the segment entry when the type of 5168 the SID is a node address, or an IPv6 5169 address with an index."; 5170 } 5171 type inet:ipv4-address; 5172 description 5173 "An IPv4 address specified as the remote 5174 node address. When the type of the segment 5175 specifies only the remote address, no other 5176 addresses are specified. When the type of 5177 the segment requires a local address, 5178 this leaf specifies the remote IPv4 5179 address."; 5180 } 5182 leaf local-ipv4-address { 5183 when "../type = 'IPV4_LOCAL_REMOTE_ADDR'" { 5184 description 5185 "A local IPv4 address can only be specified 5186 when the segment is specified by the 5187 local and remote IPv4 interface 5188 addresses."; 5189 } 5190 type inet:ipv4-address; 5191 description 5192 "An IPv4 address of a local adjacency that is 5193 used to identify the segment."; 5194 } 5196 leaf remote-ipv6-address { 5197 when "../type = 'IPV6_NODE_ADDRESS' or" + 5198 // "../type='IPV6_ADDRESS_INDEX' or" + 5199 "../type='IPV6_LOCAL_INTF_ID' or " + 5200 "../type='IPV6_LOCAL_REMOTE_ADDR'" { 5201 description 5202 "An IPv6 address can only be specified with 5203 a segment entry when the type of the SID 5204 is a node address, or an IPv6 address 5205 with an index."; 5206 } 5207 type inet:ipv6-address; 5208 description 5209 "An IPv6 address specified as the remote node 5210 address. When the type of the segment 5211 specifies only the remote address, no other 5212 addresses are specified. When the type of 5213 the segment requires a local address, 5214 this leaf specifies the remote IPv6 5215 address."; 5216 } 5218 leaf local-ipv6-address { 5219 when "../type = 'IPV6_LOCAL_REMOTE_ADDR'" { 5220 description 5221 "A local IPv6 address can only be 5222 specified when the segment is specified 5223 by the local and remote IPv6 interface 5224 addresses."; 5225 } 5226 type inet:ipv6-address; 5227 description 5228 "An IPv6 address of a local adjacency that is 5229 used to identify the segment."; 5230 } 5232 leaf local-interface-id { 5233 when "../type = 'IPV4_LOCAL_INTF_ID' or" + 5234 "../type='IPV6_LOCAL_INTF_ID'" { 5235 description 5236 "A local interface identifier can only be 5237 specified when the type of the segment 5238 is an IPv4 address with local interface 5239 ID, or IPv6 address with local interface 5240 ID."; 5241 } 5242 type uint32; 5243 description 5244 "The local interface identifier to be 5245 utilised for the segment."; 5246 reference 5247 "draft-ietf-pce-segment-routing"; 5248 } 5249 } 5250 } 5251 } 5252 } 5253 } 5254 } 5255 } 5256 } 5257 } 5258 } 5260 } 5261 5263 file "ietf-bgp-rib-shared-attributes@2019-02-25.yang" 5264 submodule ietf-bgp-rib-shared-attributes { 5265 yang-version "1.1"; 5266 belongs-to ietf-bgp-rib { 5267 prefix "br"; 5268 } 5270 // import some basic types 5271 include ietf-bgp-rib-attributes; 5273 organization 5274 "IETF IDR Working Group"; 5276 contact 5277 "WG Web: 5278 WG List: 5280 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5281 Keyur Patel (keyur at arrcus.com), 5282 Susan Hares (shares at ndzh.com"; 5284 description 5285 "This submodule contains structural data definitions for 5286 attribute sets shared across routes."; 5288 revision "2019-02-25" { 5289 description 5290 "Initial version"; 5291 reference 5292 "RFC XXXX: BGP YANG Model for Service Provider Network."; 5293 } 5295 grouping attribute-sets { 5296 description 5297 "Top level grouping for list of common attribute sets"; 5299 container attr-sets { 5300 description 5301 "Enclosing container for the list of path attribute sets"; 5303 list attr-set { 5304 key "index"; 5306 description 5307 "List of path attributes that may be in use by multiple 5308 routes in the table"; 5310 leaf index { 5311 type uint64; 5312 description 5313 "System generated index for each attribute set. The 5314 index is used to reference an attribute set from a 5315 specific path. Multiple paths may reference the same 5316 attribute set."; 5317 } 5319 uses bgp-shared-common-attr-state; 5320 uses bgp-aggregator-attr-top; 5321 uses bgp-as-path-attr-top; 5322 uses bgp-as4-path-attr-top; 5323 uses bgp-tunnel-encapsulation-attr-top; 5324 } 5325 } 5326 } 5328 grouping community-sets { 5329 description 5330 "Top level grouping for list of shared community attribute 5331 sets"; 5333 container communities { 5334 description 5335 "Enclosing container for the list of community attribute 5336 sets"; 5338 list community { 5339 key "index"; 5341 config false; 5342 description 5343 "List of path attributes that may be in use by multiple 5344 routes in the table"; 5346 leaf index { 5347 type uint64; 5348 description 5349 "System generated index for each attribute set. The 5350 index is used to reference an attribute set from a 5351 specific path. Multiple paths may reference the same 5352 attribute set."; 5353 } 5354 uses bgp-community-attr-state; 5355 } 5356 } 5357 } 5359 grouping ext-community-sets { 5360 description 5361 "Top level grouping for list of extended community attribute 5362 sets"; 5364 container ext-communities { 5365 description 5366 "Enclosing container for the list of extended community 5367 attribute sets"; 5369 list ext-community { 5370 key "index"; 5372 config false; 5373 description 5374 "List of path attributes that may be in use by multiple 5375 routes in the table"; 5377 leaf index { 5378 type uint64; 5379 description 5380 "System generated index for each attribute set. The 5381 index is used to reference an attribute set from a 5382 specific path. Multiple paths may reference the same 5383 attribute set."; 5384 } 5386 uses bgp-extended-community-attr-state; 5387 } 5388 } 5389 } 5390 } 5391 5393 file "ietf-bgp-rib-table-attributes@2019-02-25.yang" 5394 submodule ietf-bgp-rib-table-attributes { 5395 yang-version "1.1"; 5396 belongs-to ietf-bgp-rib { 5397 prefix "br"; 5398 } 5400 // import some basic types 5401 import ietf-yang-types { prefix types; } 5402 import ietf-bgp-rib-types { prefix bgpribt; } 5404 organization 5405 "IETF IDR Working Group"; 5407 contact 5408 "WG Web: 5409 WG List: 5411 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 5412 Keyur Patel (keyur at arrcus.com), 5413 Susan Hares (shares at ndzh.com"; 5415 description 5416 "This submodule contains common data definitions for data 5417 related to a RIB entry, or RIB table."; 5419 revision "2019-02-25" { 5420 description 5421 "Initial version."; 5422 reference 5423 "RFC XXXX: BGP YANG Model for Service Provider Network."; 5424 } 5426 grouping bgp-common-route-annotations-state { 5427 description 5428 "Data definitions for flags and other information attached 5429 to routes in both LOC-RIB and Adj-RIB"; 5431 leaf last-modified { 5432 type types:timeticks; 5433 description 5434 "Timestamp when this path was last modified. 5436 The value is the timestamp in seconds relative to 5437 the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; 5438 } 5440 leaf valid-route { 5441 type boolean; 5442 description 5443 "Indicates that the route is considered valid by the 5444 local router"; 5445 } 5447 leaf invalid-reason { 5448 type identityref { 5449 base bgpribt:invalid-route-reason; 5450 } 5451 description 5452 "If the route is rejected as invalid, this indicates the 5453 reason."; 5454 } 5456 } 5458 grouping bgp-loc-rib-route-annotations-state { 5459 description 5460 "Data definitions for information attached to routes in the 5461 LOC-RIB"; 5463 // placeholder for route metadata specific to the LOC-RIB 5465 } 5467 grouping bgp-adj-rib-in-post-route-annotations-state { 5468 description 5469 "Data definitions for information attached to routes in the 5470 Adj-RIB-in post-policy table"; 5472 leaf best-path { 5473 type boolean; 5474 description 5475 "Current path was selected as the best path."; 5476 } 5477 } 5479 grouping bgp-common-table-attrs-state { 5480 description 5481 "Common attributes attached to all routing tables"; 5483 // placeholder for metadata associated with all tables 5484 } 5486 grouping bgp-common-table-attrs-top { 5487 // no enclosing container as this data will fit under an 5488 // existing LOC-RIB container 5490 uses bgp-common-table-attrs-state; 5491 description 5492 "Operational state data for data related to the entire 5493 LOC-RIB"; 5494 } 5495 } 5496 5498 file "ietf-bgp-rib-tables@2019-02-25.yang" 5499 submodule ietf-bgp-rib-tables { 5500 yang-version "1.1"; 5501 belongs-to ietf-bgp-rib { 5502 prefix "br"; 5503 } 5505 // import some basic types 5506 import ietf-inet-types { 5507 prefix inet; 5508 } 5510 import ietf-routing { 5511 prefix "rt"; 5512 reference 5513 "RFC 8022: A YANG Data Model for Routing Management"; 5514 } 5516 include ietf-bgp-rib-attributes; 5517 include ietf-bgp-rib-shared-attributes; 5518 include ietf-bgp-rib-table-attributes; 5520 organization 5521 "IETF IDR Working Group"; 5523 contact 5524 "WG Web: 5525 WG List: 5527 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 5528 Authors: Keyur Patel, 5529 Mahesh Jethanandani, 5530 Susan Hares"; 5532 description 5533 "This submodule contains structural data definitions for 5534 BGP routing tables."; 5536 revision "2019-02-25" { 5537 description 5538 "Initial Version"; 5539 reference 5540 "RFC XXXX, BGP YANG Model for Service Provider Network."; 5541 } 5542 grouping bgp-adj-rib-common-attr-refs { 5543 description 5544 "Definitions of common references to attribute sets for 5545 multiple AFI-SAFIs for Adj-RIB tables"; 5547 leaf attr-index { 5548 type leafref { 5549 path "../../../../../../../../../attr-sets/attr-set/" + 5550 "index"; 5551 } 5552 description 5553 "Reference to the common attribute group for the 5554 route"; 5555 } 5557 leaf community-index { 5558 type leafref { 5559 path "../../../../../../../../../communities/community/" + 5560 "index"; 5561 } 5562 description 5563 "Reference to the community attribute for the route"; 5564 } 5566 leaf ext-community-index { 5567 type leafref { 5568 path "../../../../../../../../../ext-communities/" + 5569 "ext-community/index"; 5570 } 5571 description 5572 "Reference to the extended community attribute for the 5573 route"; 5574 } 5575 } 5577 grouping bgp-loc-rib-common-attr-refs { 5578 description 5579 "Definitions of common references to attribute sets for 5580 multiple AFI-SAFIs for LOC-RIB tables"; 5582 leaf attr-index { 5583 type leafref { 5584 path "../../../../../../../attr-sets/attr-set/" + 5585 "index"; 5586 } 5587 description 5588 "Reference to the common attribute group for the 5589 route"; 5591 } 5593 leaf community-index { 5594 type leafref { 5595 path "../../../../../../../communities/community/" + 5596 "index"; 5597 } 5598 description 5599 "Reference to the community attribute for the route"; 5600 } 5602 leaf ext-community-index { 5603 type leafref { 5604 path "../../../../../../../ext-communities/" + 5605 "ext-community/index"; 5606 } 5607 description 5608 "Reference to the extended community attribute for the 5609 route"; 5610 } 5611 } 5613 grouping bgp-loc-rib-common-keys { 5614 description 5615 "Common references used in keys for IPv4 and IPv6 5616 LOC-RIB entries"; 5618 leaf origin { 5619 type union { 5620 type inet:ip-address; 5621 type identityref { 5622 base rt:routing-protocol; 5623 } 5624 } 5625 description 5626 "Indicates the origin of the route. If the route is learned 5627 from a neighbor, this value is the neighbor address. If 5628 the route was injected or redistributed from another 5629 protocol, the origin indicates the source protocol for the 5630 route."; 5631 } 5633 leaf path-id { 5634 type uint32; 5635 // TODO: YANG does not allow default values for key 5636 // default 0; 5637 description 5638 "If the route is learned from a neighbor, the path-id 5639 corresponds to the path-id for the route in the 5640 corresponding adj-rib-in-post table. If the route is 5641 injected from another protocol, or the neighbor does not 5642 support BGP add-paths, the path-id should be set 5643 to zero, also the default value."; 5644 } 5645 } 5647 grouping ipv4-loc-rib { 5648 description 5649 "Top-level grouping for IPv4 routing tables"; 5651 container loc-rib { 5652 config false; 5653 description 5654 "Container for the IPv4 BGP LOC-RIB data"; 5656 uses bgp-common-table-attrs-top; 5658 container routes { 5659 description 5660 "Enclosing container for list of routes in the routing 5661 table."; 5663 list route { 5664 key "prefix origin path-id"; 5666 description 5667 "List of routes in the table, keyed by the route 5668 prefix, the route origin, and path-id. The route 5669 origin can be either the neighbor address from which 5670 the route was learned, or the source protocol that 5671 injected the route. The path-id distinguishes routes 5672 for the same prefix received from a neighbor (e.g., 5673 if add-paths is eanbled)."; 5675 leaf prefix { 5676 type inet:ipv4-prefix; 5677 description 5678 "The IPv4 prefix corresponding to the route"; 5679 } 5681 uses bgp-loc-rib-common-keys; 5682 uses bgp-loc-rib-common-attr-refs; 5683 uses bgp-loc-rib-attr-state; 5684 uses bgp-common-route-annotations-state; 5685 uses bgp-loc-rib-route-annotations-state; 5686 uses bgp-unknown-attr-top; 5688 } 5689 } 5690 } 5691 } 5693 grouping ipv6-loc-rib { 5694 description 5695 "Top-level grouping for IPv6 routing tables"; 5697 container loc-rib { 5698 config false; 5699 description 5700 "Container for the IPv6 BGP LOC-RIB data"; 5702 uses bgp-common-table-attrs-top; 5704 container routes { 5705 description 5706 "Enclosing container for list of routes in the routing 5707 table."; 5709 list route { 5710 key "prefix origin path-id"; 5712 description 5713 "List of routes in the table, keyed by the route 5714 prefix, the route origin, and path-id. The route 5715 origin can be either the neighbor address from which 5716 the route was learned, or the source protocol that 5717 injected the route. The path-id distinguishes routes 5718 for the same prefix received from a neighbor (e.g., 5719 if add-paths is eanbled)."; 5721 leaf prefix { 5722 type inet:ipv6-prefix; 5723 description 5724 "The IPv6 prefix corresponding to the route"; 5725 } 5727 uses bgp-loc-rib-common-keys; 5728 uses bgp-loc-rib-common-attr-refs; 5729 uses bgp-loc-rib-attr-state; 5730 uses bgp-common-route-annotations-state; 5731 uses bgp-loc-rib-route-annotations-state; 5732 uses bgp-unknown-attr-top; 5733 } 5734 } 5735 } 5737 } 5739 grouping ipv4-adj-rib-common { 5740 description 5741 "Common structural grouping for each IPv4 adj-RIB table"; 5743 uses bgp-common-table-attrs-top; 5745 container routes { 5746 config false; 5747 description 5748 "Enclosing container for list of routes in the routing 5749 table."; 5751 list route { 5752 key "prefix path-id"; 5754 description 5755 "List of routes in the table, keyed by a combination of 5756 the route prefix and path-id to distinguish multiple 5757 routes received from a neighbor for the same prefix, 5758 e.g., when BGP add-paths is enabled."; 5760 leaf prefix { 5761 type inet:ipv4-prefix; 5762 description 5763 "Prefix for the route"; 5764 } 5766 uses bgp-adj-rib-attr-state; 5767 uses bgp-adj-rib-common-attr-refs; 5768 uses bgp-common-route-annotations-state; 5769 uses bgp-unknown-attr-top; 5771 } 5772 } 5773 } 5775 grouping ipv4-adj-rib-in-post { 5776 description 5777 "Common structural grouping for the IPv4 adj-rib-in 5778 post-policy table"; 5780 uses bgp-common-table-attrs-top; 5782 container routes { 5783 config false; 5784 description 5785 "Enclosing container for list of routes in the routing 5786 table."; 5788 list route { 5789 key "prefix path-id"; 5791 description 5792 "List of routes in the table, keyed by a combination of 5793 the route prefix and path-id to distinguish multiple 5794 routes received from a neighbor for the same prefix, 5795 e.g., when BGP add-paths is enabled."; 5797 leaf prefix { 5798 type inet:ipv4-prefix; 5799 description 5800 "Prefix for the route"; 5801 } 5803 uses bgp-adj-rib-attr-state; 5804 uses bgp-adj-rib-common-attr-refs; 5805 uses bgp-common-route-annotations-state; 5806 uses bgp-adj-rib-in-post-route-annotations-state; 5807 uses bgp-unknown-attr-top; 5808 } 5809 } 5810 } 5812 grouping ipv4-adj-rib { 5813 description 5814 "Top-level grouping for Adj-RIB table"; 5816 container neighbors { 5817 config false; 5818 description 5819 "Enclosing container for neighbor list"; 5821 list neighbor { 5822 key "neighbor-address"; 5823 description 5824 "List of neighbors (peers) of the local BGP speaker"; 5826 leaf neighbor-address { 5827 type inet:ip-address; 5828 description 5829 "IP address of the BGP neighbor or peer"; 5830 } 5831 container adj-rib-in-pre { 5832 description 5833 "Per-neighbor table containing the NLRI updates 5834 received from the neighbor before any local input 5835 policy rules or filters have been applied. This can 5836 be considered the 'raw' updates from the neighbor."; 5838 uses ipv4-adj-rib-common; 5840 } 5842 container adj-rib-in-post { 5843 description 5844 "Per-neighbor table containing the paths received from 5845 the neighbor that are eligible for best-path selection 5846 after local input policy rules have been applied."; 5848 uses ipv4-adj-rib-in-post; 5849 } 5851 container adj-rib-out-pre { 5852 description 5853 "Per-neighbor table containing paths eligble for 5854 sending (advertising) to the neighbor before output 5855 policy rules have been applied"; 5857 uses ipv4-adj-rib-common; 5859 } 5861 container adj-rib-out-post { 5862 description 5863 "Per-neighbor table containing paths eligble for 5864 sending (advertising) to the neighbor after output 5865 policy rules have been applied"; 5867 uses ipv4-adj-rib-common; 5869 } 5870 } 5871 } 5872 } 5874 grouping ipv6-adj-rib-common { 5875 description 5876 "Common structural grouping for each IPv6 adj-RIB table"; 5878 uses bgp-common-table-attrs-state; 5879 container routes { 5880 config false; 5881 description 5882 "Enclosing container for list of routes in the routing 5883 table."; 5885 list route { 5886 key "prefix path-id"; 5888 description 5889 "List of routes in the table"; 5891 leaf prefix { 5892 type inet:ipv6-prefix; 5893 description 5894 "Prefix for the route"; 5895 } 5897 uses bgp-adj-rib-attr-state; 5898 uses bgp-adj-rib-common-attr-refs; 5899 uses bgp-common-route-annotations-state; 5900 uses bgp-unknown-attr-top; 5901 } 5902 } 5903 } 5905 grouping ipv6-adj-rib-in-post { 5906 description 5907 "Common structural grouping for the IPv6 adj-rib-in 5908 post-policy table"; 5910 uses bgp-common-table-attrs-state; 5912 container routes { 5913 config false; 5914 description 5915 "Enclosing container for list of routes in the routing 5916 table."; 5918 list route { 5919 key "prefix path-id"; 5921 description 5922 "List of routes in the table"; 5924 leaf prefix { 5925 type inet:ipv6-prefix; 5926 description 5927 "Prefix for the route"; 5928 } 5930 uses bgp-adj-rib-attr-state; 5931 uses bgp-adj-rib-common-attr-refs; 5932 uses bgp-common-route-annotations-state; 5933 uses bgp-adj-rib-in-post-route-annotations-state; 5934 uses bgp-unknown-attr-top; 5935 } 5936 } 5937 } 5939 grouping ipv6-adj-rib { 5940 description 5941 "Top-level grouping for Adj-RIB table"; 5943 container neighbors { 5944 config false; 5945 description 5946 "Enclosing container for neighbor list"; 5948 list neighbor { 5949 key "neighbor-address"; 5950 description 5951 "List of neighbors (peers) of the local BGP speaker"; 5953 leaf neighbor-address { 5954 type inet:ip-address; 5955 description 5956 "IP address of the BGP neighbor or peer"; 5957 } 5959 container adj-rib-in-pre { 5960 description 5961 "Per-neighbor table containing the NLRI updates 5962 received from the neighbor before any local input 5963 policy rules or filters have been applied. This can 5964 be considered the 'raw' updates from the neighbor."; 5966 uses ipv6-adj-rib-common; 5968 } 5970 container adj-rib-in-post { 5971 description 5972 "Per-neighbor table containing the paths received from 5973 the neighbor that are eligible for best-path selection 5974 after local input policy rules have been applied."; 5976 uses ipv6-adj-rib-in-post; 5977 } 5979 container adj-rib-out-pre { 5980 description 5981 "Per-neighbor table containing paths eligble for 5982 sending (advertising) to the neighbor before output 5983 policy rules have been applied"; 5985 uses ipv6-adj-rib-common; 5987 } 5989 container adj-rib-out-post { 5990 description 5991 "Per-neighbor table containing paths eligble for 5992 sending (advertising) to the neighbor after output 5993 policy rules have been applied"; 5995 uses ipv6-adj-rib-common; 5997 } 5998 } 5999 } 6000 } 6002 grouping ipvX-srte-policy-adjrib { 6003 description 6004 "Top-level grouping for the IPv4 and IPv6 AFI, SR-TE Policy SAFI 6005 Adj-RIBs."; 6007 container neighbors { 6008 description 6009 "Surrounding container for the list of neighbours that are 6010 enabled for the IPv4 and IPv6 AFI, SR-TE Policy SAFI address 6011 family."; 6013 list neighbor { 6014 key "neighbor-address"; 6016 description 6017 "An individual neighbour that is enabled for the SR-TE 6018 Policy SAFI."; 6020 uses ipvX-srte-policy-adjrib-neighbor-state; 6022 container adj-rib-in-pre { 6023 description 6024 "The Adj-RIB-In for the SR-TE Policy SAFI for the neighbour, 6025 prior to any inbound policy constraints or modifications 6026 having been applied."; 6027 uses ipvX-srte-policy-adjrib-common; 6028 } 6030 container adj-rib-in-post { 6031 description 6032 "The Adj-RIB-In for the SR-TE Policy SAFI for the neighbour, 6033 following any inbound policy constraints or modifications 6034 being made."; 6035 uses ipvX-srte-policy-adjrib-in-post; 6036 } 6038 container adj-rib-out-pre { 6039 description 6040 "The Adj-RIB-Out for the SR-TE Policy SAFI for the 6041 neighbour, prior to any outgoing policy modifications or 6042 constraints having been applied."; 6043 uses ipvX-srte-policy-adjrib-common; 6044 } 6046 container adj-rib-out-post { 6047 description 6048 "The Adj-RIB-Out for the SR-TE Policy SAFI for the 6049 neighbour, follow any outbound policy constraints or 6050 modifications being made."; 6051 uses ipvX-srte-policy-adjrib-common; 6052 } 6053 } 6054 } 6055 } 6057 grouping ipvX-srte-policy-adjrib-neighbor-state { 6058 description 6059 "Common attributes for each neighbour for which the SR-TE 6060 Policy SAFI RIBs are being maintained."; 6062 leaf neighbor-address { 6063 type inet:ip-address; 6064 description 6065 "The address of the neighbour for which the SR-TE policy 6066 SAFI has been negotiated."; 6067 } 6068 } 6070 grouping ipvX-srte-policy-adjrib-common { 6071 description 6072 "Common structure containing the routes that are learnt via 6073 the IPv4 or IPv6 SR-TE Policy SAFI."; 6075 container routes { 6076 description 6077 "Surrounding container for the list of routes within the 6078 SR-TE Policy SAFI."; 6080 list route { 6081 key "path-id endpoint color"; 6083 description 6084 "The routes within the SR-TE Policy SAFI Adj-RIB. The 6085 routes are keyed on the path-id - set to a non-zero 6086 value only if ADD-PATHS is being used; the color; and 6087 the endpoint. The colour and endpoint are extracted from 6088 the NLRI."; 6090 uses ipvX-srte-policy-common-route-state; 6091 uses bgp-adj-rib-common-attr-refs; 6092 uses bgp-common-route-annotations-state; 6093 uses bgp-unknown-attr-top; 6094 } 6095 } 6096 } 6098 grouping ipvX-srte-policy-common-route-state { 6099 description 6100 "Common attributes used SR-TE Policy SAFI routes."; 6102 leaf path-id { 6103 type uint32; 6104 // TODO: YANG does not allow default values for key 6105 // default 0; 6106 description 6107 "Identifier for the path when using BGP ADD-PATHS for the SR-TE 6108 policy SAFI."; 6109 } 6111 leaf endpoint { 6112 type inet:ip-address; 6113 description 6114 "A unique identifier for the remote set of nodes. When the 6115 address family is IPv4, the value is a 4-octet IPv4 address. 6116 When the address family is IPv6, the value is a 16-octet IPv6 6117 address."; 6118 } 6119 leaf color { 6120 type uint32; 6121 description 6122 "A 4-octet value identifying the policy. Combined with the 6123 endpoint the endpoint and colour represent the unique policy."; 6124 } 6125 } 6127 grouping ipvX-srte-policy-adjrib-in-post { 6128 description 6129 "Grouping for the post-policy Adj-RIB-In for SR-TE Policy SAFI 6130 routes"; 6132 container routes { 6133 description 6134 "The set of routes that are within the Adj-RIB-Out for the 6135 neighbour."; 6137 list route { 6138 key "path-id endpoint color"; 6140 description 6141 "The routes that are in the Adj-RIB-In-Post for the specified 6142 BGP neighbour within the SR-TE Policy SAFI for the specified 6143 address family."; 6145 uses ipvX-srte-policy-common-route-state; 6146 uses bgp-adj-rib-common-attr-refs; 6147 uses bgp-common-route-annotations-state; 6148 uses bgp-adj-rib-in-post-route-annotations-state; 6149 uses bgp-unknown-attr-top; 6150 } 6151 } 6152 } 6154 grouping ipvX-srte-policy-locrib { 6155 description 6156 "Top-level grouping for the Loc-RIB for IPv4 or IPv6 Adj-RIB 6157 for SR-TE Policy SAFI."; 6159 container loc-rib { 6160 description 6161 "The Loc-RIB for the SR-TE Policy SAFI for IPv4 or IPv6 Unicast 6162 AFIs."; 6164 container routes { 6165 description 6166 "List of routes within the SR-TE Policy SAFI, for the IPv4 or 6167 IPv6 AFI."; 6169 list route { 6170 key "path-id endpoint color"; 6172 description 6173 "Route within the specified address family for the SR-TE 6174 Policy SAFI."; 6176 uses ipvX-srte-policy-common-route-state; 6177 uses bgp-loc-rib-common-attr-refs; 6178 uses bgp-common-route-annotations-state; 6179 uses bgp-unknown-attr-top; 6180 } 6181 } 6182 } 6183 } 6184 } 6185 6187 file "ietf-bgp-rib-table-attributes@2019-02-25.yang" 6188 submodule ietf-bgp-rib-table-attributes { 6189 yang-version "1.1"; 6190 belongs-to ietf-bgp-rib { 6191 prefix "br"; 6192 } 6194 // import some basic types 6195 import ietf-yang-types { prefix types; } 6196 import ietf-bgp-rib-types { prefix bgpribt; } 6198 organization 6199 "IETF IDR Working Group"; 6201 contact 6202 "WG Web: 6203 WG List: 6205 Authors: Mahesh Jethanandani (mjethanandani at gmail.com), 6206 Keyur Patel (keyur at arrcus.com), 6207 Susan Hares (shares at ndzh.com"; 6209 description 6210 "This submodule contains common data definitions for data 6211 related to a RIB entry, or RIB table."; 6213 revision "2019-02-25" { 6214 description 6215 "Initial version."; 6216 reference 6217 "RFC XXXX: BGP YANG Model for Service Provider Network."; 6218 } 6220 grouping bgp-common-route-annotations-state { 6221 description 6222 "Data definitions for flags and other information attached 6223 to routes in both LOC-RIB and Adj-RIB"; 6225 leaf last-modified { 6226 type types:timeticks; 6227 description 6228 "Timestamp when this path was last modified. 6230 The value is the timestamp in seconds relative to 6231 the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; 6232 } 6234 leaf valid-route { 6235 type boolean; 6236 description 6237 "Indicates that the route is considered valid by the 6238 local router"; 6239 } 6241 leaf invalid-reason { 6242 type identityref { 6243 base bgpribt:invalid-route-reason; 6244 } 6245 description 6246 "If the route is rejected as invalid, this indicates the 6247 reason."; 6248 } 6250 } 6252 grouping bgp-loc-rib-route-annotations-state { 6253 description 6254 "Data definitions for information attached to routes in the 6255 LOC-RIB"; 6257 // placeholder for route metadata specific to the LOC-RIB 6259 } 6260 grouping bgp-adj-rib-in-post-route-annotations-state { 6261 description 6262 "Data definitions for information attached to routes in the 6263 Adj-RIB-in post-policy table"; 6265 leaf best-path { 6266 type boolean; 6267 description 6268 "Current path was selected as the best path."; 6269 } 6270 } 6272 grouping bgp-common-table-attrs-state { 6273 description 6274 "Common attributes attached to all routing tables"; 6276 // placeholder for metadata associated with all tables 6277 } 6279 grouping bgp-common-table-attrs-top { 6280 // no enclosing container as this data will fit under an 6281 // existing LOC-RIB container 6283 uses bgp-common-table-attrs-state; 6284 description 6285 "Operational state data for data related to the entire 6286 LOC-RIB"; 6287 } 6288 } 6289 6291 8. Examples 6293 This section tries to show some examples in how the model can be 6294 used. 6296 8.1. Creating BGP Instance 6298 This example shows how to enable BGP with the IPv4 unicast address 6299 family, while adding one network to advertise. 6301 [note: '\' line wrapping for formatting only] 6303 6304 6305 6307 6308 6309 bgp:bgp 6311 6312 name:BGP 6313 6315 6316 64496 6317 6318 6319 bt:ipv4-\ 6321 unicast 6322 6323 6324 6325 6326 6327 6328 6329 6330 6332 8.2. Neighbor Address Family Configuration 6334 This example shows how to configure a neighbor. 6336 [note: '\' line wrapping for formatting only] 6338 6339 6340 6342 6343 6344 bgp:bgp 6346 6347 name:BGP 6348 6350 6351 64496 6352 6353 6354 bt:ipv4-\ 6356 unicast 6357 6358 6359 6360 6361 6362 6363 192.0.2.1 6364 64497 6365 "Peer Router B" 6366 6367 6368 bt:ipv\ 6370 4-unicast 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 9. Contributors 6383 Previous versions of this document saw contributions from Anees 6384 Shaikh, Rob Shakir, Kevin D'Souza, Alexander Clemm, Aleksandr 6385 Zhadkin, and Xyfeng Liu. 6387 10. Acknowledgements 6389 The authors are grateful for valuable contributions to this document 6390 and the associated models from: Ebben Aires, Pavan Beeram, Chris 6391 Chase, Ed Crabbe, Luyuan Fang, Bill Fenner, Akshay Gattani, Josh 6392 George, Vijay Gill, Matt John, Jeff Haas, Dhanendra Jain, Acee 6393 Lindem, Ina Minei, Carl Moberg, Ashok Narayanan, Einar Nilsen- 6394 Nygaard, Adam Simpson, Puneet Sood, Jason Sterne, Jeff Tantsura, Jim 6395 Uttaro, and Gunter Vandevelde. 6397 Credit is also due to authors of the OpenConfig, whose model was 6398 relied upon to come up with this model. 6400 Special thanks to Robert Wilton who helped convert the YANG models to 6401 a NMDA compatible model. 6403 11. References 6405 11.1. Normative references 6407 [RFC1997] Chandra, R., Traina, P., and T. Li, "BGP Communities 6408 Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996, 6409 . 6411 [RFC2439] Villamizar, C., Chandra, R., and R. Govindan, "BGP Route 6412 Flap Damping", RFC 2439, DOI 10.17487/RFC2439, November 6413 1998, . 6415 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 6416 DOI 10.17487/RFC3688, January 2004, 6417 . 6419 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 6420 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 6421 DOI 10.17487/RFC4271, January 2006, 6422 . 6424 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 6425 Reflection: An Alternative to Full Mesh Internal BGP 6426 (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, 6427 . 6429 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 6430 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 6431 DOI 10.17487/RFC4724, January 2007, 6432 . 6434 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 6435 "Multiprotocol Extensions for BGP-4", RFC 4760, 6436 DOI 10.17487/RFC4760, January 2007, 6437 . 6439 [RFC5065] Traina, P., McPherson, D., and J. Scudder, "Autonomous 6440 System Confederations for BGP", RFC 5065, 6441 DOI 10.17487/RFC5065, August 2007, 6442 . 6444 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 6445 the Network Configuration Protocol (NETCONF)", RFC 6020, 6446 DOI 10.17487/RFC6020, October 2010, 6447 . 6449 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 6450 and A. Bierman, Ed., "Network Configuration Protocol 6451 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 6452 . 6454 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 6455 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 6456 . 6458 [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. 6459 Austein, "BGP Prefix Origin Validation", RFC 6811, 6460 DOI 10.17487/RFC6811, January 2013, 6461 . 6463 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 6464 RFC 6991, DOI 10.17487/RFC6991, July 2013, 6465 . 6467 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 6468 RFC 7950, DOI 10.17487/RFC7950, August 2016, 6469 . 6471 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 6472 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 6473 . 6475 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 6476 Access Control Model", STD 91, RFC 8341, 6477 DOI 10.17487/RFC8341, March 2018, 6478 . 6480 [RFC8349] Lhotka, L., Lindem, A., and Y. Qu, "A YANG Data Model for 6481 Routing Management (NMDA Version)", RFC 8349, 6482 DOI 10.17487/RFC8349, March 2018, 6483 . 6485 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 6486 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 6487 . 6489 11.2. Informative references 6491 [I-D.ietf-rtgwg-policy-model] 6492 Qu, Y., Tantsura, J., Lindem, A., and X. Liu, "A YANG Data 6493 Model for Routing Policy Management", draft-ietf-rtgwg- 6494 policy-model-05 (work in progress), January 2019. 6496 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 6497 and R. Wilton, "Network Management Datastore Architecture 6498 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 6499 . 6501 Authors' Addresses 6503 Keyur Patel 6504 Arrcus 6505 CA 6506 USA 6508 Email: keyur@arrcus.com 6510 Mahesh Jethanandani 6511 VMware 6513 Email: mjethanandani@gmail.com 6514 Susan Hares 6515 Huawei 6516 7453 Hickory Hill 6517 Saline, MI 48176 6518 USA 6520 Email: shares@ndzh.com