idnits 2.17.1 draft-ietf-netmod-rfc6087bis-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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 23, 2014) is 3473 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RFCXXXX' is mentioned on line 286, but not defined == Missing Reference: 'RFC6242' is mentioned on line 982, but not defined ** Obsolete normative reference: RFC 2223 (Obsoleted by RFC 7322) ** Obsolete normative reference: RFC 5741 (Obsoleted by RFC 7841) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 6087 (Obsoleted by RFC 8407) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Bierman 3 Internet-Draft YumaWorks 4 Intended status: Standards Track October 23, 2014 5 Expires: April 26, 2015 7 Guidelines for Authors and Reviewers of YANG Data Model Documents 8 draft-ietf-netmod-rfc6087bis-01 10 Abstract 12 This memo provides guidelines for authors and reviewers of Standards 13 Track specifications containing YANG data model modules. Applicable 14 portions may be used as a basis for reviews of other YANG data model 15 documents. Recommendations and procedures are defined, which are 16 intended to increase interoperability and usability of Network 17 Configuration Protocol (NETCONF) implementations that utilize YANG 18 data model modules. 20 Status of this Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on April 26, 2015. 37 Copyright Notice 39 Copyright (c) 2014 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 55 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 56 2.1. Requirements Notation . . . . . . . . . . . . . . . . . . 5 57 2.2. NETCONF Terms . . . . . . . . . . . . . . . . . . . . . . 5 58 2.3. YANG Terms . . . . . . . . . . . . . . . . . . . . . . . . 5 59 2.4. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 3. YANG Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 7 61 4. General Documentation Guidelines . . . . . . . . . . . . . . . 8 62 4.1. Module Copyright . . . . . . . . . . . . . . . . . . . . . 8 63 4.2. Terminology Section . . . . . . . . . . . . . . . . . . . 9 64 4.3. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 9 65 4.4. Narrative Sections . . . . . . . . . . . . . . . . . . . . 9 66 4.5. Definitions Section . . . . . . . . . . . . . . . . . . . 10 67 4.6. Security Considerations Section . . . . . . . . . . . . . 10 68 4.7. IANA Considerations Section . . . . . . . . . . . . . . . 11 69 4.7.1. Documents that Create a New Namespace . . . . . . . . 11 70 4.7.2. Documents that Extend an Existing Namespace . . . . . 11 71 4.8. Reference Sections . . . . . . . . . . . . . . . . . . . . 11 72 5. YANG Usage Guidelines . . . . . . . . . . . . . . . . . . . . 13 73 5.1. Module Naming Conventions . . . . . . . . . . . . . . . . 13 74 5.2. Identifiers . . . . . . . . . . . . . . . . . . . . . . . 13 75 5.3. Defaults . . . . . . . . . . . . . . . . . . . . . . . . . 13 76 5.4. Conditional Statements . . . . . . . . . . . . . . . . . . 14 77 5.5. XPath Usage . . . . . . . . . . . . . . . . . . . . . . . 14 78 5.5.1. Function Library . . . . . . . . . . . . . . . . . . . 14 79 5.5.2. Axes . . . . . . . . . . . . . . . . . . . . . . . . . 15 80 5.5.3. Types . . . . . . . . . . . . . . . . . . . . . . . . 16 81 5.5.4. Wildcards . . . . . . . . . . . . . . . . . . . . . . 16 82 5.6. Lifecycle Management . . . . . . . . . . . . . . . . . . . 17 83 5.7. Module Header, Meta, and Revision Statements . . . . . . . 17 84 5.8. Namespace Assignments . . . . . . . . . . . . . . . . . . 18 85 5.9. Top-Level Data Definitions . . . . . . . . . . . . . . . . 19 86 5.10. Data Types . . . . . . . . . . . . . . . . . . . . . . . . 20 87 5.11. Reusable Type Definitions . . . . . . . . . . . . . . . . 21 88 5.12. Data Definitions . . . . . . . . . . . . . . . . . . . . . 21 89 5.13. Operation Definitions . . . . . . . . . . . . . . . . . . 22 90 5.14. Notification Definitions . . . . . . . . . . . . . . . . . 22 91 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 92 7. Security Considerations . . . . . . . . . . . . . . . . . . . 25 93 7.1. Security Considerations Section Template . . . . . . . . . 25 94 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 27 95 9. Changes Since RFC 6087 . . . . . . . . . . . . . . . . . . . . 28 96 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 29 97 10.1. Normative References . . . . . . . . . . . . . . . . . . . 29 98 10.2. Informative References . . . . . . . . . . . . . . . . . . 29 99 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 31 100 A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . . 31 101 Appendix B. Module Review Checklist . . . . . . . . . . . . . . . 32 102 Appendix C. YANG Module Template . . . . . . . . . . . . . . . . 34 103 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 36 105 1. Introduction 107 The standardization of network configuration interfaces for use with 108 the Network Configuration Protocol [RFC6241] requires a modular set 109 of data models, which can be reused and extended over time. 111 This document defines a set of usage guidelines for Standards Track 112 documents containing [RFC6020] data models. YANG is used to define 113 the data structures, protocol operations, and notification content 114 used within a NETCONF server. A server that supports a particular 115 YANG module will support client NETCONF operation requests, as 116 indicated by the specific content defined in the YANG module. 118 This document is similar to the Structure of Management Information 119 version 2 (SMIv2) usage guidelines specification [RFC4181] in intent 120 and structure. However, since that document was written a decade 121 after SMIv2 modules had been in use, it was published as a 'Best 122 Current Practice' (BCP). This document is not a BCP, but rather an 123 informational reference, intended to promote consistency in documents 124 containing YANG modules. 126 Many YANG constructs are defined as optional to use, such as the 127 description statement. However, in order to maximize 128 interoperability of NETCONF implementations utilizing YANG data 129 models, it is desirable to define a set of usage guidelines that may 130 require a higher level of compliance than the minimum level defined 131 in the YANG specification. 133 In addition, YANG allows constructs such as infinite length 134 identifiers and string values, or top-level mandatory nodes, that a 135 compliant server is not required to support. Only constructs that 136 all servers are required to support can be used in IETF YANG modules. 138 This document defines usage guidelines related to the NETCONF 139 operations layer and NETCONF content layer, as defined in [RFC6241]. 140 These guidelines are intended to be used by authors and reviewers to 141 improve the readability and interoperability of published YANG data 142 models. 144 2. Terminology 146 2.1. Requirements Notation 148 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 149 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 150 document are to be interpreted as described in [RFC2119]. 152 RFC 2119 language is used here to express the views of the NETMOD 153 working group regarding content for YANG modules. YANG modules 154 complying with this document will treat the RFC 2119 terminology as 155 if it were describing best current practices. 157 2.2. NETCONF Terms 159 The following terms are defined in [RFC6241] and are not redefined 160 here: 162 o capabilities 164 o client 166 o operation 168 o server 170 2.3. YANG Terms 172 The following terms are defined in [RFC6020] and are not redefined 173 here: 175 o data node 177 o module 179 o namespace 181 o submodule 183 o version 185 o YANG 187 o YIN 189 Note that the term 'module' may be used as a generic term for a YANG 190 module or submodule. When describing properties that are specific to 191 submodules, the term 'submodule' is used instead. 193 2.4. Terms 195 The following terms are used throughout this document: 197 o published: A stable release of a module or submodule, usually 198 contained in an RFC. 200 o unpublished: An unstable release of a module or submodule, usually 201 contained in an Internet-Draft. 203 3. YANG Tree Diagrams 205 YANG tree diagrams provide a concise representation of a YANG module 206 to help readers understand the module structure. 208 The meaning of the symbols in YANG tree diagrams is as follows: 210 o Brackets "[" and "]" enclose list keys. 212 o Abbreviations before data node names: "rw" means configuration 213 (read-write) and "ro" state data (read-only). 215 o Symbols after data node names: "?" means an optional node, "!" 216 means a presence container, and "*" denotes a list and leaf-list. 218 o Parentheses enclose choice and case nodes, and case nodes are also 219 marked with a colon (":"). 221 o Ellipsis ("...") stands for contents of subtrees that are not 222 shown. 224 4. General Documentation Guidelines 226 YANG data model modules under review are likely to be contained in 227 Internet-Drafts. All guidelines for Internet-Draft authors MUST be 228 followed. The RFC Editor provides guidelines for authors of RFCs, 229 which are first published as Internet-Drafts. These guidelines 230 should be followed and are defined in [RFC2223] and updated in 231 [RFC5741] and "RFC Document Style" [RFC-STYLE]. 233 The following sections MUST be present in an Internet-Draft 234 containing a module: 236 o Narrative sections 238 o Definitions section 240 o Security Considerations section 242 o IANA Considerations section 244 o References section 246 4.1. Module Copyright 248 The module description statement MUST contain a reference to the 249 latest approved IETF Trust Copyright statement, which is available 250 online at: 252 http://trustee.ietf.org/license-info/ 254 Each YANG module or submodule contained within an Internet-Draft or 255 RFC is considered to be a code component. The strings '' and '' MUST be used to identify each code 257 component. 259 The '' tag SHOULD be followed by a string identifying 260 the file name specified in Section 5.2 of [RFC6020]. The following 261 example is for the '2010-01-18' revision of the 'ietf-foo' module: 263 file "ietf-foo@2010-01-18.yang" 264 module ietf-foo { 265 // ... 266 revision 2010-01-18 { 267 description "Latest revision"; 268 reference "RFC XXXX"; 269 } 270 // ... 271 } 273 275 4.2. Terminology Section 277 A terminology section MUST be present if any terms are defined in the 278 document or if any terms are imported from other documents. 280 If YANG tree diagrams are used, then a sub-section explaining the 281 YANG tree diagram syntax MUST be present, containing the following 282 text: 284 A simplified graphical representation of the data model is used in 285 this document. The meaning of the symbols in these diagrams is 286 defined in [RFCXXXX]. 288 -- RFC Editor: Replace XXXX with RFC number and remove note 290 4.3. Tree Diagrams 292 YANG tree diagrams provide a concise representation of a YANG module, 293 and SHOULD be included to help readers understand YANG module 294 structure. Tree diagrams MAY be split into sections to correspond to 295 document structure. 297 The following example shows a simple YANG tree diagram: 299 +--rw top-level-config-container 300 | +--rw config-list* [key-name] 301 | +--rw key-name string 302 | +--rw optional-parm? string 303 | +--rw mandatory-parm identityref 304 | +--ro read-only-leaf string 305 +--ro top-level-nonconfig-container 306 +--ro nonconfig-list* [name] 307 +--ro name string 308 +--ro type string 310 4.4. Narrative Sections 312 The narrative part MUST include an overview section that describes 313 the scope and field of application of the module(s) defined by the 314 specification and that specifies the relationship (if any) of these 315 modules to other standards, particularly to standards containing 316 other YANG modules. The narrative part SHOULD include one or more 317 sections to briefly describe the structure of the modules defined in 318 the specification. 320 If the module(s) defined by the specification imports definitions 321 from other modules (except for those defined in the [RFC6020] or 322 [RFC6991] documents), or are always implemented in conjunction with 323 other modules, then those facts MUST be noted in the overview 324 section, as MUST be noted any special interpretations of definitions 325 in other modules. 327 4.5. Definitions Section 329 This section contains the module(s) defined by the specification. 330 These modules MUST be written using the YANG syntax defined in 331 [RFC6020]. A YIN syntax version of the module MAY also be present in 332 the document. There MAY also be other types of modules present in 333 the document, such as SMIv2, which are not affected by these 334 guidelines. 336 See Section 5 for guidelines on YANG usage. 338 4.6. Security Considerations Section 340 Each specification that defines one or more modules MUST contain a 341 section that discusses security considerations relevant to those 342 modules. 344 This section MUST be patterned after the latest approved template 345 (available at http://trac.tools.ietf.org/area/ops/trac/wiki/ 346 yang-security-guidelines). Section 7.1 contains the security 347 considerations template dated 2010-06-16. Authors MUST check the 348 webpage at the URL listed above in case there is a more recent 349 version available. 351 In particular: 353 o Writable data nodes that could be especially disruptive if abused 354 MUST be explicitly listed by name and the associated security 355 risks MUST be explained. 357 o Readable data nodes that contain especially sensitive information 358 or that raise significant privacy concerns MUST be explicitly 359 listed by name and the reasons for the sensitivity/privacy 360 concerns MUST be explained. 362 o Operations (i.e., YANG 'rpc' statements) that are potentially 363 harmful to system behavior or that raise significant privacy 364 concerns MUST be explicitly listed by name and the reasons for the 365 sensitivity/privacy concerns MUST be explained. 367 4.7. IANA Considerations Section 369 In order to comply with IESG policy as set forth in 370 http://www.ietf.org/id-info/checklist.html, every Internet-Draft that 371 is submitted to the IESG for publication MUST contain an IANA 372 Considerations section. The requirements for this section vary 373 depending on what actions are required of the IANA. If there are no 374 IANA considerations applicable to the document, then the IANA 375 Considerations section stating that there are no actions is removed 376 by the RFC Editor before publication. Refer to the guidelines in 377 [RFC5226] for more details. 379 4.7.1. Documents that Create a New Namespace 381 If an Internet-Draft defines a new namespace that is to be 382 administered by the IANA, then the document MUST include an IANA 383 Considerations section that specifies how the namespace is to be 384 administered. 386 Specifically, if any YANG module namespace statement value contained 387 in the document is not already registered with IANA, then a new YANG 388 Namespace registry entry MUST be requested from the IANA. The 389 [RFC6020] specification includes the procedure for this purpose in 390 its IANA Considerations section. 392 4.7.2. Documents that Extend an Existing Namespace 394 It is possible to extend an existing namespace using a YANG submodule 395 that belongs to an existing module already administered by IANA. In 396 this case, the document containing the main module MUST be updated to 397 use the latest revision of the submodule. 399 4.8. Reference Sections 401 For every import or include statement that appears in a module 402 contained in the specification, which identifies a module in a 403 separate document, a corresponding normative reference to that 404 document MUST appear in the Normative References section. The 405 reference MUST correspond to the specific module version actually 406 used within the specification. 408 For every normative reference statement that appears in a module 409 contained in the specification, which identifies a separate document, 410 a corresponding normative reference to that document SHOULD appear in 411 the Normative References section. The reference SHOULD correspond to 412 the specific document version actually used within the specification. 413 If the reference statement identifies an informative reference, which 414 identifies a separate document, a corresponding informative reference 415 to that document MAY appear in the Informative References section. 417 5. YANG Usage Guidelines 419 In general, modules in IETF Standards Track specifications MUST 420 comply with all syntactic and semantic requirements of YANG 421 [RFC6020]. The guidelines in this section are intended to supplement 422 the YANG specification, which is intended to define a minimum set of 423 conformance requirements. 425 In order to promote interoperability and establish a set of practices 426 based on previous experience, the following sections establish usage 427 guidelines for specific YANG constructs. 429 Only guidelines that clarify or restrict the minimum conformance 430 requirements are included here. 432 5.1. Module Naming Conventions 434 Modules contained in Standards Track documents SHOULD be named 435 according to the guidelines in the IANA Considerations section of 436 [RFC6020]. 438 A distinctive word or acronym (e.g., protocol name or working group 439 acronym) SHOULD be used in the module name. If new definitions are 440 being defined to extend one or more existing modules, then the same 441 word or acronym should be reused, instead of creating a new one. 443 All published module names MUST be unique. For a YANG module 444 published in an RFC, this uniqueness is guaranteed by IANA. For 445 unpublished modules, the authors need to check that no other work in 446 progress is using the same module name. 448 Once a module name is published, it MUST NOT be reused, even if the 449 RFC containing the module is reclassified to 'Historic' status. 451 5.2. Identifiers 453 Identifiers for all YANG identifiers in published modules MUST be 454 between 1 and 64 characters in length. These include any construct 455 specified as an 'identifier-arg-str' token in the ABNF in Section 12 456 of [RFC6020]. 458 5.3. Defaults 460 In general, it is suggested that substatements containing very common 461 default values SHOULD NOT be present. The following substatements 462 are commonly used with the default value, which would make the module 463 difficult to read if used everywhere they are allowed. 465 +--------------+---------------+ 466 | Statement | Default Value | 467 +--------------+---------------+ 468 | config | true | 469 | mandatory | false | 470 | max-elements | unbounded | 471 | min-elements | 0 | 472 | ordered-by | system | 473 | status | current | 474 | yin-element | false | 475 +--------------+---------------+ 477 Statement Defaults 479 5.4. Conditional Statements 481 A module may be conceptually partitioned in several ways, using the 482 'if-feature' and/or 'when' statements. 484 Data model designers need to carefully consider all modularity 485 aspects, including the use of YANG conditional statements. 487 If a data definition is optional, depending on server support for a 488 NETCONF protocol capability, then a YANG 'feature' statement SHOULD 489 be defined to indicate that the NETCONF capability is supported 490 within the data model. 492 If any notification data, or any data definition, for a non- 493 configuration data node is not mandatory, then the server may or may 494 not be required to return an instance of this data node. If any 495 conditional requirements exist for returning the data node in a 496 notification payload or retrieval request, they MUST be documented 497 somewhere. For example, a 'when' or 'if-feature' statement could 498 apply to the data node, or the conditional requirements could be 499 explained in a 'description' statement within the data node or one of 500 its ancestors (if any). 502 5.5. XPath Usage 504 This section describes guidelines for using the XML Path Language 505 [W3C.REC-xpath-19991116] (XPath) within YANG modules. 507 5.5.1. Function Library 509 The 'position' and 'last' functions SHOULD NOT be used. This applies 510 to implicit use of the 'position' function as well (e.g., 511 '//chapter[42]'). A server is only required to maintain the relative 512 XML document order of all instances of a particular user-ordered list 513 or leaf-list. The 'position' and 'last' functions MAY be used if 514 they are evaluated in a context where the context node is a user- 515 ordered 'list' or 'leaf-list'. 517 The 'id' function SHOULD NOT be used. The 'ID' attribute is not 518 present in YANG documents so this function has no meaning. The YANG 519 compiler SHOULD return an empty string for this function. 521 The 'namespace-uri' and 'name' functions SHOULD NOT be used. 522 Expanded names in XPath are different than YANG. A specific 523 canonical representation of a YANG expanded name does not exist. 525 The 'lang' function SHOULD NOT be used. This function does not apply 526 to YANG because there is no 'lang' attribute set with the document. 527 The YANG compiler SHOULD return 'false' for this function. 529 The 'local-name', 'namespace-uri', 'name', 'string', and 'number' 530 functions SHOULD NOT be used if the argument is a node-set. If so, 531 the function result will be determined by the document order of the 532 node-set. Since this order can be different on each server, the 533 function results can also be different. Any function call that 534 implicitly converts a node-set to a string will also have this issue. 536 5.5.2. Axes 538 The 'attribute' and 'namespace' axes are not supported in YANG, and 539 MAY be empty in a NETCONF server implementation. 541 The 'preceding', and 'following' axes SHOULD NOT be used. These 542 constructs rely on XML document order within a NETCONF server 543 configuration database, which may not be supported consistently or 544 produce reliable results across implementations. Predicate 545 expressions based on static node properties (e.g., element name or 546 value, 'ancestor' or 'descendant' axes) SHOULD be used instead. The 547 'preceding' and 'following' axes MAY be used if document order is not 548 relevant to the outcome of the expression (e.g., check for global 549 uniqueness of a parameter value). 551 The 'preceding-sibling' and 'following-sibling' axes SHOULD NOT used. 553 A server is only required to maintain the relative XML document order 554 of all instances of a particular user-ordered list or leaf-list. The 555 'preceding-sibling' and 'following-sibling' axes MAY be used if they 556 are evaluated in a context where the context node is a user-ordered 557 'list' or 'leaf-list'. 559 5.5.3. Types 561 Data nodes that use the 'int64' and 'uint64' built-in type SHOULD NOT 562 be used within numeric or boolean expressions. There are boundary 563 conditions in which the translation from the YANG 64-bit type to an 564 XPath number can cause incorrect results. Specifically, an XPath 565 'double' precision floating point number cannot represent very large 566 positive or negative 64-bit numbers because it only provides a total 567 precision of 53 bits. The 'int64' and 'uint64' data types MAY be 568 used in numeric expressions if the value can be represented with no 569 more than 53 bits of precision. 571 Data modelers need to be careful not to confuse the YANG value space 572 and the XPath value space. The data types are not the same in both, 573 and conversion between YANG and XPath data types SHOULD be considered 574 carefully. 576 Explicit XPath data type conversions MAY be used (e.g., 'string', 577 'boolean', or 'number' functions), instead of implicit XPath data 578 type conversions. 580 XPath expressions that contain a literal value representing a YANG 581 identity SHOULD always include the declared prefix of the module 582 where the identity is defined. 584 XPath expressions for 'when' statements SHOULD NOT reference the 585 context node or any descendant nodes of the context node. They MAY 586 reference descendant nodes if the 'when' statement is contained 587 within an 'augment' statement, and the referenced nodes are not 588 defined within the 'augment' statement. 590 Example: 592 augment "/rt:active-route/rt:input/rt:destination-address" { 593 when "rt:address-family='v4ur:ipv4-unicast'" { 594 description 595 "This augment is valid only for IPv4 unicast."; 596 } 597 // nodes defined here within the augment-stmt 598 // cannot be referenced in the when-stmt 599 } 601 5.5.4. Wildcards 603 It is possible to construct XPath expressions that will evaluate 604 differently when combined with several modules within a server 605 implementation, then when evaluated within the single module. This 606 is due to augmenting nodes from other modules. 608 Wildcard expansion is done within a server against all the nodes from 609 all namespaces, so it is possible for a 'must' or 'when' expression 610 that uses the '*' operator will always evaluate to false if processed 611 within a single YANG module. In such cases, the 'description' 612 statement SHOULD clarify that augmenting objects are expected to 613 match the wildcard expansion. 615 when /foo/services/*/active { 616 description 617 "No services directly defined in this module. 618 Matches objects that have augmented the services container."; 619 } 621 5.6. Lifecycle Management 623 The status statement MUST be present if its value is 'deprecated' or 624 'obsolete'. The status SHOULD NOT be changed from 'current' directly 625 to 'obsolete'. An object SHOULD be available for at least one year 626 with 'deprecated' status before it is changed to 'obsolete'. 628 The module or submodule name MUST NOT be changed, once the document 629 containing the module or submodule is published. 631 The module namespace URI value MUST NOT be changed, once the document 632 containing the module is published. 634 The revision-date substatement within the imports statement SHOULD be 635 present if any groupings are used from the external module. 637 The revision-date substatement within the include statement SHOULD be 638 present if any groupings are used from the external submodule. 640 If submodules are used, then the document containing the main module 641 MUST be updated so that the main module revision date is equal or 642 more recent than the revision date of any submodule that is (directly 643 or indirectly) included by the main module. 645 5.7. Module Header, Meta, and Revision Statements 647 For published modules, the namespace MUST be a globally unique URI, 648 as defined in [RFC3986]. This value is usually assigned by the IANA. 650 The organization statement MUST be present. If the module is 651 contained in a document intended for Standards Track status, then the 652 organization SHOULD be the IETF working group chartered to write the 653 document. 655 The contact statement MUST be present. If the module is contained in 656 a document intended for Standards Track status, then the working 657 group web and mailing information MUST be present, and the main 658 document author or editor contact information SHOULD be present. If 659 additional authors or editors exist, their contact information MAY be 660 present. In addition, the Area Director and other contact 661 information MAY be present. 663 The description statement MUST be present. The appropriate IETF 664 Trust Copyright text MUST be present, as described in Section 4.1. 666 If the module relies on information contained in other documents, 667 which are not the same documents implied by the import statements 668 present in the module, then these documents MUST be identified in the 669 reference statement. 671 A revision statement MUST be present for each published version of 672 the module. The revision statement MUST have a reference 673 substatement. It MUST identify the published document that contains 674 the module. Modules are often extracted from their original 675 documents, and it is useful for developers and operators to know how 676 to find the original source document in a consistent manner. The 677 revision statement MAY have a description substatement. 679 Each new revision MUST include a revision date that is higher than 680 any other revision date in the module. The revision date does not 681 need to be updated if the module contents do not change in the new 682 document revision. 684 It is acceptable to reuse the same revision statement within 685 unpublished versions (i.e., Internet-Drafts), but the revision date 686 MUST be updated to a higher value each time the Internet-Draft is re- 687 posted. 689 5.8. Namespace Assignments 691 It is RECOMMENDED that only valid YANG modules be included in 692 documents, whether or not they are published yet. This allows: 694 o the module to compile correctly instead of generating disruptive 695 fatal errors. 697 o early implementors to use the modules without picking a random 698 value for the XML namespace. 700 o early interoperability testing since independent implementations 701 will use the same XML namespace value. 703 Until a URI is assigned by the IANA, a proposed namespace URI MUST be 704 provided for the namespace statement in a YANG module. A value 705 SHOULD be selected that is not likely to collide with other YANG 706 namespaces. Standard module names, prefixes, and URI strings already 707 listed in the YANG Module Registry MUST NOT be used. 709 A standard namespace statement value SHOULD have the following form: 711 : 713 The following URN prefix string SHOULD be used for published and 714 unpublished YANG modules: 716 urn:ietf:params:xml:ns:yang: 718 The following example URNs would be valid temporary namespace 719 statement values for Standards Track modules: 721 urn:ietf:params:xml:ns:yang:ietf-netconf-partial-lock 723 urn:ietf:params:xml:ns:yang:ietf-netconf-state 725 urn:ietf:params:xml:ns:yang:ietf-netconf 727 Note that a different URN prefix string SHOULD be used for non- 728 Standards-Track modules. The string SHOULD be selected according to 729 the guidelines in [RFC6020]. 731 The following examples of non-Standards-Track modules are only 732 suggestions. There are no guidelines for this type of URN in this 733 document: 735 http://example.com/ns/example-interfaces 737 http://example.com/ns/example-system 739 5.9. Top-Level Data Definitions 741 The top-level data organization SHOULD be considered carefully, in 742 advance. Data model designers need to consider how the functionality 743 for a given protocol or protocol family will grow over time. 745 The separation of configuration data and operational state SHOULD be 746 considered carefully. It is often useful to define separate top- 747 level containers for configuration and non-configuration data. There 748 SHOULD only be one top-level data node defined in each YANG module 749 for all configuration data nodes, if any configuration data nodes are 750 defined at all. There MAY be one top-level data node defined in each 751 YANG module for all non-configuration data nodes, if any non- 752 configuration data nodes are defined at all. 754 The names and data organization SHOULD reflect persistent 755 information, such as the name of a protocol. The name of the working 756 group SHOULD NOT be used because this may change over time. 758 A mandatory database data definition is defined as a node that a 759 client must provide for the database to be valid. The server is not 760 required to provide a value. 762 Top-level database data definitions MUST NOT be mandatory. If a 763 mandatory node appears at the top level, it will immediately cause 764 the database to be invalid. This can occur when the server boots or 765 when a module is loaded dynamically at runtime. 767 5.10. Data Types 769 Selection of an appropriate data type (i.e., built-in type, existing 770 derived type, or new derived type) is very subjective, and therefore 771 few requirements can be specified on that subject. 773 Data model designers SHOULD use the most appropriate built-in data 774 type for the particular application. 776 If extensibility of enumerated values is required, then the 777 'identityref' data type SHOULD be used instead of an enumeration or 778 other built-in type. 780 For string data types, if a machine-readable pattern can be defined 781 for the desired semantics, then one or more pattern statements SHOULD 782 be present. A single quoted string SHOULD be used to specify the 783 pattern, since a double-quoted string can modify the content. 785 For string data types, if the length of the string is required to be 786 bounded in all implementations, then a length statement MUST be 787 present. 789 For numeric data types, if the values allowed by the intended 790 semantics are different than those allowed by the unbounded intrinsic 791 data type (e.g., 'int32'), then a range statement SHOULD be present. 793 The signed numeric data types (i.e., 'int8', 'int16', 'int32', and 794 'int64') SHOULD NOT be used unless negative values are allowed for 795 the desired semantics. 797 For 'enumeration' or 'bits' data types, the semantics for each 'enum' 798 or 'bit' SHOULD be documented. A separate description statement 799 (within each 'enum' or 'bit' statement) SHOULD be present. 801 5.11. Reusable Type Definitions 803 If an appropriate derived type exists in any standard module, such as 804 [RFC6991], then it SHOULD be used instead of defining a new derived 805 type. 807 If an appropriate units identifier can be associated with the desired 808 semantics, then a units statement SHOULD be present. 810 If an appropriate default value can be associated with the desired 811 semantics, then a default statement SHOULD be present. 813 If a significant number of derived types are defined, and it is 814 anticipated that these data types will be reused by multiple modules, 815 then these derived types SHOULD be contained in a separate module or 816 submodule, to allow easier reuse without unnecessary coupling. 818 The description statement MUST be present. 820 If the type definition semantics are defined in an external document 821 (other than another YANG module indicated by an import statement), 822 then the reference statement MUST be present. 824 5.12. Data Definitions 826 The description statement MUST be present in the following YANG 827 statements: 829 o anyxml 831 o augment 833 o choice 835 o container 837 o extension 839 o feature 841 o grouping 843 o identity 845 o leaf 847 o leaf-list 848 o list 850 o notification 852 o rpc 854 o typedef 856 If the data definition semantics are defined in an external document, 857 (other than another YANG module indicated by an import statement), 858 then a reference statement MUST be present. 860 The 'anyxml' construct may be useful to represent an HTML banner 861 containing markup elements, such as '<b>' and '</b>', and 862 MAY be used in such cases. However, this construct SHOULD NOT be 863 used if other YANG data node types can be used instead to represent 864 the desired syntax and semantics. 866 If there are referential integrity constraints associated with the 867 desired semantics that can be represented with XPath, then one or 868 more 'must' statements SHOULD be present. 870 For list and leaf-list data definitions, if the number of possible 871 instances is required to be bounded for all implementations, then the 872 max-elements statements SHOULD be present. 874 If any 'must' or 'when' statements are used within the data 875 definition, then the data definition description statement SHOULD 876 describe the purpose of each one. 878 5.13. Operation Definitions 880 If the operation semantics are defined in an external document (other 881 than another YANG module indicated by an import statement), then a 882 reference statement MUST be present. 884 If the operation impacts system behavior in some way, it SHOULD be 885 mentioned in the description statement. 887 If the operation is potentially harmful to system behavior in some 888 way, it MUST be mentioned in the Security Considerations section of 889 the document. 891 5.14. Notification Definitions 893 The description statement MUST be present. 895 If the notification semantics are defined in an external document 896 (other than another YANG module indicated by an import statement), 897 then a reference statement MUST be present. 899 If the notification refers to a specific resource instance, then this 900 instance SHOULD be identified in the notification data. This is 901 usually done by including 'leafref' leaf nodes with the key leaf 902 values for the resource instance. For example: 904 notification interface-up { 905 description "Sent when an interface is activated."; 906 leaf name { 907 type leafref { 908 path "/if:interfaces/if:interface/if:name"; 909 } 910 } 911 } 913 6. IANA Considerations 915 This document registers one URI in the IETF XML registry [RFC3688]. 917 The following registration has been made: 919 URI: urn:ietf:params:xml:ns:yang:ietf-template 921 Registrant Contact: The NETMOD WG of the IETF. 923 XML: N/A, the requested URI is an XML namespace. 925 Per this document, the following assignment has been made in the YANG 926 Module Names Registry for the YANG module template in Appendix C. 928 +-----------+-------------------------------------------+ 929 | Field | Value | 930 +-----------+-------------------------------------------+ 931 | Name | ietf-template | 932 | Namespace | urn:ietf:params:xml:ns:yang:ietf-template | 933 | Prefix | temp | 934 | Reference | RFC XXXX | 935 +-----------+-------------------------------------------+ 937 YANG Registry Assignment 939 7. Security Considerations 941 This document defines documentation guidelines for NETCONF content 942 defined with the YANG data modeling language. The guidelines for how 943 to write a Security Considerations section for a YANG module are 944 defined in the online document 946 http://trac.tools.ietf.org/area/ops/trac/wiki/ 947 yang-security-guidelines 949 This document does not introduce any new or increased security risks 950 into the management system. 952 The following section contains the security considerations template 953 dated 2010-06-16. Be sure to check the webpage at the URL listed 954 above in case there is a more recent version available. 956 Each specification that defines one or more YANG modules MUST contain 957 a section that discusses security considerations relevant to those 958 modules. This section MUST be patterned after the latest approved 959 template (available at 961 http://www.ops.ietf.org/netconf/yang-security-considerations.txt). 963 In particular, writable data nodes that could be especially 964 disruptive if abused MUST be explicitly listed by name and the 965 associated security risks MUST be spelled out. 967 Similarly, readable data nodes that contain especially sensitive 968 information or that raise significant privacy concerns MUST be 969 explicitly listed by name and the reasons for the sensitivity/privacy 970 concerns MUST be explained. 972 Further, if new RPC operations have been defined, then the security 973 considerations of each new RPC operation MUST be explained. 975 7.1. Security Considerations Section Template 977 X. Security Considerations 979 The YANG module defined in this memo is designed to be accessed via 980 the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the 981 secure transport layer and the mandatory-to-implement secure 982 transport is SSH [RFC6242]. 984 -- if you have any writable data nodes (those are all the 985 -- "config true" nodes, and remember, that is the default) 986 -- describe their specific sensitivity or vulnerability. 988 There are a number of data nodes defined in this YANG module which 989 are writable/creatable/deletable (i.e., config true, which is the 990 default). These data nodes may be considered sensitive or vulnerable 991 in some network environments. Write operations (e.g., edit-config) 992 to these data nodes without proper protection can have a negative 993 effect on network operations. These are the subtrees and data nodes 994 and their sensitivity/vulnerability: 996 998 -- for all YANG modules you must evaluate whether any readable data 999 -- nodes (those are all the "config false" nodes, but also all other 1000 -- nodes, because they can also be read via operations like get or 1001 -- get-config) are sensitive or vulnerable (for instance, if they 1002 -- might reveal customer information or violate personal privacy 1003 -- laws such as those of the European Union if exposed to 1004 -- unauthorized parties) 1006 Some of the readable data nodes in this YANG module may be considered 1007 sensitive or vulnerable in some network environments. It is thus 1008 important to control read access (e.g., via get, get-config, or 1009 notification) to these data nodes. These are the subtrees and data 1010 nodes and their sensitivity/vulnerability: 1012 1014 -- if your YANG module has defined any rpc operations 1015 -- describe their specific sensitivity or vulnerability. 1017 Some of the RPC operations in this YANG module may be considered 1018 sensitive or vulnerable in some network environments. It is thus 1019 important to control access to these operations. These are the 1020 operations and their sensitivity/vulnerability: 1022 1024 8. Acknowledgments 1026 The structure and contents of this document are adapted from 1027 [RFC4181], guidelines for MIB Documents, by C. M. Heard. 1029 The working group thanks Martin Bjorklund, Juergen Schoenwaelder, 1030 Ladislav Lhotka, and Jernej Tuljak for their extensive reviews and 1031 contributions to this document. 1033 9. Changes Since RFC 6087 1035 The following changes have been made to the guidelines published in 1036 [RFC6087]: 1038 o Updated NETCONF reference from RFC 4741 to RFC 6241 1040 o Updated NETCONF over SSH citation from RFC 4742 to RFC 6242 1042 o Updated YANG Types reference from RFC 6021 to RFC 6991 1044 o Updated obsolete URLs for IETF resources 1046 o Changed top-level data node guideline 1048 o Clarified XPath usage for a literal value representing a YANG 1049 identity 1051 o Clarified XPath usage for a when-stmt 1053 o Added terminology guidelines 1055 o Added YANG tree diagram definition and guideline 1057 o Updated XPath guidelines for type conversions and function library 1058 usage. 1060 o Updated data types section 1062 o Updated notifications section 1064 10. References 1066 10.1. Normative References 1068 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1069 Requirement Levels", BCP 14, RFC 2119, March 1997. 1071 [RFC2223] Postel, J. and J. Reynolds, "Instructions to RFC Authors", 1072 RFC 2223, October 1997. 1074 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1075 January 2004. 1077 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1078 Resource Identifier (URI): Generic Syntax", STD 66, 1079 RFC 3986, January 2005. 1081 [RFC5378] Bradner, S. and J. Contreras, "Rights Contributors Provide 1082 to the IETF Trust", BCP 78, RFC 5378, November 2008. 1084 [RFC5741] Daigle, L., Kolkman, O., and IAB, "RFC Streams, Headers, 1085 and Boilerplates", RFC 5741, December 2009. 1087 [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the 1088 Network Configuration Protocol (NETCONF)", RFC 6020, 1089 October 2010. 1091 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 1092 and A. Bierman, Ed., "Network Configuration Protocol 1093 (NETCONF)", RFC 6241, June 2011. 1095 [RFC6991] Schoenwaelder, J., "Common YANG Data Types", RFC 6991, 1096 July 2013. 1098 [W3C.REC-xpath-19991116] 1099 Clark, J. and S. DeRose, "XML Path Language (XPath) 1100 Version 1.0", World Wide Web Consortium 1101 Recommendation REC-xpath-19991116, November 1999, 1102 . 1104 10.2. Informative References 1106 [RFC-STYLE] 1107 Braden, R., Ginoza, S., and A. Hagens, "RFC Document 1108 Style", September 2009, 1109 . 1111 [RFC4181] Heard, C., "Guidelines for Authors and Reviewers of MIB 1112 Documents", BCP 111, RFC 4181, September 2005. 1114 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1115 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1116 May 2008. 1118 [RFC6087] Bierman, A., "Guidelines for Authors and Reviewers of YANG 1119 Data Model Documents", RFC 6087, January 2011. 1121 Appendix A. Change Log 1123 -- RFC Ed.: remove this section before publication. 1125 A.1. 00 to 01 1127 All issues from the issue tracker have been addressed. 1129 https://github.com/netmod-wg/rfc6087bis/issues 1131 o Issue 1: Tree Diagrams: Added Section 3 so RFCs with YANG modules 1132 can use an Informative reference to this RFC for tree diagrams. 1133 Updated guidelines to reference this RFC when tree diagrams are 1134 used 1136 o Issue 2: XPath function restrictions: Added paragraphs in XPath 1137 usage section for 'id', 'namesapce-uri', 'name', and 'lang' 1138 functions 1140 o Issue 3: XPath function document order issues: Added paragraph in 1141 XPath usage section about node-set ordering for 'local-name', 1142 'namespace-uri', 'name', 'string' and 'number' functions. Also 1143 any function that implicitly converts a node-set to a string. 1145 o Issue 4: XPath preceding-sibling and following-sibling: Checked 1146 and text in XPath usage section already has proposed text from 1147 Lada. 1149 o Issue 5: XPath 'when-stmt' reference to descendant nodes: Added 1150 exception and example in XPath Usage section for augmented nodes. 1152 o Issue 6: XPath numeric conversions: Changed 'numeric expressions' 1153 to 'numeric and boolean expressions' 1155 o Issue 7: XPath module containment: Added sub-section on XPath 1156 wildcards 1158 o Issue 8: status-stmt usage: Added text to Lifecycle Management 1159 section about transitioning from active to deprecated and then to 1160 obsolete. 1162 o Issue 9: resource identification in notifications: Add text to 1163 Notifications section about identifying resources and using the 1164 leafref data type. 1166 o Issue 10: single quoted strings: Added text to Data Types section 1167 about using a single-quoted string for patterns. 1169 Appendix B. Module Review Checklist 1171 This section is adapted from RFC 4181. 1173 The purpose of a YANG module review is to review the YANG module both 1174 for technical correctness and for adherence to IETF documentation 1175 requirements. The following checklist may be helpful when reviewing 1176 an Internet-Draft: 1178 o I-D Boilerplate -- verify that the draft contains the required 1179 Internet-Draft boilerplate (see 1180 http://www.ietf.org/id-info/guidelines.html), including the 1181 appropriate statement to permit publication as an RFC, and that 1182 I-D boilerplate does not contain references or section numbers. 1184 o Abstract -- verify that the abstract does not contain references, 1185 that it does not have a section number, and that its content 1186 follows the guidelines in 1187 http://www.ietf.org/id-info/guidelines.html. 1189 o Copyright Notice -- verify that the draft has the appropriate text 1190 regarding the rights that document contributers provide to the 1191 IETF Trust [RFC5378]. Verify that it contains the full IETF Trust 1192 copyright notice at the beginning of the document. The IETF Trust 1193 Legal Provisions (TLP) can be found at: 1195 http://trustee.ietf.org/license-info/ 1197 o Security Considerations section -- verify that the draft uses the 1198 latest approved template from the OPS area website (http:// 1199 trac.tools.ietf.org/area/ops/trac/wiki/yang-security-guidelines) 1200 and that the guidelines therein have been followed. 1202 o IANA Considerations section -- this section must always be 1203 present. For each module within the document, ensure that the 1204 IANA Considerations section contains entries for the following 1205 IANA registries: 1207 XML Namespace Registry: Register the YANG module namespace. 1209 YANG Module Registry: Register the YANG module name, prefix, 1210 namespace, and RFC number, according to the rules specified 1211 in [RFC6020]. 1213 o References -- verify that the references are properly divided 1214 between normative and informative references, that RFC 2119 is 1215 included as a normative reference if the terminology defined 1216 therein is used in the document, that all references required by 1217 the boilerplate are present, that all YANG modules containing 1218 imported items are cited as normative references, and that all 1219 citations point to the most current RFCs unless there is a valid 1220 reason to do otherwise (for example, it is OK to include an 1221 informative reference to a previous version of a specification to 1222 help explain a feature included for backward compatibility). Be 1223 sure citations for all imported modules are present somewhere in 1224 the document text (outside the YANG module). 1226 o License -- verify that the draft contains the Simplified BSD 1227 License in each YANG module or submodule. Some guidelines related 1228 to this requirement are described in Section 4.1. Make sure that 1229 the correct year is used in all copyright dates. Use the approved 1230 text from the latest Trust Legal Provisions (TLP) document, which 1231 can be found at: 1233 http://trustee.ietf.org/license-info/ 1235 o Other Issues -- check for any issues mentioned in 1236 http://www.ietf.org/id-info/checklist.html that are not covered 1237 elsewhere. 1239 o Technical Content -- review the actual technical content for 1240 compliance with the guidelines in this document. The use of a 1241 YANG module compiler is recommended when checking for syntax 1242 errors. A list of freely available tools and other information 1243 can be found at: 1245 http://trac.tools.ietf.org/wg/netconf/trac/wiki 1247 Checking for correct syntax, however, is only part of the job. 1248 It is just as important to actually read the YANG module document 1249 from the point of view of a potential implementor. It is 1250 particularly important to check that description statements are 1251 sufficiently clear and unambiguous to allow interoperable 1252 implementations to be created. 1254 Appendix C. YANG Module Template 1256 file "ietf-template@2010-05-18.yang" 1258 module ietf-template { 1260 // replace this string with a unique namespace URN value 1261 namespace 1262 "urn:ietf:params:xml:ns:yang:ietf-template"; 1264 // replace this string, and try to pick a unique prefix 1265 prefix "temp"; 1267 // import statements here: e.g., 1268 // import ietf-yang-types { prefix yang; } 1269 // import ietf-inet-types { prefix inet; } 1271 // identify the IETF working group if applicable 1272 organization 1273 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 1275 // update this contact statement with your info 1276 contact 1277 "WG Web: 1278 WG List: 1280 WG Chair: your-WG-chair 1281 1283 Editor: your-name 1284 "; 1286 // replace the first sentence in this description statement. 1287 // replace the copyright notice with the most recent 1288 // version, if it has been updated since the publication 1289 // of this document 1290 description 1291 "This module defines a template for other YANG modules. 1293 Copyright (c) IETF Trust and the persons 1294 identified as authors of the code. All rights reserved. 1296 Redistribution and use in source and binary forms, with or 1297 without modification, is permitted pursuant to, and subject 1298 to the license terms contained in, the Simplified BSD License 1299 set forth in Section 4.c of the IETF Trust's Legal Provisions 1300 Relating to IETF Documents 1301 (http://trustee.ietf.org/license-info). 1303 This version of this YANG module is part of RFC XXXX; see 1304 the RFC itself for full legal notices."; 1306 // RFC Ed.: replace XXXX with actual RFC number and remove 1307 // this note 1309 reference "RFC XXXX"; 1311 // RFC Ed.: remove this note 1312 // Note: extracted from RFC XXXX 1314 // replace '2010-05-18' with the module publication date 1315 // The format is (year-month-day) 1316 revision "2010-05-18" { 1317 description 1318 "Initial version"; 1319 } 1321 // extension statements 1323 // feature statements 1325 // identity statements 1327 // typedef statements 1329 // grouping statements 1331 // data definition statements 1333 // augment statements 1335 // rpc statements 1337 // notification statements 1339 // DO NOT put deviation statements in a published module 1341 } 1343 1345 Author's Address 1347 Andy Bierman 1348 YumaWorks 1350 Email: andy@yumaworks.com