idnits 2.17.1 draft-lengyel-netmod-yang-instance-data-02.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 388 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 2, 2018) is 2125 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 417, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 448, but no explicit reference was found in the text == Unused Reference: 'RFC8174' is defined on line 453, 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 3, 2019 Cisco Systems, Inc. 6 July 2, 2018 8 YANG Instance Data Files and their use for Documenting Server 9 Capabilities 10 draft-lengyel-netmod-yang-instance-data-02 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 3, 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. Use Case 1: Early Documentation of Server Capabilites . . 4 59 2.2. Use Case 2: Preloading Data . . . . . . . . . . . . . . . 4 60 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 4 61 3.1. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 7 62 4. YANG Model . . . . . . . . . . . . . . . . . . . . . . . . . 8 63 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9 64 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 65 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 66 7.1. Normative References . . . . . . . . . . . . . . . . . . 10 67 7.2. Informative References . . . . . . . . . . . . . . . . . 10 68 Appendix A. Open Issues . . . . . . . . . . . . . . . . . . . . 10 69 Appendix B. Changes between revisions . . . . . . . . . . . . . 11 70 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 72 1. Terminology 74 Design time: A time during which a YANG model and the implementation 75 behind it is created. Sometimes in other documents this period is 76 divided into design and implementation time. 78 Instance Data Set: A named set of data items that can be used as 79 instance data in a YANG data tree. 81 Instance Data File: A file containing an instance data set formatted 82 according to the rules described in this document. 84 2. Introduction 86 A YANG server has a number of server-capabilities that can be 87 retrieved from the server using protocols like NETCONF or RESTCONF. 88 YANG server capabilities include 90 o data defined in ietf-yang-library: YANG modules, submodules, 91 features, deviations, schema-mounts 92 ([I-D.ietf-netconf-rfc7895bis]) 94 o datastores supported 96 o alarms supported ([I-D.ietf-ccamp-alarm-module]) 97 o data nodes, subtrees that support or do not support on-change 98 notifications ([I-D.ietf-netconf-yang-push]) 100 o netconf-capabilities 102 While it is good practice to allow a client to query these 103 capabilites from the live YANG server, that is often not enough. 104 Most server-capabilities are relatively stable but the fact is that 105 some might change. Looking at the change frequency, we have roughly 106 three categories: 108 1. only at upgrade, e.g. introduced with a new SW package 110 2. rarely e.g. due to licensing or HW inserted 112 3. more frequently e.g. a capability might be dependent on the CPU 113 or traffic load, although that would be most unusual 115 Most capabilities belong to type 1), some to type 2) and a relatively 116 small set to type 3). Many network nodes only have type 1) or type 117 1+2) capabilities. Stable capabilities are usually defined by a 118 vendor in design time, before the product is released. While these 119 capabilities can be retrieved from the live server in run-time, there 120 is a strong need to provide the same data already during design time. 121 (Often only a part of all the server capabilities can be made 122 available.) 124 Often when a network node is released an associated NMS (network 125 management system) is also released with it. The NMS depends on the 126 capabilities of the YANG server. During NMS implementation 127 information about server capabilities is needed. If the information 128 is not available early in some off-line document, but only as 129 instance data from the live network node, the NMS implementation will 130 be delayed, because it has to wait for the network node to be ready. 131 Also assuming that all NMS implementors will have a correctly 132 configured network node available to retrieve data from, is a very 133 expensive proposition. (An NMS may handle dozens of node types.) 135 Beside NMS implementors, system integrators and many others also need 136 the same information early. Examples could be model driven testing, 137 generating documentation, etc. 139 As capabilities are often already known in design time and are 140 relativaly stable, it feasible and advantageous to define/document 141 them early. This document specifies a file format for YANG instance 142 data that may be used to provide server capability information, 143 allowing vendors to specify capabilities early, in design time. 145 The same instance data file format can be used for other purposes, 146 like providing initial data for any YANG module. E.g. a basic set of 147 access control groups can be provided either by a device vendor or an 148 operator using the network device. 150 2.1. Use Case 1: Early Documentation of Server Capabilites 152 An operator wants to integrate his own, in-house built management 153 system with the network node from ACME Systems. The management 154 integration must be ready by the time the first AcmeRouter is 155 installed in the network. To do the integration the operator needs 156 the list of supported YANG modules and features. While this list 157 could be read from the ietf-yang-library via Netconf, in order to 158 allow time for developing the management integration, the operator 159 demands this information early. The operator will value that this 160 information is available in a standard format, that is actually the 161 same format that can be read later from the node via Netconf. 163 YANG instance data files are used to provide design time information 164 about server capabilities. 166 2.2. Use Case 2: Preloading Data 168 There are parts of the configuration that must be fully configurable 169 by the operator, however for which often a semi-standard default 170 configuration will be sufficient. 172 One example is access control groups/roles and related rules. While 173 a sophisticated operator may define dozens of different groups often 174 a basic (read-only operator, read-write system administrator, 175 security-administrator) triplet will be enough. Vendors will often 176 provide such default configuration data to make device configuration 177 easier for an operator. 179 Defining Access control data is a complex task. To help the device 180 vendor pre-defines a set of default groups (/nacm:nacm/groups) and 181 rules for these groups to access specific parts of common models 182 (/nacm:nacm/rule-list/rule). 184 YANG instance data files are used to document and/or preload the 185 default configurationp. 187 3. Instance Data File Format 189 Two standard formats to represent YANG Instance Data are specified 190 based on the XML and JSON encoding. The XML format is based on 191 [RFC7950] while the JSON format is based on [RFC7951]. Later as 192 other YANG encodings (e.g. CBOR) are defined further Instance Data 193 formats may be specified. 195 For both formats data is placed in a top level auxiliary container 196 named "instance-data-set". The purpose of the container, which is 197 not part of the real data itself, is to carry meta-data for the 198 complete instance-data-set. 200 The XML format SHALL follow the format returned for a NETCONF GET 201 operation. The anydata (which is not part of the real data 202 itself) SHALL contain all data that would be inside the 203 wrapper element of a reply to the operation. XML attributes 204 SHOULD NOT be present, however if a SW receiving a YANG instance data 205 file encounters XML attributes unknown to it, it MUST ignore them, 206 allowing them to be used later for other purposes. 208 The JSON format SHALL follow the format of the reply returmed for a 209 RESTCONF GET request directed at the datastore resource: 210 {+restconf}/data. ETags and Timestamps SHOULD NOT be included, but 211 if present SHOULD be ignored. 213 A YANG Instance data file MUST contain a single instance data set. 214 Instance data MUST conform to the corresponding YANG Modules and 215 follow the XML/JSON encoding rules as defined in [RFC7950] and 216 [RFC7951] and use UTF-8 character encoding. Default values SHOULD 217 NOT but MAY be included. Config=true and config=false data MAY be 218 mixed in the instance data file. Instance data files MAY contain 219 partial data sets. This means mandatory, min-elements or require- 220 instance=true constrains MAY be violated. 222 The name of the file SHOULD be of the form: 224 instance-data-set-name ['@' revision-date] ( '.yid' ) 226 E.g. acme-router-modules@2018-01-25.yid 228 Meta data, information about the data set itself SHALL be included in 229 the instance data set. This data will be children of the top level 230 instance-data-set container as defined in the ietf-instance-data YANG 231 module. Meta data SHALL include: 233 o Name of the instance data set 235 Meta data SHOULD include: 237 o Revision date of the instance data set (later a semantic version 238 MAY also be included) 240 o Description of the instance data set. The description SHOULD 241 contain information whether and how the data can change during the 242 lifetime of the YANG server. 244 245 acme-router-modules 248 2108-01-25 249 Defines the minimal set of modules that any acme-router 250 will contain. These modules will always be present. 251 info@acme.com 252 253 254 255 basic 256 257 ietf-system 258 2014-08-06 259 260 urn:ietf:params:xml:ns:yang:ietf-system 261 authentication 262 radius-authentication 263 264 265 266 267 269 Figure 1: XML Instance Data File example 271 { 272 "ietf-yang-instance-data:instance-data-set": { 273 "name": "acme-router-modules", 274 "revision": "2108-01-25", 275 "contact": "info@acme.com", 276 "description": 277 "Defines the set of modules that an acme-router will contain.", 278 "data": { 279 "ietf-yang-library:yang-library": { 280 "module-set": [ 281 "name": "basic", 282 "module": [ 283 { 284 "name": "ietf-system", 285 "revision": "2014-08-06", 286 "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", 287 "feature": ["authentication", "radius-authentication"] 288 } 289 } 290 ] 291 ] 292 } 293 } 294 } 296 Figure 2: JSON Instance Data File example 298 3.1. Data Life cycle 300 Data defined or documented in YANG Instance Data Sets may be used for 301 preloading a YANG server with this data, but the server may populate 302 the data without using the actual file in which case the Instance 303 Data File is only used as documentation. 305 While such data will usually not change, data documented by Instance 306 Data Files MAY be changed by the YANG server itself or by management 307 operations. It is out of scope for this document to specify a method 308 to prevent this. If the information retrieved in run-time via 309 Netconf/Restconf and the YANG Instance Data File for the same YANG 310 module are in conflict, the run-time data MUST be considered 311 authorative. Whether this data changes and if so, when and how, 312 SHOULD be described either in the instance data file description 313 statements or some other implementation specific manner. 315 Notifications about the change of data documented by Instance Data 316 Sets may be supplied by e.g. the Yang-Push mechanism, but it is out 317 of scope for this document. 319 4. YANG Model 321 file "ietf-yang-instance-data.yang" 323 module ietf-yang-instance-data { 324 yang-version 1.1; 325 namespace 326 "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; 327 prefix yid ; 329 import ietf-yang-data-ext { prefix yd; } 331 organization "IETF NETMOD Working Group"; 332 contact 333 "WG Web: 334 WG List: 336 Author: Balazs Lengyel 337 "; 339 description "The module defines the structure and content of YANG 340 Instance Data Sets."; 342 revision 2018-06-30 { 343 description "Initial revision."; 344 reference "RFC XXXX: YANG Instance Data"; 345 } 347 yd:yang-data instance-data-format { 348 container instance-data-set { 349 description "Auxiliary container to carry meta-data for 350 the complete instance data set."; 352 leaf name { 353 type string; 354 mandatory true; 355 description "Name of a YANG instance data set."; 356 } 358 leaf description { type string; } 360 leaf contact { 361 type string; 362 description "Contains the same information the contact 363 statement carries for a YANG module."; 364 } 366 leaf organization { 367 type string; 368 description "Contains the same information the 369 organization statement carries for a YANG module."; 370 } 372 list revision { 373 key date; 374 description "An instance-data-set SHOULD have at least 375 one revision entry. For every published 376 editorial change, a new one SHOULD be added in front 377 of the revisions sequence so that all revisions are 378 in reverse chronological order."; 380 leaf date { 381 type string { 382 pattern '\d{4}-\d{2}-\d{2}'; 383 } 384 description "Specifies the data the revision 385 was last modified. Formated as YYYY-MM-DD"; 386 } 388 leaf description { type string; } 389 } 391 anydata data { 392 mandatory true; 393 description "Contains the real instance data. 394 The data MUST conform to the relevant YANG Modules."; 395 } 396 } 397 } 398 } 400 402 5. Security Considerations 404 Depending on the nature of the instance data, instance data files MAY 405 need to be handled in a secure way. The same type of handling should 406 be applied, that would be needed for the result of a operation 407 returning the same data. 409 6. IANA Considerations 411 To be completed, all the usual requests for a new YANG module 413 7. References 415 7.1. Normative References 417 [I-D.ietf-netmod-yang-data-ext] 418 Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data 419 Extensions", draft-ietf-netmod-yang-data-ext-01 (work in 420 progress), March 2018. 422 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 423 RFC 7950, DOI 10.17487/RFC7950, August 2016, 424 . 426 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 427 RFC 7951, DOI 10.17487/RFC7951, August 2016, 428 . 430 7.2. Informative References 432 [I-D.ietf-ccamp-alarm-module] 433 Vallin, S. and M. Bjorklund, "YANG Alarm Module", draft- 434 ietf-ccamp-alarm-module-01 (work in progress), February 435 2018. 437 [I-D.ietf-netconf-rfc7895bis] 438 Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 439 and R. Wilton, "YANG Library", draft-ietf-netconf- 440 rfc7895bis-06 (work in progress), April 2018. 442 [I-D.ietf-netconf-yang-push] 443 Clemm, A., Voit, E., Prieto, A., Tripathy, A., Nilsen- 444 Nygaard, E., Bierman, A., and B. Lengyel, "YANG Datastore 445 Subscription", draft-ietf-netconf-yang-push-17 (work in 446 progress), July 2018. 448 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 449 Requirement Levels", BCP 14, RFC 2119, 450 DOI 10.17487/RFC2119, March 1997, 451 . 453 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 454 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 455 May 2017, . 457 Appendix A. Open Issues 458 o Shall we create tags to hold instance data blocks in RFCs just as 459 we have similar tags for YANG modules: 460 Proposal: define 462 o Should we use yang-data-ext to define the instance data module? 463 Proposal: yes. This is the perfect use case for it. It does not 464 affect the actual instance-data-file format. It maybe more 465 difficult for some tools. Exactly how ? Using it is important in 466 mixed modules, but might not be important here. 468 o Do we need to specify which datastore the data belongs to? 469 Proposal: Not now. Only if we find a use-case for it. As for now 470 config=false data always belongs to the operational datastore, 471 while config=true belongs to running or candidate. Even selecting 472 between candidate and running might be dependent on other run-time 473 configuration. 475 o Shall we recommend as a general practice: servers SHOULD document 476 their capabilities using instance data? While I very strongly 477 believe it SHOULD be a preferred practice, there were other 478 opinions raised. If we don't document it here, should we create a 479 separate draft to recommend documenting server properties (e.g. 480 for ietf-yang-library) as instance data? Or maybe an rfc7895bis- 481 bis? 483 o Allow multiple instance-data-sets in one file? Proposal: No. One 484 instance-data-set can contain data for any number of modules. 485 Packaging multiple separate instance-data-sets together in a file 486 is out-of-scope just as packaging multiple YANG modules in one 487 file was never considered. 489 o Shall we specify the revision/semantic version of the YANG modules 490 we are defining data for? Proposal: No. Revision is too strict, 491 semver is not ready. Maybe later. 493 o Shall we define a semantic version for the instance-data-set? 494 Proposal: No. We don't know what compatibility mean for instance 495 data? Maybe later. 497 Appendix B. Changes between revisions 499 v01 - v02 501 o The recommendation to document server capabilities was changed to 502 be just the primary use-case. (Merged chapter 4 into the use case 503 chapter.) 505 o Stated that RFC7950/7951 encoding must be followed which also 506 defines (dis)allowed whitespace rules. 508 o Added UTF-8 encoding as it is not specified in t950 for instance 509 data 511 o added XML declaration 513 v00 - v01 515 o Redefined using yang-data-ext 517 o Moved meta data into ordinary leafs/leaf-lists 519 Authors' Addresses 521 Balazs Lengyel 522 Ericsson 523 xxx 524 1117 Budapest 525 Hungary 527 Phone: +36-70-330-7909 528 Email: balazs.lengyel@ericsson.com 530 Benoit Claise 531 Cisco Systems, Inc. 532 De Kleetlaan 6a b1 533 1831 Diegem 534 Belgium 536 Phone: +32 2 704 5622 537 Email: bclaise@cisco.com