idnits 2.17.1 draft-ietf-rtgwg-yang-vrrp-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 231 has weird spacing: '...address ine...' == Line 249 has weird spacing: '...address ine...' == Line 289 has weird spacing: '...address ine...' == Line 312 has weird spacing: '...address ine...' == Line 345 has weird spacing: '...address ine...' == (19 more instances...) -- The document date (September 30, 2017) is 2398 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) -- Possible downref: Normative reference to a draft: ref. 'I-D.bjorklund-netmod-rfc7223bis' -- Possible downref: Normative reference to a draft: ref. 'I-D.bjorklund-netmod-rfc7277bis' == Outdated reference: A later version (-10) exists of draft-ietf-netmod-revised-datastores-04 -- Obsolete informational reference (is this intentional?): RFC 3768 (Obsoleted by RFC 5798) -- Obsolete informational reference (is this intentional?): RFC 6536 (Obsoleted by RFC 8341) == Outdated reference: A later version (-25) exists of draft-ietf-netconf-yang-push-09 == Outdated reference: A later version (-20) exists of draft-ietf-netmod-rfc6087bis-14 Summary: 0 errors (**), 0 flaws (~~), 10 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group X. Liu, Ed. 3 Internet-Draft A. Kyparlis 4 Intended status: Standards Track Jabil 5 Expires: April 3, 2018 R. Parikh 6 VMware 7 A. Lindem 8 Cisco Systems 9 M. Zhang 10 Huawei Technologies 11 September 30, 2017 13 A YANG Data Model for Virtual Router Redundancy Protocol (VRRP) 14 draft-ietf-rtgwg-yang-vrrp-05 16 Abstract 18 This document describes a data model for Virtual Router Redundancy 19 Protocol (VRRP). Both version 2 and version 3 of VRRP are covered. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on April 3, 2018. 38 Copyright Notice 40 Copyright (c) 2017 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 57 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 58 1.3. Prefixes in Data Node Names . . . . . . . . . . . . . . . 3 59 2. Design of the Data Model . . . . . . . . . . . . . . . . . . 4 60 2.1. Scope of the Model . . . . . . . . . . . . . . . . . . . 4 61 2.2. Relations with Interface Model and IP Model . . . . . . . 4 62 2.3. Protocol Configuration . . . . . . . . . . . . . . . . . 5 63 2.4. Protocol States . . . . . . . . . . . . . . . . . . . . . 7 64 2.5. Notifications . . . . . . . . . . . . . . . . . . . . . . 8 65 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 10 66 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31 67 5. Security Considerations . . . . . . . . . . . . . . . . . . . 31 68 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 32 69 6.1. Normative References . . . . . . . . . . . . . . . . . . 32 70 6.2. Informative References . . . . . . . . . . . . . . . . . 33 71 Appendix A. Complete Model Tree Structure . . . . . . . . . . . 35 72 Appendix B. Data Tree Example . . . . . . . . . . . . . . . . . 37 73 Appendix C. YANG Model for Non-NMDA Compliant Implementations . 41 74 C.1. Non-NMDA YANG Module . . . . . . . . . . . . . . . . . . 41 75 C.2. Non-NMDA Model Tree Structure . . . . . . . . . . . . . . 64 76 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 67 78 1. Introduction 80 This document introduces a YANG [RFC6020][RFC7950] data model for 81 Virtual Router Redundancy Protocol (VRRP) [RFC3768][RFC5798]. VRRP 82 provides higher resiliency by specifying an election protocol that 83 dynamically assigns responsibility for a virtual router to one of the 84 VRRP routers on a LAN. 86 This YANG model supports both version 2 and version 3 of VRRP. VRRP 87 version 2 defined in [RFC3768] supports IPv4. VRRP version 3 defined 88 in [RFC5798] supports both IPv4 and IPv6. 90 1.1. Terminology 92 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 93 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 94 document are to be interpreted as described in [RFC2119]. 96 The following terms are defined in [RFC7950] and are not redefined 97 here: 99 o augment 101 o data model 103 o data node 105 1.2. Tree Diagrams 107 A simplified graphical representation of the data model is used in 108 this document. The meaning of the symbols in these diagrams is as 109 follows: 111 o Brackets "[" and "]" enclose list keys. 113 o Curly braces "{" and "}" contain names of optional features that 114 make the corresponding node conditional. 116 o Abbreviations before data node names: "rw" means configuration 117 (read-write), and "ro" means state data (read-only). 119 o Symbols after data node names: "?" means an optional node, "!" 120 means a presence container, and "*" denotes a list and leaf-list. 122 o Parentheses enclose choice and case nodes, and case nodes are also 123 marked with a colon (":"). 125 o Ellipsis ("...") stands for contents of subtrees that are not 126 shown. 128 1.3. Prefixes in Data Node Names 130 In this document, names of data nodes, actions, and other data model 131 objects are often used without a prefix, as long as it is clear from 132 the context in which YANG module each name is defined. Otherwise, 133 names are prefixed using the standard prefix associated with the 134 corresponding YANG module, as shown in Table 1. 136 +--------+-----------------+-----------------------------------+ 137 | Prefix | YANG module | Reference | 138 +--------+-----------------+-----------------------------------+ 139 | yang | ietf-yang-types | [RFC6991] | 140 | inet | ietf-inet-types | [RFC6991] | 141 | if | ietf-interfaces | [I-D.bjorklund-netmod-rfc7223bis] | 142 | ip | ietf-ip | [I-D.bjorklund-netmod-rfc7277bis] | 143 +--------+-----------------+-----------------------------------+ 145 Table 1: Prefixes and Corresponding YANG Modules 147 2. Design of the Data Model 149 2.1. Scope of the Model 151 The model covers VRRP version 2 [RFC3768] and VRRP version 3 152 [RFC5798] protocols. The model is designed to be implemented on a 153 device where VRRP version 2 or version 3 is implemented. With the 154 help of a proper management protocol, the defined model can be used 155 to: 157 o Configure the VRRP version 2 or version 3 protocol. 159 o Manage the protocol operational behavior. 161 o Retrieve the protocol operational status. 163 o Receive the protocol notifications. 165 2.2. Relations with Interface Model and IP Model 167 This model augments the interface data model "ietf-interfaces" 168 [I-D.bjorklund-netmod-rfc7223bis] and the IP management model "ietf- 169 ip" [I-D.bjorklund-netmod-rfc7277bis]. The augmentation relations 170 are shown as follows: 172 module: ietf-interfaces 173 +--rw interfaces 174 +--rw interface* [name] 175 ... 176 +--rw ip:ipv4! 177 | +--rw ip:address* [ip] 178 ... 179 | +--rw vrrp:vrrp 180 | +--rw vrrp:vrrp-instance* [vrid] 181 | +--rw vrrp:vrid uint8 182 | +--rw vrrp:virtual-ipv4-addresses 183 ... 184 +--rw ip:ipv6! 185 +--rw ip:address* [ip] 186 ... 187 +--rw vrrp:vrrp 188 +--rw vrrp:vrrp-instance* [vrid] 189 +--rw vrrp:vrid uint8 190 +--rw vrrp:virtual-ipv6-addresses 191 ... 193 In the above figure, a tree node without a prefix is from the model 194 "ietf-interfaces". A tree node with prefix "ip:" is from the model 195 "ietf-ip". A tree node with prefix "vrrp:" is from the VRRP model 196 specified in this document. 198 The "vrrp" container contains a list of vrrp-instance nodes, which 199 are instantiated under an interface for a specified address family 200 (IPv4 or IPv6). 202 Each vrrp-instance node represents a VRRP router state machine 203 described in Section 6.4 of [RFC5798], providing the configuration 204 and state information for the election process of a virtual router. 205 The IP addresses on the augmented interface are the real addresses 206 through which the VRRP router operates. The IPv4 or IPv6 address(es) 207 associated with a virtual router (described in Section 1 of 208 [RFC5798]) are modeled as a list of IPv4 or IPv6 addresses under the 209 vrrp-instance. 211 2.3. Protocol Configuration 213 The model structure for the protocol configuration is as shown below: 215 augment /if:interfaces/if:interface/ip:ipv4: 216 +--rw vrrp 217 +--rw vrrp-instance* [vrid] 218 +--rw vrid uint8 219 | ... 220 +--rw track 221 | +--rw interfaces 222 | | +--rw interface* [interface] 223 | | +--rw interface if:interface-ref 224 | | ... 225 | +--rw networks 226 | +--rw network* [prefix] 227 | +--rw prefix inet:ipv4-prefix 228 | ... 229 +--rw virtual-ipv4-addresses 230 +--rw virtual-ipv4-address* [ipv4-address] 231 +--rw ipv4-address inet:ipv4-address 233 augment /if:interfaces/if:interface/ip:ipv6: 234 +--rw vrrp 235 +--rw vrrp-instance* [vrid] 236 +--rw vrid uint8 237 | ... 238 +--rw track 239 | +--rw interfaces 240 | | +--rw interface* [interface] 241 | | +--rw interface if:interface-ref 242 | | ... 243 | +--rw networks 244 | +--rw network* [prefix] 245 | +--rw prefix inet:ipv6-prefix 246 | ... 247 +--rw virtual-ipv6-addresses 248 +--rw virtual-ipv6-address* [ipv6-address] 249 +--rw ipv6-address inet:ipv6-address 251 The model allows to configure the following protocol entities: 253 o VRRP instance (version 2 or version 3), representing a VRRP 254 router. 256 o Virtual IPv4 or IPv6 address associated with a virtual router. 258 o Tracking interface, to detect interface connectivity failures. 260 o Tracking network, to detect interface connectivity failures. 262 2.4. Protocol States 264 The model structure for the protocol states is as shown below: 266 module: ietf-vrrp 267 +--rw vrrp 268 +--ro 269 +--ro statistics 270 +--ro discontinuity-datetime? yang:date-and-time 271 +--ro 273 augment /if:interfaces/if:interface/ip:ipv4: 274 +--rw vrrp 275 +--rw vrrp-instance* [vrid] 276 +--rw vrid uint8 277 | ... 278 +--rw track 279 | +--rw interfaces 280 | | +--rw interface* [interface] 281 | | +--rw interface if:interface-ref 282 | | ... 283 | +--rw networks 284 | +--rw network* [prefix] 285 | +--wo prefix inet:ipv4-prefix 286 | ... 287 +--rw virtual-ipv4-addresses 288 | +--rw virtual-ipv4-address* [ipv4-address] 289 | +--rw ipv4-address inet:ipv4-address 290 | 291 +--ro 292 +--ro statistics 293 +--ro 295 augment /if:interfaces/if:interface/ip:ipv6: 296 +--rw vrrp 297 +--rw vrrp-instance* [vrid] 298 +--rw vrid uint8 299 + ... 300 +--rw track 301 | +--rw interfaces 302 | | +--rw interface* [interface] 303 | | +--rw interface if:interface-ref 304 | | ... 305 | +--rw networks 306 | +--rw network* [prefix] 307 | +--rw prefix inet:ipv6-prefix 308 | ... 310 +--rw virtual-ipv6-addresses 311 | +--rw virtual-ipv6-address* [ipv6-address] 312 | +--rw ipv6-address inet:ipv6-address 313 | 314 +--ro 315 +--ro statistics 316 +--ro 318 This model conforms to the Network Management Datastore Architecture 319 (NMDA) [I-D.ietf-netmod-revised-datastores]. The operational state 320 data is combined with the associated configuration data in the same 321 hierarchy [I-D.ietf-netmod-rfc6087bis]. When protocol states are 322 retrieved from the NMDA operational state datastore, the returned 323 states cover all "config true" (rw) and "config false" (ro) nodes 324 defined in the schema. 326 The model allows to retrieve protocol states at the following levels: 328 o VRRP instance (version 2 or version 3), representing a VRRP 329 router. 331 o Virtual IPv4 or IPv6 address associated with a virtual router. 333 o Tracking interface, to detect interface connectivity failures. 335 o Tracking network, to detect interface connectivity failures. 337 o Global states and statistics summarizing all instances. 339 2.5. Notifications 341 This model defines the following VRRP specific notifications: 343 notifications: 344 +---n vrrp-new-master-event 345 | +--ro master-ip-address inet:ip-address 346 | +--ro new-master-reason new-master-reason-type 347 +---n vrrp-protocol-error-event 348 | +--ro protocol-error-reason identityref 349 +---n vrrp-virtual-router-error-event 350 +--ro interface if:interface-ref 351 +--ro (ip-version) 352 | +--:(ipv4) 353 | | +--ro ipv4 354 | | +--ro vrid leafref 355 | +--:(ipv6) 356 | +--ro ipv6 357 | +--ro vrid leafref 358 +--ro virtual-router-error-reason identityref 360 Each notification type is used to indicate a type of VRRP state 361 changes or error occurances: 363 vrrp-new-master-event 364 VRRP new master event, indicating that a new master has been 365 elected. 367 vrrp-protocol-error-event 368 VRRP protocol error event for a message that fails to reach a VRRP 369 instance to be processed. 371 vrrp-virtual-router-error-event 372 VRRP virtual router error event for a message processed on a VRRP 373 instance. 375 In addition to the notifications specified above, the mechanism 376 defined in [I-D.ietf-netconf-yang-push] and 377 [I-D.ietf-netconf-rfc5277bis] can be used for other general 378 notifications. This mechanism currently allows the user to: 380 o Subscribe notifications on a per client basis. 382 o Specify subtree filters or xpath filters so that only interested 383 contents will be sent. 385 o Specify either periodic or on-demand notifications. 387 3. YANG Module 389 file "ietf-vrrp@2017-09-25.yang" 390 module ietf-vrrp { 391 yang-version 1.1; 392 namespace "urn:ietf:params:xml:ns:yang:ietf-vrrp"; 393 prefix "vrrp"; 395 import ietf-inet-types { 396 prefix "inet"; 397 } 399 import ietf-yang-types { 400 prefix "yang"; 401 } 403 import ietf-interfaces { 404 prefix "if"; 405 } 407 import ietf-ip { 408 prefix "ip"; 409 } 411 organization 412 "IETF Routing Area Working Group (RTGWG)"; 413 contact 414 "WG Web: 415 WG List: 417 WG Chair: Jeff Tantsura 418 420 WG Chair: Chris Bowers 421 423 Editor: Xufeng Liu 424 426 Editor: Athanasios Kyparlis 427 429 Editor: Ravi Parikh 430 432 Editor: Acee Lindem 433 435 Editor: Mingui Zhang 436 "; 438 description 439 "This YANG module defines a model for managing Virtual Router 440 Redundancy Protocol (VRRP) version 2 and version 3."; 442 revision 2017-09-25 { 443 description "Initial revision"; 444 reference 445 "RFC XXXX: A YANG Data Model for Virtual Router Redundancy 446 Protocol (VRRP). 447 RFC 2787: Definitions of Managed Objects for the Virtual 448 Router Redundancy Protocol. 449 RFC 3768: Virtual Router Redundancy Protocol (VRRP). 450 RFC 5798: Virtual Router Redundancy Protocol (VRRP) Version 3. 451 RFC 6527: Definitions of Managed Objects for the Virtual 452 Router Redundancy Protocol Version 3 (VRRPv3)."; 453 } 455 /* 456 * Features 457 */ 459 feature validate-interval-errors { 460 description 461 "This feature indicates that the system validates that 462 the advertisement interval from advertisement packets 463 received is the same as the one configured for the local 464 VRRP router."; 465 } 467 feature validate-address-list-errors { 468 description 469 "This feature indicates that the system validates that 470 the address list from received packets matches the 471 locally configured list for the VRRP router."; 472 } 474 /* 475 * Typedefs 476 */ 478 typedef new-master-reason-type { 479 type enumeration { 480 enum not-master { 481 description 482 "The virtual router has never transitioned to master 483 state,"; 484 } 485 enum priority { 486 description "Priority was higher."; 487 } 488 enum preempted { 489 description "The master was preempted."; 490 } 491 enum no-response { 492 description "Previous master did not respond."; 493 } 494 } 495 description 496 "The reason for the virtual router to transition to master 497 state."; 498 } // new-master-reason-type 500 /* 501 * Identities 502 */ 504 /* vrrp-event-type identity and its derivatives. */ 505 identity vrrp-event-type { 506 description 507 "The type to indicate the type of a VRRP protocol event."; 508 } 509 identity vrrp-event-none { 510 base vrrp-event-type; 511 description 512 "Indicates a non-meaningful event."; 513 } 514 identity vrrp-event-startup { 515 base vrrp-event-type; 516 description 517 "Indicates that a VRRP router has initiated the protocol."; 518 } 519 identity vrrp-event-shutdown { 520 base vrrp-event-type; 521 description 522 "Indicates that a VRRP router has closed down the protocol."; 523 } 524 identity vrrp-event-higher-priority-backup { 525 base vrrp-event-type; 526 description 527 "Indicates that a backup router has a higher priority than 528 the current master."; 529 } 530 identity vrrp-event-master-timeout { 531 base vrrp-event-type; 532 description 533 "Indicates that the current master has not sent an 534 advertisement within the limit of master-down-interval."; 535 } 536 identity vrrp-event-interface-up { 537 base vrrp-event-type; 538 description 539 "Indicates that the VRRP enabled interface has become 540 operational up."; 541 } 542 identity vrrp-event-interface-down { 543 base vrrp-event-type; 544 description 545 "Indicates that the VRRP enabled interface has become 546 operational down."; 547 } 548 identity vrrp-event-no-primary-ip-address { 549 base vrrp-event-type; 550 description 551 "Indicates that the primary IP address on the VRRP enabled 552 interface has become unavailable."; 553 } 554 identity vrrp-event-primary-ip-address { 555 base vrrp-event-type; 556 description 557 "Indicates that the primary IP address on the VRRP enabled 558 interface has become available."; 559 } 560 identity vrrp-event-no-virtual-ip-addresses { 561 base vrrp-event-type; 562 description 563 "Indicates that there are no virtual IP addresses on the 564 virtual router."; 565 } 566 identity vrrp-event-virtual-ip-addresses { 567 base vrrp-event-type; 568 description 569 "Indicates that there are virtual IP addresses on the 570 virtual router."; 571 } 572 identity vrrp-event-preempt-hold-timeout { 573 base vrrp-event-type; 574 description 575 "Indicates that the configured preemption hold time has 576 passed."; 577 } 578 identity vrrp-event-lower-priority-master { 579 base vrrp-event-type; 580 description 581 "Indicates that there is a lower priority VRRP master."; 582 } 583 identity vrrp-event-owner-preempt { 584 base vrrp-event-type; 585 description 586 "Indicates that the owner has preempted another router to 587 become the master."; 588 } 590 /* vrrp-error-global identity and its derivatives. */ 591 identity vrrp-error-global { 592 description 593 "The type to indicate the type of a VRRP error that occurs 594 for a packet before it reaches a VRRP router."; 595 } 596 identity checksum-error { 597 base vrrp-error-global; 598 description 599 "A packet has been received with an invalid VRRP checksum 600 value."; 601 } 602 identity ip-ttl-error { 603 base vrrp-error-global; 604 description 605 "A packet has been received with IP TTL (Time-To-Live) 606 not equal to 255."; 607 } 608 identity version-error { 609 base vrrp-error-global; 610 description 611 "A packet has been received with an unknown or unsupported 612 version number."; 613 } 614 identity vrid-error { 615 base vrrp-error-global; 616 description 617 "A packet has been received with a VRID that is not valid 618 for any virtual router on this router."; 619 } 621 /* vrrp-error-virtual-router identity and its derivatives. */ 622 identity vrrp-error-virtual-router { 623 description 624 "The type to indicate the type of a VRRP error that occurs 625 after a packet reaches a VRRP router."; 626 } 627 identity address-list-error { 628 base vrrp-error-virtual-router; 629 description 630 "A packet has been received with an address list that 631 does not match the locally configured address list for 632 the virtual router."; 633 } 634 identity interval-error { 635 base vrrp-error-virtual-router; 636 description 637 "A packet has been received with an advertisement 638 interval different than the one configured for the local 639 virtual router"; 640 } 641 identity packet-length-error { 642 base vrrp-error-virtual-router; 643 description 644 "A packet has been received with a packet length less 645 than the length of the VRRP header."; 646 } 648 /* vrrp-state-type identity and its derivatives. */ 649 identity vrrp-state-type { 650 description 651 "The type to indicate the state of a virtual router."; 652 } 653 identity initialize { 654 base vrrp-state-type; 655 description 656 "Indicates that the virtual router is waiting 657 for a startup event."; 658 } 659 identity backup { 660 base vrrp-state-type; 661 description 662 "Indicates that the virtual router is monitoring the 663 availability of the master router."; 664 } 665 identity master { 666 base vrrp-state-type; 667 description 668 "Indicates that the virtual router is forwarding 669 packets for IP addresses that are associated with 670 this virtual router."; 671 } 673 /* vrrp-version identity and its derivatives. */ 674 identity vrrp-version { 675 description 676 "The version of the VRRP protocol."; 677 } 678 identity vrrp-v2 { 679 base vrrp-version; 680 description 681 "Indicates version 2 of the VRRP protocol."; 682 } 683 identity vrrp-v3 { 684 base vrrp-version; 685 description 686 "Indicates version 3 of the VRRP protocol."; 687 } 689 /* 690 * Groupings 691 */ 693 grouping vrrp-common-attributes { 694 description 695 "Group of VRRP attributes common to version 2 and version 3"; 697 leaf vrid { 698 type uint8 { 699 range 1..255; 700 } 701 description "Virtual router ID."; 702 } 704 leaf version { 705 type identityref { 706 base vrrp:vrrp-version; 707 } 708 mandatory true; 709 description "Version 2 or version 3 of VRRP."; 710 } 712 leaf log-state-change { 713 type boolean; 714 default "false"; 715 description 716 "Generates VRRP state change messages each time the VRRP 717 instance changes state (from up to down or down to up)."; 718 } 720 container preempt { 721 description 722 "Enables a higher priority Virtual Router Redundancy 723 Protocol (VRRP) backup router to preempt a lower priority 724 VRRP master."; 725 leaf enabled { 726 type boolean; 727 default "true"; 728 description 729 "'true' if preemption is enabled."; 730 } 731 leaf hold-time { 732 type uint16; 733 units seconds; 734 default 0; 735 description 736 "Hold time, in seconds, for which a higher priority VRRP 737 backup router must wait before preempting a lower priority 738 VRRP master."; 739 } 740 } 742 leaf priority { 743 type uint8 { 744 range 1..254; 745 } 746 default 100; 747 description 748 "Configures the Virtual Router Redundancy Protocol (VRRP) 749 election priority for the backup virtual router."; 750 } 752 leaf accept-mode { 753 when "derived-from-or-self(current()/../version, 'vrrp-v3')" { 754 description "Applicable only to version 3."; 755 } 756 type boolean; 757 default "false"; 758 description 759 "Controls whether a virtual router in Master state will 760 accept packets addressed to the address owner's IPvX address 761 as its own if it is not the IPvX address owner. The default 762 is false. Deployments that rely on, for example, pinging the 763 address owner's IPvX address may wish to configure 764 accept-mode to true. 766 Note: IPv6 Neighbor Solicitations and Neighbor 767 Advertisements MUST NOT be dropped when accept-mode is 768 false."; 769 } 770 } // vrrp-common-attributes 771 grouping vrrp-ipv4-attributes { 772 description 773 "Group of VRRP attributes for IPv4."; 775 uses vrrp-common-attributes; 777 choice advertise-interval-choice { 778 description 779 "The options for the advertisement interval at which VRRPv2 780 or VRRPv3 advertisements are sent from the specified 781 interface."; 783 case v2 { 784 when "derived-from-or-self(version, 'vrrp-v2')" { 785 description "Applicable only to version 2."; 786 } 787 leaf advertise-interval-sec { 788 type uint8 { 789 range 1..254; 790 } 791 units seconds; 792 default 1; 793 description 794 "Configures the interval that Virtual Router 795 Redundancy Protocol Version 2 (VRRPv2) advertisements 796 are sent from the specified interface."; 797 } 798 } 800 case v3 { 801 when "derived-from-or-self(version, 'vrrp-v3')" { 802 description "Applicable only to version 3."; 803 } 804 leaf advertise-interval-centi-sec { 805 type uint16 { 806 range 1..4095; 807 } 808 units centiseconds; 809 default 100; 810 description 811 "Configures the interval that Virtual Router 812 Redundancy Protocol version 3 (VRRPv3) advertisements 813 are sent from the specified interface."; 814 } 815 } 816 } // advertise-interval-choice 818 container track { 819 description 820 "Enables the specified VRRP instance to track interfaces 821 or networks."; 822 container interfaces { 823 description 824 "Enables the specified Virtual Router Redundancy Protocol 825 version 2 (VRRP) or version 3 (VRRPv3) instance to track 826 an interface."; 828 list interface { 829 key "interface"; 830 description 831 "Interface to track."; 833 leaf interface { 834 type if:interface-ref; 835 must "/if:interfaces/if:interface[if:name=current()]/" 836 + "ip:ipv4" { 837 description "Interface is IPv4."; 838 } 839 description 840 "Interface to track."; 841 } 843 leaf priority-decrement { 844 type uint8 { 845 range 1..254; 846 } 847 default 10; 848 description 849 "Specifies how much to decrement the priority of the 850 VRRP instance if the interface goes down."; 851 } 852 } // interface 853 } // interfaces 855 container networks { 856 description 857 "Enables the backup Virtual Router Redundancy Protocol 858 version 2 (VRRP) or version 3 (VRRPv3) router to track a 859 specified network through the IP network prefix of that 860 network."; 861 list network { 862 key "prefix"; 863 description 864 "Enables the specified Virtual Router Redundancy 865 Protocol version 2 (VRRP) or version 3 (VRRPv3) 866 instance to track an IP network, by specifying the 867 prefix of the IP network."; 869 leaf prefix { 870 type inet:ipv4-prefix; 871 description 872 "The prefix of the network to track."; 873 } 875 leaf priority-decrement { 876 type uint8 { 877 range 1..254; 878 } 879 default 10; 880 description 881 "Specifies how much to decrement the priority of the 882 backup VRRP router if there is a failure in the IP 883 network."; 884 } 885 } // track-network 886 } // track-networks 887 } // track 889 container virtual-ipv4-addresses { 890 description 891 "Configures the virtual IP address for the Virtual Router 892 Redundancy Protocol (VRRP) interface."; 894 list virtual-ipv4-address { 895 key "ipv4-address"; 896 max-elements 16; 897 description 898 "Virtual IP addresses for a single VRRP instance. For a 899 VRRP owner router, the virtual address must match one 900 of the IP addresses configured on the interface 901 corresponding to the virtual router."; 903 leaf ipv4-address { 904 type inet:ipv4-address; 905 description 906 "An IPv4 address associated with a virtual router."; 907 reference 908 "RFC 5798: Virtual Router Redundancy Protocol (VRRP) 909 Version 3. Section 1.2."; 910 } 911 } // virtual-ipv4-address 912 } // virtual-ipv4-addresses 913 } // grouping vrrp-ipv4-attributes 914 grouping vrrp-ipv6-attributes { 915 description 916 "Group of VRRP attributes for IPv6."; 918 uses vrrp-common-attributes; 920 leaf advertise-interval-centi-sec { 921 type uint16 { 922 range 1..4095; 923 } 924 units centiseconds; 925 default 100; 926 description 927 "Configures the interval that Virtual Router 928 Redundancy Protocol version 3 (VRRPv3) advertisements 929 are sent from the specified interface."; 930 } 932 container track { 933 description 934 "Enables the specified VRRP instance to track interfaces 935 or networks."; 936 container interfaces { 937 description 938 "Enables the specified Virtual Router Redundancy Protocol 939 version 2 (VRRP) or version 3 (VRRPv3) instance to track 940 an interface."; 941 list interface { 942 key "interface"; 943 description 944 "Interface to track."; 946 leaf interface { 947 type if:interface-ref; 948 must "/if:interfaces/if:interface[if:name=current()]/" 949 + "ip:ipv6" { 950 description "Interface is IPv6."; 951 } 952 description 953 "Interface to track."; 954 } 956 leaf priority-decrement { 957 type uint8 { 958 range 1..254; 959 } 960 default 10; 961 description 962 "Specifies how much to decrement the priority of the 963 VRRP instance if the interface goes down."; 964 } 965 } // interface 966 } // interfaces 968 container networks { 969 description 970 "Enables the backup Virtual Router Redundancy Protocol 971 version 2 (VRRP) or version 3 (VRRPv3) router to track a 972 specified network through the IP network prefix of that 973 network."; 974 list network { 975 key "prefix"; 976 description 977 "Enables the specified Virtual Router Redundancy 978 Protocol version 2 (VRRP) or version 3 (VRRPv3) 979 instance to track an IP network, by specifying the 980 prefix of the IP network."; 982 leaf prefix { 983 type inet:ipv6-prefix; 984 description 985 "The prefix of the network to track."; 986 } 988 leaf priority-decrement { 989 type uint8 { 990 range 1..254; 991 } 992 default 10; 993 description 994 "Specifies how much to decrement the priority of the 995 backup VRRP router if there is a failure in the IP 996 network."; 997 } 998 } // track-network 999 } // track-networks 1000 } // track 1002 container virtual-ipv6-addresses { 1003 description 1004 "Configures the virtual IP address for the Virtual Router 1005 Redundancy Protocol (VRRP) interface."; 1006 list virtual-ipv6-address { 1007 key "ipv6-address"; 1008 max-elements 2; 1009 description 1010 "Two IPv6 addresses are allowed. The first one must be 1011 a link-local address and the second one can be a 1012 link-local or global address."; 1014 leaf ipv6-address { 1015 type inet:ipv6-address; 1016 description 1017 "An IPv6 address associated with a virtual router."; 1018 reference 1019 "RFC 5798: Virtual Router Redundancy Protocol (VRRP) 1020 Version 3. Section 1.3."; 1021 } 1022 } // virtual-ipv6-address 1023 } // virtual-ipv6-addresses 1024 } // grouping vrrp-ipv6-attributes 1026 grouping vrrp-state-attributes { 1027 description 1028 "Group of VRRP state attributes."; 1030 leaf state { 1031 type identityref { 1032 base vrrp:vrrp-state-type; 1033 } 1034 config false; 1035 description 1036 "Operational state."; 1037 } 1039 leaf is-owner { 1040 type boolean; 1041 config false; 1042 description 1043 "Set to true if this virtual router is owner."; 1044 } 1046 leaf last-adv-source { 1047 type inet:ip-address; 1048 config false; 1049 description 1050 "Last advertised IPv4/IPv6 source address"; 1051 } 1053 leaf up-datetime { 1054 type yang:date-and-time; 1055 config false; 1056 description 1057 "The date and time when this virtual router 1058 transitioned out of init state."; 1059 } 1061 leaf master-down-interval { 1062 type uint32; 1063 units centiseconds; 1064 config false; 1065 description 1066 "Time interval for backup virtual router to declare 1067 Master down."; 1068 } 1070 leaf skew-time { 1071 type uint32; 1072 units microseconds; 1073 config false; 1074 description 1075 "Calculated based on the priority and advertisement 1076 interval configuration command parameters. See RFC 3768."; 1077 } 1079 leaf last-event { 1080 type identityref { 1081 base vrrp:vrrp-event-type; 1082 } 1083 config false; 1084 description 1085 "Last reported event."; 1086 } 1088 leaf new-master-reason { 1089 type new-master-reason-type; 1090 config false; 1091 description 1092 "Indicates the reason for the virtual router to transition 1093 to master state."; 1094 } 1096 container statistics { 1097 config false; 1098 description 1099 "VRRP statistics."; 1101 leaf discontinuity-datetime { 1102 type yang:date-and-time; 1103 description 1104 "The time on the most recent occasion at which any one or 1105 more of the VRRP statistic counters suffered a 1106 discontinuity. If no such discontinuities have occurred 1107 since the last re-initialization of the local management 1108 subsystem, then this node contains the time that the 1109 local management subsystem re-initialized itself."; 1110 } 1112 leaf master-transitions { 1113 type yang:counter32; 1114 description 1115 "The total number of times that this virtual router's 1116 state has transitioned to master"; 1117 } 1119 leaf advertisement-recv { 1120 type yang:counter64; 1121 description 1122 "The total number of VRRP advertisements received by 1123 this virtual router."; 1124 } 1126 leaf advertisement-sent { 1127 type yang:counter64; 1128 description 1129 "The total number of VRRP advertisements sent by 1130 this virtual router."; 1131 } 1133 leaf interval-errors { 1134 if-feature validate-interval-errors; 1135 type yang:counter64; 1136 description 1137 "The total number of VRRP advertisement packets 1138 received with an advertisement interval 1139 different than the one configured for the local 1140 virtual router"; 1141 } 1143 leaf priority-zero-pkts-rcvd { 1144 type yang:counter64; 1145 description 1146 "The total number of VRRP packets received by the 1147 virtual router with a priority of 0."; 1148 } 1150 leaf priority-zero-pkts-sent { 1151 type yang:counter64; 1152 description 1153 "The total number of VRRP packets sent by the 1154 virtual router with a priority of 0."; 1155 } 1157 leaf invalid-type-pkts-rcvd { 1158 type yang:counter64; 1159 description 1160 "The number of VRRP packets received by the virtual 1161 router with an invalid value in the 'type' field."; 1162 } 1164 leaf address-list-errors { 1165 if-feature validate-address-list-errors; 1166 type yang:counter64; 1167 description 1168 "The total number of packets received with an 1169 address list that does not match the locally 1170 configured address list for the virtual router."; 1171 } 1173 leaf packet-length-errors { 1174 type yang:counter64; 1175 description 1176 "The total number of packets received with a packet 1177 length less than the length of the VRRP header."; 1178 } 1179 } // container statistics 1180 } // grouping vrrp-state-attributes 1182 grouping vrrp-global-state-attributes { 1183 description 1184 "Group of VRRP global state attributes."; 1186 leaf virtual-routers { 1187 type uint32; 1188 config false; 1189 description "Number of configured virtual routers."; 1190 } 1192 leaf interfaces { 1193 type uint32; 1194 config false; 1195 description "Number of interface with VRRP configured."; 1196 } 1198 container statistics { 1199 config false; 1200 description 1201 "VRRP global statistics."; 1203 leaf discontinuity-datetime { 1204 type yang:date-and-time; 1205 description 1206 "The time on the most recent occasion at which one of 1207 checksum-errors, version-errors, vrid-errors, and 1208 ip-ttl-errors suffered a discontinuity. 1210 If no such discontinuities have occurred since the last 1211 re-initialization of the local management subsystem, 1212 then this node contains the time that the local management 1213 subsystem re-initialized itself."; 1214 } 1216 leaf checksum-errors { 1217 type yang:counter64; 1218 description 1219 "The total number of VRRP packets received with an invalid 1220 VRRP checksum value."; 1221 reference "RFC 5798, Section 5.2.8"; 1222 } 1224 leaf version-errors { 1225 type yang:counter64; 1226 description 1227 "The total number of VRRP packets received with an unknown 1228 or unsupported version number."; 1229 reference "RFC 5798, Section 5.2.1"; 1230 } 1232 leaf vrid-errors { 1233 type yang:counter64; 1234 description 1235 "The total number of VRRP packets received with a VRID that 1236 is not valid for any virtual router on this router."; 1237 reference "RFC 5798, Section 5.2.3"; 1238 } 1240 leaf ip-ttl-errors { 1241 type yang:counter64; 1242 description 1243 "The total number of VRRP packets received by the 1244 virtual router with IP TTL (Time-To-Live) not equal 1245 to 255."; 1246 reference "RFC 5798, Sections 5.1.1.3 and 5.1.2.3."; 1247 } 1248 } // statistics 1249 } // vrrp-global-state-attributes 1250 /* 1251 * Configuration data and operational state data nodes 1252 */ 1254 augment "/if:interfaces/if:interface/ip:ipv4" { 1255 description "Augment IPv4 interface."; 1257 container vrrp { 1258 description 1259 "Configures the Virtual Router Redundancy Protocol (VRRP) 1260 version 2 or version 3 for IPv4."; 1262 list vrrp-instance { 1263 key "vrid"; 1264 description 1265 "Defines a virtual router, identified by a virtual router 1266 identifier (VRID), within IPv4 address space."; 1268 uses vrrp-ipv4-attributes; 1269 uses vrrp-state-attributes; 1270 } 1271 } 1272 } // augment ipv4 1274 augment "/if:interfaces/if:interface/ip:ipv6" { 1275 description "Augment IPv6 interface."; 1277 container vrrp { 1278 description 1279 "Configures the Virtual Router Redundancy Protocol (VRRP) 1280 version 3 for IPv6."; 1282 list vrrp-instance { 1283 must "derived-from-or-self(version, 'vrrp-v3')" { 1284 description 1285 "IPv6 is only supported by version 3."; 1286 } 1287 key "vrid"; 1288 description 1289 "Defines a virtual router, identified by a virtual router 1290 identifier (VRID), within IPv6 address space."; 1292 uses vrrp-ipv6-attributes; 1293 uses vrrp-state-attributes; 1294 } // list vrrp-instance 1295 } // container vrrp 1296 } // augment ipv6 1297 container vrrp { 1298 description "VRRP data at the global level."; 1300 uses vrrp-global-state-attributes; 1301 } 1303 /* 1304 * Notifications 1305 */ 1307 notification vrrp-new-master-event { 1308 description 1309 "Notification event for a change of VRRP new master."; 1310 leaf master-ip-address { 1311 type inet:ip-address; 1312 mandatory true; 1313 description 1314 "IPv4 or IPv6 address of the new master."; 1315 } 1316 leaf new-master-reason { 1317 type new-master-reason-type; 1318 mandatory true; 1319 description 1320 "Indicates the reason for the virtual router to transition 1321 to master state."; 1322 } 1323 } 1325 notification vrrp-protocol-error-event { 1326 description 1327 "Notification event for a VRRP protocol error."; 1328 leaf protocol-error-reason { 1329 type identityref { 1330 base vrrp:vrrp-error-global; 1331 } 1332 mandatory true; 1333 description 1334 "Indicates the reason for the protocol error."; 1335 } 1336 } 1338 notification vrrp-virtual-router-error-event { 1339 description 1340 "Notification event for an error happened on a virtual 1341 router."; 1342 leaf interface { 1343 type if:interface-ref; 1344 mandatory true; 1345 description 1346 "Indicates the interface for which statistics area 1347 to be cleared."; 1348 } 1350 choice ip-version { 1351 mandatory true; 1352 description 1353 "The error may have happened on either an IPv4 virtual 1354 router or an IPv6 virtual router. The information 1355 related to a specific IP version is provided by one of 1356 the following cases."; 1357 case ipv4 { 1358 description "IPv4"; 1359 container ipv4 { 1360 description 1361 "Error information for IPv4."; 1362 leaf vrid { 1363 type leafref { 1364 path "/if:interfaces/if:interface" 1365 + "[if:name = current()/../../vrrp:interface]/" 1366 + "ip:ipv4/vrrp:vrrp/vrrp:vrrp-instance/vrrp:vrid"; 1367 } 1368 mandatory true; 1369 description 1370 "Indicates the virtual router on which the event has 1371 occurred."; 1372 } 1373 } 1374 } 1375 case ipv6 { 1376 description "IPv6"; 1377 container ipv6 { 1378 description 1379 "Error information for IPv6."; 1380 leaf vrid { 1381 type leafref { 1382 path "/if:interfaces/if:interface" 1383 + "[if:name = current()/../../vrrp:interface]/" 1384 + "ip:ipv6/vrrp:vrrp/vrrp:vrrp-instance/vrrp:vrid"; 1385 } 1386 mandatory true; 1387 description 1388 "Indicates the virtual router on which the event has 1389 occurred."; 1390 } 1391 } 1392 } 1394 } 1396 leaf virtual-router-error-reason { 1397 type identityref { 1398 base vrrp:vrrp-error-virtual-router; 1399 } 1400 mandatory true; 1401 description 1402 "Indicates the reason for the virtual router error."; 1403 } 1404 } 1405 } 1406 1408 4. IANA Considerations 1410 RFC Ed.: In this section, replace all occurrences of 'XXXX' with the 1411 actual RFC number (and remove this note). 1413 This document registers the following namespace URIs in the IETF XML 1414 registry [RFC3688]: 1416 -------------------------------------------------------------------- 1417 URI: urn:ietf:params:xml:ns:yang:ietf-vrrp 1418 Registrant Contact: The IESG. 1419 XML: N/A, the requested URI is an XML namespace. 1420 -------------------------------------------------------------------- 1422 This document registers the following YANG modules in the YANG Module 1423 Names registry [RFC7950]: 1425 -------------------------------------------------------------------- 1426 name: ietf-vrrp 1427 namespace: urn:ietf:params:xml:ns:yang:ietf-vrrp 1428 prefix: vrrp 1429 reference: RFC XXXX 1430 -------------------------------------------------------------------- 1432 5. Security Considerations 1434 The configuration, state, and action data defined in this document 1435 are designed to be accessed via a management protocol with a secure 1436 transport layer, such as NETCONF [RFC6241]. The NETCONF access 1437 control model [RFC6536] provides the means to restrict access for 1438 particular NETCONF users to a preconfigured subset of all available 1439 NETCONF protocol operations and contents. 1441 A number of configuration data nodes defined in this document are 1442 writable/creatable/deletable (i.e., "config true" in YANG terms, 1443 which is the default). These data nodes may be considered sensitive 1444 or vulnerable in some network environments. Write operations to 1445 these data nodes, such as "edit-config" in NETCONF, can have negative 1446 effects on the network if the protocol operations are not properly 1447 protected. The vulnerable "config true" parameters and subtrees are 1448 the following: 1450 /if:interfaces/if:interface/ip:ipv4/vrrp:vrrp/vrrp:vrrp-instance 1452 /if:interfaces/if:interface/ip:ipv6/vrrp:vrrp/vrrp:vrrp-instance 1454 Unauthorized access to any node of these can adversely affect the 1455 routing subsystem of both the local device and the network. This may 1456 lead to network malfunctions, delivery of packets to inappropriate 1457 destinations, and other problems. 1459 6. References 1461 6.1. Normative References 1463 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1464 Requirement Levels", BCP 14, RFC 2119, 1465 DOI 10.17487/RFC2119, March 1997, . 1468 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1469 DOI 10.17487/RFC3688, January 2004, . 1472 [RFC5798] Nadas, S., Ed., "Virtual Router Redundancy Protocol (VRRP) 1473 Version 3 for IPv4 and IPv6", RFC 5798, 1474 DOI 10.17487/RFC5798, March 2010, . 1477 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1478 the Network Configuration Protocol (NETCONF)", RFC 6020, 1479 DOI 10.17487/RFC6020, October 2010, . 1482 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 1483 and A. Bierman, Ed., "Network Configuration Protocol 1484 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 1485 . 1487 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 1488 RFC 6991, DOI 10.17487/RFC6991, July 2013, 1489 . 1491 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 1492 RFC 7950, DOI 10.17487/RFC7950, August 2016, 1493 . 1495 [I-D.bjorklund-netmod-rfc7223bis] 1496 Bjorklund, M., "A YANG Data Model for Interface 1497 Management", draft-bjorklund-netmod-rfc7223bis-00 (work in 1498 progress), August 2017. 1500 [I-D.bjorklund-netmod-rfc7277bis] 1501 Bjorklund, M., "A YANG Data Model for IP Management", 1502 draft-bjorklund-netmod-rfc7277bis-00 (work in progress), 1503 August 2017. 1505 [I-D.ietf-netmod-revised-datastores] 1506 Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 1507 and R. Wilton, "Network Management Datastore 1508 Architecture", draft-ietf-netmod-revised-datastores-04 1509 (work in progress), August 2017. 1511 6.2. Informative References 1513 [RFC3768] Hinden, R., Ed., "Virtual Router Redundancy Protocol 1514 (VRRP)", RFC 3768, DOI 10.17487/RFC3768, April 2004, 1515 . 1517 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 1518 Protocol (NETCONF) Access Control Model", RFC 6536, 1519 DOI 10.17487/RFC6536, March 2012, . 1522 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 1523 RFC 7951, DOI 10.17487/RFC7951, August 2016, 1524 . 1526 [I-D.ietf-netconf-rfc5277bis] 1527 Clemm, A., Prieto, A., Voit, E., Nilsen-Nygaard, E., 1528 Tripathy, A., Chisholm, S., and H. Trevino, "Subscribing 1529 to Event Notifications", draft-ietf-netconf-rfc5277bis-01 1530 (work in progress), October 2016. 1532 [I-D.ietf-netconf-yang-push] 1533 Clemm, A., Voit, E., Prieto, A., Tripathy, A., Nilsen- 1534 Nygaard, E., Bierman, A., and B. Lengyel, "Subscribing to 1535 YANG datastore push updates", draft-ietf-netconf-yang- 1536 push-09 (work in progress), September 2017. 1538 [I-D.ietf-netmod-rfc6087bis] 1539 Bierman, A., "Guidelines for Authors and Reviewers of YANG 1540 Data Model Documents", draft-ietf-netmod-rfc6087bis-14 1541 (work in progress), September 2017. 1543 Appendix A. Complete Model Tree Structure 1545 The VRRP YANG data model defined in this document has the following 1546 tree structure: 1548 module: ietf-vrrp 1549 +--rw vrrp 1550 +--ro virtual-routers? uint32 1551 +--ro interfaces? uint32 1552 +--ro statistics 1553 +--ro discontinuity-datetime? yang:date-and-time 1554 +--ro checksum-errors? yang:counter64 1555 +--ro version-errors? yang:counter64 1556 +--ro vrid-errors? yang:counter64 1557 +--ro ip-ttl-errors? yang:counter64 1558 augment /if:interfaces/if:interface/ip:ipv4: 1559 +--rw vrrp 1560 +--rw vrrp-instance* [vrid] 1561 +--rw vrid uint8 1562 +--rw version identityref 1563 +--rw log-state-change? boolean 1564 +--rw preempt 1565 | +--rw enabled? boolean 1566 | +--rw hold-time? uint16 1567 +--rw priority? uint8 1568 +--rw accept-mode? boolean 1569 +--rw (advertise-interval-choice)? 1570 | +--:(v2) 1571 | | +--rw advertise-interval-sec? uint8 1572 | +--:(v3) 1573 | +--rw advertise-interval-centi-sec? uint16 1574 +--rw track 1575 | +--rw interfaces 1576 | | +--rw interface* [interface] 1577 | | +--rw interface if:interface-ref 1578 | | +--rw priority-decrement? uint8 1579 | +--rw networks 1580 | +--rw network* [prefix] 1581 | +--rw prefix inet:ipv4-prefix 1582 | +--rw priority-decrement? uint8 1583 +--rw virtual-ipv4-addresses 1584 | +--rw virtual-ipv4-address* [ipv4-address] 1585 | +--rw ipv4-address inet:ipv4-address 1586 +--ro state? identityref 1587 +--ro is-owner? boolean 1588 +--ro last-adv-source? inet:ip-address 1589 +--ro up-datetime? yang:date-and-time 1590 +--ro master-down-interval? uint32 1591 +--ro skew-time? uint32 1592 +--ro last-event? identityref 1593 +--ro new-master-reason? 1594 new-master-reason-type 1595 +--ro statistics 1596 +--ro discontinuity-datetime? yang:date-and-time 1597 +--ro master-transitions? yang:counter32 1598 +--ro advertisement-recv? yang:counter64 1599 +--ro advertisement-sent? yang:counter64 1600 +--ro interval-errors? yang:counter64 1601 {validate-interval-errors}? 1602 +--ro priority-zero-pkts-rcvd? yang:counter64 1603 +--ro priority-zero-pkts-sent? yang:counter64 1604 +--ro invalid-type-pkts-rcvd? yang:counter64 1605 +--ro address-list-errors? yang:counter64 1606 {validate-address-list-errors}? 1607 +--ro packet-length-errors? yang:counter64 1608 augment /if:interfaces/if:interface/ip:ipv6: 1609 +--rw vrrp 1610 +--rw vrrp-instance* [vrid] 1611 +--rw vrid uint8 1612 +--rw version identityref 1613 +--rw log-state-change? boolean 1614 +--rw preempt 1615 | +--rw enabled? boolean 1616 | +--rw hold-time? uint16 1617 +--rw priority? uint8 1618 +--rw accept-mode? boolean 1619 +--rw advertise-interval-centi-sec? uint16 1620 +--rw track 1621 | +--rw interfaces 1622 | | +--rw interface* [interface] 1623 | | +--rw interface if:interface-ref 1624 | | +--rw priority-decrement? uint8 1625 | +--rw networks 1626 | +--rw network* [prefix] 1627 | +--rw prefix inet:ipv6-prefix 1628 | +--rw priority-decrement? uint8 1629 +--rw virtual-ipv6-addresses 1630 | +--rw virtual-ipv6-address* [ipv6-address] 1631 | +--rw ipv6-address inet:ipv6-address 1632 +--ro state? identityref 1633 +--ro is-owner? boolean 1634 +--ro last-adv-source? inet:ip-address 1635 +--ro up-datetime? yang:date-and-time 1636 +--ro master-down-interval? uint32 1637 +--ro skew-time? uint32 1638 +--ro last-event? identityref 1639 +--ro new-master-reason? 1640 new-master-reason-type 1641 +--ro statistics 1642 +--ro discontinuity-datetime? yang:date-and-time 1643 +--ro master-transitions? yang:counter32 1644 +--ro advertisement-recv? yang:counter64 1645 +--ro advertisement-sent? yang:counter64 1646 +--ro interval-errors? yang:counter64 1647 {validate-interval-errors}? 1648 +--ro priority-zero-pkts-rcvd? yang:counter64 1649 +--ro priority-zero-pkts-sent? yang:counter64 1650 +--ro invalid-type-pkts-rcvd? yang:counter64 1651 +--ro address-list-errors? yang:counter64 1652 {validate-address-list-errors}? 1653 +--ro packet-length-errors? yang:counter64 1655 notifications: 1656 +---n vrrp-new-master-event 1657 | +--ro master-ip-address inet:ip-address 1658 | +--ro new-master-reason new-master-reason-type 1659 +---n vrrp-protocol-error-event 1660 | +--ro protocol-error-reason identityref 1661 +---n vrrp-virtual-router-error-event 1662 +--ro interface if:interface-ref 1663 +--ro (ip-version) 1664 | +--:(ipv4) 1665 | | +--ro ipv4 1666 | | +--ro vrid -> /if:interfaces/interface[if:name = 1667 current()/../../vrrp:interface]/ip:ipv4/vrrp:vrrp/vrrp-instance/vrid 1668 | +--:(ipv6) 1669 | +--ro ipv6 1670 | +--ro vrid -> /if:interfaces/interface[if:name = 1671 current()/../../vrrp:interface]/ip:ipv6/vrrp:vrrp/vrrp-instance/vrid 1672 +--ro virtual-router-error-reason identityref 1674 Appendix B. Data Tree Example 1676 This section contains an example of an instance data tree in the JSON 1677 encoding [RFC7951], containing both configuration and state data. 1679 Virtual router IP address: 192.0.2.1 1680 +-----------------+ +-----------------+ 1681 | | | | 1682 | Router 1 | | Router 2 | 1683 | | | | 1684 +--------+--------+ +--------+--------+ 1685 |eth1 |eth1 1686 |192.0.2.11 |192.0.2.12 1687 -------+--------------------------+------- 1688 | | 1689 |192.0.2.51 |192.0.2.52 1690 +--------+--------+ +--------+--------+ 1691 | Host 1 | | Host 2 | 1692 | Default gateway:| | Default gateway:| 1693 | 192.0.2.1 | | 192.0.2.1 | 1694 +-----------------+ +-----------------+ 1696 The configuration instance data for Router 1 in the above figure 1697 could be as follows: 1699 { 1700 "ietf-interfaces:interfaces": { 1701 "interface": [ 1702 { 1703 "name": "eth1", 1704 "type": "iana-if-type:ethernetCsmacd", 1705 "description": "An interface with VRRP enabled.", 1706 "ietf-ip:ipv4": { 1707 "address": [ 1708 { 1709 "ip": "192.0.2.11", 1710 "prefix-length": 24 1711 } 1712 ], 1713 "forwarding": true, 1714 "ietf-vrrp:vrrp": { 1715 "vrrp-instance": [ 1716 { 1717 "vrid": 1, 1718 "version": "vrrp-v3", 1719 "priority": 200, 1720 "advertise-interval-centi-sec": 50, 1721 "virtual-ipv4-addresses": { 1722 "virtual-ipv4-address": [ 1723 "ipv4-address": "192.0.2.1" 1724 ] 1725 } 1726 } 1727 ] 1728 } 1729 } 1730 } 1731 ] 1732 } 1733 } 1735 The cooresponding operational state data for Router 1 could be as 1736 follows: 1738 { 1739 "ietf-interfaces:interfaces": { 1740 "interface": [ 1741 { 1742 "name": "eth1", 1743 "type": "iana-if-type:ethernetCsmacd", 1744 "phys-address": "00:0C:42:E5:B1:E9", 1745 "oper-status": "up", 1746 "statistics": { 1747 "discontinuity-time": "2016-10-24T17:11:27+02:00" 1748 }, 1749 "ietf-ip:ipv4": { 1750 "forwarding": true, 1751 "mtu": 1500, 1752 "address": [ 1753 { 1754 "ip": "192.0.2.11", 1755 "prefix-length": 24 1756 } 1757 ] 1758 "ietf-vrrp:vrrp": { 1759 "vrrp-instance": [ 1760 { 1761 "vrid": 1, 1762 "version": "vrrp-v3", 1763 "log-state-change": false, 1764 "preempt": { 1765 "enabled": true, 1766 "hold-time": 0 1767 } 1768 "priority": 200, 1769 "accept-mode": false, 1770 "advertise-interval-centi-sec": 50, 1771 "virtual-ipv4-addresses": { 1772 "virtual-ipv4-address": [ 1773 "ipv4-address": "192.0.2.1" 1774 ] 1775 }, 1776 "state": "master", 1777 "is-owner": false, 1778 "last-adv-source": "192.0.2.11", 1779 "up-datetime": "2016-10-24T17:11:27+02:00", 1780 "master-down-interval": 161, 1781 "skew-time": 11, 1782 "last-event": "vrrp-event-interface-up", 1783 "new-master-reason": "priority", 1784 "statistics": { 1785 "discontinuity-datetime": 1786 "2016-10-24T17:11:27+02:00", 1787 "master-transitions": 2, 1788 "advertisement-recv": 20, 1789 "advertisement-sent": 12, 1790 "interval-errors": 0, 1791 "priority-zero-pkts-rcvd": 0, 1792 "priority-zero-pkts-sent": 0, 1793 "invalid-type-pkts-rcvd": 0, 1794 "address-list-errors": 0, 1795 "packet-length-errors": 1 1796 } 1797 } 1798 ] 1799 } 1800 } 1801 } 1802 ] 1803 } 1804 } 1806 { 1807 "ietf-vrrp:vrrp": { 1808 "virtual-routers": 3, 1809 "interfaces": 2, 1810 "statistics": { 1811 "discontinuity-datetime": "2016-10-24T17:11:27+02:00", 1812 "checksum-errors": 2, 1813 "version-errors": 0, 1814 "vrid-errors": 0, 1815 "ip-ttl-errors": 1 1816 } 1817 } 1818 } 1820 Appendix C. YANG Model for Non-NMDA Compliant Implementations 1822 The YANG data model defined so far in this document is designed to be 1823 used in conjunction with implementations that support the Network 1824 Management Datastore Architecture (NMDA) defined in 1825 [I-D.ietf-netmod-revised-datastores]. However, currently there are 1826 existing implementations that are not NMDA compliant. In order for 1827 such implementations to be used temporarily until NMDA 1828 implementations are available, this section describes the following 1829 non-NMDA version of the equivalent model. 1831 C.1. Non-NMDA YANG Module 1833 file "ietf-vrrp@2017-09-22.yang" 1834 module ietf-vrrp { 1835 yang-version 1.1; 1836 namespace "urn:ietf:params:xml:ns:yang:ietf-vrrp"; 1837 prefix "vrrp"; 1838 import ietf-inet-types { 1839 prefix "inet"; 1840 } 1842 import ietf-yang-types { 1843 prefix "yang"; 1844 } 1846 import ietf-interfaces { 1847 prefix "if"; 1848 } 1850 import ietf-ip { 1851 prefix "ip"; 1852 } 1854 organization 1855 "IETF Routing Area Working Group (RTGWG)"; 1856 contact 1857 "WG Web: 1858 WG List: 1860 WG Chair: Jeff Tantsura 1861 1863 WG Chair: Chris Bowers 1864 1866 Editor: Xufeng Liu 1867 1869 Editor: Athanasios Kyparlis 1870 1872 Editor: Ravi Parikh 1873 1875 Editor: Acee Lindem 1876 1878 Editor: Mingui Zhang 1879 "; 1881 description 1882 "This YANG module defines a model for managing Virtual Router 1883 Redundancy Protocol (VRRP) version 2 and version 3."; 1885 revision 2017-09-22 { 1886 description "Initial revision"; 1887 reference 1888 "RFC XXXX: A YANG Data Model for Virtual Router Redundancy 1889 Protocol (VRRP). 1890 RFC 2787: Definitions of Managed Objects for the Virtual 1891 Router Redundancy Protocol. 1892 RFC 3768: Virtual Router Redundancy Protocol (VRRP). 1893 RFC 5798: Virtual Router Redundancy Protocol (VRRP) Version 3. 1894 RFC 6527: Definitions of Managed Objects for the Virtual 1895 Router Redundancy Protocol Version 3 (VRRPv3)."; 1896 } 1898 /* 1899 * Features 1900 */ 1902 feature validate-interval-errors { 1903 description 1904 "This feature indicates that the system validates that 1905 the advertisement interval from advertisement packets 1906 received is the same as the one configured for the local 1907 VRRP router."; 1908 } 1910 feature validate-address-list-errors { 1911 description 1912 "This feature indicates that the system validates that 1913 the address list from received packets matches the 1914 locally configured list for the VRRP router."; 1915 } 1917 /* 1918 * Typedefs 1919 */ 1921 typedef new-master-reason-type { 1922 type enumeration { 1923 enum not-master { 1924 description 1925 "The virtual router has never transitioned to master 1926 state,"; 1927 } 1928 enum priority { 1929 description "Priority was higher."; 1930 } 1931 enum preempted { 1932 description "The master was preempted."; 1933 } 1934 enum no-response { 1935 description "Previous master did not respond."; 1936 } 1937 } 1938 description 1939 "The reason for the virtual router to transition to master 1940 state."; 1941 } // new-master-reason-type 1943 /* 1944 * Identities 1945 */ 1947 /* vrrp-event-type identity and its derivatives. */ 1948 identity vrrp-event-type { 1949 description 1950 "The type to indicate the type of a VRRP protocol event."; 1951 } 1952 identity vrrp-event-none { 1953 base vrrp-event-type; 1954 description 1955 "Indicates a non-meaningful event."; 1956 } 1957 identity vrrp-event-startup { 1958 base vrrp-event-type; 1959 description 1960 "Indicates that a VRRP router has initiated the protocol."; 1961 } 1962 identity vrrp-event-shutdown { 1963 base vrrp-event-type; 1964 description 1965 "Indicates that a VRRP router has closed down the protocol."; 1966 } 1967 identity vrrp-event-higher-priority-backup { 1968 base vrrp-event-type; 1969 description 1970 "Indicates that a backup router has a higher priority than 1971 the current master."; 1972 } 1973 identity vrrp-event-master-timeout { 1974 base vrrp-event-type; 1975 description 1976 "Indicates that the current master has not sent an 1977 advertisement within the limit of master-down-interval."; 1978 } 1979 identity vrrp-event-interface-up { 1980 base vrrp-event-type; 1981 description 1982 "Indicates that the VRRP enabled interface has become 1983 operational up."; 1984 } 1985 identity vrrp-event-interface-down { 1986 base vrrp-event-type; 1987 description 1988 "Indicates that the VRRP enabled interface has become 1989 operational down."; 1990 } 1991 identity vrrp-event-no-primary-ip-address { 1992 base vrrp-event-type; 1993 description 1994 "Indicates that the primary IP address on the VRRP enabled 1995 interface has become unavailable."; 1996 } 1997 identity vrrp-event-primary-ip-address { 1998 base vrrp-event-type; 1999 description 2000 "Indicates that the primary IP address on the VRRP enabled 2001 interface has become available."; 2002 } 2003 identity vrrp-event-no-virtual-ip-addresses { 2004 base vrrp-event-type; 2005 description 2006 "Indicates that there are no virtual IP addresses on the 2007 virtual router."; 2008 } 2009 identity vrrp-event-virtual-ip-addresses { 2010 base vrrp-event-type; 2011 description 2012 "Indicates that there are virtual IP addresses on the 2013 virtual router."; 2014 } 2015 identity vrrp-event-preempt-hold-timeout { 2016 base vrrp-event-type; 2017 description 2018 "Indicates that the configured preemption hold time has 2019 passed."; 2020 } 2021 identity vrrp-event-lower-priority-master { 2022 base vrrp-event-type; 2023 description 2024 "Indicates that there is a lower priority VRRP master."; 2025 } 2026 identity vrrp-event-owner-preempt { 2027 base vrrp-event-type; 2028 description 2029 "Indicates that the owner has preempted another router to 2030 become the master."; 2031 } 2033 /* vrrp-error-global identity and its derivatives. */ 2034 identity vrrp-error-global { 2035 description 2036 "The type to indicate the type of a VRRP error that occurs 2037 for a packet before it reaches a VRRP router."; 2038 } 2039 identity checksum-error { 2040 base vrrp-error-global; 2041 description 2042 "A packet has been received with an invalid VRRP checksum 2043 value."; 2044 } 2045 identity ip-ttl-error { 2046 base vrrp-error-global; 2047 description 2048 "A packet has been received with IP TTL (Time-To-Live) 2049 not equal to 255."; 2050 } 2051 identity version-error { 2052 base vrrp-error-global; 2053 description 2054 "A packet has been received with an unknown or unsupported 2055 version number."; 2056 } 2057 identity vrid-error { 2058 base vrrp-error-global; 2059 description 2060 "A packet has been received with a VRID that is not valid 2061 for any virtual router on this router."; 2062 } 2064 /* vrrp-error-virtual-router identity and its derivatives. */ 2065 identity vrrp-error-virtual-router { 2066 description 2067 "The type to indicate the type of a VRRP error that occurs 2068 after a packet reaches a VRRP router."; 2069 } 2070 identity address-list-error { 2071 base vrrp-error-virtual-router; 2072 description 2073 "A packet has been received with an address list that 2074 does not match the locally configured address list for 2075 the virtual router."; 2076 } 2077 identity interval-error { 2078 base vrrp-error-virtual-router; 2079 description 2080 "A packet has been received with an advertisement 2081 interval different than the one configured for the local 2082 virtual router"; 2083 } 2084 identity packet-length-error { 2085 base vrrp-error-virtual-router; 2086 description 2087 "A packet has been received with a packet length less 2088 than the length of the VRRP header."; 2089 } 2091 /* vrrp-state-type identity and its derivatives. */ 2092 identity vrrp-state-type { 2093 description 2094 "The type to indicate the state of a virtual router."; 2095 } 2096 identity initialize { 2097 base vrrp-state-type; 2098 description 2099 "Indicates that the virtual router is waiting 2100 for a startup event."; 2101 } 2102 identity backup { 2103 base vrrp-state-type; 2104 description 2105 "Indicates that the virtual router is monitoring the 2106 availability of the master router."; 2107 } 2108 identity master { 2109 base vrrp-state-type; 2110 description 2111 "Indicates that the virtual router is forwarding 2112 packets for IP addresses that are associated with 2113 this virtual router."; 2114 } 2116 /* vrrp-version identity and its derivatives. */ 2117 identity vrrp-version { 2118 description 2119 "The version of the VRRP protocol."; 2120 } 2121 identity vrrp-v2 { 2122 base vrrp-version; 2123 description 2124 "Indicates version 2 of the VRRP protocol."; 2125 } 2126 identity vrrp-v3 { 2127 base vrrp-version; 2128 description 2129 "Indicates version 3 of the VRRP protocol."; 2130 } 2132 /* 2133 * Groupings 2134 */ 2136 grouping vrrp-common-attributes { 2137 description 2138 "Group of VRRP attributes common to version 2 and version 3"; 2140 leaf vrid { 2141 type uint8 { 2142 range 1..255; 2143 } 2144 description "Virtual router ID."; 2145 } 2147 leaf version { 2148 type identityref { 2149 base vrrp:vrrp-version; 2150 } 2151 mandatory true; 2152 description "Version 2 or version 3 of VRRP."; 2153 } 2155 leaf log-state-change { 2156 type boolean; 2157 default "false"; 2158 description 2159 "Generates VRRP state change messages each time the VRRP 2160 instance changes state (from up to down or down to up)."; 2161 } 2163 container preempt { 2164 description 2165 "Enables a higher priority Virtual Router Redundancy 2166 Protocol (VRRP) backup router to preempt a lower priority 2167 VRRP master."; 2168 leaf enabled { 2169 type boolean; 2170 default "true"; 2171 description 2172 "'true' if preemption is enabled."; 2173 } 2174 leaf hold-time { 2175 type uint16; 2176 units seconds; 2177 default 0; 2178 description 2179 "Hold time, in seconds, for which a higher priority VRRP 2180 backup router must wait before preempting a lower priority 2181 VRRP master."; 2182 } 2183 } 2185 leaf priority { 2186 type uint8 { 2187 range 1..254; 2188 } 2189 default 100; 2190 description 2191 "Configures the Virtual Router Redundancy Protocol (VRRP) 2192 election priority for the backup virtual router."; 2193 } 2195 leaf accept-mode { 2196 when "derived-from-or-self(current()/../version, 'vrrp-v3')" { 2197 description "Applicable only to version 3."; 2198 } 2199 type boolean; 2200 default "false"; 2201 description 2202 "Controls whether a virtual router in Master state will 2203 accept packets addressed to the address owner's IPvX address 2204 as its own if it is not the IPvX address owner. The default 2205 is false. Deployments that rely on, for example, pinging the 2206 address owner's IPvX address may wish to configure 2207 accept-mode to true. 2209 Note: IPv6 Neighbor Solicitations and Neighbor 2210 Advertisements MUST NOT be dropped when accept-mode is 2211 false."; 2212 } 2213 } // vrrp-common-attributes 2215 grouping vrrp-ipv4-attributes { 2216 description 2217 "Group of VRRP attributes for IPv4."; 2219 uses vrrp-common-attributes; 2221 choice advertise-interval-choice { 2222 description 2223 "The options for the advertisement interval at which VRRPv2 2224 or VRRPv3 advertisements are sent from the specified 2225 interface."; 2227 case v2 { 2228 when "derived-from-or-self(version, 'vrrp-v2')" { 2229 description "Applicable only to version 2."; 2230 } 2231 leaf advertise-interval-sec { 2232 type uint8 { 2233 range 1..254; 2234 } 2235 units seconds; 2236 default 1; 2237 description 2238 "Configures the interval that Virtual Router 2239 Redundancy Protocol Version 2 (VRRPv2) advertisements 2240 are sent from the specified interface."; 2241 } 2242 } 2244 case v3 { 2245 when "derived-from-or-self(version, 'vrrp-v3')" { 2246 description "Applicable only to version 3."; 2247 } 2248 leaf advertise-interval-centi-sec { 2249 type uint16 { 2250 range 1..4095; 2251 } 2252 units centiseconds; 2253 default 100; 2254 description 2255 "Configures the interval that Virtual Router 2256 Redundancy Protocol version 3 (VRRPv3) advertisements 2257 are sent from the specified interface."; 2258 } 2259 } 2260 } // advertise-interval-choice 2262 container track { 2263 description 2264 "Enables the specified VRRP instance to track interfaces 2265 or networks."; 2266 container interfaces { 2267 description 2268 "Enables the specified Virtual Router Redundancy Protocol 2269 version 2 (VRRP) or version 3 (VRRPv3) instance to track 2270 an interface."; 2272 list interface { 2273 key "interface"; 2274 description 2275 "Interface to track."; 2277 leaf interface { 2278 type if:interface-ref; 2279 must "/if:interfaces/if:interface[if:name=current()]/" 2280 + "ip:ipv4" { 2281 description "Interface is IPv4."; 2282 } 2283 description 2284 "Interface to track."; 2285 } 2287 leaf priority-decrement { 2288 type uint8 { 2289 range 1..254; 2290 } 2291 default 10; 2292 description 2293 "Specifies how much to decrement the priority of the 2294 VRRP instance if the interface goes down."; 2295 } 2296 } // interface 2297 } // interfaces 2299 container networks { 2300 description 2301 "Enables the backup Virtual Router Redundancy Protocol 2302 version 2 (VRRP) or version 3 (VRRPv3) router to track a 2303 specified network through the IP network prefix of that 2304 network."; 2305 list network { 2306 key "prefix"; 2307 description 2308 "Enables the specified Virtual Router Redundancy 2309 Protocol version 2 (VRRP) or version 3 (VRRPv3) 2310 instance to track an IP network, by specifying the 2311 prefix of the IP network."; 2313 leaf prefix { 2314 type inet:ipv4-prefix; 2315 description 2316 "The prefix of the network to track."; 2317 } 2318 leaf priority-decrement { 2319 type uint8 { 2320 range 1..254; 2321 } 2322 default 10; 2323 description 2324 "Specifies how much to decrement the priority of the 2325 backup VRRP router if there is a failure in the IP 2326 network."; 2327 } 2328 } // track-network 2329 } // track-networks 2330 } // track 2332 container virtual-ipv4-addresses { 2333 description 2334 "Configures the virtual IP address for the Virtual Router 2335 Redundancy Protocol (VRRP) interface."; 2337 list virtual-ipv4-address { 2338 key "ipv4-address"; 2339 max-elements 16; 2340 description 2341 "Virtual IP addresses for a single VRRP instance. For a 2342 VRRP owner router, the virtual address must match one 2343 of the IP addresses configured on the interface 2344 corresponding to the virtual router."; 2346 leaf ipv4-address { 2347 type inet:ipv4-address; 2348 description 2349 "An IPv4 address associated with a virtual router."; 2350 reference 2351 "RFC 5798: Virtual Router Redundancy Protocol (VRRP) 2352 Version 3. Section 1.2."; 2353 } 2354 } // virtual-ipv4-address 2355 } // virtual-ipv4-addresses 2356 } // grouping vrrp-ipv4-attributes 2358 grouping vrrp-ipv6-attributes { 2359 description 2360 "Group of VRRP attributes for IPv6."; 2362 uses vrrp-common-attributes; 2364 leaf advertise-interval-centi-sec { 2365 type uint16 { 2366 range 1..4095; 2367 } 2368 units centiseconds; 2369 default 100; 2370 description 2371 "Configures the interval that Virtual Router 2372 Redundancy Protocol version 3 (VRRPv3) advertisements 2373 are sent from the specified interface."; 2374 } 2376 container track { 2377 description 2378 "Enables the specified VRRP instance to track interfaces 2379 or networks."; 2380 container interfaces { 2381 description 2382 "Enables the specified Virtual Router Redundancy Protocol 2383 version 2 (VRRP) or version 3 (VRRPv3) instance to track 2384 an interface."; 2385 list interface { 2386 key "interface"; 2387 description 2388 "Interface to track."; 2390 leaf interface { 2391 type if:interface-ref; 2392 must "/if:interfaces/if:interface[if:name=current()]/" 2393 + "ip:ipv6" { 2394 description "Interface is IPv6."; 2395 } 2396 description 2397 "Interface to track."; 2398 } 2400 leaf priority-decrement { 2401 type uint8 { 2402 range 1..254; 2403 } 2404 default 10; 2405 description 2406 "Specifies how much to decrement the priority of the 2407 VRRP instance if the interface goes down."; 2408 } 2409 } // interface 2410 } // interfaces 2412 container networks { 2413 description 2414 "Enables the backup Virtual Router Redundancy Protocol 2415 version 2 (VRRP) or version 3 (VRRPv3) router to track a 2416 specified network through the IP network prefix of that 2417 network."; 2418 list network { 2419 key "prefix"; 2420 description 2421 "Enables the specified Virtual Router Redundancy 2422 Protocol version 2 (VRRP) or version 3 (VRRPv3) 2423 instance to track an IP network, by specifying the 2424 prefix of the IP network."; 2426 leaf prefix { 2427 type inet:ipv6-prefix; 2428 description 2429 "The prefix of the network to track."; 2430 } 2432 leaf priority-decrement { 2433 type uint8 { 2434 range 1..254; 2435 } 2436 default 10; 2437 description 2438 "Specifies how much to decrement the priority of the 2439 backup VRRP router if there is a failure in the IP 2440 network."; 2441 } 2442 } // track-network 2443 } // track-networks 2444 } // track 2446 container virtual-ipv6-addresses { 2447 description 2448 "Configures the virtual IP address for the Virtual Router 2449 Redundancy Protocol (VRRP) interface."; 2450 list virtual-ipv6-address { 2451 key "ipv6-address"; 2452 max-elements 2; 2453 description 2454 "Two IPv6 addresses are allowed. The first one must be 2455 a link-local address and the second one can be a 2456 link-local or global address."; 2458 leaf ipv6-address { 2459 type inet:ipv6-address; 2460 description 2461 "An IPv6 address associated with a virtual router."; 2463 reference 2464 "RFC 5798: Virtual Router Redundancy Protocol (VRRP) 2465 Version 3. Section 1.3."; 2466 } 2467 } // virtual-ipv6-address 2468 } // virtual-ipv6-addresses 2469 } // grouping vrrp-ipv6-attributes 2471 grouping vrrp-state-attributes { 2472 description 2473 "Group of VRRP state attributes."; 2475 leaf state { 2476 type identityref { 2477 base vrrp:vrrp-state-type; 2478 } 2479 description 2480 "Operational state."; 2481 } 2483 leaf is-owner { 2484 type boolean; 2485 description 2486 "Set to true if this virtual router is owner."; 2487 } 2489 leaf last-adv-source { 2490 type inet:ip-address; 2491 description 2492 "Last advertised IPv4/IPv6 source address"; 2493 } 2495 leaf up-datetime { 2496 type yang:date-and-time; 2497 description 2498 "The date and time when this virtual router 2499 transitioned out of init state."; 2500 } 2502 leaf master-down-interval { 2503 type uint32; 2504 units centiseconds; 2505 description 2506 "Time interval for backup virtual router to declare 2507 Master down."; 2508 } 2510 leaf skew-time { 2511 type uint32; 2512 units microseconds; 2513 description 2514 "Calculated based on the priority and advertisement 2515 interval configuration command parameters. See RFC 3768."; 2516 } 2518 leaf last-event { 2519 type identityref { 2520 base vrrp:vrrp-event-type; 2521 } 2522 description 2523 "Last reported event."; 2524 } 2526 leaf new-master-reason { 2527 type new-master-reason-type; 2528 description 2529 "Indicates the reason for the virtual router to transition 2530 to master state."; 2531 } 2533 container statistics { 2534 description 2535 "VRRP statistics."; 2537 leaf discontinuity-datetime { 2538 type yang:date-and-time; 2539 description 2540 "The time on the most recent occasion at which any one or 2541 more of the VRRP statistic counters suffered a 2542 discontinuity. If no such discontinuities have occurred 2543 since the last re-initialization of the local management 2544 subsystem, then this node contains the time that the 2545 local management subsystem re-initialized itself."; 2546 } 2548 leaf master-transitions { 2549 type yang:counter32; 2550 description 2551 "The total number of times that this virtual router's 2552 state has transitioned to master"; 2553 } 2555 leaf advertisement-recv { 2556 type yang:counter64; 2557 description 2558 "The total number of VRRP advertisements received by 2559 this virtual router."; 2560 } 2562 leaf advertisement-sent { 2563 type yang:counter64; 2564 description 2565 "The total number of VRRP advertisements sent by 2566 this virtual router."; 2567 } 2569 leaf interval-errors { 2570 if-feature validate-interval-errors; 2571 type yang:counter64; 2572 description 2573 "The total number of VRRP advertisement packets 2574 received with an advertisement interval 2575 different than the one configured for the local 2576 virtual router"; 2577 } 2579 leaf priority-zero-pkts-rcvd { 2580 type yang:counter64; 2581 description 2582 "The total number of VRRP packets received by the 2583 virtual router with a priority of 0."; 2584 } 2586 leaf priority-zero-pkts-sent { 2587 type yang:counter64; 2588 description 2589 "The total number of VRRP packets sent by the 2590 virtual router with a priority of 0."; 2591 } 2593 leaf invalid-type-pkts-rcvd { 2594 type yang:counter64; 2595 description 2596 "The number of VRRP packets received by the virtual 2597 router with an invalid value in the 'type' field."; 2598 } 2600 leaf address-list-errors { 2601 if-feature validate-address-list-errors; 2602 type yang:counter64; 2603 description 2604 "The total number of packets received with an 2605 address list that does not match the locally 2606 configured address list for the virtual router."; 2608 } 2610 leaf packet-length-errors { 2611 type yang:counter64; 2612 description 2613 "The total number of packets received with a packet 2614 length less than the length of the VRRP header."; 2615 } 2616 } // container statistics 2617 } // grouping vrrp-state-attributes 2619 grouping vrrp-global-state-attributes { 2620 description 2621 "Group of VRRP global state attributes."; 2623 leaf virtual-routers { 2624 type uint32; 2625 description "Number of configured virtual routers."; 2626 } 2628 leaf interfaces { 2629 type uint32; 2630 description "Number of interface with VRRP configured."; 2631 } 2633 container statistics { 2634 description 2635 "VRRP global statistics."; 2637 leaf discontinuity-datetime { 2638 type yang:date-and-time; 2639 description 2640 "The time on the most recent occasion at which one of 2641 checksum-errors, version-errors, vrid-errors, and 2642 ip-ttl-errors suffered a discontinuity. 2644 If no such discontinuities have occurred since the last 2645 re-initialization of the local management subsystem, 2646 then this node contains the time that the local management 2647 subsystem re-initialized itself."; 2648 } 2650 leaf checksum-errors { 2651 type yang:counter64; 2652 description 2653 "The total number of VRRP packets received with an invalid 2654 VRRP checksum value."; 2655 reference "RFC 5798, Section 5.2.8"; 2657 } 2659 leaf version-errors { 2660 type yang:counter64; 2661 description 2662 "The total number of VRRP packets received with an unknown 2663 or unsupported version number."; 2664 reference "RFC 5798, Section 5.2.1"; 2665 } 2667 leaf vrid-errors { 2668 type yang:counter64; 2669 description 2670 "The total number of VRRP packets received with a VRID that 2671 is not valid for any virtual router on this router."; 2672 reference "RFC 5798, Section 5.2.3"; 2673 } 2675 leaf ip-ttl-errors { 2676 type yang:counter64; 2677 description 2678 "The total number of VRRP packets received by the 2679 virtual router with IP TTL (Time-To-Live) not equal 2680 to 255."; 2681 reference "RFC 5798, Sections 5.1.1.3 and 5.1.2.3."; 2682 } 2683 } // statistics 2684 } // vrrp-global-state-attributes 2686 /* 2687 * Configuration data nodes 2688 */ 2690 augment "/if:interfaces/if:interface/ip:ipv4" { 2691 description "Augment IPv4 interface."; 2693 container vrrp { 2694 description 2695 "Configures the Virtual Router Redundancy Protocol (VRRP) 2696 version 2 or version 3 for IPv4."; 2698 list vrrp-instance { 2699 key "vrid"; 2700 description 2701 "Defines a virtual router, identified by a virtual router 2702 identifier (VRID), within IPv4 address space."; 2704 uses vrrp-ipv4-attributes; 2706 } 2707 } 2708 } // augment ipv4 2710 augment "/if:interfaces/if:interface/ip:ipv6" { 2711 description "Augment IPv6 interface."; 2713 container vrrp { 2714 description 2715 "Configures the Virtual Router Redundancy Protocol (VRRP) 2716 version 3 for IPv6."; 2718 list vrrp-instance { 2719 must "derived-from-or-self(version, 'vrrp-v3')" { 2720 description 2721 "IPv6 is only supported by version 3."; 2722 } 2723 key "vrid"; 2724 description 2725 "Defines a virtual router, identified by a virtual router 2726 identifier (VRID), within IPv6 address space."; 2728 uses vrrp-ipv6-attributes; 2729 } // list vrrp-instance 2730 } // container vrrp 2731 } // augment ipv6 2733 /* 2734 * Operational state data nodes 2735 */ 2737 augment "/if:interfaces-state/if:interface/ip:ipv4" { 2738 description "Augment IPv4 interface state."; 2740 container vrrp { 2741 description 2742 "State information for Virtual Router Redundancy Protocol 2743 (VRRP) version 2 for IPv4."; 2745 list vrrp-instance { 2746 key "vrid"; 2747 description 2748 "States of a virtual router, identified by a virtual router 2749 identifier (VRID), within IPv4 address space."; 2751 uses vrrp-ipv4-attributes; 2752 uses vrrp-state-attributes; 2753 } // list vrrp-instance 2755 } 2756 } 2758 augment "/if:interfaces-state/if:interface/ip:ipv6" { 2759 description "Augment IPv6 interface state."; 2761 container vrrp { 2762 description 2763 "State information of the Virtual Router Redundancy Protocol 2764 (VRRP) version 2 or version 3 for IPv6."; 2766 list vrrp-instance { 2767 key "vrid"; 2768 description 2769 "States of a virtual router, identified by a virtual router 2770 identifier (VRID), within IPv6 address space."; 2772 uses vrrp-ipv6-attributes; 2773 uses vrrp-state-attributes; 2774 } // list vrrp-instance 2775 } 2776 } 2778 augment "/if:interfaces-state" { 2779 description "Specify VRRP state data at the global level."; 2781 container vrrp-global { 2782 description 2783 "State information of the Virtual Router Redundancy Protocol 2784 (VRRP) at the global level"; 2786 uses vrrp-global-state-attributes; 2787 } 2788 } 2790 /* 2791 * Notifications 2792 */ 2794 notification vrrp-new-master-event { 2795 description 2796 "Notification event for a change of VRRP new master."; 2797 leaf master-ip-address { 2798 type inet:ip-address; 2799 mandatory true; 2800 description 2801 "IPv4 or IPv6 address of the new master."; 2802 } 2803 leaf new-master-reason { 2804 type new-master-reason-type; 2805 mandatory true; 2806 description 2807 "Indicates the reason for the virtual router to transition 2808 to master state."; 2809 } 2810 } 2812 notification vrrp-protocol-error-event { 2813 description 2814 "Notification event for a VRRP protocol error."; 2815 leaf protocol-error-reason { 2816 type identityref { 2817 base vrrp:vrrp-error-global; 2818 } 2819 mandatory true; 2820 description 2821 "Indicates the reason for the protocol error."; 2822 } 2823 } 2825 notification vrrp-virtual-router-error-event { 2826 description 2827 "Notification event for an error happened on a virtual 2828 router."; 2829 leaf interface { 2830 type if:interface-ref; 2831 mandatory true; 2832 description 2833 "Indicates the interface for which statistics area 2834 to be cleared."; 2835 } 2837 choice ip-version { 2838 mandatory true; 2839 description 2840 "The error may have happened on either an IPv4 virtual 2841 router or an IPv6 virtual router. The information 2842 related to a specific IP version is provided by one of 2843 the following cases."; 2844 case ipv4 { 2845 description "IPv4"; 2846 container ipv4 { 2847 description 2848 "Error information for IPv4."; 2849 leaf vrid { 2850 type leafref { 2851 path "/if:interfaces/if:interface" 2852 + "[if:name = current()/../../vrrp:interface]/" 2853 + "ip:ipv4/vrrp:vrrp/vrrp:vrrp-instance/vrrp:vrid"; 2854 } 2855 mandatory true; 2856 description 2857 "Indicates the virtual router on which the event has 2858 occurred."; 2859 } 2860 } 2861 } 2862 case ipv6 { 2863 description "IPv6"; 2864 container ipv6 { 2865 description 2866 "Error information for IPv6."; 2867 leaf vrid { 2868 type leafref { 2869 path "/if:interfaces/if:interface" 2870 + "[if:name = current()/../../vrrp:interface]/" 2871 + "ip:ipv6/vrrp:vrrp/vrrp:vrrp-instance/vrrp:vrid"; 2872 } 2873 mandatory true; 2874 description 2875 "Indicates the virtual router on which the event has 2876 occurred."; 2877 } 2878 } 2879 } 2880 } 2882 leaf virtual-router-error-reason { 2883 type identityref { 2884 base vrrp:vrrp-error-virtual-router; 2885 } 2886 mandatory true; 2887 description 2888 "Indicates the reason for the virtual router error."; 2889 } 2890 } 2891 } 2892 2894 C.2. Non-NMDA Model Tree Structure 2896 module: ietf-vrrp 2897 augment /if:interfaces/if:interface/ip:ipv4: 2898 +--rw vrrp 2899 +--rw vrrp-instance* [vrid] 2900 +--rw vrid uint8 2901 +--rw version identityref 2902 +--rw log-state-change? boolean 2903 +--rw preempt 2904 | +--rw enabled? boolean 2905 | +--rw hold-time? uint16 2906 +--rw priority? uint8 2907 +--rw accept-mode? boolean 2908 +--rw (advertise-interval-choice)? 2909 | +--:(v2) 2910 | | +--rw advertise-interval-sec? uint8 2911 | +--:(v3) 2912 | +--rw advertise-interval-centi-sec? uint16 2913 +--rw track 2914 | +--rw interfaces 2915 | | +--rw interface* [interface] 2916 | | +--rw interface if:interface-ref 2917 | | +--rw priority-decrement? uint8 2918 | +--rw networks 2919 | +--rw network* [prefix] 2920 | +--rw prefix inet:ipv4-prefix 2921 | +--rw priority-decrement? uint8 2922 +--rw virtual-ipv4-addresses 2923 +--rw virtual-ipv4-address* [ipv4-address] 2924 +--rw ipv4-address inet:ipv4-address 2925 augment /if:interfaces/if:interface/ip:ipv6: 2926 +--rw vrrp 2927 +--rw vrrp-instance* [vrid] 2928 +--rw vrid uint8 2929 +--rw version identityref 2930 +--rw log-state-change? boolean 2931 +--rw preempt 2932 | +--rw enabled? boolean 2933 | +--rw hold-time? uint16 2934 +--rw priority? uint8 2935 +--rw accept-mode? boolean 2936 +--rw advertise-interval-centi-sec? uint16 2937 +--rw track 2938 | +--rw interfaces 2939 | | +--rw interface* [interface] 2940 | | +--rw interface if:interface-ref 2941 | | +--rw priority-decrement? uint8 2942 | +--rw networks 2943 | +--rw network* [prefix] 2944 | +--rw prefix inet:ipv6-prefix 2945 | +--rw priority-decrement? uint8 2946 +--rw virtual-ipv6-addresses 2947 +--rw virtual-ipv6-address* [ipv6-address] 2948 +--rw ipv6-address inet:ipv6-address 2949 augment /if:interfaces-state/if:interface/ip:ipv4: 2950 +--ro vrrp 2951 +--ro vrrp-instance* [vrid] 2952 +--ro vrid uint8 2953 +--ro version identityref 2954 +--ro log-state-change? boolean 2955 +--ro preempt 2956 | +--ro enabled? boolean 2957 | +--ro hold-time? uint16 2958 +--ro priority? uint8 2959 +--ro accept-mode? boolean 2960 +--ro (advertise-interval-choice)? 2961 | +--:(v2) 2962 | | +--ro advertise-interval-sec? uint8 2963 | +--:(v3) 2964 | +--ro advertise-interval-centi-sec? uint16 2965 +--ro track 2966 | +--ro interfaces 2967 | | +--ro interface* [interface] 2968 | | +--ro interface if:interface-ref 2969 | | +--ro priority-decrement? uint8 2970 | +--ro networks 2971 | +--ro network* [prefix] 2972 | +--ro prefix inet:ipv4-prefix 2973 | +--ro priority-decrement? uint8 2974 +--ro virtual-ipv4-addresses 2975 | +--ro virtual-ipv4-address* [ipv4-address] 2976 | +--ro ipv4-address inet:ipv4-address 2977 +--ro state? identityref 2978 +--ro is-owner? boolean 2979 +--ro last-adv-source? inet:ip-address 2980 +--ro up-datetime? yang:date-and-time 2981 +--ro master-down-interval? uint32 2982 +--ro skew-time? uint32 2983 +--ro last-event? identityref 2984 +--ro new-master-reason? 2985 new-master-reason-type 2986 +--ro statistics 2987 +--ro discontinuity-datetime? yang:date-and-time 2988 +--ro master-transitions? yang:counter32 2989 +--ro advertisement-recv? yang:counter64 2990 +--ro advertisement-sent? yang:counter64 2991 +--ro interval-errors? yang:counter64 2992 {validate-interval-errors}? 2993 +--ro priority-zero-pkts-rcvd? yang:counter64 2994 +--ro priority-zero-pkts-sent? yang:counter64 2995 +--ro invalid-type-pkts-rcvd? yang:counter64 2996 +--ro address-list-errors? yang:counter64 2997 {validate-address-list-errors}? 2998 +--ro packet-length-errors? yang:counter64 2999 augment /if:interfaces-state/if:interface/ip:ipv6: 3000 +--ro vrrp 3001 +--ro vrrp-instance* [vrid] 3002 +--ro vrid uint8 3003 +--ro version identityref 3004 +--ro log-state-change? boolean 3005 +--ro preempt 3006 | +--ro enabled? boolean 3007 | +--ro hold-time? uint16 3008 +--ro priority? uint8 3009 +--ro accept-mode? boolean 3010 +--ro advertise-interval-centi-sec? uint16 3011 +--ro track 3012 | +--ro interfaces 3013 | | +--ro interface* [interface] 3014 | | +--ro interface if:interface-ref 3015 | | +--ro priority-decrement? uint8 3016 | +--ro networks 3017 | +--ro network* [prefix] 3018 | +--ro prefix inet:ipv6-prefix 3019 | +--ro priority-decrement? uint8 3020 +--ro virtual-ipv6-addresses 3021 | +--ro virtual-ipv6-address* [ipv6-address] 3022 | +--ro ipv6-address inet:ipv6-address 3023 +--ro state? identityref 3024 +--ro is-owner? boolean 3025 +--ro last-adv-source? inet:ip-address 3026 +--ro up-datetime? yang:date-and-time 3027 +--ro master-down-interval? uint32 3028 +--ro skew-time? uint32 3029 +--ro last-event? identityref 3030 +--ro new-master-reason? 3031 new-master-reason-type 3032 +--ro statistics 3033 +--ro discontinuity-datetime? yang:date-and-time 3034 +--ro master-transitions? yang:counter32 3035 +--ro advertisement-recv? yang:counter64 3036 +--ro advertisement-sent? yang:counter64 3037 +--ro interval-errors? yang:counter64 3039 {validate-interval-errors}? 3040 +--ro priority-zero-pkts-rcvd? yang:counter64 3041 +--ro priority-zero-pkts-sent? yang:counter64 3042 +--ro invalid-type-pkts-rcvd? yang:counter64 3043 +--ro address-list-errors? yang:counter64 3044 {validate-address-list-errors}? 3045 +--ro packet-length-errors? yang:counter64 3046 augment /if:interfaces-state: 3047 +--ro vrrp-global 3048 +--ro virtual-routers? uint32 3049 +--ro interfaces? uint32 3050 +--ro statistics 3051 +--ro discontinuity-datetime? yang:date-and-time 3052 +--ro checksum-errors? yang:counter64 3053 +--ro version-errors? yang:counter64 3054 +--ro vrid-errors? yang:counter64 3055 +--ro ip-ttl-errors? yang:counter64 3057 notifications: 3058 +---n vrrp-new-master-event 3059 | +--ro master-ip-address inet:ip-address 3060 | +--ro new-master-reason new-master-reason-type 3061 +---n vrrp-protocol-error-event 3062 | +--ro protocol-error-reason identityref 3063 +---n vrrp-virtual-router-error-event 3064 +--ro interface if:interface-ref 3065 +--ro (ip-version) 3066 | +--:(ipv4) 3067 | | +--ro ipv4 3068 | | +--ro vrid -> /if:interfaces/interface[if:name = 3069 current()/../../vrrp:interface]/ip:ipv4/vrrp:vrrp/vrrp-instance/vrid 3070 | +--:(ipv6) 3071 | +--ro ipv6 3072 | +--ro vrid -> /if:interfaces/interface[if:name = 3073 current()/../../vrrp:interface]/ip:ipv6/vrrp:vrrp/vrrp-instance/vrid 3074 +--ro virtual-router-error-reason identityref 3076 Authors' Addresses 3078 Xufeng Liu (editor) 3079 Jabil 3080 8281 Greensboro Drive, Suite 200 3081 McLean VA 22102 3082 USA 3084 EMail: Xufeng_Liu@jabil.com 3085 Athanasios Kyparlis 3086 Jabil 3087 8281 Greensboro Drive, Suite 200 3088 McLean VA 22102 3089 USA 3091 EMail: Athanasios_Kyparlis@jabil.com 3093 Ravi Parikh 3094 VMware 3095 3425 Hillview Avenue 3096 Palo Alto CA 94304 3097 USA 3099 EMail: parikhr@vmware.com 3101 Acee Lindem 3102 Cisco Systems 3103 301 Midenhall Way 3104 Cary NC 27513 3105 USA 3107 EMail: acee@cisco.com 3109 Mingui Zhang 3110 Huawei Technologies 3111 No. 156 Beiqing Rd. Haidian District 3112 Beijing 100095 3113 P.R. China 3115 EMail: zhangmingui@huawei.com