idnits 2.17.1 draft-mks-idr-bgp-yang-model-01.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 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 1088 has weird spacing: '...unicast speci...' -- The document date (November 15, 2017) is 2354 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) ** Obsolete normative reference: RFC 3065 (Obsoleted by RFC 5065) == Outdated reference: A later version (-10) exists of draft-ietf-netmod-revised-datastores-06 == Outdated reference: A later version (-12) exists of draft-ietf-rtgwg-ni-model-04 == Outdated reference: A later version (-31) exists of draft-ietf-rtgwg-policy-model-01 Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Interdomain Routing K. Patel, Ed. 3 Internet-Draft Arrcus 4 Intended status: Standards Track M. Jethanandani, Ed. 5 Expires: May 19, 2018 6 S. Hares, Ed. 7 Hickory Hill Consulting 8 November 15, 2017 10 BGP YANG Model 11 draft-mks-idr-bgp-yang-model-01 13 Abstract 15 This Internet draft provides a set of example text for the 16 replacement of draft-ietf-idr-bgp-model-02.txt with the IETF models 17 based on the Network Management Datastore Architecture to be released 18 in draft-ietf-idr-bgp-model-03.txt. This draft is provided for the 19 IDR WG by potential editors as example text for draft-ietf-idr-bgp- 20 model-03.txt for the yang models. Please send review comments or 21 suggestions to these potential editors and the IDR working group 22 (idr@ietf.org). 24 This document defines a YANG data model for configuring and managing 25 BGP, including protocol, policy, and operational aspects based on 26 data center, carrier and content provider operational requirements. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on May 19, 2018. 45 Copyright Notice 47 Copyright (c) 2017 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 63 1.1. Goals and approach . . . . . . . . . . . . . . . . . . . 3 64 2. Model overview . . . . . . . . . . . . . . . . . . . . . . . 4 65 2.1. BGP protocol configuration . . . . . . . . . . . . . . . 5 66 2.2. Policy configuration overview . . . . . . . . . . . . . . 7 67 2.3. Operational state overview . . . . . . . . . . . . . . . 8 68 3. Relation to other YANG data models . . . . . . . . . . . . . 8 69 4. Security Considerations . . . . . . . . . . . . . . . . . . . 9 70 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 71 6. YANG modules . . . . . . . . . . . . . . . . . . . . . . . . 9 72 7. BGP main module and submodule for base items . . . . . . . . 10 73 8. BGP types . . . . . . . . . . . . . . . . . . . . . . . . . . 50 74 9. BGP policy data . . . . . . . . . . . . . . . . . . . . . . . 59 75 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 73 76 10.1. Normative references . . . . . . . . . . . . . . . . . . 73 77 10.2. Informative references . . . . . . . . . . . . . . . . . 74 78 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 75 79 Appendix B. Change summary . . . . . . . . . . . . . . . . . . . 75 80 B.1. Changes between revisions -01 and -02 . . . . . . . . . . 75 81 B.2. Changes between revisions -00 and -01 . . . . . . . . . . 75 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 75 84 1. Introduction 86 This Internet draft is a set of example text for the replacement of 87 draft-ietf-idr-bgp-model-02.txt with a version of the yang models 88 which are compatible with the Network Management Datastore 89 Architecture to be released in draft-ietf-idr-bgp-model-03.txt. This 90 draft is only for provided an example structure for the IDR WG by the 91 potential editors for draft-ietf-idr-bgp-model-03.txt. The authors 92 of the draft-ietf-bgp-model-02.txt are: 94 o Anees Shaikh 96 o Rob Shakir 98 o Keyur Patel 100 o Susan Hares 102 o Kevin D'Souza 104 o Deepak Bansal 106 o Alex Clemm 108 o Alex Zhdankin 110 o Mahesh Jethanandani 112 o Xufeng Liu 114 This document describes a YANG data model for the BGP [RFC4271] 115 protocol, including various protocol extensions, policy 116 configuration, as well as defining key operational state data. The 117 model is intended to be vendor-neutral, in order to allow operators 118 to manage BGP configuration in heterogeneous environments with 119 routers supplied by multiple vendors. The model is also intended to 120 be readily mapped to existing implementations to facilitate support 121 from as large a set of routing hardware and software vendors as 122 possible. 124 1.1. Goals and approach 126 The model covers the base BGP features that are deployed across major 127 implementations and the common BGP configurations in use across a 128 number of operator network deployments. In particular, this model 129 attempts to cover BGP features defined in [RFC4271], [RFC1997], 130 [RFC4456], [RFC4760], [RFC3065], [RFC2439], [RFC4724], and [RFC6811]. 132 Along with configuration of base BGP features, this model also 133 addresses policy configuration, by providing "hooks" for applying 134 policies, and also defining BGP-specific policy features. The BGP 135 policy features are intended to be used with the general routing 136 policy model defined in [I-D.ietf-rtgwg-policy-model]. The model 137 also supports operational state data to provide a common model for 138 reading BGP-related state from a BGP speaker. 140 For the base BGP features, the focus of the model described in this 141 document is on providing configuration and operational state 142 information relating to: 144 o The global BGP instance, and neighbors whose configuration is 145 specified individually, or templated with the use of peer-groups. 147 o The address families that are supported by peers, and the global 148 configuration which relates to them. 150 o The policy configuration "hooks" and BGP-specific policy features 151 that relate to a neighbor - controlling the import and export of 152 NLRIs. 154 As mentioned earlier, any configuration items that are deemed to be 155 widely available in existing major BGP implementations are included 156 in the model. Additional, more esoteric, configuration items that 157 are not commonly used, or only available from a single 158 implementation, are omitted from the model with an expectation that 159 they will be available in companion modules that augment or extend 160 the current model. This allows clarity in identifying data that is 161 part of the vendor-neutral base model. 163 Where possible, naming in the model follows conventions used in 164 available standards documents, and otherwise tries to be self- 165 explanatory with sufficient descriptions of the intended behavior. 166 Similarly, configuration data value constraints and default values, 167 where used, are based on recommendations in current standards 168 documentation, or those commonly used in multiple implementations. 169 Since implementations can vary widely in this respect, this version 170 of the model specifies only a limited set of defaults and ranges with 171 the expectation of being more prescriptive in future versions based 172 on actual operator use. 174 2. Model overview 176 The BGP model is defined across several YANG modules and submodules, 177 but at a high level is organized into six elements: 179 o base protocol configuration -- configuration affecting BGP 180 protocol-related operations, defined at various levels of 181 hierarchy. 183 o multiprotocol configuration -- configuration affecting individual 184 address-families within BGP [RFC4760]. 186 o neighbor configuration -- configuration affecting an individual 187 neighbor within BGP. 189 o neighbor multiprotocol configuration -- configuration affecting 190 individual address-families for a neighbor within BGP. 192 o policy configuration -- hooks for application of the policies 193 defined in [I-D.ietf-rtgwg-policy-model] that act on routes sent 194 (received) to (from) peers or other routing protocols and BGP- 195 specific policy features. 197 o operational state -- variables used for monitoring and management 198 of BGP operations. 200 These modules also make use of standard Internet types, such as IP 201 addresses and prefixes, autonomous system numbers, etc., defined in 202 RFC 6991 [RFC6991]. 204 Throughout the model, the approach described in NMDA 205 [I-D.ietf-netmod-revised-datastores] is used to represent running 206 configuration, intended and operational datastore. That is to say, 207 that the model defines a single container, and it is the 208 implementation of the different datastores that reflects the value of 209 a given node in either the , or 210 datastore. 212 2.1. BGP protocol configuration 214 The BGP protocol configuration model is organized hierarchically, 215 much like the majority of router implementations. That is, 216 configuration items can be specified at multiple levels, as shown 217 below. 219 +--rw bgp! 220 +--rw global 221 | +-- (global-configuration-options) 222 +--rw neighbors 223 | +--rw neighbor* [neighbor-address] 224 | +-- (neighbor-configuration-options) 225 +--rw peer-groups 226 +--rw peer-group* [peer-group-name] 227 +-- (neighbor-configuration-options) 229 Users may specify configuration at a higher level and have it apply 230 to all lower-level items, or provide overriding configuration at a 231 lower level of the hierarchy. Overriding configuration items are 232 optional, with neighbor specific configuration being the most 233 specific or lowest level, followed by peer-group, and finally global. 234 Global configuration options reflect a subset of the peer-group or 235 neighbor specific configuration options which are relevant to the 236 entire BGP instance. 238 The model makes the simplifying assumption that most of the 239 configuration items are available at all levels of the hierarchy. 240 That is, very little configuration is specific to a particular level 241 in the hierarchy, other than obvious items such as "group-name" only 242 being available for the peer group-level config. A notable exception 243 is for sub-address family configuration where some items are only 244 applicable for a given AFI-SAFI combination. 246 In order to allow common configuration to be applied to a set of 247 neighbors, all neighbor configuration options are available within a 248 peer-group. A neighbor is associated to a particular peer-group 249 through the use of a peer-group leaf (which provides a reference to a 250 configured item in the peer-group list). 252 Address-family configuration is made available in multiple points 253 within the model - primarily within the global container, where 254 instance-wide configuration can be set (for example, global protocol 255 parameters, the BGP best path route selection options, or global 256 policies relating to the address-family); and on a per-neighbor or 257 per-peer-group basis, where address-families can be enabled or 258 disabled, and policy associated with the parent entity applied. 259 Within the afi-safi container, generic configuration that applies to 260 all address-families (e.g., whether the AFI-SAFI is enabled) is 261 presented at the top-level, with address-family specific containers 262 made available for options relating to only that AFI-SAFI. Within 263 the current revision of the model a generic set of address-families, 264 and common configuration and state options are included - further 265 work is expected to add additional parameters to this area of the 266 model. 268 The following address-families are currently supported by the model: 270 +--rw bgp! 271 +--rw global 272 +--rw afi-safis 273 +--rw afi-safi* [afi-safi-name] 274 +--rw afi-safi-name -> ../config/afi-safi-name 275 | 276 +--rw ipv4-unicast 277 | ... 278 +--rw ipv6-unicast 279 | ... 280 +--rw ipv4-labelled-unicast 281 | ... 282 +--rw ipv6-labelled-unicast 283 | ... 284 +--rw l3vpn-ipv4-unicast 285 | ... 286 +--rw l3vpn-ipv6-unicast 287 | ... 288 +--rw l3vpn-ipv4-multicast 289 | ... 290 +--rw l3vpn-ipv6-multicast 291 | ... 292 +--rw l2vpn-vpls 293 | ... 294 +--rw l2vpn-evpn 295 | ... 297 2.2. Policy configuration overview 299 The BGP policy configuration model references the generic YANG 300 routing policy model described in [I-D.ietf-rtgwg-policy-model], 301 which represents a condition-action policy framework for routing. 302 This model adds BGP-specific conditions (e.g., matching on the 303 community attribute), and actions (e.g., setting local preference) to 304 the generic policy framework. 306 Policies that are defined in the routing-policy model are referenced 307 in multiple places within the model: 309 o within the global instance, where a policy applies to all address- 310 families for all peers. 312 o on a global AFI-SAFI basis, where policies apply to all peers for 313 a particular address-family. 315 o on a per-peer-group or per-neighbor basis - where the policy 316 applies to all address-families for the particular group or 317 neighbor. 319 o on a per-afi-safi basis within a neighbor or peer-group context, 320 where the policy is specific to the AFI-SAFI for a a specific 321 neighbor or group. 323 +--rw bgp 324 +--rw global 325 | +--rw afi-safi 326 | | +--rw afi-safi* [afi-safi-name] 327 | | +--rw apply-policy 328 | +--rw apply-policy 329 +--rw neighbors 330 | +--rw neighbor* [neighbor-address] 331 | +--rw afi-safi 332 | | +--rw afi-safi* [afi-safi-name] 333 | | +--rw apply-policy 334 | +--rw apply-policy 335 +--rw peer-groups 336 +--rw peer-group* [peer-group-name] 337 +--rw afi-safi 338 | +--rw afi-safi* [afi-safi-name] 339 | +--rw apply-policy 340 +--rw apply-policy 342 2.3. Operational state overview 344 The BGP operational model contains data which relates to the 345 operational state of the various elements of the BGP router. As 346 noted in Section 2 - the approach described in NMDA 347 [I-D.ietf-netmod-revised-datastores] is utilized for the modeling of 348 operational and statistical data. To this end, the "-state" 349 groupings (those that contain derived operational parameters) is not 350 a separate container, but is instead collapsed into one container 351 that defines both the read-write and read-only nodes. In some cases, 352 operational information may be relevant to one instance of a common 353 grouping, but not another - for example, the number of received, 354 advertised, and installed prefixes is relevant on a per-neighbor- 355 basis, but is not required (or meaningful) in the peer-group context. 356 Groupings are defined with the appropriate operational state data 357 accordingly. 359 3. Relation to other YANG data models 361 The BGP model is intended to work within a larger framework model, 362 such as the Network Instance model [I-D.ietf-rtgwg-ni-model] which 363 provides a comprehensive model for defining VRFs, associated routing 364 protocols, multiple protocol instances, and inter-protocol and inter- 365 instance routing policies. The current version of the model imports 366 and instantiates the BGP model in its tree at /network-instances/ 367 network-instance/protocols/protocol/bgp/... 369 It is also possible to integrate the BGP model with the Routing 370 Management model [I-D.ietf-netmod-routing-cfg] or the Network Device 371 Organizational Model [I-D.rtgyangdt-rtgwg-device-model], both of 372 which define the notion of routing instances, or VRFs. 374 4. Security Considerations 376 BGP configuration has a significant impact on network operations, and 377 as such any related protocol or model carries potential security 378 risks. 380 YANG data models are generally designed to be used with the NETCONF 381 protocol over an SSH transport. This provides an authenticated and 382 secure channel over which to transfer BGP configuration and 383 operational data. Note that use of alternate transport or data 384 encoding (e.g., JSON over HTTPS) would require similar mechanisms for 385 authenticating and securing access to configuration data. 387 Most of the data elements in the configuration model could be 388 considered sensitive from a security standpoint. Unauthorized access 389 or invalid data could cause major disruption. 391 5. IANA Considerations 393 An appropriate namespace URI will be registered in the IETF XML 394 Registry" [RFC3688]. The BGP YANG modules will be registered in the 395 "YANG Module Names" registry [RFC6020]. 397 6. YANG modules 399 The modules comprising the BGP configuration and operational model 400 are described by the YANG modules and submodules in the sections 401 below. 403 The main module, ietf-bgp.yang, includes the following submodules: 405 o ietf-bgp-common - defines the groupings that are common across 406 more than one context (where contexts are neighbor, group, global) 408 o ietf-bgp-common-multiprotocol - defines the groupings that are 409 common across more than one context, and relate to multiprotocol 410 BGP 412 o ietf-bgp-common-structure - defines groupings that are shared by 413 multiple contexts, but are used only to create structural 414 elements, i.e., containers (leaf nodes are defined in separate 415 groupings) 417 o ietf-bgp-global - groupings with data specific to the global 418 context 420 o ietf-bgp-peer-group - groupings with data specific to the peer 421 group context 423 o ietf-bgp-neighbor - groupings with data specific to the neighbor 424 context 426 Additional modules include: 428 o ietf-bgp-types - common type and identity definitions for BGP, 429 including BGP policy 431 o ietf-bgp-policy - BGP-specific policy data definitions for use 432 with [I-D.ietf-rtgwg-policy-model] (described in more detail 433 Section 2.2) 435 7. BGP main module and submodule for base items 437 file "ietf-bgp@2017-10-17.yang" 438 module ietf-bgp { 440 yang-version "1"; 442 // namespace 443 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp"; 445 prefix "bgp"; 447 // import some basic inet types 448 import ietf-routing-policy { 449 prefix rpol; 450 } 452 // Common: defines the groupings that are common across more than 453 // one context (where contexts are neighbor, group, global) 454 include ietf-bgp-common; 455 // Multiprotocol: defines the groupings that are common across more 456 // than one context, and relate to Multiprotocol 457 include ietf-bgp-common-multiprotocol; 458 // Structure: defines groupings that are shared but are solely used 459 // for structural reasons. 460 include ietf-bgp-common-structure; 461 // Include peer-group/neighbor/global - these define the groupings 462 // that are specific to one context 463 include ietf-bgp-neighbor; 464 include ietf-bgp-global; 465 include ietf-bgp-peer-group; 467 // meta 468 organization 469 "IETF IDR Working Group"; 471 contact 472 "WG Web: 473 WG List: 475 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 476 Authors: Keyur Patel, 477 Mahesh Jethanandani, 478 Susan Hares"; 480 description 481 "This module describes a YANG model for BGP protocol 482 configuration. It is a limited subset of all of the configuration 483 parameters available in the variety of vendor implementations, 484 hence it is expected that it would be augmented with vendor- 485 specific configuration data as needed. Additional modules or 486 submodules to handle other aspects of BGP configuration, 487 including policy, VRFs, VPNs, and additional address families 488 are also expected. 490 This model supports the following BGP configuration level 491 hierarchy: 493 BGP 494 | 495 +-> [ global BGP configuration ] 496 +-> AFI / SAFI global 497 +-> peer group 498 +-> [ peer group config ] 499 +-> AFI / SAFI [ per-AFI overrides ] 500 +-> neighbor 501 +-> [ neighbor config ] 502 +-> [ optional pointer to peer-group ] 503 +-> AFI / SAFI [ per-AFI overrides ]"; 505 revision "2017-10-17" { 506 description 507 "Initial Version"; 508 reference 509 "RFC XXXX, BGP Model for Service Provider Network "; 511 } 513 /* 514 * Groupings 515 */ 516 container bgp { 517 description 518 "Top-level configuration for the BGP router"; 520 container global { 521 description 522 "Global configuration for the BGP router"; 523 uses bgp-global-base; 524 uses rpol:apply-policy-group; 525 } 527 container neighbors { 528 description 529 "Configuration for BGP neighbors"; 530 uses bgp-neighbor-list; 531 } 533 container peer-groups { 534 description 535 "Configuration for BGP peer-groups"; 536 uses bgp-peer-group-list; 537 } 538 } 539 } 540 542 file "ietf-bgp-common@2017-10-17.yang" 543 submodule ietf-bgp-common { 544 belongs-to ietf-bgp { 545 prefix "bgp"; 546 } 548 import ietf-bgp-types { 549 prefix bgp-types; 550 } 551 import ietf-inet-types { 552 prefix inet; 553 } 555 // meta 556 organization 557 "IETF IDR Working Group"; 559 contact 560 "WG Web: 561 WG List: 563 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 564 Authors: Keyur Patel, 565 Mahesh Jethanandani, 566 Susan Hares"; 568 description 569 "This sub-module contains common groupings that are common across 570 multiple contexts within the BGP module. That is to say that 571 they may be application to a subset of global, peer-group or 572 neighbor contexts."; 574 revision "2017-10-17" { 575 description 576 "Initial Version"; 577 reference 578 "RFC XXX, BGP Model for Service Provider Network."; 579 } 581 grouping bgp-common-neighbor-group-timers-config { 582 description 583 "Config parameters related to timers associated with the BGP 584 peer"; 586 leaf connect-retry { 587 type decimal64 { 588 fraction-digits 2; 589 } 590 default 30; 591 description 592 "Time interval in seconds between attempts to establish a 593 session with the peer."; 594 } 596 leaf hold-time { 597 type decimal64 { 598 fraction-digits 2; 599 } 600 default 90; 601 description 602 "Time interval in seconds that a BGP session will be 603 considered active in the absence of keepalive or other 604 messages from the peer. The hold-time is typically set to 605 3x the keepalive-interval."; 606 reference 607 "RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; 608 } 610 leaf keepalive-interval { 611 type decimal64 { 612 fraction-digits 2; 613 } 614 default 30; 615 description 616 "Time interval in seconds between transmission of keepalive 617 messages to the neighbor. Typically set to 1/3 the 618 hold-time."; 619 } 621 leaf minimum-advertisement-interval { 622 type decimal64 { 623 fraction-digits 2; 624 } 625 default 30; 626 description 627 "Minimum time which must elapse between subsequent UPDATE 628 messages relating to a common set of NLRI being transmitted 629 to a peer. This timer is referred to as 630 MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to 631 reduce the number of UPDATE messages transmitted when a 632 particular set of NLRI exhibit instability."; 633 reference 634 "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; 635 } 636 } 638 grouping bgp-common-neighbor-group-config { 639 description 640 "Neighbor level configuration items."; 642 leaf peer-as { 643 type inet:as-number; 644 description 645 "AS number of the peer."; 646 } 648 leaf local-as { 649 type inet:as-number; 650 description 651 "The local autonomous system number that is to be used when 652 establishing sessions with the remote peer or peer group, if 653 this differs from the global BGP router autonomous system 654 number."; 656 } 658 leaf peer-type { 659 type bgp-types:peer-type; 660 description 661 "Explicitly designate the peer or peer group as internal 662 (iBGP) or external (eBGP)."; 663 } 665 leaf auth-password { 666 type string; 667 description 668 "Configures an MD5 authentication password for use with 669 neighboring devices."; 670 } 672 leaf remove-private-as { 673 // could also make this a container with a flag to enable 674 // remove-private and separate option. here, option implies 675 // remove-private is enabled. 676 type bgp-types:remove-private-as-option; 677 description 678 "Remove private AS numbers from updates sent to peers - when 679 this leaf is not specified, the AS_PATH attribute should be 680 sent to the peer unchanged"; 681 } 683 leaf route-flap-damping { 684 type boolean; 685 default false; 686 description 687 "Enable route flap damping."; 688 } 690 leaf send-community { 691 type bgp-types:community-type; 692 default "NONE"; 693 description 694 "Specify which types of community should be sent to the 695 neighbor or group. The default is to not send the community 696 attribute"; 697 } 699 leaf description { 700 type string; 701 description 702 "An optional textual description (intended primarily for use 703 with a peer or group"; 705 } 706 } 708 grouping bgp-common-neighbor-group-transport-config { 709 description 710 "Configuration parameters relating to the transport protocol 711 used by the BGP session to the peer"; 713 leaf tcp-mss { 714 type uint16; 715 description 716 "Sets the max segment size for BGP TCP sessions."; 717 } 719 leaf mtu-discovery { 720 type boolean; 721 default false; 722 description 723 "Turns path mtu discovery for BGP TCP sessions on (true) or 724 off (false)"; 725 } 727 leaf passive-mode { 728 type boolean; 729 default false; 730 description 731 "Wait for peers to issue requests to open a BGP session, 732 rather than initiating sessions from the local router."; 733 } 735 leaf local-address { 736 type union { 737 type inet:ip-address; 738 type string; 739 } 740 //TODO: the string should be converted to a leafref type 741 //to point to an interface when YANG 1.1 is available with 742 //leafrefs in union types. 743 description 744 "Set the local IP (either IPv4 or IPv6) address to use for 745 the session when sending BGP update messages. This may be 746 expressed as either an IP address or reference to the name 747 of an interface."; 748 } 749 } 751 grouping bgp-common-neighbor-group-error-handling-config { 752 description 753 "Configuration parameters relating to enhanced error handling 754 behaviours for BGP"; 756 leaf treat-as-withdraw { 757 type boolean; 758 default "false"; 759 description 760 "Specify whether erroneous UPDATE messages for which the NLRI 761 can be extracted are reated as though the NLRI is withdrawn 762 - avoiding session reset"; 763 reference "draft-ietf-idr-error-handling-16"; 764 } 765 } 767 grouping bgp-common-graceful-restart-config { 768 description 769 "Configuration parameters relating to BGP graceful restart."; 771 leaf enabled { 772 type boolean; 773 description 774 "Enable or disable the graceful-restart capability."; 775 } 777 leaf restart-time { 778 type uint16 { 779 range 0..4096; 780 } 781 description 782 "Estimated time (in seconds) for the local BGP speaker to 783 restart a session. This value is advertise in the graceful 784 restart BGP capability. This is a 12-bit value, referred to 785 as Restart Time in RFC4724. Per RFC4724, the suggested 786 default value is <= the hold-time value."; 787 } 789 leaf stale-routes-time { 790 type decimal64 { 791 fraction-digits 2; 792 } 793 description 794 "An upper-bound on the time thate stale routes will be 795 retained by a router after a session is restarted. If an 796 End-of-RIB (EOR) marker is received prior to this timer 797 expiring stale-routes will be flushed upon its receipt - if 798 no EOR is received, then when this timer expires stale paths 799 will be purged. This timer is referred to as the 800 Selection_Deferral_Timer in RFC4724"; 802 } 804 leaf helper-only { 805 type boolean; 806 description 807 "Enable graceful-restart in helper mode only. When this leaf 808 is set, the local system does not retain forwarding its own 809 state during a restart, but supports procedures for the 810 receiving speaker, as defined in RFC4724."; 811 } 812 } 814 grouping bgp-common-use-multiple-paths-config { 815 description 816 "Generic configuration options relating to use of multiple 817 paths for a referenced AFI-SAFI, group or neighbor"; 819 leaf enabled { 820 type boolean; 821 default false; 822 description 823 "Whether the use of multiple paths for the same NLRI is 824 enabled for the neighbor. This value is overridden by any 825 more specific configuration value."; 826 } 827 } 829 grouping bgp-common-use-multiple-paths-ebgp-as-options-config { 830 description 831 "Configuration parameters specific to eBGP multipath applicable 832 to all contexts"; 834 leaf allow-multiple-as { 835 type boolean; 836 default "false"; 837 description 838 "Allow multipath to use paths from different neighbouring ASes. 839 The default is to only consider multiple paths from the same 840 neighbouring AS."; 841 } 842 } 844 grouping bgp-common-global-group-use-multiple-paths { 845 description 846 "Common grouping used for both global and groups which provides 847 configuration and state parameters relating to use of multiple 848 paths"; 850 container use-multiple-paths { 851 description 852 "Parameters related to the use of multiple paths for the 853 same NLRI"; 855 uses bgp-common-use-multiple-paths-config; 857 container ebgp { 858 description 859 "Multipath parameters for eBGP"; 861 leaf allow-multiple-as { 862 type boolean; 863 default "false"; 864 description 865 "Allow multipath to use paths from different neighbouring 866 ASes. The default is to only consider multiple paths 867 from the same neighbouring AS."; 868 } 870 leaf maximum-paths { 871 type uint32; 872 default 1; 873 description 874 "Maximum number of parallel paths to consider when using 875 BGP multipath. The default is use a single path."; 876 } 877 } 879 container ibgp { 880 description 881 "Multipath parameters for iBGP"; 883 leaf maximum-paths { 884 type uint32; 885 default 1; 886 description 887 "Maximum number of parallel paths to consider when using 888 iBGP multipath. The default is to use a single path"; 889 } 890 } 891 } 892 } 894 grouping bgp-common-route-selection-options { 895 description 896 "Configuration and state relating to route selection options"; 898 container route-selection-options { 899 description 900 "Parameters relating to options for route selection"; 902 leaf always-compare-med { 903 type boolean; 904 default "false"; 905 description 906 "Compare multi-exit discriminator (MED) value from 907 different ASes when selecting the best route. The default 908 behavior is to only compare MEDs for paths received from 909 the same AS."; 910 } 912 leaf ignore-as-path-length { 913 type boolean; 914 default "false"; 915 description 916 "Ignore the AS path length when selecting the best path. 917 The default is to use the AS path length and prefer paths 918 with shorter length."; 919 } 921 leaf external-compare-router-id { 922 type boolean; 923 default "true"; 924 description 925 "When comparing similar routes received from external BGP 926 peers, use the router-id as a criterion to select the 927 active path."; 928 } 930 leaf advertise-inactive-routes { 931 type boolean; 932 default "false"; 933 description 934 "Advertise inactive routes to external peers. The default 935 is to only advertise active routes."; 936 } 938 leaf enable-aigp { 939 type boolean; 940 default false; 941 description 942 "Flag to enable sending / receiving accumulated IGP 943 attribute in routing updates"; 944 } 945 leaf ignore-next-hop-igp-metric { 946 type boolean; 947 default "false"; 948 description 949 "Ignore the IGP metric to the next-hop when calculating BGP 950 best-path. The default is to select the route for which 951 the metric to the next-hop is lowest"; 952 } 953 } 954 } 956 grouping bgp-common-state { 957 description 958 "Grouping containing common counters relating to prefixes and 959 paths"; 961 leaf total-paths { 962 type uint32; 963 config false; 964 description 965 "Total number of BGP paths within the context"; 966 } 968 leaf total-prefixes { 969 type uint32; 970 config false; 971 description 972 "Total number of BGP prefixes received within the context"; 973 } 974 } 975 } 976 978 file "ietf-bgp-common-multiprotocol@2017-10-17.yang" 979 submodule ietf-bgp-common-multiprotocol { 980 belongs-to ietf-bgp { 981 prefix "bgp"; 982 } 984 import ietf-bgp-types { 985 prefix bgp-types; 986 } 987 import ietf-routing-policy { 988 prefix rpol; 989 } 991 include ietf-bgp-common; 992 // meta 993 organization 994 "IETF IDR Working Group"; 996 contact 997 "WG Web: 998 WG List: 1000 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 1001 Authors: Keyur Patel, 1002 Mahesh Jethanandani, 1003 Susan Hares"; 1005 description 1006 "This sub-module contains groupings that are related to support 1007 for multiple protocols in BGP. The groupings are common across 1008 multiple contexts."; 1010 revision "2017-10-17" { 1011 description 1012 "Initial Version"; 1013 reference 1014 "RFC XXX, BGP Model for Service Provider Network."; 1015 } 1017 grouping bgp-common-mp-afi-safi-graceful-restart-config { 1018 description 1019 "BGP graceful restart parameters that apply on a per-AFI-SAFI 1020 basis"; 1022 leaf enabled { 1023 type boolean; 1024 default false; 1025 description 1026 "This leaf indicates whether graceful-restart is enabled for 1027 this AFI-SAFI"; 1028 } 1029 } 1031 grouping bgp-common-mp-afi-safi-config { 1032 description 1033 "Configuration parameters used for all BGP AFI-SAFIs"; 1035 leaf afi-safi-name { 1036 type identityref { 1037 base bgp-types:AFI_SAFI_TYPE; 1038 } 1039 description "AFI,SAFI"; 1041 } 1043 leaf enabled { 1044 type boolean; 1045 default false; 1046 description 1047 "This leaf indicates whether the IPv4 Unicast AFI,SAFI is 1048 enabled for the neighbour or group"; 1049 } 1050 } 1052 grouping bgp-common-mp-all-afi-safi-list-contents { 1053 description 1054 "A common grouping used for contents of the list that is used 1055 for AFI-SAFI entries"; 1057 // import and export policy included for the afi/safi 1058 uses rpol:apply-policy-group; 1060 uses bgp-common-mp-ipv4-unicast-group; 1061 uses bgp-common-mp-ipv6-unicast-group; 1062 uses bgp-common-mp-ipv4-labeled-unicast-group; 1063 uses bgp-common-mp-ipv6-labeled-unicast-group; 1064 uses bgp-common-mp-l3vpn-ipv4-unicast-group; 1065 uses bgp-common-mp-l3vpn-ipv6-unicast-group; 1066 uses bgp-common-mp-l3vpn-ipv4-multicast-group; 1067 uses bgp-common-mp-l3vpn-ipv6-multicast-group; 1068 uses bgp-common-mp-l2vpn-vpls-group; 1069 uses bgp-common-mp-l2vpn-evpn-group; 1070 } 1072 // Groupings relating to each address family 1073 grouping bgp-common-mp-ipv4-unicast-group { 1074 description 1075 "Group for IPv4 Unicast configuration options"; 1077 container ipv4-unicast { 1078 when "../afi-safi-name = 'bgp-types:IPV4_UNICAST'" { 1079 description 1080 "Include this container for IPv4 Unicast specific 1081 configuration"; 1082 } 1084 description "IPv4 unicast configuration options"; 1086 // include common IPv[46] unicast options 1087 uses bgp-common-mp-ipv4-ipv6-unicast-common; 1088 // placeholder for IPv4 unicast specific configuration 1089 } 1090 } 1092 grouping bgp-common-mp-ipv6-unicast-group { 1093 description 1094 "Group for IPv6 Unicast configuration options"; 1096 container ipv6-unicast { 1097 when "../afi-safi-name = 'bgp-types:IPV6_UNICAST'" { 1098 description 1099 "Include this container for IPv6 Unicast specific 1100 configuration"; 1101 } 1103 description "IPv6 unicast configuration options"; 1105 // include common IPv[46] unicast options 1106 uses bgp-common-mp-ipv4-ipv6-unicast-common; 1108 // placeholder for IPv6 unicast specific configuration 1109 // options 1110 } 1111 } 1113 grouping bgp-common-mp-ipv4-labeled-unicast-group { 1114 description 1115 "Group for IPv4 Labeled Unicast configuration options"; 1117 container ipv4-labeled-unicast { 1118 when "../afi-safi-name = 'bgp-types:IPV4_LABELED_UNICAST'" { 1119 description 1120 "Include this container for IPv4 Labeled Unicast specific 1121 configuration"; 1122 } 1124 description "IPv4 Labeled Unicast configuration options"; 1126 uses bgp-common-mp-all-afi-safi-common; 1128 // placeholder for IPv4 Labeled Unicast specific config 1129 // options 1130 } 1131 } 1133 grouping bgp-common-mp-ipv6-labeled-unicast-group { 1134 description 1135 "Group for IPv6 Labeled Unicast configuration options"; 1137 container ipv6-labeled-unicast { 1138 when "../afi-safi-name = 'bgp-types:IPV6_LABELED_UNICAST'" { 1139 description 1140 "Include this container for IPv6 Labeled Unicast specific 1141 configuration"; 1142 } 1144 description "IPv6 Labeled Unicast configuration options"; 1146 uses bgp-common-mp-all-afi-safi-common; 1148 // placeholder for IPv6 Labeled Unicast specific config 1149 // options. 1150 } 1151 } 1153 grouping bgp-common-mp-l3vpn-ipv4-unicast-group { 1154 description 1155 "Group for IPv4 Unicast L3VPN configuration options"; 1157 container l3vpn-ipv4-unicast { 1158 when "../afi-safi-name = 'bgp-types:L3VPN_IPV4_UNICAST'" { 1159 description 1160 "Include this container for IPv4 Unicast L3VPN specific 1161 configuration"; 1162 } 1164 description "Unicast IPv4 L3VPN configuration options"; 1166 // include common L3VPN configuration options 1167 uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; 1169 // placeholder for IPv4 Unicast L3VPN specific config options. 1170 } 1171 } 1173 grouping bgp-common-mp-l3vpn-ipv6-unicast-group { 1174 description 1175 "Group for IPv6 Unicast L3VPN configuration options"; 1177 container l3vpn-ipv6-unicast { 1178 when "../afi-safi-name = 'bgp-types:L3VPN_IPV6_UNICAST'" { 1179 description 1180 "Include this container for unicast IPv6 L3VPN specific 1181 configuration"; 1182 } 1184 description "Unicast IPv6 L3VPN configuration options"; 1185 // include common L3VPN configuration options 1186 uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; 1188 // placeholder for IPv6 Unicast L3VPN specific configuration 1189 // options 1190 } 1191 } 1193 grouping bgp-common-mp-l3vpn-ipv4-multicast-group { 1194 description 1195 "Group for IPv4 L3VPN multicast configuration options"; 1197 container l3vpn-ipv4-multicast { 1198 when "../afi-safi-name = 'bgp-types:L3VPN_IPV4_MULTICAST'" { 1199 description 1200 "Include this container for multicast IPv6 L3VPN specific 1201 configuration"; 1202 } 1204 description "Multicast IPv4 L3VPN configuration options"; 1206 // include common L3VPN multicast options 1207 uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; 1209 // placeholder for IPv4 Multicast L3VPN specific configuration 1210 // options 1211 } 1212 } 1214 grouping bgp-common-mp-l3vpn-ipv6-multicast-group { 1215 description 1216 "Group for IPv6 L3VPN multicast configuration options"; 1218 container l3vpn-ipv6-multicast { 1219 when "../afi-safi-name = 'bgp-types:L3VPN_IPV6_MULTICAST'" { 1220 description 1221 "Include this container for multicast IPv6 L3VPN specific 1222 configuration"; 1223 } 1224 description "Multicast IPv6 L3VPN configuration options"; 1226 // include common L3VPN multicast options 1227 uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; 1229 // placeholder for IPv6 Multicast L3VPN specific configuration 1230 // options 1231 } 1232 } 1233 grouping bgp-common-mp-l2vpn-vpls-group { 1234 description 1235 "Group for BGP-signalled VPLS configuration options"; 1237 container l2vpn-vpls { 1238 when "../afi-safi-name = 'bgp-types:L2VPN_VPLS'" { 1239 description 1240 "Include this container for BGP-signalled VPLS specific 1241 configuration"; 1242 } 1244 description "BGP-signalled VPLS configuration options"; 1246 // include common L2VPN options 1247 uses bgp-common-mp-l2vpn-common; 1249 // placeholder for BGP-signalled VPLS specific configuration 1250 // options 1251 } 1252 } 1254 grouping bgp-common-mp-l2vpn-evpn-group { 1255 description 1256 "Group for BGP EVPN configuration options"; 1258 container l2vpn-evpn { 1259 when "../afi-safi-name = 'bgp-types:L2VPN_EVPN'" { 1260 description 1261 "Include this container for BGP EVPN specific 1262 configuration"; 1263 } 1265 description "BGP EVPN configuration options"; 1267 // include common L2VPN options 1268 uses bgp-common-mp-l2vpn-common; 1270 // placeholder for BGP EVPN specific configuration options 1271 } 1272 } 1274 // Common groupings across multiple AFI,SAFIs 1275 grouping bgp-common-mp-all-afi-safi-common { 1276 description 1277 "Grouping for configuration common to all AFI,SAFI"; 1279 container prefix-limit { 1280 description 1281 "Parameters relating to the prefix limit for the AFI-SAFI"; 1282 leaf max-prefixes { 1283 type uint32; 1284 description 1285 "Maximum number of prefixes that will be accepted from the 1286 neighbour"; 1287 } 1288 leaf shutdown-threshold-pct { 1289 type bgp-types:percentage; 1290 description 1291 "Threshold on number of prefixes that can be received from 1292 a neighbour before generation of warning messages or log 1293 entries. Expressed as a percentage of max-prefixes"; 1294 } 1296 leaf restart-timer { 1297 type decimal64 { 1298 fraction-digits 2; 1299 } 1300 units "seconds"; 1301 description 1302 "Time interval in seconds after which the BGP session is 1303 re-established after being torn down due to exceeding the 1304 max-prefix limit."; 1305 } 1306 } 1307 } 1309 grouping bgp-common-mp-ipv4-ipv6-unicast-common { 1310 description 1311 "Common configuration that is applicable for IPv4 and IPv6 1312 unicast"; 1314 // include common afi-safi options. 1315 uses bgp-common-mp-all-afi-safi-common; 1317 // configuration options that are specific to IPv[46] unicast 1318 leaf send-default-route { 1319 type boolean; 1320 default "false"; 1321 description 1322 "If set to true, send the default-route to the neighbour(s)"; 1323 } 1324 } 1326 grouping bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common { 1327 description 1328 "Common configuration applied across L3VPN for IPv4 1329 and IPv6"; 1331 // placeholder -- specific configuration options that are generic 1332 // across IPv[46] unicast address families. 1333 uses bgp-common-mp-all-afi-safi-common; 1334 } 1336 grouping bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common { 1337 description 1338 "Common configuration applied across L3VPN for IPv4 1339 and IPv6"; 1341 // placeholder -- specific configuration options that are 1342 // generic across IPv[46] multicast address families. 1343 uses bgp-common-mp-all-afi-safi-common; 1344 } 1346 grouping bgp-common-mp-l2vpn-common { 1347 description 1348 "Common configuration applied across L2VPN address 1349 families"; 1351 // placeholder -- specific configuration options that are 1352 // generic across L2VPN address families 1353 uses bgp-common-mp-all-afi-safi-common; 1354 } 1356 // Config groupings for common groups 1357 grouping bgp-common-mp-all-afi-safi-common-prefix-limit-config { 1358 description 1359 "Configuration parameters relating to prefix-limits for an 1360 AFI-SAFI"; 1362 } 1363 } 1364 1366 file "ietf-bgp-common-structure@2017-10-17.yang" 1367 submodule ietf-bgp-common-structure { 1369 belongs-to ietf-bgp { 1370 prefix "bgp"; 1371 } 1373 import ietf-bgp-types { prefix bgp-types; } 1374 import ietf-routing-policy { prefix rpol; } 1375 include ietf-bgp-common-multiprotocol; 1376 include ietf-bgp-common; 1378 // meta 1379 organization 1380 "IETF IDR Working Group"; 1382 contact 1383 "WG Web: 1384 WG List: 1386 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 1387 Authors: Keyur Patel, 1388 Mahesh Jethanandani, 1389 Susan Hares"; 1391 description 1392 "This sub-module contains groupings that are common across 1393 multiple BGP contexts and provide structure around other 1394 primitive groupings."; 1396 revision "2017-10-17" { 1397 description 1398 "Initial Version"; 1399 reference 1400 "RFC XXX, BGP Model for Service Provider Network."; 1401 } 1403 grouping bgp-common-structure-neighbor-group-logging-options { 1404 description 1405 "Structural grouping used to include error handling 1406 configuration and state for both BGP neighbors and groups"; 1408 container logging-options { 1409 description 1410 "Logging options for events related to the BGP neighbor or 1411 group"; 1413 leaf log-neighbor-state-changes { 1414 type boolean; 1415 default "true"; 1416 description 1417 "Configure logging of peer state changes. Default is to 1418 enable logging of peer state changes."; 1419 } 1420 } 1421 } 1422 grouping bgp-common-structure-neighbor-group-ebgp-multihop { 1423 description 1424 "Structural grouping used to include eBGP multihop 1425 configuration and state for both BGP neighbors and peer 1426 groups"; 1428 container ebgp-multihop { 1429 description 1430 "eBGP multi-hop parameters for the BGPgroup"; 1432 leaf enabled { 1433 type boolean; 1434 default "false"; 1435 description 1436 "When enabled the referenced group or neighbors are 1437 permitted to be indirectly connected - including cases 1438 where the TTL can be decremented between the BGP peers"; 1439 } 1441 leaf multihop-ttl { 1442 type uint8; 1443 description 1444 "Time-to-live value to use when packets are sent to the 1445 referenced group or neighbors and ebgp-multihop is 1446 enabled"; 1447 } 1448 } 1449 } 1451 grouping bgp-common-structure-neighbor-group-route-reflector { 1452 description 1453 "Structural grouping used to include route reflector 1454 configuration and state for both BGP neighbors and peer 1455 groups"; 1457 container route-reflector { 1458 description 1459 "Route reflector parameters for the BGPgroup"; 1461 leaf route-reflector-cluster-id { 1462 type bgp-types:rr-cluster-id-type; 1463 description 1464 "route-reflector cluster id to use when local router is 1465 configured as a route reflector. Commonly set at the 1466 group level, but allows a different cluster id to be set 1467 for each neighbor."; 1468 } 1470 leaf route-reflector-client { 1471 type boolean; 1472 default "false"; 1473 description 1474 "Configure the neighbor as a route reflector client."; 1475 } 1476 } 1477 } 1479 grouping bgp-common-structure-neighbor-group-as-path-options { 1480 description 1481 "Structural grouping used to include AS_PATH manipulation 1482 configuration and state for both BGP neighbors and peer 1483 groups"; 1485 container as-path-options { 1486 description 1487 "AS_PATH manipulation parameters for the BGP neighbor or 1488 group"; 1489 leaf allow-own-as { 1490 type uint8; 1491 default 0; 1492 description 1493 "Specify the number of occurrences of the local BGP 1494 speaker's AS that can occur within the AS_PATH before it 1495 is rejected."; 1496 } 1498 leaf replace-peer-as { 1499 type boolean; 1500 default "false"; 1501 description 1502 "Replace occurrences of the peer's AS in the AS_PATH with 1503 the local autonomous system number"; 1504 } 1505 } 1506 } 1508 grouping bgp-common-structure-neighbor-group-add-paths { 1509 description 1510 "Structural grouping used to include ADD-PATHs configuration 1511 and state for both BGP neighbors and peer groups"; 1513 container add-paths { 1514 description 1515 "Parameters relating to the advertisement and receipt of 1516 multiple paths for a single NLRI (add-paths)"; 1518 leaf receive { 1519 type boolean; 1520 default false; 1521 description 1522 "Enable ability to receive multiple path advertisements for 1523 an NLRI from the neighbor or group"; 1524 } 1526 leaf send-max { 1527 type uint8; 1528 description 1529 "The maximum number of paths to advertise to neighbors for 1530 a single NLRI"; 1531 } 1532 leaf eligible-prefix-policy { 1533 type leafref { 1534 path "/rpol:routing-policy/rpol:policy-definitions/" + 1535 "rpol:policy-definition/rpol:name"; 1536 } 1537 description 1538 "A reference to a routing policy which can be used to 1539 restrict the prefixes for which add-paths is enabled"; 1540 } 1541 } 1542 } 1543 } 1544 1546 file "ietf-bgp-peer-group@2017-10-17.yang" 1547 submodule ietf-bgp-peer-group { 1548 belongs-to ietf-bgp { 1549 prefix "bgp"; 1550 } 1552 import ietf-routing-policy { 1553 prefix rpol; 1554 } 1556 // Include the common submodule 1557 include ietf-bgp-common; 1558 include ietf-bgp-common-multiprotocol; 1559 include ietf-bgp-common-structure; 1561 // meta 1562 organization 1563 "IETF IDR Working Group"; 1565 contact 1566 "WG Web: 1567 WG List: 1569 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 1570 Authors: Keyur Patel, 1571 Mahesh Jethanandani, 1572 Susan Hares"; 1574 description 1575 "This sub-module contains groupings that are specific to the 1576 peer-group context of the BGP module."; 1578 revision "2017-10-17" { 1579 description 1580 "Initial Version"; 1581 reference 1582 "RFC XXX, BGP Model for Service Provider Network."; 1583 } 1585 grouping bgp-peer-group-config { 1586 description 1587 "Configuration parameters relating to a base BGP peer group 1588 that are not also applicable to any other context (e.g., 1589 neighbor)"; 1591 leaf peer-group-name { 1592 type string; 1593 description 1594 "Name of the BGP peer-group"; 1595 } 1597 } 1599 grouping bgp-peer-group-afi-safi-list { 1600 description 1601 "List of address-families associated with the BGP peer-group"; 1603 list afi-safi { 1604 key "afi-safi-name"; 1606 description 1607 "AFI,SAFI configuration available for the 1608 neighbour or group"; 1610 uses bgp-common-mp-afi-safi-config; 1612 container graceful-restart { 1613 description 1614 "Parameters relating to BGP graceful-restart"; 1616 uses bgp-common-mp-afi-safi-graceful-restart-config; 1617 } 1619 uses bgp-common-route-selection-options; 1620 uses bgp-common-global-group-use-multiple-paths; 1621 uses bgp-common-mp-all-afi-safi-list-contents; 1622 } 1623 } 1625 grouping bgp-peer-group-base { 1626 description 1627 "Parameters related to a BGP group"; 1629 uses bgp-peer-group-config; 1630 uses bgp-common-neighbor-group-config; 1631 uses bgp-common-state; 1633 container timers { 1634 description 1635 "Timers related to a BGP peer-group"; 1637 uses bgp-common-neighbor-group-timers-config; 1638 } 1640 container transport { 1641 description 1642 "Transport session parameters for the BGP peer-group"; 1644 uses bgp-common-neighbor-group-transport-config; 1645 } 1647 container error-handling { 1648 description 1649 "Error handling parameters used for the BGP peer-group"; 1651 uses bgp-common-neighbor-group-error-handling-config; 1652 } 1654 container graceful-restart { 1655 description 1656 "Parameters relating the graceful restart mechanism for BGP"; 1658 uses bgp-common-graceful-restart-config; 1659 } 1661 uses bgp-common-structure-neighbor-group-logging-options; 1662 uses bgp-common-structure-neighbor-group-ebgp-multihop; 1663 uses bgp-common-structure-neighbor-group-route-reflector; 1664 uses bgp-common-structure-neighbor-group-as-path-options; 1665 uses bgp-common-structure-neighbor-group-add-paths; 1666 uses bgp-common-global-group-use-multiple-paths; 1667 uses rpol:apply-policy-group; 1669 container afi-safis { 1670 description 1671 "Per-address-family configuration parameters associated with 1672 thegroup"; 1673 uses bgp-peer-group-afi-safi-list; 1674 } 1675 } 1677 grouping bgp-peer-group-list { 1678 description 1679 "The list of BGP peer groups"; 1681 list peer-group { 1682 key "peer-group-name"; 1683 description 1684 "List of BGP peer-groups configured on the local system - 1685 uniquely identified by peer-group name"; 1687 uses bgp-peer-group-base; 1688 } 1689 } 1690 } 1691 1693 file "ietf-bgp-neighbor@2017-10-17.yang" 1694 submodule ietf-bgp-neighbor { 1695 belongs-to ietf-bgp { 1696 prefix "bgp"; 1697 } 1699 import ietf-routing-policy { 1700 prefix rpol; 1701 } 1702 import ietf-bgp-types { 1703 prefix bgp-types; 1704 } 1705 import ietf-inet-types { 1706 prefix inet; 1707 } 1708 import ietf-yang-types { 1709 prefix yang; 1710 } 1712 // Include the common submodule 1713 include ietf-bgp-common; 1714 include ietf-bgp-common-multiprotocol; 1715 include ietf-bgp-peer-group; 1716 include ietf-bgp-common-structure; 1718 // meta 1719 organization 1720 "IETF IDR Working Group"; 1722 contact 1723 "WG Web: 1724 WG List: 1726 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 1727 Authors: Keyur Patel, 1728 Mahesh Jethanandani, 1729 Susan Hares"; 1731 description 1732 "This sub-module contains groupings that are specific to the 1733 neighbor context of the BGP module."; 1735 revision "2017-10-17" { 1736 description 1737 "Initial Version"; 1738 reference 1739 "RFC XXX, BGP Model for Service Provider Network."; 1740 } 1742 grouping bgp-neighbor-use-multiple-paths { 1743 description 1744 "Multipath configuration and state applicable to a BGP 1745 neighbor"; 1747 container use-multiple-paths { 1748 description 1749 "Parameters related to the use of multiple-paths for the same 1750 NLRI when they are received only from this neighbor"; 1752 uses bgp-common-use-multiple-paths-config; 1754 container ebgp { 1755 description 1756 "Multipath configuration for eBGP"; 1758 uses bgp-common-use-multiple-paths-ebgp-as-options-config; 1759 } 1760 } 1761 } 1763 grouping bgp-neighbor-counters-message-types-state { 1764 description 1765 "Grouping of BGP message types, included for re-use across 1766 counters"; 1768 leaf UPDATE { 1769 type uint64; 1770 description 1771 "Number of BGP UPDATE messages announcing, withdrawing or 1772 modifying paths exchanged."; 1773 } 1775 leaf NOTIFICATION { 1776 type uint64; 1777 description 1778 "Number of BGP NOTIFICATION messages indicating an error 1779 condition has occurred exchanged."; 1780 } 1781 } 1783 grouping bgp-neighbor-afi-safi-list { 1784 description 1785 "List of address-families associated with the BGP neighbor"; 1787 list afi-safi { 1788 key "afi-safi-name"; 1790 description 1791 "AFI,SAFI configuration available for the neighbour or 1792 group"; 1794 uses bgp-common-mp-afi-safi-config; 1796 leaf active { 1797 type boolean; 1798 config false; 1799 description 1800 "This value indicates whether a particular AFI-SAFI has 1801 been succesfully negotiated with the peer. An AFI-SAFI may 1802 be enabled in the current running configuration, but a 1803 session restart may be required in order to negotiate the 1804 new capability."; 1805 } 1806 container prefixes { 1807 config false; 1808 description "Prefix counters for the BGP session"; 1809 leaf received { 1810 type uint32; 1811 description 1812 "The number of prefixes received from the neighbor"; 1813 } 1815 leaf sent { 1816 type uint32; 1817 description 1818 "The number of prefixes advertised to the neighbor"; 1819 } 1821 leaf installed { 1822 type uint32; 1823 description 1824 "The number of advertised prefixes installed in the 1825 Loc-RIB"; 1826 } 1827 } 1829 container graceful-restart { 1830 description 1831 "Parameters relating to BGP graceful-restart"; 1833 uses bgp-common-mp-afi-safi-graceful-restart-config; 1835 leaf received { 1836 type boolean; 1837 config false; 1838 description 1839 "This leaf indicates whether the neighbor advertised the 1840 ability to support graceful-restart for this AFI-SAFI"; 1841 } 1843 leaf advertised { 1844 type boolean; 1845 config false; 1846 description 1847 "This leaf indicates whether the ability to support 1848 graceful-restart has been advertised to the peer"; 1849 } 1850 } 1852 uses bgp-common-mp-all-afi-safi-list-contents; 1853 uses bgp-neighbor-use-multiple-paths; 1855 } 1856 } 1858 grouping bgp-neighbor-base { 1859 description 1860 "Parameters related to a BGP neighbor"; 1862 leaf peer-group { 1863 type leafref { 1864 path "../../../peer-groups/peer-group/peer-group-name"; 1865 } 1866 description 1867 "The peer-group with which this neighbor is associated"; 1868 } 1870 leaf neighbor-address { 1871 type inet:ip-address; 1872 description 1873 "Address of the BGP peer, either in IPv4 or IPv6"; 1874 } 1876 leaf enabled { 1877 type boolean; 1878 default true; 1879 description 1880 "Whether the BGP peer is enabled. In cases where the enabled 1881 leaf is set to false, the local system should not initiate 1882 connections to the neighbor, and should not respond to TCP 1883 connections attempts from the neighbor. If the state of the 1884 BGP session is ESTABLISHED at the time that this leaf is set 1885 to false, the BGP session should be ceased."; 1886 } 1888 uses bgp-common-neighbor-group-config; 1890 leaf session-state { 1891 type enumeration { 1892 enum IDLE { 1893 description 1894 "neighbor is down, and in the Idle state of the FSM"; 1895 } 1896 enum CONNECT { 1897 description 1898 "neighbor is down, and the session is waiting for the 1899 underlying transport session to be established"; 1900 } 1901 enum ACTIVE { 1902 description 1903 "neighbor is down, and the local system is awaiting a 1904 conncetion from the remote peer"; 1905 } 1906 enum OPENSENT { 1907 description 1908 "neighbor is in the process of being established. The 1909 local system has sent an OPEN message"; 1910 } 1911 enum OPENCONFIRM { 1912 description 1913 "neighbor is in the process of being established. The 1914 local system is awaiting a NOTIFICATION or KEEPALIVE 1915 message"; 1916 } 1917 enum ESTABLISHED { 1918 description 1919 "neighbor is up - the BGP session with the peer is 1920 established"; 1921 } 1922 } 1923 config false; 1924 description 1925 "Operational state of the BGP peer"; 1926 } 1928 leaf last-established { 1929 // Was oc-types:timeticks64 1930 type uint64; 1931 config false; 1932 description 1933 "This timestamp indicates the time that the BGP session last 1934 transitioned in or out of the Established state. The value 1935 is the timestamp in seconds relative to the Unix Epoch (Jan 1936 1, 1970 00:00:00 UTC). 1938 The BGP session uptime can be computed by clients as the 1939 difference between this value and the current time in UTC 1940 (assuming the session is in the ESTABLISHED state, per the 1941 session-state leaf)."; 1942 } 1944 leaf established-transitions { 1945 type yang:counter64; 1946 config false; 1947 description 1948 "Number of transitions to the Established state for the 1949 neighbor session. This value is analogous to the 1950 bgpPeerFsmEstablishedTransitions object from the standard 1951 BGP-4 MIB"; 1952 reference 1953 "RFC 4273 - Definitions of Managed Objects for BGP-4"; 1954 } 1956 leaf-list supported-capabilities { 1957 type identityref { 1958 base bgp-types:BGP_CAPABILITY; 1959 } 1960 config false; 1961 description 1962 "BGP capabilities negotiated as supported with the peer"; 1963 } 1965 container messages { 1966 config false; 1967 description 1968 "Counters for BGP messages sent and received from the 1969 neighbor"; 1970 container sent { 1971 description 1972 "Counters relating to BGP messages sent to the neighbor"; 1973 uses bgp-neighbor-counters-message-types-state; 1974 } 1976 container received { 1977 description 1978 "Counters for BGP messages received from the neighbor"; 1979 uses bgp-neighbor-counters-message-types-state; 1980 } 1981 } 1983 container queues { 1984 config false; 1985 description 1986 "Counters related to queued messages associated with the BGP 1987 neighbor"; 1989 leaf input { 1990 type uint32; 1991 description 1992 "The number of messages received from the peer currently 1993 queued"; 1994 } 1996 leaf output { 1997 type uint32; 1998 description 1999 "The number of messages queued to be sent to the peer"; 2000 } 2001 } 2003 container timers { 2004 description 2005 "Timers related to a BGP neighbor"; 2007 uses bgp-common-neighbor-group-timers-config; 2009 leaf negotiated-hold-time { 2010 type decimal64 { 2011 fraction-digits 2; 2012 } 2013 config false; 2014 description 2015 "The negotiated hold-time for the BGP session"; 2016 } 2017 } 2019 container transport { 2020 description 2021 "Transport session parameters for the BGP neighbor"; 2023 uses bgp-common-neighbor-group-transport-config; 2025 leaf local-port { 2026 type inet:port-number; 2027 config false; 2028 description 2029 "Local TCP port being used for the TCP session supporting 2030 the BGP session"; 2031 } 2033 leaf remote-address { 2034 type inet:ip-address; 2035 config false; 2036 description 2037 "Remote address to which the BGP session has been 2038 established"; 2039 } 2041 leaf remote-port { 2042 type inet:port-number; 2043 config false; 2044 description 2045 "Remote port being used by the peer for the TCP session 2046 supporting the BGP session"; 2048 } 2049 } 2051 container error-handling { 2052 description 2053 "Error handling parameters used for the BGP neighbor or 2054 group"; 2055 uses bgp-common-neighbor-group-error-handling-config; 2057 leaf erroneous-update-messages { 2058 type uint32; 2059 config false; 2060 description 2061 "The number of BGP UPDATE messages for which the 2062 treat-as-withdraw mechanism has been applied based on 2063 erroneous message contents"; 2064 } 2065 } 2067 container graceful-restart { 2068 description 2069 "Parameters relating the graceful restart mechanism for BGP"; 2071 uses bgp-common-graceful-restart-config; 2073 leaf peer-restart-time { 2074 type uint16 { 2075 range 0..4096; 2076 } 2077 config false; 2078 description 2079 "The period of time (advertised by the peer) that the peer 2080 expects a restart of a BGP session to take"; 2081 } 2083 leaf peer-restarting { 2084 type boolean; 2085 config false; 2086 description 2087 "This flag indicates whether the remote neighbor is 2088 currently in the process of restarting, and hence received 2089 routes are currently stale"; 2090 } 2092 leaf local-restarting { 2093 type boolean; 2094 config false; 2095 description 2096 "This flag indicates whether the local neighbor is 2097 currently restarting. The flag is unset after all NLRI 2098 have been advertised to the peer, and the End-of-RIB (EOR) 2099 marker has been unset"; 2100 } 2102 leaf mode { 2103 type enumeration { 2104 enum HELPER_ONLY { 2105 description 2106 "The local router is operating in helper-only mode, and 2107 hence will not retain forwarding state during a local 2108 session restart, but will do so during a restart of 2109 the remote peer"; 2110 } 2111 enum BILATERAL { 2112 description 2113 "The local router is operating in both helper mode, and 2114 hence retains forwarding state during a remote 2115 restart, and also maintains forwarding state during 2116 local session restart"; 2117 } 2118 enum REMOTE_HELPER { 2119 description 2120 "The local system is able to retain routes during 2121 restart but the remote system is only able to act as a 2122 helper"; 2123 } 2124 } 2125 config false; 2126 description 2127 "This leaf indicates the mode of operation of BGP graceful 2128 restart with the peer"; 2129 } 2130 } 2132 uses bgp-common-structure-neighbor-group-logging-options; 2133 uses bgp-common-structure-neighbor-group-ebgp-multihop; 2134 uses bgp-common-structure-neighbor-group-route-reflector; 2135 uses bgp-common-structure-neighbor-group-as-path-options; 2136 uses bgp-common-structure-neighbor-group-add-paths; 2137 uses bgp-neighbor-use-multiple-paths; 2138 uses rpol:apply-policy-group; 2140 container afi-safis { 2141 description 2142 "Per-address-family configuration parameters associated with 2143 the neighbor"; 2145 uses bgp-neighbor-afi-safi-list; 2146 } 2147 } 2149 grouping bgp-neighbor-list { 2150 description 2151 "The list of BGP neighbors"; 2153 list neighbor { 2154 key "neighbor-address"; 2155 description 2156 "List of BGP neighbors configured on the local system, 2157 uniquely identified by peer IPv[46] address"; 2159 uses bgp-neighbor-base; 2160 } 2161 } 2162 } 2163 2165 file "ietf-bgp-global@2017-10-17.yang" 2166 submodule ietf-bgp-global { 2167 belongs-to ietf-bgp { 2168 prefix "bgp"; 2169 } 2171 import ietf-inet-types { 2172 prefix inet; 2173 } 2174 import ietf-yang-types { 2175 prefix yang; 2176 } 2178 // Include common submodule 2179 include ietf-bgp-common; 2180 include ietf-bgp-common-multiprotocol; 2182 // meta 2183 organization 2184 "IETF IDR Working Group"; 2186 contact 2187 "WG Web: 2188 WG List: 2190 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 2191 Authors: Keyur Patel, 2192 Mahesh Jethanandani, 2193 Susan Hares"; 2195 description 2196 "This sub-module contains groupings that are specific to the 2197 global context of the BGP module"; 2199 revision "2017-10-17" { 2200 description 2201 "Initial Version"; 2202 reference 2203 "RFC XXX, BGP Model for Service Provider Network."; 2204 } 2206 grouping bgp-global-config { 2207 description 2208 "Global configuration options for the BGP router."; 2210 leaf as { 2211 type inet:as-number; 2212 mandatory true; 2213 description 2214 "Local autonomous system number of the router. Uses 2215 the 32-bit as-number type from the model in RFC 6991."; 2216 } 2218 leaf router-id { 2219 type yang:dotted-quad; 2220 description 2221 "Router id of the router - an unsigned 32-bit integer 2222 expressed in dotted quad notation."; 2223 reference 2224 "RFC4271 - A Border Gateway Protocol 4 (BGP-4), 2225 Section 4.2"; 2226 } 2227 } 2229 grouping bgp-global-state { 2230 description 2231 "Operational state parameters for the BGP neighbor"; 2233 uses bgp-common-state; 2234 } 2236 grouping bgp-global-default-route-distance-config { 2237 description 2238 "Configuration options relating to the administrative distance 2239 (or preference) assigned to routes received from different 2240 sources (external, internal, and local)."; 2242 leaf external-route-distance { 2243 type uint8 { 2244 range "1..255"; 2245 } 2246 description 2247 "Administrative distance for routes learned from external 2248 BGP (eBGP)."; 2249 } 2250 leaf internal-route-distance { 2251 type uint8 { 2252 range "1..255"; 2253 } 2254 description 2255 "Administrative distance for routes learned from internal 2256 BGP (iBGP)."; 2257 } 2258 } 2260 grouping bgp-global-confederation-config { 2261 description 2262 "Configuration options specifying parameters when the local 2263 router is within an autonomous system which is part of a BGP 2264 confederation."; 2266 leaf enabled { 2267 type boolean; 2268 description 2269 "When this leaf is set to true it indicates that 2270 the local-AS is part of a BGP confederation"; 2271 } 2273 leaf identifier { 2274 type inet:as-number; 2275 description 2276 "Confederation identifier for the autonomous system."; 2277 } 2279 leaf-list member-as { 2280 type inet:as-number; 2281 description 2282 "Remote autonomous systems that are to be treated 2283 as part of the local confederation."; 2284 } 2285 } 2287 grouping bgp-global-afi-safi-list { 2288 description 2289 "List of address-families associated with the BGP instance"; 2291 list afi-safi { 2292 key "afi-safi-name"; 2294 description 2295 "AFI,SAFI configuration available for the 2296 neighbour or group"; 2298 uses bgp-common-mp-afi-safi-config; 2299 uses bgp-common-state; 2301 container graceful-restart { 2302 description 2303 "Parameters relating to BGP graceful-restart"; 2305 uses bgp-common-mp-afi-safi-graceful-restart-config; 2306 } 2308 uses bgp-common-route-selection-options; 2309 uses bgp-common-global-group-use-multiple-paths; 2310 uses bgp-common-mp-all-afi-safi-list-contents; 2311 } 2312 } 2314 // Structural groupings 2315 grouping bgp-global-base { 2316 description 2317 "Global configuration parameters for the BGP router"; 2319 uses bgp-global-config; 2320 uses bgp-global-state; 2322 container default-route-distance { 2323 description 2324 "Administrative distance (or preference) assigned to 2325 routes received from different sources 2326 (external, internal, and local)."; 2328 uses bgp-global-default-route-distance-config; 2329 } 2331 container confederation { 2332 description 2333 "Parameters indicating whether the local system acts as part 2334 of a BGP confederation"; 2336 uses bgp-global-confederation-config; 2337 } 2339 container graceful-restart { 2340 description 2341 "Parameters relating the graceful restart mechanism for BGP"; 2342 uses bgp-common-graceful-restart-config; 2343 } 2345 uses bgp-common-global-group-use-multiple-paths; 2346 uses bgp-common-route-selection-options; 2348 container afi-safis { 2349 description 2350 "Address family specific configuration"; 2351 uses bgp-global-afi-safi-list; 2352 } 2353 } 2355 } 2356 2358 8. BGP types 2360 file "ietf-bgp-types@2017-10-17.yang" 2361 module ietf-bgp-types { 2362 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types"; 2364 prefix "bgp-types"; 2366 import ietf-inet-types { 2367 prefix inet; 2368 } 2370 // meta 2371 organization 2372 "IETF IDR Working Group"; 2374 contact 2375 "WG Web: 2376 WG List: 2378 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 2379 Authors: Keyur Patel, 2380 Mahesh Jethanandani, 2381 Susan Hares"; 2383 description 2384 "This module contains general data definitions for use in BGP 2385 policy. It can be imported by modules that make use of BGP 2386 attributes"; 2388 revision "2017-10-17" { 2389 description 2390 "Initial Version"; 2391 reference 2392 "RFC XXX, BGP Model for Service Provider Network."; 2393 } 2395 identity BGP_CAPABILITY { 2396 description "Base identity for a BGP capability"; 2397 } 2399 identity MPBGP { 2400 base BGP_CAPABILITY; 2401 description 2402 "Multi-protocol extensions to BGP"; 2403 reference "RFC2858"; 2404 } 2406 identity ROUTE_REFRESH { 2407 base BGP_CAPABILITY; 2408 description 2409 "The BGP route-refresh functionality"; 2410 reference "RFC2918"; 2411 } 2413 identity ASN32 { 2414 base BGP_CAPABILITY; 2415 description 2416 "4-byte (32-bit) AS number functionality"; 2417 reference "RFC6793"; 2418 } 2420 identity GRACEFUL_RESTART { 2421 base BGP_CAPABILITY; 2422 description 2423 "Graceful restart functionality"; 2424 reference "RFC4724"; 2425 } 2427 identity ADD_PATHS { 2428 base BGP_CAPABILITY; 2429 description 2430 "BGP add-paths"; 2432 reference "draft-ietf-idr-add-paths"; 2433 } 2435 identity AFI_SAFI_TYPE { 2436 description 2437 "Base identity type for AFI,SAFI tuples for BGP-4"; 2438 reference "RFC4760 - multiprotocol extensions for BGP-4"; 2439 } 2441 identity IPV4_UNICAST { 2442 base AFI_SAFI_TYPE; 2443 description 2444 "IPv4 unicast (AFI,SAFI = 1,1)"; 2445 reference "RFC4760"; 2446 } 2448 identity IPV6_UNICAST { 2449 base AFI_SAFI_TYPE; 2450 description 2451 "IPv6 unicast (AFI,SAFI = 2,1)"; 2452 reference "RFC4760"; 2453 } 2455 identity IPV4_LABELED_UNICAST { 2456 base AFI_SAFI_TYPE; 2457 description 2458 "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; 2459 reference "RFC3107"; 2460 } 2462 identity IPV6_LABELED_UNICAST { 2463 base AFI_SAFI_TYPE; 2464 description 2465 "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; 2466 reference "RFC3107"; 2467 } 2469 identity L3VPN_IPV4_UNICAST { 2470 base AFI_SAFI_TYPE; 2471 description 2472 "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; 2473 reference "RFC4364"; 2474 } 2476 identity L3VPN_IPV6_UNICAST { 2477 base AFI_SAFI_TYPE; 2478 description 2479 "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; 2481 reference "RFC4659"; 2482 } 2484 identity L3VPN_IPV4_MULTICAST { 2485 base AFI_SAFI_TYPE; 2486 description 2487 "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; 2488 reference "RFC6514"; 2489 } 2491 identity L3VPN_IPV6_MULTICAST { 2492 base AFI_SAFI_TYPE; 2493 description 2494 "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; 2495 reference "RFC6514"; 2496 } 2498 identity L2VPN_VPLS { 2499 base AFI_SAFI_TYPE; 2500 description 2501 "BGP-signalled VPLS (AFI,SAFI = 25,65)"; 2502 reference "RFC4761"; 2503 } 2505 identity L2VPN_EVPN { 2506 base AFI_SAFI_TYPE; 2507 description 2508 "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; 2509 } 2511 identity BGP_WELL_KNOWN_STD_COMMUNITY { 2512 description 2513 "Reserved communities within the standard community space 2514 defined by RFC1997. These communities must fall within the 2515 range 0x00000000 to 0xFFFFFFFF"; 2516 reference "RFC1997"; 2517 } 2519 identity NO_EXPORT { 2520 base BGP_WELL_KNOWN_STD_COMMUNITY; 2521 description 2522 "Do not export NLRI received carrying this community outside 2523 the bounds of this autonomous system, or this confederation if 2524 the local autonomous system is a confederation member AS. This 2525 community has a value of 0xFFFFFF01."; 2526 reference "RFC1997"; 2527 } 2528 identity NO_ADVERTISE { 2529 base BGP_WELL_KNOWN_STD_COMMUNITY; 2530 description 2531 "All NLRI received carrying this community must not be 2532 advertised to other BGP peers. This community has a value of 2533 0xFFFFFF02."; 2534 reference "RFC1997"; 2535 } 2537 identity NO_EXPORT_SUBCONFED { 2538 base BGP_WELL_KNOWN_STD_COMMUNITY; 2539 description 2540 "All NLRI received carrying this community must not be 2541 advertised to external BGP peers - including over confederation 2542 sub-AS boundaries. This community has a value of 0xFFFFFF03."; 2543 reference "RFC1997"; 2544 } 2546 identity NOPEER { 2547 base BGP_WELL_KNOWN_STD_COMMUNITY; 2548 description 2549 "An autonomous system receiving NLRI tagged with this community 2550 is advised not to readvertise the NLRI to external bi-lateral 2551 peer autonomous systems. An AS may also filter received NLRI 2552 from bilateral peer sessions when they are tagged with this 2553 community value"; 2554 reference "RFC3765"; 2555 } 2557 typedef bgp-session-direction { 2558 type enumeration { 2559 enum INBOUND { 2560 description 2561 "Refers to all NLRI received from the BGP peer"; 2562 } 2563 enum OUTBOUND { 2564 description 2565 "Refers to all NLRI advertised to the BGP peer"; 2566 } 2567 } 2568 description 2569 "Type to describe the direction of NLRI transmission"; 2570 } 2572 typedef bgp-well-known-community-type { 2573 type identityref { 2574 base BGP_WELL_KNOWN_STD_COMMUNITY; 2575 } 2576 description 2577 "Type definition for well-known IETF community attribute 2578 values"; 2579 reference 2580 "IANA Border Gateway Protocol (BGP) Well Known Communities"; 2581 } 2583 typedef bgp-std-community-type { 2584 // TODO: further refine restrictions and allowed patterns 2585 // 4-octet value: 2586 // 2 octets 2587 // 2 octets 2588 type union { 2589 type uint32 { 2590 // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - 2591 // 0xFFFFFFFF are reserved 2592 range "65536..4294901759"; // 0x00010000..0xFFFEFFFF 2593 } 2594 type string { 2595 pattern '([0-9]+:[0-9]+)'; 2596 } 2597 } 2598 description 2599 "Type definition for standard commmunity attributes"; 2600 reference "RFC 1997 - BGP Communities Attribute"; 2601 } 2603 typedef bgp-ext-community-type { 2604 // TODO: needs more work to make this more precise given the 2605 // variability of extended community attribute specifications 2606 // 8-octet value: 2607 // 2 octects 2608 // 6 octets 2610 type union { 2611 type string { 2612 // Type 1: 2-octet global and 4-octet local 2613 // (AS number) (Integer) 2614 pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 2615 '[1-9][0-9]{1,4}|[0-9]):' + 2616 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 2617 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 2618 } 2619 type string { 2620 // Type 2: 4-octet global and 2-octet local 2621 // (ipv4-address) (integer) 2622 pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 2623 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 2624 '2[0-4][0-9]|25[0-5]):' + 2625 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 2626 '[1-9][0-9]{1,4}|[0-9])'; 2627 } 2628 type string { 2629 // route-target with Type 1 2630 // route-target:(ASN):(local-part) 2631 pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' + 2632 '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + 2633 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 2634 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 2635 } 2636 type string { 2637 // route-target with Type 2 2638 // route-target:(IPv4):(local-part) 2639 pattern 'route\-target:' + 2640 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 2641 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 2642 '2[0-4][0-9]|25[0-5]):' + 2643 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 2644 '[1-9][0-9]{1,4}|[0-9])'; 2645 } 2646 type string { 2647 // route-origin with Type 1 2648 pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' + 2649 '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + 2650 '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + 2651 '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; 2652 } 2653 type string { 2654 // route-origin with Type 2 2655 pattern 'route\-origin:' + 2656 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + 2657 '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + 2658 '2[0-4][0-9]|25[0-5]):' + 2659 '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + 2660 '[1-9][0-9]{1,4}|[0-9])'; 2661 } 2662 } 2663 description 2664 "Type definition for extended community attributes"; 2665 reference "RFC 4360 - BGP Extended Communities Attribute"; 2666 } 2668 typedef bgp-community-regexp-type { 2669 // TODO: needs more work to decide what format these regexps can 2670 // take. 2672 //type oc-types:std-regexp; 2673 type string; 2674 description 2675 "Type definition for communities specified as regular 2676 expression patterns"; 2677 } 2679 typedef bgp-origin-attr-type { 2680 type enumeration { 2681 enum IGP { 2682 description "Origin of the NLRI is internal"; 2683 } 2684 enum EGP { 2685 description "Origin of the NLRI is EGP"; 2686 } 2687 enum INCOMPLETE { 2688 description "Origin of the NLRI is neither IGP or EGP"; 2689 } 2690 } 2691 description 2692 "Type definition for standard BGP origin attribute"; 2693 reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), 2694 Sec 4.3"; 2695 } 2697 typedef peer-type { 2698 type enumeration { 2699 enum INTERNAL { 2700 description "internal (iBGP) peer"; 2701 } 2702 enum EXTERNAL { 2703 description "external (eBGP) peer"; 2704 } 2705 } 2706 description 2707 "labels a peer or peer group as explicitly internal or 2708 external"; 2709 } 2711 identity REMOVE_PRIVATE_AS_OPTION { 2712 description 2713 "Base identity for options for removing private autonomous 2714 system numbers from the AS_PATH attribute"; 2715 } 2717 identity PRIVATE_AS_REMOVE_ALL { 2718 base REMOVE_PRIVATE_AS_OPTION; 2719 description 2720 "Strip all private autonmous system numbers from the AS_PATH. 2721 This action is performed regardless of the other content of the 2722 AS_PATH attribute, and for all instances of private AS numbers 2723 within that attribute."; 2724 } 2726 identity PRIVATE_AS_REPLACE_ALL { 2727 base REMOVE_PRIVATE_AS_OPTION; 2728 description 2729 "Replace all instances of private autonomous system numbers in 2730 the AS_PATH with the local BGP speaker's autonomous system 2731 number. This action is performed regardless of the other 2732 content of the AS_PATH attribute, and for all instances of 2733 private AS number within that attribute."; 2734 } 2736 typedef remove-private-as-option { 2737 type identityref { 2738 base REMOVE_PRIVATE_AS_OPTION; 2739 } 2740 description 2741 "set of options for configuring how private AS path numbers 2742 are removed from advertisements"; 2743 } 2745 typedef percentage { 2746 type uint8 { 2747 range "0..100"; 2748 } 2749 description 2750 "Integer indicating a percentage value"; 2751 } 2753 typedef rr-cluster-id-type { 2754 type union { 2755 type uint32; 2756 type inet:ipv4-address; 2757 } 2758 description 2759 "union type for route reflector cluster ids: 2760 option 1: 4-byte number 2761 option 2: IP address"; 2762 } 2764 typedef community-type { 2765 type enumeration { 2766 enum STANDARD { 2767 description "send only standard communities"; 2769 } 2770 enum EXTENDED { 2771 description "send only extended communities"; 2772 } 2773 enum BOTH { 2774 description "send both standard and extended communities"; 2775 } 2776 enum NONE { 2777 description "do not send any community attribute"; 2778 } 2779 } 2780 description 2781 "type describing variations of community attributes: 2782 STANDARD: standard BGP community [rfc1997] 2783 EXTENDED: extended BGP community [rfc4360] 2784 BOTH: both standard and extended community"; 2785 } 2786 } 2787 2789 9. BGP policy data 2791 file "ietf-bgp-policy@2017-10-17.yang" 2792 module ietf-bgp-policy { 2793 yang-version "1.1"; 2795 // namespace 2796 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy"; 2798 prefix "bgp-pol"; 2800 // import some basic types 2801 import ietf-inet-types { 2802 prefix inet; 2803 } 2804 import ietf-routing-policy { 2805 prefix rpol; 2806 } 2807 import ietf-policy-types { 2808 prefix pol-types; 2809 } 2810 import ietf-bgp-types { 2811 prefix bgp-types; 2812 } 2814 import ietf-routing-types { 2815 prefix rt-types; 2817 } 2819 // meta 2820 organization 2821 "IETF IDR Working Group"; 2823 contact 2824 "WG Web: 2825 WG List: 2827 Editor: Mahesh Jethanandani (mjethanandani@gmail.com) 2828 Authors: Keyur Patel, 2829 Mahesh Jethanandani, 2830 Susan Hares"; 2832 description 2833 "This module contains data definitions for BGP routing policy. 2834 It augments the base routing-policy module with BGP-specific 2835 options for conditions and actions."; 2837 revision "2017-10-17" { 2838 description 2839 "Initial Version"; 2840 reference 2841 "RFC XXX, BGP Model for Service Provider Network."; 2842 } 2844 // typedef statements 2846 typedef bgp-set-community-option-type { 2847 type enumeration { 2848 enum ADD { 2849 description 2850 "add the specified communities to the existing 2851 community attribute"; 2852 } 2853 enum REMOVE { 2854 description 2855 "remove the specified communities from the 2856 existing community attribute"; 2857 } 2858 enum REPLACE { 2859 description 2860 "replace the existing community attribute with 2861 the specified communities. If an empty set is 2862 specified, this removes the community attribute 2863 from the route."; 2865 } 2866 } 2867 description 2868 "Type definition for options when setting the community 2869 attribute in a policy action"; 2870 } 2872 typedef bgp-next-hop-type { 2873 type union { 2874 type inet:ip-address-no-zone; 2875 type enumeration { 2876 enum SELF { 2877 description "special designation for local router's own 2878 address, i.e., next-hop-self"; 2879 } 2880 } 2881 } 2882 description 2883 "type definition for specifying next-hop in policy actions"; 2884 } 2886 typedef bgp-set-med-type { 2887 type union { 2888 type uint32; 2889 type string { 2890 pattern "^[+-][0-9]+"; 2891 } 2892 type enumeration { 2893 enum IGP { 2894 description "set the MED value to the IGP cost toward the 2895 next hop for the route"; 2896 } 2897 } 2898 } 2899 description 2900 "Type definition for specifying how the BGP MED can 2901 be set in BGP policy actions. The three choices are to set 2902 the MED directly, increment/decrement using +/- notation, 2903 and setting it to the IGP cost (predefined value)."; 2904 } 2906 // grouping statements 2908 grouping match-community-top { 2909 description 2910 "Top-level grouping for match conditions on communities"; 2912 container match-community-set { 2913 description 2914 "Top-level container for match conditions on communities. 2915 Match a referenced community-set according to the logic 2916 defined in the match-set-options leaf"; 2918 leaf community-set { 2919 type leafref { 2920 path 2921 "/rpol:routing-policy/rpol:defined-sets/" + 2922 "bgp-pol:bgp-defined-sets/bgp-pol:community-sets/" + 2923 "bgp-pol:community-set/bgp-pol:community-set-name"; 2924 } 2925 description 2926 "References a defined community set"; 2927 } 2929 uses rpol:match-set-options-group; 2930 } 2931 } 2933 grouping match-ext-community-top { 2934 description 2935 "Top-level grouping for match conditions on extended 2936 communities"; 2938 container match-ext-community-set { 2939 description 2940 "Match a referenced extended community-set according to the 2941 logic defined in the match-set-options leaf"; 2943 leaf ext-community-set { 2944 type leafref { 2945 path 2946 "/rpol:routing-policy/rpol:defined-sets/" + 2947 "bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/" + 2948 "bgp-pol:ext-community-set/" + 2949 "bgp-pol:ext-community-set-name"; 2950 } 2951 description "References a defined extended community set"; 2952 } 2954 uses rpol:match-set-options-group; 2955 } 2956 } 2958 grouping match-as-path-top { 2959 description 2960 "Top-level grouping for match conditions on AS path set"; 2962 container match-as-path-set { 2963 description 2964 "Match a referenced as-path set according to the logic 2965 defined in the match-set-options leaf"; 2967 leaf as-path-set { 2968 type leafref { 2969 path "/rpol:routing-policy/rpol:defined-sets/" + 2970 "bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/" + 2971 "bgp-pol:as-path-set/bgp-pol:as-path-set-name"; 2972 } 2973 description "References a defined AS path set"; 2974 } 2975 uses rpol:match-set-options-group; 2976 } 2977 } 2979 grouping bgp-match-set-conditions { 2980 description 2981 "Condition statement definitions for checking membership in a 2982 defined set"; 2984 uses match-community-top; 2985 uses match-ext-community-top; 2986 uses match-as-path-top; 2987 } 2989 grouping community-count-top { 2990 description 2991 "Top-level grouping for community count condition"; 2993 container community-count { 2994 description 2995 "Value and comparison operations for conditions based on the 2996 number of communities in the route update"; 2998 uses pol-types:attribute-compare-operators; 2999 } 3000 } 3002 grouping as-path-length-top { 3003 description 3004 "Top-level grouping for AS path length condition"; 3006 container as-path-length { 3007 description 3008 "Value and comparison operations for conditions based on the 3009 length of the AS path in the route update"; 3011 uses pol-types:attribute-compare-operators; 3012 } 3013 } 3015 grouping bgp-conditions-top { 3016 description 3017 "Top-level grouping for BGP-specific policy conditions"; 3019 container bgp-conditions { 3020 description 3021 "Top-level container "; 3023 leaf med-eq { 3024 type uint32; 3025 description 3026 "Condition to check if the received MED value is equal to 3027 the specified value"; 3028 } 3030 leaf origin-eq { 3031 type bgp-types:bgp-origin-attr-type; 3032 description 3033 "Condition to check if the route origin is equal to the 3034 specified value"; 3035 } 3037 leaf-list next-hop-in { 3038 type inet:ip-address-no-zone; 3039 description 3040 "List of next hop addresses to check for in the route 3041 update"; 3042 } 3044 leaf-list afi-safi-in { 3045 type identityref { 3046 base bgp-types:AFI_SAFI_TYPE; 3047 } 3048 description 3049 "List of address families which the NLRI may be within"; 3050 } 3052 leaf local-pref-eq { 3053 type uint32; 3054 // TODO: add support for other comparisons if needed 3055 description 3056 "Condition to check if the local pref attribute is equal to 3057 the specified value"; 3058 } 3060 leaf route-type { 3061 // TODO: verify extent of vendor support for this comparison 3062 type enumeration { 3063 enum INTERNAL { 3064 description "route type is internal"; 3065 } 3066 enum EXTERNAL { 3067 description "route type is external"; 3068 } 3069 } 3070 description 3071 "Condition to check the route type in the route update"; 3072 } 3074 uses community-count-top; 3075 uses as-path-length-top; 3076 uses bgp-match-set-conditions; 3077 } 3078 } 3080 grouping community-set-top { 3081 description 3082 "Top-level grouping for BGP community sets"; 3084 container community-sets { 3085 description 3086 "Enclosing container for list of defined BGP community sets"; 3088 list community-set { 3089 key "community-set-name"; 3090 description 3091 "List of defined BGP community sets"; 3093 leaf community-set-name { 3094 type string; 3095 mandatory true; 3096 description 3097 "name / label of the community set -- this is used to 3098 reference the set in match conditions"; 3099 } 3101 leaf-list community-member { 3102 type union { 3103 type bgp-types:bgp-std-community-type; 3104 type bgp-types:bgp-community-regexp-type; 3105 type bgp-types:bgp-well-known-community-type; 3106 } 3107 description 3108 "members of the community set"; 3109 } 3110 } 3111 } 3112 } 3114 grouping ext-community-set-top { 3115 description 3116 "Top-level grouping for extended BGP community sets"; 3118 container ext-community-sets { 3119 description 3120 "Enclosing container for list of extended BGP community 3121 sets"; 3122 list ext-community-set { 3123 key "ext-community-set-name"; 3124 description 3125 "List of defined extended BGP community sets"; 3127 leaf ext-community-set-name { 3128 type string; 3129 description 3130 "name / label of the extended community set -- this is 3131 used to reference the set in match conditions"; 3132 } 3134 leaf-list ext-community-member { 3135 type union { 3136 type rt-types:route-target; 3137 type bgp-types:bgp-community-regexp-type; 3138 } 3139 description 3140 "members of the extended community set"; 3141 } 3142 } 3143 } 3144 } 3146 grouping as-path-set-top { 3147 description 3148 "Top-level grouping for AS path sets"; 3150 container as-path-sets { 3151 description 3152 "Enclosing container for list of define AS path sets"; 3154 list as-path-set { 3155 key "as-path-set-name"; 3156 description 3157 "List of defined AS path sets"; 3159 leaf as-path-set-name { 3160 type string; 3161 description 3162 "name of the AS path set -- this is used to reference the 3163 set in match conditions"; 3164 } 3166 leaf-list as-path-set-member { 3167 // TODO: need to refine typedef for AS path expressions 3168 type string; 3169 description 3170 "AS path expression -- list of ASes in the set"; 3171 } 3172 } 3173 } 3174 } 3176 // augment statements 3178 augment "/rpol:routing-policy/rpol:defined-sets" { 3179 description "adds BGP defined sets container to routing policy 3180 model"; 3182 container bgp-defined-sets { 3183 description 3184 "BGP-related set definitions for policy match conditions"; 3186 uses community-set-top; 3187 uses ext-community-set-top; 3188 uses as-path-set-top; 3189 } 3190 } 3192 grouping as-path-prepend-top { 3193 description 3194 "Top-level grouping for the AS path prepend action"; 3196 container set-as-path-prepend { 3197 description 3198 "action to prepend local AS number to the AS-path a 3199 specified number of times"; 3201 leaf repeat-n { 3202 type uint8 { 3203 range 1..max; 3204 } 3205 description 3206 "Number of times to prepend the local AS number to the AS 3207 path. The value should be between 1 and the maximum 3208 supported by the implementation."; 3209 } 3210 } 3211 } 3213 grouping set-community-action-common { 3214 description 3215 "Common leaves for set-community and set-ext-community 3216 actions"; 3218 leaf method { 3219 type enumeration { 3220 enum INLINE { 3221 description 3222 "The extended communities are specified inline as a 3223 list"; 3224 } 3225 enum REFERENCE { 3226 description 3227 "The extended communities are specified by referencing a 3228 defined ext-community set"; 3229 } 3230 } 3231 description 3232 "Indicates the method used to specify the extended 3233 communities for the set-ext-community action"; 3234 } 3236 leaf options { 3237 type bgp-set-community-option-type; 3238 description 3239 "Options for modifying the community attribute with 3240 the specified values. These options apply to both 3241 methods of setting the community attribute."; 3242 } 3243 } 3245 grouping set-community-inline-top { 3246 description 3247 "Top-level grouping or inline specification of set-community 3248 action"; 3250 container inline { 3251 when "../config/method=INLINE" { 3252 description 3253 "Active only when the set-community method is INLINE"; 3254 } 3255 description 3256 "Set the community values for the action inline with 3257 a list."; 3259 leaf-list communities { 3260 type union { 3261 type bgp-types:bgp-std-community-type; 3262 type bgp-types:bgp-well-known-community-type; 3263 } 3264 description 3265 "Set the community values for the update inline with a 3266 list."; 3267 } 3268 } 3269 } 3271 grouping set-community-reference-top { 3272 description 3273 "Top-level grouping for referening a community-set in the 3274 set-community action"; 3276 container reference { 3277 when "../config/method=REFERENCE" { 3278 description 3279 "Active only when the set-community method is REFERENCE"; 3280 } 3281 description 3282 "Provide a reference to a defined community set for the 3283 set-community action"; 3285 leaf community-set-ref { 3286 type leafref { 3287 path "/rpol:routing-policy/rpol:defined-sets/" + 3288 "bgp-pol:bgp-defined-sets/" + 3289 "bgp-pol:community-sets/bgp-pol:community-set/" + 3290 "bgp-pol:community-set-name"; 3291 } 3292 description 3293 "References a defined community set by name"; 3294 } 3295 } 3296 } 3297 grouping set-community-action-top { 3298 description 3299 "Top-level grouping for the set-community action"; 3301 container set-community { 3302 description 3303 "Action to set the community attributes of the route, along 3304 with options to modify how the community is modified. 3305 Communities may be set using an inline list OR 3306 reference to an existing defined set (not both)."; 3308 uses set-community-action-common; 3309 uses set-community-inline-top; 3310 uses set-community-reference-top; 3311 } 3312 } 3314 grouping set-ext-community-inline-top { 3315 description 3316 "Top-level grouping or inline specification of 3317 set-ext-community action"; 3319 container inline { 3320 when "../config/method=INLINE" { 3321 description 3322 "Active only when the set-community method is INLINE"; 3323 } 3324 description 3325 "Set the extended community values for the action inline with 3326 a list."; 3328 leaf-list communities { 3329 type union { 3330 type rt-types:route-target; 3331 type bgp-types:bgp-well-known-community-type; 3332 } 3333 description 3334 "Set the extended community values for the update inline 3335 with a list."; 3336 } 3337 } 3338 } 3340 grouping set-ext-community-reference-top { 3341 description 3342 "Top-level grouping for referening an extended community-set 3343 in the set-community action"; 3345 container reference { 3346 when "../config/method=REFERENCE" { 3347 description 3348 "Active only when the set-community method is REFERENCE"; 3349 } 3350 description 3351 "Provide a reference to an extended community set for the 3352 set-ext-community action"; 3354 leaf ext-community-set-ref { 3355 type leafref { 3356 path 3357 "/rpol:routing-policy/rpol:defined-sets/" + 3358 "bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/" + 3359 "bgp-pol:ext-community-set/" + 3360 "bgp-pol:ext-community-set-name"; 3361 } 3362 description 3363 "References a defined extended community set by name"; 3364 } 3365 } 3366 } 3368 grouping set-ext-community-action-top { 3369 description 3370 "Top-level grouping for the set-ext-community action"; 3372 container set-ext-community { 3373 description 3374 "Action to set the extended community attributes of the 3375 route, along with options to modify how the community is 3376 modified. Extended communities may be set using an inline 3377 list OR a reference to an existing defined set (but not 3378 both)."; 3380 uses set-community-action-common; 3381 uses set-ext-community-inline-top; 3382 uses set-ext-community-reference-top; 3383 } 3384 } 3386 grouping bgp-actions-top { 3387 description 3388 "Top-level grouping for BGP-specific actions"; 3390 container bgp-actions { 3391 description 3392 "Top-level container for BGP-specific actions"; 3394 leaf set-route-origin { 3395 type bgp-types:bgp-origin-attr-type; 3396 description 3397 "set the origin attribute to the specified value"; 3398 } 3400 leaf set-local-pref { 3401 type uint32; 3402 description 3403 "set the local pref attribute on the route update"; 3404 } 3406 leaf set-next-hop { 3407 type bgp-next-hop-type; 3408 description 3409 "set the next-hop attribute in the route update"; 3410 } 3412 leaf set-med { 3413 type bgp-set-med-type; 3414 description 3415 "set the med metric attribute in the route update"; 3416 } 3417 uses as-path-prepend-top; 3418 uses set-community-action-top; 3419 uses set-ext-community-action-top; 3420 } 3421 } 3423 augment "/rpol:routing-policy/rpol:policy-definitions/" + 3424 "rpol:policy-definition/rpol:statements/rpol:statement/" + 3425 "rpol:conditions" { 3426 description 3427 "BGP policy conditions added to routing policy module"; 3429 uses bgp-conditions-top; 3430 } 3432 augment "/rpol:routing-policy/rpol:policy-definitions/" + 3433 "rpol:policy-definition/rpol:statements/rpol:statement/" + 3434 "rpol:actions" { 3435 description "BGP policy actions added to routing policy 3436 module"; 3438 uses bgp-actions-top; 3439 } 3441 // rpc statements 3442 // notification statements 3443 } 3444 3446 10. References 3448 10.1. Normative references 3450 [RFC1997] Chandra, R., Traina, P., and T. Li, "BGP Communities 3451 Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996, 3452 . 3454 [RFC2439] Villamizar, C., Chandra, R., and R. Govindan, "BGP Route 3455 Flap Damping", RFC 2439, DOI 10.17487/RFC2439, November 3456 1998, . 3458 [RFC3065] Traina, P., McPherson, D., and J. Scudder, "Autonomous 3459 System Confederations for BGP", RFC 3065, 3460 DOI 10.17487/RFC3065, February 2001, 3461 . 3463 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3464 DOI 10.17487/RFC3688, January 2004, 3465 . 3467 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 3468 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 3469 DOI 10.17487/RFC4271, January 2006, 3470 . 3472 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 3473 Reflection: An Alternative to Full Mesh Internal BGP 3474 (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, 3475 . 3477 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 3478 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 3479 DOI 10.17487/RFC4724, January 2007, 3480 . 3482 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 3483 "Multiprotocol Extensions for BGP-4", RFC 4760, 3484 DOI 10.17487/RFC4760, January 2007, 3485 . 3487 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 3488 the Network Configuration Protocol (NETCONF)", RFC 6020, 3489 DOI 10.17487/RFC6020, October 2010, 3490 . 3492 [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. 3493 Austein, "BGP Prefix Origin Validation", RFC 6811, 3494 DOI 10.17487/RFC6811, January 2013, 3495 . 3497 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3498 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3499 . 3501 10.2. Informative references 3503 [I-D.ietf-netmod-revised-datastores] 3504 Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 3505 and R. Wilton, "Network Management Datastore 3506 Architecture", draft-ietf-netmod-revised-datastores-06 3507 (work in progress), October 2017. 3509 [I-D.ietf-netmod-routing-cfg] 3510 Lhotka, L. and A. Lindem, "A YANG Data Model for Routing 3511 Management", draft-ietf-netmod-routing-cfg-25 (work in 3512 progress), November 2016. 3514 [I-D.ietf-rtgwg-ni-model] 3515 Berger, L., Hopps, C., Lindem, A., Bogdanovic, D., and X. 3516 Liu, "YANG Network Instances", draft-ietf-rtgwg-ni- 3517 model-04 (work in progress), September 2017. 3519 [I-D.ietf-rtgwg-policy-model] 3520 Shaikh, A., Shakir, R., D'Souza, K., and C. Chase, 3521 "Routing Policy Configuration Model for Service Provider 3522 Networks", draft-ietf-rtgwg-policy-model-01 (work in 3523 progress), April 2016. 3525 [I-D.rtgyangdt-rtgwg-device-model] 3526 Lindem, A., Berger, L., Bogdanovic, D., and C. Hopps, 3527 "Network Device YANG Organizational Models", draft- 3528 rtgyangdt-rtgwg-device-model-05 (work in progress), August 3529 2016. 3531 Appendix A. Acknowledgements 3533 The authors are grateful for valuable contributions to this document 3534 and the associated models from: Ebben Aires, Pavan Beeram, Chris 3535 Chase, Ed Crabbe, Luyuan Fang, Bill Fenner, Akshay Gattani, Josh 3536 George, Vijay Gill, Matt John, Jeff Haas, Dhanendra Jain, Acee 3537 Lindem, Ina Minei, Carl Moberg, Ashok Narayanan, Einar Nilsen- 3538 Nygaard, Adam Simpson, Puneet Sood, Jason Sterne, Jeff Tantsura, Jim 3539 Uttaro, and Gunter Vandevelde. 3541 Appendix B. Change summary 3543 B.1. Changes between revisions -01 and -02 3545 o Refactored BGP model such that it is comprised of multiple sub- 3546 modules rather than independent modules. 3548 o Remove the need for self-augmentation of the BGP model to allow 3549 the ability to import the model in wider structures more easily. 3551 o Added new operational state values for BGP session established 3552 transitions and last-established timestamp. Also deprecated 3553 uptime operational state leaf. 3555 o Added ability to select eligible paths for add-paths based on a 3556 policy. 3558 B.2. Changes between revisions -00 and -01 3560 o Updated module namespaces to reflect IETF standard namespace. 3562 o Updated module filenames with ietf- prefix per RFC 6087 3563 guidelines. 3565 Authors' Addresses 3567 Keyur Patel (editor) 3568 Arrcus 3569 CA 3570 USA 3572 Email: keyur@arrcus.com 3573 Mahesh Jethanandani (editor) 3574 CA 3575 USA 3577 Email: mjethanandani@gmail.com 3579 Susan Hares (editor) 3580 Hickory Hill Consulting 3581 7453 Hickory Hill 3582 Saline, MI 48176 3583 USA 3585 Email: shares@ndzh.com