idnits 2.17.1 draft-ietf-netmod-yang-usage-09.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 (July 12, 2010) is 5036 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2223 (Obsoleted by RFC 7322) ** Obsolete normative reference: RFC 4741 (Obsoleted by RFC 6241) ** Obsolete normative reference: RFC 5741 (Obsoleted by RFC 7841) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force A. Bierman 3 Internet-Draft InterWorking Labs 4 Intended status: Informational July 12, 2010 5 Expires: January 13, 2011 7 Guidelines for Authors and Reviewers of YANG Data Model Documents 8 draft-ietf-netmod-yang-usage-09 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 which utilize YANG 18 data model modules. 20 Status of this Memo 22 This Internet-Draft is submitted to IETF 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 January 13, 2011. 37 Copyright Notice 39 Copyright (c) 2010 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. General Documentation Guidelines . . . . . . . . . . . . . . . 7 61 3.1. Module Copyright . . . . . . . . . . . . . . . . . . . . . 7 62 3.2. Narrative Sections . . . . . . . . . . . . . . . . . . . . 8 63 3.3. Definitions Section . . . . . . . . . . . . . . . . . . . 8 64 3.4. Security Considerations Section . . . . . . . . . . . . . 8 65 3.5. IANA Considerations Section . . . . . . . . . . . . . . . 9 66 3.5.1. Documents that Create a New Name Space . . . . . . . . 9 67 3.5.2. Documents that Extend an Existing Name Space . . . . . 9 68 3.6. Reference Sections . . . . . . . . . . . . . . . . . . . . 10 69 3.7. Intellectual Property Section . . . . . . . . . . . . . . 10 70 4. YANG Usage Guidelines . . . . . . . . . . . . . . . . . . . . 11 71 4.1. Module Naming Conventions . . . . . . . . . . . . . . . . 11 72 4.2. Identifiers . . . . . . . . . . . . . . . . . . . . . . . 11 73 4.3. Defaults . . . . . . . . . . . . . . . . . . . . . . . . . 11 74 4.4. Conditional Statements . . . . . . . . . . . . . . . . . . 12 75 4.5. XPath Usage . . . . . . . . . . . . . . . . . . . . . . . 12 76 4.6. Lifecycle Management . . . . . . . . . . . . . . . . . . . 13 77 4.7. Module Header, Meta, and Revision Statements . . . . . . . 14 78 4.8. Namespace Assignments . . . . . . . . . . . . . . . . . . 15 79 4.9. Top Level Data Definitions . . . . . . . . . . . . . . . . 16 80 4.10. Data Types . . . . . . . . . . . . . . . . . . . . . . . . 16 81 4.11. Reusable Type Definitions . . . . . . . . . . . . . . . . 17 82 4.12. Data Definitions . . . . . . . . . . . . . . . . . . . . . 17 83 4.13. Operation Definitions . . . . . . . . . . . . . . . . . . 18 84 4.14. Notification Definitions . . . . . . . . . . . . . . . . . 19 85 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 86 6. Security Considerations . . . . . . . . . . . . . . . . . . . 21 87 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 22 88 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 23 89 8.1. Normative References . . . . . . . . . . . . . . . . . . . 23 90 8.2. Informative References . . . . . . . . . . . . . . . . . . 23 91 Appendix A. Module Review Checklist . . . . . . . . . . . . . . . 25 92 Appendix B. YANG Module Template . . . . . . . . . . . . . . . . 27 93 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 30 94 C.1. Changes from 08 to 09 . . . . . . . . . . . . . . . . . . 30 95 C.2. Changes from 07 to 08 . . . . . . . . . . . . . . . . . . 30 96 C.3. Changes from 06 to 07 . . . . . . . . . . . . . . . . . . 30 97 C.4. Changes from 05 to 06 . . . . . . . . . . . . . . . . . . 30 98 C.5. Changes from 04 to 05 . . . . . . . . . . . . . . . . . . 30 99 C.6. Changes from 03 to 04 . . . . . . . . . . . . . . . . . . 31 100 C.7. Changes from 02 to 03 . . . . . . . . . . . . . . . . . . 32 101 C.8. Changes from 01 to 02 . . . . . . . . . . . . . . . . . . 32 102 C.9. Changes from 00 to 01 . . . . . . . . . . . . . . . . . . 32 103 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 33 105 1. Introduction 107 The standardization of network configuration interfaces for use with 108 the Network Configuration Protocol (NETCONF) [RFC4741] requires a 109 modular set of data models, which can be reused and extended over 110 time. 112 This document defines a set of usage guidelines for standards track 113 documents containing YANG [I-D.ietf-netmod-yang] data models. YANG 114 is used to define the data structures, protocol operations, and 115 notification content used within a NETCONF server. A server which 116 supports a particular YANG module will support client NETCONF 117 operation requests, as indicated by the specific content defined in 118 the YANG module. 120 This document is similar to the SMIv2 usage guidelines specification 121 [RFC4181] in intent and structure. However, since that document was 122 written a decade after SMIv2 modules had been in use, it was 123 published as a 'best current practice' (BCP). This document is not a 124 BCP, but rather an informational reference, intended to promote 125 consistency in documents containing YANG modules. 127 Many YANG constructs are defined as optional to use, such as the 128 description statement. However, in order to maximize 129 interoperability of NETCONF implementations utilizing YANG data 130 models, it is desirable to define a set of usage guidelines which may 131 require a higher level of compliance than the minimum level defined 132 in the YANG specification. 134 In addition, YANG allows constructs such as infinite length 135 identifiers and string values, or top-level mandatory nodes, that a 136 compliant server is not required to support. Only constructs which 137 all servers are required to support can be used in IETF YANG modules. 139 This document defines usage guidelines related to the NETCONF 140 operations layer, and NETCONF content layer, as defined in [RFC4741]. 141 These guidelines are intended to be used by authors and reviewers to 142 improve the readability and interoperability of published YANG data 143 models. 145 2. Terminology 147 2.1. Requirements Notation 149 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 150 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 151 document are to be interpreted as described in [RFC2119]. 153 RFC 2119 language is used here to express the views of the NETMOD 154 working group regarding content for YANG modules. YANG modules 155 complying with this document will treat the RFC 2119 terminology as 156 if it were describing best current practices. 158 2.2. NETCONF Terms 160 The following terms are defined in [RFC4741] and are not redefined 161 here: 163 o capabilities 165 o client 167 o operation 169 o server 171 2.3. YANG Terms 173 The following terms are defined in [I-D.ietf-netmod-yang] and are not 174 redefined here: 176 o data node 178 o module 180 o namespace 182 o submodule 184 o version 186 o YANG 188 o YIN 190 Note that the term 'module' may be used as a generic term for a YANG 191 module or submodule. When describing properties which are specific 192 to submodules, the term 'submodule' is used instead. 194 2.4. Terms 196 The following terms are used throughout this document: 198 published: A stable release of a module or submodule, usually 199 contained in an RFC. 201 unpublished: An unstable release of a module or submodule, usually 202 contained in an Internet-Draft. 204 3. General Documentation Guidelines 206 YANG data model modules under review are likely to be contained in 207 Internet-Drafts. All guidelines for Internet-Draft authors MUST be 208 followed. These guidelines are defined in [RFC2223] and updated in 209 [RFC5741]. Additional information is also available online at: 211 http://www.rfc-editor.org/rfc-editor/instructions2authors.txt 213 The following sections MUST be present in an Internet-Draft 214 containing a module: 216 o Narrative sections 218 o Definitions section 220 o Security Considerations section 222 o IANA Considerations section 224 o References section 226 3.1. Module Copyright 228 The module description statement MUST contain a reference to the 229 latest approved IETF Trust Copyright statement, which is available 230 on-line at: 232 http://trustee.ietf.org/license-info/ 234 Each YANG module or submodule contained within an Internet-Draft or 235 RFC is considered to be a code component. The strings '' and '' MUST be used to identify each code 237 component. 239 The '' tag SHOULD be followed by a string identifying 240 the file name specified in section 5.2 of [I-D.ietf-netmod-yang]. 241 The following example is for the '2010-01-18' revision of the 'ietf- 242 foo' module: 244 file "ietf-foo@2010-01-18.yang" 245 module ietf-foo { 246 // ... 247 revision 2010-01-18 { 248 description "Latest revision"; 249 reference "RFC XXXXX"; 250 } 251 // ... 252 } 253 255 Figure 1 257 3.2. Narrative Sections 259 The narrative part MUST include an overview section that describes 260 the scope and field of application of the module(s) defined by the 261 specification and that specifies the relationship (if any) of these 262 modules to other standards, particularly to standards containing 263 other YANG modules. The narrative part SHOULD include one or more 264 sections to briefly describe the structure of the modules defined in 265 the specification. 267 If the module(s) defined by the specification import definitions from 268 other modules (except for those defined in the YANG 269 [I-D.ietf-netmod-yang] or YANG Types [I-D.ietf-netmod-yang-types] 270 documents), or are always implemented in conjunction with other 271 modules, then those facts MUST be noted in the overview section, as 272 MUST be noted any special interpretations of definitions in other 273 modules. 275 3.3. Definitions Section 277 This section contains the module(s) defined by the specification. 278 These modules MUST be written using the YANG syntax defined in 279 [I-D.ietf-netmod-yang]. A YIN syntax version of the module MAY also 280 be present in the document. There MAY also be other types of modules 281 present in the document, such as SMIv2, which are not affected by 282 these guidelines. 284 See Section 4 for guidelines on YANG usage. 286 3.4. Security Considerations Section 288 Each specification that defines one or more modules MUST contain a 289 section that discusses security considerations relevant to those 290 modules. This section MUST be patterned after the latest approved 291 template (available at 292 http://www.ops.ietf.org/netconf/yang-security-considerations.txt). 294 In particular: 296 o Writable data nodes that could be especially disruptive if abused 297 MUST be explicitly listed by name and the associated security 298 risks MUST be explained. 300 o Readable data nodes that contain especially sensitive information 301 or that raise significant privacy concerns MUST be explicitly 302 listed by name and the reasons for the sensitivity/privacy 303 concerns MUST be explained. 305 o Operations (i.e., YANG 'rpc' statements) which are potentially 306 harmful to system behavior or that raise significant privacy 307 concerns MUST be explicitly listed by name and the reasons for the 308 sensitivity/privacy concerns MUST be explained. 310 3.5. IANA Considerations Section 312 In order to comply with IESG policy as set forth in 313 http://www.ietf.org/ID-Checklist.html, every Internet-Draft that is 314 submitted to the IESG for publication which has action items for IANA 315 MUST contain an IANA Considerations section. The requirements for 316 this section vary depending what actions are required of the IANA. 317 If there are no IANA considerations applicable to the document, then 318 the IANA Considerations section is not required. Refer to the 319 guidelines in [RFC5226] for more details. 321 3.5.1. Documents that Create a New Name Space 323 If an Internet-Draft defines a new name space that is to be 324 administered by the IANA, then the document MUST include an IANA 325 Considerations section, that specifies how the name space is to be 326 administered. 328 Specifically, if any YANG module namespace statement value contained 329 in the document is not already registered with IANA, then a new YANG 330 Namespace registry entry MUST be requested from the IANA. The YANG 331 [I-D.ietf-netmod-yang] specification includes the procedure for this 332 purpose in its IANA Considerations section. 334 3.5.2. Documents that Extend an Existing Name Space 336 It is possible to extend an existing namespace using a YANG submodule 337 which belongs to an existing module already administered by IANA. In 338 this case, the document containing the main module MUST be updated to 339 use the latest revision of the submodule. 341 3.6. Reference Sections 343 For every import or include statement which appears in a module 344 contained in the specification, which identifies a module in a 345 separate document, a corresponding normative reference to that 346 document MUST appear in the Normative References section. The 347 reference MUST correspond to the specific module version actually 348 used within the specification. 350 For every normative reference statement which appears in a module 351 contained in the specification, which identifies a separate document, 352 a corresponding normative reference to that document SHOULD appear in 353 the Normative References section. The reference SHOULD correspond to 354 the specific document version actually used within the specification. 355 If the reference statement identifies an informative reference, which 356 identifies a separate document, a corresponding informative reference 357 to that document MAY appear in the Informative References section. 359 3.7. Intellectual Property Section 361 The proper IPR statements MUST be present in the document, according 362 to the most current Internet-Draft boilerplate. Refer to the IETF 363 Trust Legal Provision for the exact legal text that needs to be 364 included. 366 4. YANG Usage Guidelines 368 In general, modules in IETF standards-track specifications MUST 369 comply with all syntactic and semantic requirements of YANG. 370 [I-D.ietf-netmod-yang]. The guidelines in this section are intended 371 to supplement the YANG specification, which is intended to define a 372 minimum set of conformance requirements. 374 In order to promote interoperability and establish a set of practices 375 based on previous experience, the following sections establish usage 376 guidelines for specific YANG constructs. 378 Only guidelines which clarify or restrict the minimum conformance 379 requirements are included here. 381 4.1. Module Naming Conventions 383 Modules contained in standards track documents SHOULD be named 384 according to the guidelines in the IANA considerations section of 385 [I-D.ietf-netmod-yang]. 387 A distinctive word or acronym (e.g., protocol name or working group 388 acronym) SHOULD be used in the module name. If new definitions are 389 being defined to extend one or more existing modules, then the same 390 word or acronym should be reused, instead of creating a new one. 392 All published module names MUST be unique. For a YANG module 393 published in an RFC, this uniqueness is guaranteed by IANA. For 394 unpublished modules, the authors need to check that no other work in 395 progress is using the same module name. 397 Once a module name is published, it MUST NOT be reused, even if the 398 RFC containing the module is reclassified to 'Historic' status. 400 4.2. Identifiers 402 Identifiers for all YANG identifiers in published modules MUST be 403 between 1 and 64 characters in length. These include any construct 404 specified as an 'identifier-arg-str' token in the ABNF in section 12 405 of [I-D.ietf-netmod-yang]. 407 4.3. Defaults 409 In general, it is suggested that sub-statements containing very 410 common default values SHOULD NOT be present. The following sub- 411 statements are commonly used with the default value, which would make 412 the module difficult to read if used everywhere they are allowed. 414 +---------------+---------------+ 415 | Statement | Default Value | 416 +---------------+---------------+ 417 | config | true | 418 | | | 419 | mandatory | false | 420 | | | 421 | max-elements | unbounded | 422 | | | 423 | min-elements | 0 | 424 | | | 425 | ordered-by | system | 426 | | | 427 | status | current | 428 | | | 429 | yin-element | false | 430 +---------------+---------------+ 432 4.4. Conditional Statements 434 A module may be conceptually partitioned in several ways, using the 435 'if-feature' and/or 'when' statements. 437 Data model designers need to carefully consider all modularity 438 aspects, including the use of YANG conditional statements. 440 If a data definition is optional, depending on server support for a 441 NETCONF protocol capability, then a YANG 'feature' statement SHOULD 442 be defined to indicate that the NETCONF capability is supported 443 within the data model. 445 4.5. XPath Usage 447 This section describes guidelines for using the XML Path Language 448 [W3C.REC-xpath-19991116] (XPath) within YANG modules. 450 The 'attribute' and 'namespace' axes are not supported in YANG, and 451 MAY be empty in a NETCONF server implementation. 453 The 'position' and 'last' functions MAY be used with caution. A 454 server is not required to maintain any particular XML document order 455 for system-ordered data nodes. A server is only required to maintain 456 the relative XML document order of all instances of a particular 457 user-ordered list or leaf-list. 459 The 'preceding', and 'following' axes SHOULD NOT be used. These 460 constructs rely on XML document order within a NETCONF server 461 configuration database, which may not be supported consistently or 462 produce reliable results across implementations. Predicate 463 expressions based on static node properties (e.g., element name or 464 value, 'ancestor' or 'descendant' axes) SHOULD be used instead. 466 The 'preceding-sibling' and 'following-sibling' axes MAY be used, 467 with caution. A server is not required to maintain a persistent or 468 deterministic XML document order, which will affect use of these 469 axes. 471 Implicit 'position' function calls within predicates MAY be used with 472 caution. (e.g., '//chapter[42]'). Note that a NETCONF server is only 473 required to maintain relative document order for related instances of 474 a user-ordered list or leaf-list data definition (i.e., 'ordered-by' 475 statement set to 'user'). 477 Data nodes which use the 'int64' and 'uint64' built-in type MAY be 478 used with caution, within 'RelationalExpr' expressions. There are 479 boundary conditions in which the translation from the YANG 64-bit 480 type to an XPath number can cause incorrect results. Specifically, 481 an XPath 'double' precision floating point number cannot represent 482 very large positive or negative 64-bit numbers because it only 483 provides a total precision of 53 bits. 485 Data modelers need to be careful not to confuse the YANG value space 486 and the XPath value space. The data types are not the same in both, 487 and conversion between YANG and XPath data types SHOULD be considered 488 carefully. 490 Explicit XPath data type conversions MAY be used (e.g., 'string', 491 'boolean', or 'number' functions), instead of implicit XPath data 492 type conversions. 494 4.6. Lifecycle Management 496 The status statement MUST be present if its value is 'deprecated' or 497 'obsolete'. 499 The module or submodule name MUST NOT be changed, once the document 500 containing the module or submodule is published. 502 The module namespace URI value MUST NOT be changed, once the document 503 containing the module is published. 505 The revision-date sub-statement within the imports statement SHOULD 506 be present if any groupings are used from the external module. 508 The revision-date sub-statement within the include statement SHOULD 509 be present if any groupings are used from the external sub-module. 511 If submodules are used, then the document containing the main module 512 MUST be updated so that the main module revision date is equal or 513 more recent than the revision date of any submodule which is 514 (directly or indirectly) included by the main module. 516 4.7. Module Header, Meta, and Revision Statements 518 For published modules, the namespace MUST be a globally unique URI, 519 as defined in [RFC3986]. This value is usually assigned by the IANA. 521 The organization statement MUST be present. If the module is 522 contained in a document intended for standards-track status, then the 523 organization SHOULD be the IETF working group chartered to write the 524 document. 526 The contact statement MUST be present. If the module is contained in 527 a document intended for standards-track status, then the working 528 group WEB and mailing information MUST be present, and the main 529 document author or editor contact information SHOULD be present. If 530 additional authors or editors exist, their contact information MAY be 531 present. In addition, the Area Director and other contact 532 information MAY be present. 534 The description statement MUST be present. The appropriate IETF 535 Trust Copyright text MUST be present, as described in Section 3.1. 537 If the module relies on information contained in other documents, 538 which are not the same documents implied by the import statements 539 present in the module, then these documents MUST be identified in the 540 reference statement. 542 A revision statement MUST be present for each published version of 543 the module. The revision statement MUST have a reference 544 substatement. It MUST identify the published document which contains 545 the module. Modules are often extracted from their original 546 documents and it is useful for developers and operators to know how 547 to find the original source document in a consistent manner. The 548 revision statement MAY have a description substatement. 550 Each new revision MUST include a revision date which is higher than 551 any other revision date in the module. 553 It is acceptable to reuse the same revision statement within 554 unpublished versions (i.e., Internet-Drafts), but the revision date 555 MUST be updated to a higher value each time the Internet-Draft is re- 556 published. 558 4.8. Namespace Assignments 560 It is RECOMMENDED that only valid YANG modules are included in 561 documents, whether they are published yet or not. This allows: 563 o the module to compile correctly instead of generating disruptive 564 fatal errors. 566 o early implementors to use the modules without picking a random 567 value for the XML namespace. 569 o early interoperability testing since independent implementations 570 will use the same XML namespace value. 572 Until a URI is assigned by the IANA, a proposed namespace URI MUST be 573 provided for the namespace statement in a YANG module. A value 574 SHOULD be selected which is not likely to collide with other YANG 575 namespaces. Standard module names, prefixes, and URI strings already 576 listed in the YANG Module Registry MUST NOT be used. 578 A standard namespace statement value SHOULD have the following form: 580 : 582 The following URN prefix string SHOULD be used for published and 583 unpublished YANG modules: 585 urn:ietf:params:xml:ns:yang: 587 The following example URNs would be valid temporary namespace 588 statement values for standards-track modules: 590 urn:ietf:params:xml:ns:yang:ietf-netconf-partial-lock 592 urn:ietf:params:xml:ns:yang:ietf-netconf-state 594 urn:ietf:params:xml:ns:yang:ietf-netconf 596 Note that a different URN prefix string SHOULD be used for non- 597 standards track modules. The string SHOULD be selected according to 598 the guidelines in [I-D.ietf-netmod-yang]. 600 The following examples of non-standards track modules are only 601 suggestions. There are no guidelines for this type of URN in this 602 document: 604 http://example.com/ns/example-interfaces 605 http://example.com/ns/example-system 607 4.9. Top Level Data Definitions 609 There SHOULD only be one top-level data node defined in each YANG 610 module, if any data nodes are defined at all. 612 The top-level data organization SHOULD be considered carefully, in 613 advance. Data model designers need to consider how the functionality 614 for a given protocol or protocol family will grow over time. 616 The names and data organization SHOULD reflect persistent 617 information, such as the name of a protocol. The name of the working 618 group SHOULD NOT be used because this may change over time. 620 A mandatory database data definition is defined as a node that a 621 client must provide for the database to be valid. The server is not 622 required to provide a value. 624 Top-level database data definitions MUST NOT be mandatory. If a 625 mandatory node appears at the top-level, it will immediately cause 626 the database to be invalid. This can occur when the server boots or 627 when a module is loaded dynamically at runtime. 629 4.10. Data Types 631 Selection of an appropriate data type (i.e., built-in type, existing 632 derived type, or new derived type) is very subjective and therefore 633 few requirements can be specified on that subject. 635 Data model designers SHOULD use the most appropriate built-in data 636 type for the particular application. 638 If extensibility of enumerated values is required, then the 639 'identityref' data type SHOULD be used instead of an enumeration or 640 other built-in type. 642 For string data types, if a machine-readable pattern can be defined 643 for the desired semantics, then one or more pattern statements SHOULD 644 be present. 646 For string data types, if the length of the string is required to be 647 bounded in all implementations, then a length statement MUST be 648 present. 650 For numeric data types, if the values allowed by the intended 651 semantics are different than those allowed by the unbounded intrinsic 652 data type (e.g., 'int32'), then a range statement SHOULD be present. 654 The signed numeric data types (i.e., 'int8', 'int16', 'int32', and 655 'int64') SHOULD NOT be used unless negative values are allowed for 656 the desired semantics. 658 For 'enumeration' or 'bits' data types, the semantics for each 'enum' 659 or 'bit' SHOULD be documented. A separate description statement 660 (within each 'enum' or 'bit' statement) SHOULD be present. 662 4.11. Reusable Type Definitions 664 If an appropriate derived type exists in any standard module, such as 665 [I-D.ietf-netmod-yang-types], then it SHOULD be used instead of 666 defining a new derived type. 668 If an appropriate units identifier can be associated with the desired 669 semantics, then a units statement SHOULD be present. 671 If an appropriate default value can be associated with the desired 672 semantics, then a default statement SHOULD be present. 674 If a significant number of derived types are defined, and it is 675 anticipated that these data types will be reused by multiple modules, 676 then these derived types SHOULD be contained in a separate module or 677 submodule, to allow easier reuse without unnecessary coupling. 679 The description statement MUST be present. 681 If the type definition semantics are defined in an external document 682 (other than another YANG module indicated by an import statement), 683 then the reference statement MUST be present. 685 4.12. Data Definitions 687 The description statement MUST be present in the following YANG 688 statements: 690 o anyxml 692 o augment 694 o choice 696 o container 698 o extension 700 o feature 701 o grouping 703 o identity 705 o leaf 707 o leaf-list 709 o list 711 o notification 713 o rpc 715 o typedef 717 If the data definition semantics are defined in an external document, 718 (other than another YANG module indicated by an import statement), 719 then a reference statement MUST be present. 721 The 'anyxml' construct MAY be used with caution within configuration 722 data. This may be useful to represent an HTML banner containing 723 markup elements, such as and . However, this construct 724 SHOULD NOT be used if other YANG data node types can be used instead 725 to represent the desired syntax and semantics. 727 If there are referential integrity constraints associated with the 728 desired semantics that can be represented with XPath, then one or 729 more must statements SHOULD be present. 731 For list and leaf-list data definitions, if the number of possible 732 instances is required to be bounded for all implementations, then the 733 max-elements statements SHOULD be present. 735 If any must or when statements are used within the data definition, 736 then the data definition description statement SHOULD describe the 737 purpose of each one. 739 4.13. Operation Definitions 741 If the operation semantics are defined in an external document (other 742 than another YANG module indicated by an import statement), then a 743 reference statement MUST be present. 745 If the operation impacts system behavior in some way, it SHOULD be 746 mentioned in the description statement. 748 If the operation is potentially harmful to system behavior in some 749 way, it MUST be mentioned in the Security Considerations section of 750 the document. 752 4.14. Notification Definitions 754 The description statement MUST be present. 756 If the notification semantics are defined in an external document 757 (other than another YANG module indicated by an import statement), 758 then a reference statement MUST be present. 760 5. IANA Considerations 762 This document registers one URI in the IETF XML registry [RFC3688]. 763 The following registration is requested: 765 URI: urn:ietf:params:xml:ns:yang:ietf-template 767 Registrant Contact: The NETMOD WG of the IETF. 769 XML: N/A, the requested URI is an XML namespace. 771 This document requests the following assignment in the YANG Module 772 Names Registry for the YANG module template in Appendix B. 774 +---------------+-------------------------------------------+ 775 | Field | Value | 776 +---------------+-------------------------------------------+ 777 | name | ietf-template | 778 | | | 779 | namespace | urn:ietf:params:xml:ns:yang:ietf-template | 780 | | | 781 | prefix | temp | 782 | | | 783 | reference | RFCXXXX | 784 +---------------+-------------------------------------------+ 786 6. Security Considerations 788 This document defines documentation guidelines for NETCONF content 789 defined with the YANG data modeling language. The guidelines for how 790 to write a Security Considerations section for a YANG module are 791 defined in the online document 793 http://www.ops.ietf.org/netconf/yang-security-considerations.txt 795 This document does not introduce any new or increased security risks 796 into the management system. 798 7. Acknowledgments 800 The structure and contents of this document are adapted from 801 Guidelines for MIB Documents [RFC4181], by C. M. Heard. 803 The working group thanks Martin Bjorklund and Juergen Schoenwaelder 804 for their extensive reviews and contributions to this document. 806 8. References 808 8.1. Normative References 810 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 811 Requirement Levels", BCP 14, RFC 2119, March 1997. 813 [RFC2223] Postel, J. and J. Reynolds, "Instructions to RFC Authors", 814 RFC 2223, October 1997. 816 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 817 January 2004. 819 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 820 Resource Identifier (URI): Generic Syntax", STD 66, 821 RFC 3986, January 2005. 823 [RFC4741] Enns, R., "NETCONF Configuration Protocol", RFC 4741, 824 December 2006. 826 [RFC5378] Bradner, S. and J. Contreras, "Rights Contributors Provide 827 to the IETF Trust", BCP 78, RFC 5378, November 2008. 829 [RFC5741] Daigle, L., Kolkman, O., and IAB, "RFC Streams, Headers, 830 and Boilerplates", RFC 5741, December 2009. 832 [W3C.REC-xpath-19991116] 833 DeRose, S. and J. Clark, "XML Path Language (XPath) 834 Version 1.0", World Wide Web Consortium 835 Recommendation REC-xpath-19991116, November 1999, 836 . 838 [I-D.ietf-netmod-yang] 839 Bjorklund, M., "YANG - A data modeling language for the 840 Network Configuration Protocol (NETCONF)", 841 draft-ietf-netmod-yang-13 (work in progress), June 2010. 843 [I-D.ietf-netmod-yang-types] 844 Schoenwaelder, J., "Common YANG Data Types", 845 draft-ietf-netmod-yang-types-09 (work in progress), 846 April 2010. 848 8.2. Informative References 850 [RFC4181] Heard, C., "Guidelines for Authors and Reviewers of MIB 851 Documents", BCP 111, RFC 4181, September 2005. 853 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 854 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 855 May 2008. 857 Appendix A. Module Review Checklist 859 This section is adapted from RFC 4181. 861 The purpose of a YANG module review is to review the YANG module both 862 for technical correctness and for adherence to IETF documentation 863 requirements. The following checklist may be helpful when reviewing 864 a draft document: 866 1. I-D Boilerplate -- verify that the draft contains the required 867 Internet-Draft boilerplate (see 868 http://www.ietf.org/ietf/1id-guidelines.txt), including the 869 appropriate statement to permit publication as an RFC, and that 870 I-D boilerplate does not contain references or section numbers. 872 2. Abstract -- verify that the abstract does not contain references, 873 that it does not have a section number, and that its content 874 follows the guidelines in 875 http://www.ietf.org/ietf/1id-guidelines.txt. 877 3. IETF Trust Copyright -- verify that the draft has the appropriate 878 text regarding the rights that document contributers provide to 879 the IETF Trust [RFC5378]. Some guidelines related to this 880 requirement are described in Section 3.1. The IETF Trust license 881 policy (TLP) can be found at: 883 http://trustee.ietf.org/docs/IETF-Trust-License-Policy.pdf 885 4. Security Considerations Section -- verify that the draft uses the 886 latest approved template from the OPS area web site (http:// 887 www.ops.ietf.org/netconf/yang-security-considerations.txt) and 888 that the guidelines therein have been followed. 890 5. IANA Considerations Section -- this section must always be 891 present. For each module within the document, ensure that the 892 IANA Considerations section contains entries for the following 893 IANA registries: 895 XML Namespace Registry: Register the YANG module namespace. 897 YANG Module Registry: Register the YANG module name, prefix, 898 namespace, and RFC number, according to the rules specified in 899 [I-D.ietf-netmod-yang]. 901 6. References -- verify that the references are properly divided 902 between normative and informative references, that RFC 2119 is 903 included as a normative reference if the terminology defined 904 therein is used in the document, that all references required by 905 the boilerplate are present, that all YANG modules containing 906 imported items are cited as normative references, and that all 907 citations point to the most current RFCs unless there is a valid 908 reason to do otherwise (for example, it is OK to include an 909 informative reference to a previous version of a specification to 910 help explain a feature included for backward compatibility). Be 911 sure citations for all imported modules are present somewhere in 912 the document text (outside the YANG module). 914 7. Copyright Notices -- verify that the draft contains an 915 abbreviated IETF Trust copyright notice in the description 916 statement of each YANG module or sub-module, and that it contains 917 the full IETF Trust copyright notice at the end of the document. 918 Make sure that the correct year is used in all copyright dates. 919 Use the approved text from the latest Trust Legal Provisions 920 (TLP) document, which can be found at: 922 http://trustee.ietf.org/license-info/ 924 8. Other Issues -- check for any issues mentioned in 925 http://www.ietf.org/ID-Checklist.html that are not covered 926 elsewhere. 928 9. Technical Content -- review the actual technical content for 929 compliance with the guidelines in this document. The use of a 930 YANG module compiler is recommended when checking for syntax 931 errors. A list of freely available tools and other information 932 can be found at: 934 http://trac.tools.ietf.org/wg/netconf/trac/wiki 936 Checking for correct syntax, however, is only part of the job. 937 It is just as important to actually read the YANG module document 938 from the point of view of a potential implementor. It is 939 particularly important to check that description statements are 940 sufficiently clear and unambiguous to allow interoperable 941 implementations to be created. 943 Appendix B. YANG Module Template 945 file "ietf-template@2010-05-18.yang" 947 module ietf-template { 949 // replace this string with a unique namespace URN value 950 namespace 951 "urn:ietf:params:xml:ns:yang:ietf-template"; 953 // replace this string, and try to pick a unique prefix 954 prefix "temp"; 956 // import statements here: e.g., 957 // import ietf-yang-types { prefix yang; } 958 // import ietf-inet-types { prefix inet; } 960 // identify the IETF working group if applicable 961 organization 962 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 964 // update this contact statement with your info 965 contact 966 "WG Web: 967 WG List: 969 WG Chair: your-WG-chair 970 972 Editor: your-name 973 "; 975 // replace the first sentence in this description statement. 976 // replace the copyright notice with the most recent 977 // version, if it has been updated since the publication 978 // of this document 979 description 980 "This module defines a template for other YANG modules. 982 Copyright (c) 2010 IETF Trust and the persons identified as 983 the document authors. All rights reserved. 985 Redistribution and use in source and binary forms, with or 986 without modification, is permitted pursuant to, and subject 987 to the license terms contained in, the Simplified BSD License 988 set forth in Section 4.c of the IETF Trust's Legal Provisions 989 Relating to IETF Documents 990 (http://trustee.ietf.org/license-info). 992 This version of this YANG module is part of RFC XXXX; see 993 the RFC itself for full legal notices."; 995 // RFC Ed.: replace XXXX with actual RFC number and remove this note 997 reference "RFC XXXX"; 999 // RFC Ed.: remove this note 1000 // Note: extracted from draft-ietf-netmod-yang-usage-04.txt 1002 // replace '2010-05-18' with the module publication date 1003 // The format is (year-month-day) 1004 revision "2010-05-18" { 1005 description 1006 "Initial version"; 1007 } 1009 // extension statements 1011 // feature statements 1013 // identity statements 1015 // typedef statements 1017 // grouping statements 1019 // data definition statements 1021 // augment statements 1023 // rpc statements 1025 // notification statements 1027 // DO NOT put deviation statements in a published module 1029 } 1031 1032 Figure 2 1034 Appendix C. Change Log 1036 C.1. Changes from 08 to 09 1038 o Clarifications and corrections to address Gen-ART review comments. 1040 C.2. Changes from 07 to 08 1042 o Corrected YANG security considerations URL. 1044 o Expanded 'CODE BEGINS' example. 1046 o Added RPC operations to the security considerations guidelines 1047 section. 1049 o Removed guideline about leading and trailing whitespace. 1051 C.3. Changes from 06 to 07 1053 o Corrected title change bug; supposed to be page header instead. 1055 o Fixed typos added to last revision. 1057 o Added sentence to checklist to make sure text outside module 1058 contains citations for imports. 1060 C.4. Changes from 05 to 06 1062 o Several clarifications and corrections, based on the AD review by 1063 Dan Romascanu. 1065 C.5. Changes from 04 to 05 1067 o Changed 'object' terminology to 'data definition'. 1069 o Put XPath guidelines in separate section. 1071 o Clarified XPath usage for XML document order dependencies. 1073 o Updated guidelines to current conventions. 1075 o Added informative reference for IANA considerations guidelines and 1076 XML registry. 1078 o Updated IANA Considerations section to reserve the ietf-template 1079 module in the YANG Module Name Registry so it cannot be reused 1080 accidently. 1082 o Many other clarifications and fixed typos found in WGLC reviews. 1084 C.6. Changes from 03 to 04 1086 o Removed figure 1 to reduce duplication, just refer to 4741bis 1087 draft. 1089 o Fixed bugs and typos found in WGLC reviews. 1091 o Removed some guidelines and referring to YANG draft instead of 1092 duplicating YANG rules here. 1094 o Changed security guidelines so they refer to the IETF Trust TLP 1095 instead of MIB-specific references. 1097 o Change temporary namespace guidelines so the DRAFT-XX and RFC-nnnn 1098 suffix strings are not used. 1100 o Changed some MIB boilerplate so it refers to YANG boilerplate 1101 instead. 1103 o Introduced dangling URL reference to online YANG security 1104 guidelines 1106 http://www.ops.ietf.org/yang-security.html 1108 [ed.: Text from Bert Wijnen will be completed soon and posted 1109 online, and then this URL will be finalized.] 1111 o Moved reference for identifying the source document inside the 1112 each revision statement. 1114 o Removed guideline about valid XPath since YANG already requires 1115 valid XPath. 1117 o Added guideline that strings should not rely on preservation of 1118 leading and trailing whitespace characters. 1120 o Relaxed some XPath and anyxml guidelines from SHOULD NOT or MUST 1121 NOT to MAY use with caution. 1123 o Updated the TLP text within the example module again. 1125 o Reversed order of change log so most recent entries are first. 1127 C.7. Changes from 02 to 03 1129 o Updated figure 1 to align with 4741bis draft. 1131 o Updated guidelines for import-by-revision and include-by-revision. 1133 o Added file name to code begins convention in ietf-template module. 1135 C.8. Changes from 01 to 02 1137 o Updated figure 1 per mailing list comments. 1139 o Updated suggested organization to include the working group name. 1141 o Updated ietf-template.yang to use new organization statement 1142 value. 1144 o Updated Code Component requirements as per new TLP. 1146 o Updated ietf-template.yang to use new Code Component begin and end 1147 markers. 1149 o Updated references to the TLP in a couple sections. 1151 o Change manager/agent terminology to client/server. 1153 C.9. Changes from 00 to 01 1155 o Added transport 'TLS' to figure 1. 1157 o Added note about RFC 2119 terminology. 1159 o Corrected URL for instructions to authors. 1161 o Updated namespace procedures section. 1163 o Updated guidelines on module contact, reference, and organization 1164 statements. 1166 o Added note on use of preceding-sibling and following-sibling axes 1167 in XPath expressions. 1169 o Added section on temporary namespace statement values. 1171 o Added section on top level database objects. 1173 o Added ietf-template.yang appendix. 1175 Author's Address 1177 Andy Bierman 1178 InterWorking Labs 1180 Email: andyb@iwl.com