idnits 2.17.1 draft-lengyel-netmod-yang-instance-data-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 427 has weird spacing: '... { type strin...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (October 19, 2018) is 2015 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'I-D.ietf-netmod-yang-data-ext' is defined on line 456, but no explicit reference was found in the text == Outdated reference: A later version (-05) exists of draft-ietf-netmod-yang-data-ext-01 == Outdated reference: A later version (-09) exists of draft-ietf-ccamp-alarm-module-04 == Outdated reference: A later version (-25) exists of draft-ietf-netconf-yang-push-19 Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Netconf B. Lengyel 3 Internet-Draft Ericsson 4 Intended status: Standards Track B. Claise 5 Expires: April 22, 2019 Cisco Systems, Inc. 6 October 19, 2018 8 YANG Based Instance Data Files Format 9 draft-lengyel-netmod-yang-instance-data-05 11 Abstract 13 There is a need to document data defined in YANG models without the 14 need to fetch it from a live YANG server. Data is often needed 15 already in design time or needed by groups that do not have a live 16 running YANG server available. This document specifies a standard 17 file format for YANG Based Instance data, that is data that could be 18 stored in a datastore and whose syntax and semantics is defined by 19 YANG models. Most important use cases foreseen include documenting 20 server capabilities, factory-default settings, or vendor provided 21 default configurations. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at https://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on April 22, 2019. 40 Copyright Notice 42 Copyright (c) 2018 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (https://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 58 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 3 60 2.1.1. Use Case 1: Early Documentation of Server Capabilites 3 61 2.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 4 62 2.1.3. Use Case 3: Dcoumenting Factory Default Settings . . 4 63 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 5 64 4. Data Life cycle . . . . . . . . . . . . . . . . . . . . . . . 8 65 5. Delivery of Instance Data . . . . . . . . . . . . . . . . . . 9 66 6. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 9 67 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11 68 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 69 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 70 9.1. Normative References . . . . . . . . . . . . . . . . . . 11 71 9.2. Informative References . . . . . . . . . . . . . . . . . 11 72 Appendix A. Open Issues . . . . . . . . . . . . . . . . . . . . 12 73 Appendix B. Changes between revisions . . . . . . . . . . . . . 13 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 76 1. Terminology 78 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 79 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 80 "OPTIONAL" in this document are to be interpreted as described in BCP 81 14 RFC 2119 [RFC2119] RFC 8174 [RFC8174] when, and only when, they 82 appear in all capitals, as shown here. 84 Design time: A time during which a YANG model and the implementation 85 behind it is created. Sometimes in other documents this period is 86 divided into design and implementation time. 88 Instance Data Set: A named set of data items that can be used as 89 instance data in a YANG data tree. 91 Instance Data File: A file containing an instance data set formatted 92 according to the rules described in this document. 94 Target YANG Module: A YANG module for which the instance data set 95 contains instance data, like ietf-yang-library in the examples. 97 2. Introduction 99 There is a need to provide instance data defined in YANG models 100 without the need to fetch it from a live YANG server. Data is often 101 needed already in design time before the YANG server is implemented 102 or needed by groups that do not have a live running YANG server 103 available. To facilitate this off-line delivery of data this 104 document specifies a standard file format for YANG Based Instance 105 data, that is data that could be stored in a datastore and whose 106 syntax and semantics is defined by YANG models. 108 2.1. Use Cases 110 We present a number of use cases were Yang based instance data is 111 needed. 113 2.1.1. Use Case 1: Early Documentation of Server Capabilites 115 A YANG server has a number of server-capabilities that are defined in 116 YANG modules and can be retrieved from the server using protocols 117 like NETCONF or RESTCONF. YANG server capabilities include 119 o data defined in ietf-yang-library: YANG modules, submodules, 120 features, deviations, schema-mounts, datastores supported 121 ([I-D.ietf-netconf-rfc7895bis]) 123 o alarms supported ([I-D.ietf-ccamp-alarm-module]) 125 o data nodes, subtrees that support or do not support on-change 126 notifications ([I-D.ietf-netconf-yang-push]) 128 o netconf-capabilities in ietf-netconf-monitoring 130 While it is good practice to allow a client to query these 131 capabilites from the live YANG server, that is often not enough. 133 Often when a network node is released an associated NMS (network 134 management system) is also released with it. The NMS depends on the 135 capabilities of the YANG server. During NMS implementation 136 information about server capabilities is needed. If the information 137 is not available early in some off-line document, but only as 138 instance data from the live network node, the NMS implementation will 139 be delayed, because it has to wait for the network node to be ready. 140 Also assuming that all NMS implementors will have a correctly 141 configured network node available to retrieve data from, is a very 142 expensive proposition. (An NMS may handle dozens of node types.) 143 Network operators often build their own home-grown NMS systems that 144 needs to be integrated with a vendor's network node. The operator 145 needs to know the network node's server capabilities in order to do 146 this. Moreover the network operator's decision to buy a vendor's 147 product may even be influenced by the network node's OAM feature set 148 documented as the Yang server's capabilites. 150 Beside NMS implementors, system integrators and many others also need 151 the same information early. Examples could be model driven testing, 152 generating documentation, etc. 154 Most server-capabilities are relatively stable and change only during 155 upgrade or due to licensing or addition or removal of HW. They are 156 usually defined by a vendor in design time, before the product is 157 released. It feasible and advantageous to define/document them early 158 e.g. in a Yang Based Instance Data File. 160 It is anticipated that a separate IETF document will define in detail 161 how and which set of server capabilites should be documented. 163 2.1.2. Use Case 2: Preloading Data 165 There are parts of the configuration that must be fully configurable 166 by the operator, however for which often a simple default 167 configuration will be sufficient. 169 One example is access control groups/roles and related rules. While 170 a sophisticated operator may define dozens of different groups often 171 a basic (read-only operator, read-write system administrator, 172 security-administrator) triplet will be enough. Vendors will often 173 provide such default configuration data to make device configuration 174 easier for an operator. 176 Defining Access control data is a complex task. To help the device 177 vendor pre-defines a set of default groups (/nacm:nacm/groups) and 178 rules for these groups to access specific parts of common models 179 (/nacm:nacm/rule-list/rule). 181 YANG Based Instance data files are used to document and/or preload 182 the default configurationp. 184 2.1.3. Use Case 3: Dcoumenting Factory Default Settings 186 Nearly every YANG server has a factory default configuration. If the 187 system is really badly misconfigured or if the current configuration 188 is to be abandoned the system can be reset to this default. 190 In Netconf the operation can already be used to do 191 this for the startup configuration. There are ongoing efforts to 192 introduce a new, more generic reset operation for the same purpose 193 [I-D.wu-netconf-restconf-factory-restore] 195 The operator currently has no way to know what the default 196 configuration actually contains. YANG Based Instance data can be 197 used to document the factory default configuration. 199 3. Instance Data File Format 201 Two standard formats to represent YANG Based Instance Data are 202 specified based on the XML and JSON encoding. The XML format is 203 based on [RFC7950] while the JSON format is based on [RFC7951]. 204 Later as other YANG encodings (e.g. CBOR) are defined further 205 Instance Data formats may be specified. 207 For both formats data is placed in a top level auxiliary container 208 named "instance-data-set". The purpose of the container, which is 209 not part of the real data itself, is to carry meta-data for the 210 complete instance-data-set. 212 The XML format SHALL follow the format returned for a NETCONF GET 213 operation. The anydata (which is not part of the real data 214 itself) SHALL contain all data that would be inside the 215 wrapper element of a reply to the operation. XML attributes 216 SHOULD NOT be present, however if a SW receiving a YANG Based 217 Instance data file encounters XML attributes unknown to it, it MUST 218 ignore them, allowing them to be used later for other purposes. 220 The JSON format SHALL follow the format of the reply returmed for a 221 RESTCONF GET request directed at the datastore resource: 222 {+restconf}/data. ETags and Timestamps SHOULD NOT be included, but 223 if present SHOULD be ignored. 225 A YANG Based Instance data file MUST contain a single instance data 226 set. Instance data MUST conform to the corresponding target YANG 227 Modules and follow the XML/JSON encoding rules as defined in 228 [RFC7950] and [RFC7951] and use UTF-8 character encoding. A single 229 instance data set MAY contain data for any number of target YANG 230 modules, if needed it MAY carry the complete configuraton and state 231 data set for a YANG server. Default values SHOULD NOT but MAY be 232 included. Config=true and config=false data MAY be mixed in the 233 instance data file. Instance data files MAY contain partial data 234 sets. This means mandatory, min-elements or require-instance=true 235 constrains MAY be violated. 237 The name of the file SHOULD be of the form: 239 instance-data-set-name ['@' revision-date] ( '.yid' ) 241 E.g. acme-router-modules@2018-01-25.yid 243 The revision date is optional. It SHOULD NOT be used if the file is 244 stored in a version control system (e.g. git) because the change of 245 file names will break the connection between the different revisions 246 of the file. 248 Meta data, information about the data set itself SHALL be included in 249 the instance data set. This data will be children of the top level 250 instance-data-set container as defined in the ietf-instance-data YANG 251 module. Meta data SHALL include: 253 o Name of the instance data set 255 Meta data SHOULD include: 257 o Revision date of the instance data set 259 o Description of the instance data set. The description SHOULD 260 contain information whether and how the data can change during the 261 lifetime of the YANG server. 263 264 266 acme-router-modules 267 2108-01-25 268 Defines the minimal set of modules that any acme-router 269 will contain. These modules will always be present. 270 info@acme.com 271 272 273 274 basic 275 276 ietf-system 277 2014-08-06 278 279 urn:ietf:params:xml:ns:yang:ietf-system 280 authentication 281 radius-authentication 282 283 284 285 286 288 Figure 1: XML Instance Data File example 290 { 291 "ietf-yang-instance-data:instance-data-set": { 292 "name": "acme-router-modules", 293 "revision": "2108-01-25", 294 "contact": "info@acme.com", 295 "description": 296 "Defines the set of modules that an acme-router will contain.", 297 "data": { 298 "ietf-yang-library:yang-library": { 299 "module-set": [ 300 "name": "basic", 301 "module": [ 302 { 303 "name": "ietf-system", 304 "revision": "2014-08-06", 305 "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", 306 "feature": ["authentication", "radius-authentication"] 307 } 308 } 309 ] 310 ] 311 } 312 } 313 } 315 Figure 2: JSON Instance Data File example 317 4. Data Life cycle 319 Data defined or documented in YANG Based Instance Data Sets may be 320 used for preloading a YANG server with this data, but the server may 321 populate the data without using the actual file in which case the 322 Instance Data File is only used as documentation. 324 While such data will usually not change, data documented by Instance 325 Data sets MAY be changed by the YANG server itself or by management 326 operations. It is out of scope for this document to specify a method 327 to prevent this. Whether such data changes and if so, when and how, 328 SHOULD be described either in the instance data file description 329 statement or in some other implementation specific manner. 331 YANG Based Instance data is a snap-shot of information at a specific 332 point of time. If the data changes afterwards this is not 333 represented in the instance data set anymore, the valid values can be 334 retrieved in run-time via Netconf/Restconf 335 Notifications about the change of data documented by Instance Data 336 Sets may be supplied by e.g. the Yang-Push mechanism, but it is out 337 of scope for this document. 339 5. Delivery of Instance Data 341 Instance data files SHOULD be available without the need for a live 342 YANG server e.g. via download from the vendor's website, or any 343 other way together with other product documentation. 345 6. YANG Model 347 file "ietf-yang-instance-data.yang" 349 module ietf-yang-instance-data { 350 yang-version 1.1; 351 namespace 352 "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; 353 prefix yid ; 355 import ietf-yang-data-ext { prefix yd; } 357 import ietf-datastores { prefix ds; } 359 organization "IETF NETMOD Working Group"; 360 contact 361 "WG Web: 362 WG List: 364 Author: Balazs Lengyel 365 "; 367 description "The module defines the structure and content of YANG 368 Instance Data Sets."; 370 revision 2018-06-30 { 371 description "Initial revision."; 372 reference "RFC XXXX: YANG Based Instance Data"; 373 } 375 yd:yang-data instance-data-format { 376 container instance-data-set { 377 description "Auxiliary container to carry meta-data for 378 the complete instance data set."; 380 leaf name { 381 type string; 382 mandatory true; 383 description "Name of a YANG Based Instance data set."; 384 } 386 leaf description { type string; } 388 leaf contact { 389 type string; 390 description "Contains the same information the contact 391 statement carries for a YANG module."; 392 } 394 leaf organization { 395 type string; 396 description "Contains the same information the 397 organization statement carries for a YANG module."; 398 } 400 leaf datastore { 401 type ds:datastore-ref; 402 description "The identity of the datastore for which 403 the instance data is documented for config=true data nodes. 404 The leaf MAY be absent in which case the running dtastore or 405 if thats not writable, the candidate datastore is implied. 407 For config=false data nodes always the operational 408 data store is implied."; 409 } 411 list revision { 412 key date; 413 description "An instance-data-set SHOULD have at least 414 one revision entry. For every published 415 editorial change, a new one SHOULD be added in front 416 of the revisions sequence so that all revisions are 417 in reverse chronological order."; 419 leaf date { 420 type string { 421 pattern '\d{4}-\d{2}-\d{2}'; 422 } 423 description "Specifies the data the revision 424 was last modified. Formated as YYYY-MM-DD"; 425 } 427 leaf description { type string; } 428 } 430 anydata data { 431 mandatory true; 432 description "Contains the real instance data. 433 The data MUST conform to the relevant YANG Modules."; 434 } 435 } 436 } 437 } 439 441 7. Security Considerations 443 Depending on the nature of the instance data, instance data files MAY 444 need to be handled in a secure way. The same type of handling should 445 be applied, that would be needed for the result of a operation 446 returning the same data. 448 8. IANA Considerations 450 To be completed, all the usual requests for a new YANG module 452 9. References 454 9.1. Normative References 456 [I-D.ietf-netmod-yang-data-ext] 457 Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data 458 Extensions", draft-ietf-netmod-yang-data-ext-01 (work in 459 progress), March 2018. 461 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 462 RFC 7950, DOI 10.17487/RFC7950, August 2016, 463 . 465 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 466 RFC 7951, DOI 10.17487/RFC7951, August 2016, 467 . 469 9.2. Informative References 471 [I-D.ietf-ccamp-alarm-module] 472 Vallin, S. and M. Bjorklund, "YANG Alarm Module", draft- 473 ietf-ccamp-alarm-module-04 (work in progress), October 474 2018. 476 [I-D.ietf-netconf-rfc7895bis] 477 Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 478 and R. Wilton, "YANG Library", draft-ietf-netconf- 479 rfc7895bis-07 (work in progress), October 2018. 481 [I-D.ietf-netconf-yang-push] 482 Clemm, A., Voit, E., Prieto, A., Tripathy, A., Nilsen- 483 Nygaard, E., Bierman, A., and B. Lengyel, "YANG Datastore 484 Subscription", draft-ietf-netconf-yang-push-19 (work in 485 progress), September 2018. 487 [I-D.wu-netconf-restconf-factory-restore] 488 Wu, Q., Lengyel, B., and Y. Niu, "Factory default 489 Setting", draft-wu-netconf-restconf-factory-restore-03 490 (work in progress), October 2018. 492 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 493 Requirement Levels", BCP 14, RFC 2119, 494 DOI 10.17487/RFC2119, March 1997, 495 . 497 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 498 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 499 May 2017, . 501 Appendix A. Open Issues 503 o If we define metadata per target module, a list of target YAM 504 could be included in the metadata. This depends on what 505 additional metadata we will include. 507 o How do we know for which version of the target Yang Module is a 508 data set valid? Proposal: One possibility would be to just 509 indicate for which module version(s) was the data set last 510 updated. This would be a hint about compatibility, but nothing 511 more. Maybe we should wait till the YANG versioning work is 512 complete/stable. Identifying just one version is way to strict, 513 so something enforcing that shall not be used. 515 o Should we document what YANG features does the instance data set 516 implicitly require? Proposal: that is already a use case, 517 documenting data from the YANG library. 519 o Augmenting metadata must be possible. As of now it looks like 520 yang-data-ext will solve that. If not, define instance data as 521 regular YANG instead of yd:yang-data. 523 Appendix B. Changes between revisions 525 v04 - v05 527 o Changed title and introduction to clarify that this draft is only 528 about the file format and documenting server capabilities is just 529 a use case. 531 o Added reference to draft-wu-netconf-restconf-factory-restore 533 o Added new open issues. 535 v03 - v04 537 o Updated changelog for v02-v03 539 v02 - v03 541 o Updated the document according to comments received at IETF102 543 o Added parameter to specify datastore 545 o Rearranged chapters 547 o Added new use case: Documenting Factory Default Settings 549 o Added "Target YANG Module" to terminology 551 o Clarified that instance data is a snapshot valid at the time of 552 creation, so it does not contain any later changes. 554 o Removed topics from Open Issues according to comments received at 555 IETF102 557 v01 - v02 559 o The recommendation to document server capabilities was changed to 560 be just the primary use-case. (Merged chapter 4 into the use case 561 chapter.) 563 o Stated that RFC7950/7951 encoding must be followed which also 564 defines (dis)allowed whitespace rules. 566 o Added UTF-8 encoding as it is not specified in t950 for instance 567 data 569 o added XML declaration 570 v00 - v01 572 o Redefined using yang-data-ext 574 o Moved meta data into ordinary leafs/leaf-lists 576 Authors' Addresses 578 Balazs Lengyel 579 Ericsson 580 Magyar Tudosok korutja 11 581 1117 Budapest 582 Hungary 584 Phone: +36-70-330-7909 585 Email: balazs.lengyel@ericsson.com 587 Benoit Claise 588 Cisco Systems, Inc. 589 De Kleetlaan 6a b1 590 1831 Diegem 591 Belgium 593 Phone: +32 2 704 5622 594 Email: bclaise@cisco.com