idnits 2.17.1 draft-lengyel-netmod-yang-instance-data-03.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 435 has weird spacing: '... { type strin...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (July 22, 2018) is 2076 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 464, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 495, but no explicit reference was found in the text == Unused Reference: 'RFC8174' is defined on line 500, 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-01 == Outdated reference: A later version (-07) exists of draft-ietf-netconf-rfc7895bis-06 == Outdated reference: A later version (-25) exists of draft-ietf-netconf-yang-push-17 Summary: 0 errors (**), 0 flaws (~~), 10 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group B. Lengyel 3 Internet-Draft Ericsson 4 Intended status: Standards Track B. Claise 5 Expires: January 23, 2019 Cisco Systems, Inc. 6 July 22, 2018 8 YANG Instance Data Files and their use for Documenting Server 9 Capabilities 10 draft-lengyel-netmod-yang-instance-data-03 12 Abstract 14 This document specifies a standard file format for YANG instance 15 data, that is data that could be stored in a datastore and whose 16 syntax and semantics is defined by YANG models. Instance data files 17 can be used to provide information that is defined in design time. 18 There is a need to document Server capabilities (which are often 19 specified in design time). Defining server capabilities is foreseen 20 as the most important use of YANG instance data files. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on January 23, 2019. 39 Copyright Notice 41 Copyright (c) 2018 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 2.1. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 4 59 2.2. Delivery of Instance Data . . . . . . . . . . . . . . . . 4 60 2.3. Use Case 1: Early Documentation of Server Capabilites . . 5 61 2.4. Use Case 2: Preloading Data . . . . . . . . . . . . . . . 5 62 2.5. Use Case 3: Dcoumenting Factory Default Settings . . . . 5 63 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 6 64 4. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 8 65 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 66 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 68 7.1. Normative References . . . . . . . . . . . . . . . . . . 10 69 7.2. Informative References . . . . . . . . . . . . . . . . . 11 70 Appendix A. Open Issues . . . . . . . . . . . . . . . . . . . . 11 71 Appendix B. Changes between revisions . . . . . . . . . . . . . 11 72 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 74 1. Terminology 76 Design time: A time during which a YANG model and the implementation 77 behind it is created. Sometimes in other documents this period is 78 divided into design and implementation time. 80 Instance Data Set: A named set of data items that can be used as 81 instance data in a YANG data tree. 83 Instance Data File: A file containing an instance data set formatted 84 according to the rules described in this document. 86 Target YANG Module: A YANG module for which the instance data set 87 contains instance data, like ietf-yang-library in the examples. 89 2. Introduction 91 A YANG server has a number of server-capabilities that can be 92 retrieved from the server using protocols like NETCONF or RESTCONF. 93 YANG server capabilities include 94 o data defined in ietf-yang-library: YANG modules, submodules, 95 features, deviations, schema-mounts 96 ([I-D.ietf-netconf-rfc7895bis]) 98 o datastores supported 100 o alarms supported ([I-D.ietf-ccamp-alarm-module]) 102 o data nodes, subtrees that support or do not support on-change 103 notifications ([I-D.ietf-netconf-yang-push]) 105 o netconf-capabilities 107 While it is good practice to allow a client to query these 108 capabilites from the live YANG server, that is often not enough. 109 Most server-capabilities are relatively stable but the fact is that 110 some might change. Looking at the change frequency, we have roughly 111 three categories: 113 1. only at upgrade, e.g. introduced with a new SW package 115 2. rarely e.g. due to licensing or HW inserted 117 3. more frequently e.g. a capability might be dependent on the CPU 118 or traffic load, although that would be most unusual 120 Most capabilities belong to type 1), some to type 2) and a relatively 121 small set to type 3). Many network nodes only have type 1) or type 122 1+2) capabilities. Stable capabilities are usually defined by a 123 vendor in design time, before the product is released. While these 124 capabilities can be retrieved from the live server in run-time, there 125 is a strong need to provide the same data already during design time. 126 (Often only a part of all the server capabilities can be made 127 available.) 129 Often when a network node is released an associated NMS (network 130 management system) is also released with it. The NMS depends on the 131 capabilities of the YANG server. During NMS implementation 132 information about server capabilities is needed. If the information 133 is not available early in some off-line document, but only as 134 instance data from the live network node, the NMS implementation will 135 be delayed, because it has to wait for the network node to be ready. 136 Also assuming that all NMS implementors will have a correctly 137 configured network node available to retrieve data from, is a very 138 expensive proposition. (An NMS may handle dozens of node types.) 139 Beside NMS implementors, system integrators and many others also need 140 the same information early. Examples could be model driven testing, 141 generating documentation, etc. 143 As capabilities are often already known in design time and are 144 relativaly stable, it feasible and advantageous to define/document 145 them early. This document specifies a file format for YANG instance 146 data that may be used to provide server capability information, 147 allowing vendors to specify capabilities early, in design time. 149 The same instance data file format can be used for other purposes, 150 like providing initial data for any YANG module. E.g. a basic set of 151 access control groups can be provided either by a device vendor or an 152 operator using the network device. 154 2.1. Data Life cycle 156 Data defined or documented in YANG Instance Data Sets may be used for 157 preloading a YANG server with this data, but the server may populate 158 the data without using the actual file in which case the Instance 159 Data File is only used as documentation. 161 While such data will usually not change, data documented by Instance 162 Data sets MAY be changed by the YANG server itself or by management 163 operations. It is out of scope for this document to specify a method 164 to prevent this. Whether such data changes and if so, when and how, 165 SHOULD be described either in the instance data file description 166 statement or in some other implementation specific manner. 168 YANG Instance data is a snap-shot of information at a specific point 169 of time. If the data changes afterwards this is not represented in 170 the instance data set anymore, the valid values can be retrieved in 171 run-time via Netconf/Restconf 173 Notifications about the change of data documented by Instance Data 174 Sets may be supplied by e.g. the Yang-Push mechanism, but it is out 175 of scope for this document. 177 2.2. Delivery of Instance Data 179 Instance data files SHOULD be available without the need for and 180 before the instalation of a live YANG server e.g. via download from 181 the vendor's website. or any other way together with other product 182 documentation. 184 2.3. Use Case 1: Early Documentation of Server Capabilites 186 An operator wants to integrate his own, in-house built management 187 system with the network node from ACME Systems. The management 188 integration must be ready by the time the first AcmeRouter is 189 installed in the network. To do the integration the operator needs 190 the list of supported YANG modules and features. While this list 191 could be read from the ietf-yang-library via Netconf, in order to 192 allow time for developing the management integration, the operator 193 demands this information early. The operator will value that this 194 information is available in a standard format, that is actually the 195 same format that can be read later from the node via Netconf. 197 YANG instance data files are used to provide design time information 198 about server capabilities. 200 2.4. Use Case 2: Preloading Data 202 There are parts of the configuration that must be fully configurable 203 by the operator, however for which often a semi-standard default 204 configuration will be sufficient. 206 One example is access control groups/roles and related rules. While 207 a sophisticated operator may define dozens of different groups often 208 a basic (read-only operator, read-write system administrator, 209 security-administrator) triplet will be enough. Vendors will often 210 provide such default configuration data to make device configuration 211 easier for an operator. 213 Defining Access control data is a complex task. To help the device 214 vendor pre-defines a set of default groups (/nacm:nacm/groups) and 215 rules for these groups to access specific parts of common models 216 (/nacm:nacm/rule-list/rule). 218 YANG instance data files are used to document and/or preload the 219 default configurationp. 221 2.5. Use Case 3: Dcoumenting Factory Default Settings 223 Nearly every YANG server has a factory default configuration. If the 224 system is really badly misconfigured or if the current configuration 225 is to be abandoned the system can be reset to this default. 227 In Netconf the operation can be used to do this, 228 while in Restconf there are plans to introduce a custom operation for 229 this purpose. 231 The operator curerntly has no way to know what the default 232 configuration actually contains. YANG Instance data can be used to 233 document the factory default configuration. 235 3. Instance Data File Format 237 Two standard formats to represent YANG Instance Data are specified 238 based on the XML and JSON encoding. The XML format is based on 239 [RFC7950] while the JSON format is based on [RFC7951]. Later as 240 other YANG encodings (e.g. CBOR) are defined further Instance Data 241 formats may be specified. 243 For both formats data is placed in a top level auxiliary container 244 named "instance-data-set". The purpose of the container, which is 245 not part of the real data itself, is to carry meta-data for the 246 complete instance-data-set. 248 The XML format SHALL follow the format returned for a NETCONF GET 249 operation. The anydata (which is not part of the real data 250 itself) SHALL contain all data that would be inside the 251 wrapper element of a reply to the operation. XML attributes 252 SHOULD NOT be present, however if a SW receiving a YANG instance data 253 file encounters XML attributes unknown to it, it MUST ignore them, 254 allowing them to be used later for other purposes. 256 The JSON format SHALL follow the format of the reply returmed for a 257 RESTCONF GET request directed at the datastore resource: 258 {+restconf}/data. ETags and Timestamps SHOULD NOT be included, but 259 if present SHOULD be ignored. 261 A YANG Instance data file MUST contain a single instance data set. 262 Instance data MUST conform to the corresponding target YANG Modules 263 and follow the XML/JSON encoding rules as defined in [RFC7950] and 264 [RFC7951] and use UTF-8 character encoding. A single instance data 265 set MAY contain data for any number of target YANG modules, if needed 266 it MAY carry the complete configuraton and state data set for a YANG 267 server. Default values SHOULD NOT but MAY be included. Config=true 268 and config=false data MAY be mixed in the instance data file. 269 Instance data files MAY contain partial data sets. This means 270 mandatory, min-elements or require-instance=true constrains MAY be 271 violated. 273 The name of the file SHOULD be of the form: 275 instance-data-set-name ['@' revision-date] ( '.yid' ) 277 E.g. acme-router-modules@2018-01-25.yid 279 The revision date is optional. It SHOULD NOT be used if the file is 280 stored in a version control system (e.g. git) because the change of 281 file names will break the connection between the different revisions 282 of the file. 284 Meta data, information about the data set itself SHALL be included in 285 the instance data set. This data will be children of the top level 286 instance-data-set container as defined in the ietf-instance-data YANG 287 module. Meta data SHALL include: 289 o Name of the instance data set 291 Meta data SHOULD include: 293 o Revision date of the instance data set 295 o Description of the instance data set. The description SHOULD 296 contain information whether and how the data can change during the 297 lifetime of the YANG server. 299 300 302 acme-router-modules 303 2108-01-25 304 Defines the minimal set of modules that any acme-router 305 will contain. These modules will always be present. 306 info@acme.com 307 308 309 310 basic 311 312 ietf-system 313 2014-08-06 314 315 urn:ietf:params:xml:ns:yang:ietf-system 316 authentication 317 radius-authentication 318 319 320 321 322 324 Figure 1: XML Instance Data File example 326 { 327 "ietf-yang-instance-data:instance-data-set": { 328 "name": "acme-router-modules", 329 "revision": "2108-01-25", 330 "contact": "info@acme.com", 331 "description": 332 "Defines the set of modules that an acme-router will contain.", 333 "data": { 334 "ietf-yang-library:yang-library": { 335 "module-set": [ 336 "name": "basic", 337 "module": [ 338 { 339 "name": "ietf-system", 340 "revision": "2014-08-06", 341 "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", 342 "feature": ["authentication", "radius-authentication"] 343 } 344 } 345 ] 346 ] 347 } 348 } 349 } 351 Figure 2: JSON Instance Data File example 353 4. YANG Model 355 file "ietf-yang-instance-data.yang" 357 module ietf-yang-instance-data { 358 yang-version 1.1; 359 namespace 360 "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; 361 prefix yid ; 363 import ietf-yang-data-ext { prefix yd; } 365 import ietf-datastores { prefix ds; } 367 organization "IETF NETMOD Working Group"; 368 contact 369 "WG Web: 370 WG List: 372 Author: Balazs Lengyel 373 "; 375 description "The module defines the structure and content of YANG 376 Instance Data Sets."; 378 revision 2018-06-30 { 379 description "Initial revision."; 380 reference "RFC XXXX: YANG Instance Data"; 381 } 383 yd:yang-data instance-data-format { 384 container instance-data-set { 385 description "Auxiliary container to carry meta-data for 386 the complete instance data set."; 388 leaf name { 389 type string; 390 mandatory true; 391 description "Name of a YANG instance data set."; 392 } 394 leaf description { type string; } 396 leaf contact { 397 type string; 398 description "Contains the same information the contact 399 statement carries for a YANG module."; 400 } 402 leaf organization { 403 type string; 404 description "Contains the same information the 405 organization statement carries for a YANG module."; 406 } 408 leaf datastore { 409 type ds:datastore-ref; 410 description "The identity of the datastore for which 411 the instance data is documented for config=true data nodes. 412 The leaf MAY be absent in which case the running dtastore or 413 if thats not writable, the candidate datastore is implied. 415 For config=false data nodes always the operational 416 data store is implied."; 417 } 419 list revision { 420 key date; 421 description "An instance-data-set SHOULD have at least 422 one revision entry. For every published 423 editorial change, a new one SHOULD be added in front 424 of the revisions sequence so that all revisions are 425 in reverse chronological order."; 427 leaf date { 428 type string { 429 pattern '\d{4}-\d{2}-\d{2}'; 430 } 431 description "Specifies the data the revision 432 was last modified. Formated as YYYY-MM-DD"; 433 } 435 leaf description { type string; } 436 } 438 anydata data { 439 mandatory true; 440 description "Contains the real instance data. 441 The data MUST conform to the relevant YANG Modules."; 442 } 443 } 444 } 445 } 447 449 5. Security Considerations 451 Depending on the nature of the instance data, instance data files MAY 452 need to be handled in a secure way. The same type of handling should 453 be applied, that would be needed for the result of a operation 454 returning the same data. 456 6. IANA Considerations 458 To be completed, all the usual requests for a new YANG module 460 7. References 462 7.1. Normative References 464 [I-D.ietf-netmod-yang-data-ext] 465 Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data 466 Extensions", draft-ietf-netmod-yang-data-ext-01 (work in 467 progress), March 2018. 469 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 470 RFC 7950, DOI 10.17487/RFC7950, August 2016, 471 . 473 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 474 RFC 7951, DOI 10.17487/RFC7951, August 2016, 475 . 477 7.2. Informative References 479 [I-D.ietf-ccamp-alarm-module] 480 Vallin, S. and M. Bjorklund, "YANG Alarm Module", draft- 481 ietf-ccamp-alarm-module-01 (work in progress), February 482 2018. 484 [I-D.ietf-netconf-rfc7895bis] 485 Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 486 and R. Wilton, "YANG Library", draft-ietf-netconf- 487 rfc7895bis-06 (work in progress), April 2018. 489 [I-D.ietf-netconf-yang-push] 490 Clemm, A., Voit, E., Prieto, A., Tripathy, A., Nilsen- 491 Nygaard, E., Bierman, A., and B. Lengyel, "YANG Datastore 492 Subscription", draft-ietf-netconf-yang-push-17 (work in 493 progress), July 2018. 495 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 496 Requirement Levels", BCP 14, RFC 2119, 497 DOI 10.17487/RFC2119, March 1997, 498 . 500 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 501 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 502 May 2017, . 504 Appendix A. Open Issues 506 o - 508 Appendix B. Changes between revisions 510 v02 - v03 512 o Added parameter to specify datastore 514 o Updated the document with the open issues according to the 515 discussions on IETF102 517 v01 - v02 519 o The recommendation to document server capabilities was changed to 520 be just the primary use-case. (Merged chapter 4 into the use case 521 chapter.) 523 o Stated that RFC7950/7951 encoding must be followed which also 524 defines (dis)allowed whitespace rules. 526 o Added UTF-8 encoding as it is not specified in t950 for instance 527 data 529 o added XML declaration 531 v00 - v01 533 o Redefined using yang-data-ext 535 o Moved meta data into ordinary leafs/leaf-lists 537 Authors' Addresses 539 Balazs Lengyel 540 Ericsson 541 Magyar Tudosok korutja 11 542 1117 Budapest 543 Hungary 545 Phone: +36-70-330-7909 546 Email: balazs.lengyel@ericsson.com 548 Benoit Claise 549 Cisco Systems, Inc. 550 De Kleetlaan 6a b1 551 1831 Diegem 552 Belgium 554 Phone: +32 2 704 5622 555 Email: bclaise@cisco.com