idnits 2.17.1 draft-ietf-netmod-nmda-diff-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 220 has weird spacing: '...atch-id str...' -- The document date (July 8, 2019) is 1753 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) == Outdated reference: A later version (-29) exists of draft-ietf-ospf-yang-23 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Clemm 3 Internet-Draft Y. Qu 4 Intended status: Standards Track Futurewei 5 Expires: January 9, 2020 J. Tantsura 6 Apstra 7 A. Bierman 8 YumaWorks 9 July 8, 2019 11 Comparison of NMDA datastores 12 draft-ietf-netmod-nmda-diff-02 14 Abstract 16 This document defines an RPC operation to compare management 17 datastores that comply with the NMDA architecture. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on January 9, 2020. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Key Words . . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 3. Definitions and Acronyms . . . . . . . . . . . . . . . . . . 3 56 4. Data Model Overview . . . . . . . . . . . . . . . . . . . . . 4 57 5. YANG Data Model . . . . . . . . . . . . . . . . . . . . . . . 5 58 6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 59 7. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 12 60 8. Possible Future Extensions . . . . . . . . . . . . . . . . . 13 61 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 62 9.1. Updates to the IETF XML Registry . . . . . . . . . . . . 13 63 9.2. Updates to the YANG Module Names Registry . . . . . . . . 14 64 10. Security Considerations . . . . . . . . . . . . . . . . . . . 14 65 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 15 66 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 67 12.1. Normative References . . . . . . . . . . . . . . . . . . 15 68 12.2. Informative References . . . . . . . . . . . . . . . . . 16 69 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16 71 1. Introduction 73 The revised Network Management Datastore Architecture (NMDA) 74 [RFC8342] introduces a set of new datastores that each hold YANG- 75 defined data [RFC7950] and represent a different "viewpoint" on the 76 data that is maintained by a server. New YANG datastores that are 77 introduced include , which contains validated configuration 78 data that a client application intends to be in effect, and 79 , which contains at least conceptually operational state 80 data (such as statistics) as well as configuration data that is 81 actually in effect. 83 NMDA introduces in effect a concept of "lifecycle" for management 84 data, allowing to clearly distinguish between data that is part of a 85 configuration that was supplied by a user, configuration data that 86 has actually been successfully applied and that is part of the 87 operational state, and overall operational state that includes both 88 applied configuration data as well as status and statistics. 90 As a result, data from the same management model can be reflected in 91 multiple datastores. Clients need to specify the target datastore to 92 be specific about which viewpoint of the data they want to access. 93 This way, an application can differentiate whether they are (for 94 example) interested in the configuration that has been applied and is 95 actually in effect, or in the configuration that was supplied by a 96 client and that is supposed to be in effect. 98 Due to the fact that data can propagate from one datastore to 99 another, it is possibly for differences between datastores to occur. 100 Some of this is entirely expected, as there may be a time lag between 101 when a configuration is given to the device and reflected in 102 , until when it actually takes effect and is reflected in 103 . However, there may be cases when a configuration item 104 that was to be applied may not actually take effect at all or needs 105 an unusually long time to do so. This can be the case due to certain 106 conditions not being met, resource dependencies not being resolved, 107 or even implementation errors in corner conditions. 109 When configuration that is in effect is different from configuration 110 that was applied, many issues can result. It becomes more difficult 111 to operate the network properly due to limited visibility of actual 112 status which makes it more difficult to analyze and understand what 113 is going on in the network. Services may be negatively affected (for 114 example, breaking a service instance resulting in service is not 115 properly delivered to a customer) and network resources be 116 misallocated. 118 Applications can potentially analyze any differences between two 119 datastores by retrieving the contents from both datastores and 120 comparing them. However, in many cases this will be at the same time 121 costly and extremely wasteful. 123 This document introduces a YANG data model which defines RPCs, 124 intended to be used in conjunction with NETCONF [RFC6241] or RESTCONF 125 [RFC8040], that allow a client to request a server to compare two 126 NMDA datastores and report any differences. 128 2. Key Words 130 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 131 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 132 "OPTIONAL" in this document are to be interpreted as described in BCP 133 14 [RFC2119] [RFC8174] when, and only when, they appear in all 134 capitals, as shown here. 136 3. Definitions and Acronyms 138 NMDA: Network Management Datastore Architecture 140 RPC: Remote Procedure Call 142 4. Data Model Overview 144 At the core of the solution is a new management operation, , 145 that allows to compare two datastores for the same data. The 146 operation checks whether there are any differences in values or in 147 data nodes that are contained in either datastore, and returns any 148 differences as output. The output is returned in the format 149 specified in YANG-Patch [RFC8072]. 151 The YANG data model defines the operation as a new RPC. 152 The operation takes the following input parameters: 154 o source: The source identifies the datastore that will serve as 155 reference for the comparison, for example . 157 o target: The target identifies the datastore to compare against the 158 source. 160 o filter-spec: This is a choice between different filter constructs 161 to identify the portions of the datastore to be retrieved. It 162 acts as a node selector that specifies which data nodes are within 163 the scope of the comparison and which nodes are outside the scope. 164 This allows a comparison operation to be applied only to a 165 specific portion of the datastore that is of interest, such as a 166 particular subtree. (The filter dow not contain expressions that 167 would match values data nodes, as this is not required by most use 168 cases and would complicate the scheme, from implementation to 169 dealing with race conditions.) 171 o all: When set, this parameter indicates that all differences 172 should be included, including differences pertaining to schema 173 nodes that exist in only one of the datastores. When this 174 parameter is not included, a prefiltering step is automatically 175 applied to exclude data from the comparison that does not pertain 176 to both datastores: if the same schema node is not present in both 177 datastores, then all instances of that schema node and all its 178 descendants are excluded from the comparison. This allows client 179 applications to focus on the differences that constitute true 180 mismatches of instance data without needing to specify more 181 complex filter constructs. 183 The operation provides the following output parameter: 185 o differences: This parameter contains the list of differences. 186 Those differences are encoded per YANG-Patch data model defined in 187 RFC8072. The YANG-Patch data model is augmented to indicate the 188 value of source datastore nodes in addition to the patch itself 189 that would need to be applied to the source to produce the target. 191 When the target datastore is , "origin" metadata is 192 included as part of the patch. Including origin metadata can help 193 in some cases explain the cause of a difference, for example when 194 a data node is part of but the origin of the same data 195 node in is reported as "system". 197 The data model is defined in the ietf-nmda-compare YANG module. Its 198 structure is shown in the following figure. The notation syntax 199 follows [RFC8340]. 201 module: ietf-nmda-compare 202 rpcs: 203 +---x compare 204 +---w input 205 | +---w source identityref 206 | +---w target identityref 207 | +---w all? empty 208 | +---w (filter-spec)? 209 | +--:(subtree-filter) 210 | | +---w subtree-filter? 211 | +--:(xpath-filter) 212 | +---w xpath-filter? yang:xpath1.0 {nc:xpath}? 213 +--ro output 214 +--ro (compare-response)? 215 +--:(no-matches) 216 | +--ro no-matches? empty 217 +--:(differences) 218 +--ro differences 219 +--ro yang-patch 220 +--ro patch-id string 221 +--ro comment? string 222 +--ro edit* [edit-id] 223 +--ro edit-id string 224 +--ro operation enumeration 225 +--ro target target-resource-offset 226 +--ro point? target-resource-offset 227 +--ro where? enumeration 228 +--ro value? 229 +--ro source-value? 231 Structure of ietf-nmda-compare 233 5. YANG Data Model 235 file "ietf-nmda-compare@2019-07-08.yang" 236 module ietf-nmda-compare { 238 yang-version 1.1; 239 namespace "urn:ietf:params:xml:ns:yang:ietf-nmda-compare"; 241 prefix cp; 243 import ietf-yang-types { 244 prefix yang; 245 } 246 import ietf-datastores { 247 prefix ds; 248 } 249 import ietf-yang-patch { 250 prefix ypatch; 251 } 252 import ietf-netconf { 253 prefix nc; 254 } 256 organization "IETF"; 257 contact 258 "WG Web: 259 WG List: 261 Author: Alexander Clemm 262 264 Author: Yingzhen Qu 265 267 Author: Jeff Tantsura 268 270 Author: Andy Bierman 271 "; 273 description 274 "The YANG data model defines a new operation, , that 275 can be used to compare NMDA datastores."; 277 revision 2019-07-08 { 278 description 279 "Initial revision"; 280 reference 281 "RFC XXXX: Comparison of NMDA datastores"; 282 } 284 /* RPC */ 285 rpc compare { 286 description 287 "NMDA compare operation."; 288 input { 289 leaf source { 290 type identityref { 291 base ds:datastore; 292 } 293 mandatory true; 294 description 295 "The source datastore to be compared."; 296 } 297 leaf target { 298 type identityref { 299 base ds:datastore; 300 } 301 mandatory true; 302 description 303 "The target datastore to be compared."; 304 } 305 leaf all { 306 type empty; 307 description 308 "When this leaf is provided, all data nodes are compared, 309 whether their schema node pertains to both datastores or 310 not. When this leaf is omitted, a prefiltering step is 311 automatically applied that excludes data nodes from the 312 comparison that can occur in only one datastore but not 313 the other. Specifically, if one of the datastores 314 (source or target) contains only configuration data and 315 the other datastore is , data nodes for 316 which config is false are excluded from the comparison."; 317 } 318 choice filter-spec { 319 description 320 "Identifies the portions of the datastores to be 321 compared."; 322 anydata subtree-filter { 323 description 324 "This parameter identifies the portions of the 325 target datastore to retrieve."; 326 reference "RFC 6241, Section 6."; 327 } 328 leaf xpath-filter { 329 if-feature nc:xpath; 330 type yang:xpath1.0; 331 description 332 "This parameter contains an XPath expression 333 identifying the portions of the target 334 datastore to retrieve."; 336 } 337 } 338 } 339 output { 340 choice compare-response { 341 description 342 "Comparison results."; 343 leaf no-matches { 344 type empty; 345 description 346 "This leaf indicates that the filter did not match 347 anything and nothing was compared."; 348 } 349 container differences { 350 description 351 "The list of differences, encoded per RFC8072 with an 352 augmentation to include source values where 353 applicable."; 354 uses ypatch:yang-patch { 355 augment "yang-patch/edit" { 356 description 357 "Provide the value of the source of the patch, 358 respectively of the comparison, in addition to 359 the target value, where applicable."; 360 anydata source-value { 361 when "../operation = 'delete'" 362 + "or ../operation = 'merge'" 363 + "or ../operation = 'move'" 364 + "or ../operation = 'replace'" 365 + "or ../operation = 'remove'"; 366 description 367 "The anydata 'value' is only used for 'delete', 368 'move', 'merge', 'replace', and 'remove' 369 operations."; 370 } 371 } 372 } 373 } 374 } 375 } 376 } 377 } 378 380 6. Example 382 The following example compares the difference between 383 and for a subtree under "ospf". The subtree contains 384 objects that are defined in a YANG data model for the management of 385 OSPF defined in [I-D.ietf-ospf-yang]. The excerpt of the data model 386 whose instantiation is basis of the comparison is as follows: 388 container ospf { 389 leaf enable { 390 type boolean; 391 } 392 leaf explicit-router-id { 393 type rt-types:router-id; 394 } 395 leaf preference { 396 type uint8; 397 } 398 } 400 The contents of and datastores: 402 404 true 405 2.2.2.2 406 408 410 true 411 1.1.1.1 412 200 413 415 contains one object that was not contained in 416 , "preference". Another object, "explicit-router-id", has 417 differences in values. A third object, "enable", is the same in both 418 cases. 420 RPC request to compare (target of the comparison): 423 425 427 ds:operational 428 ds:intended 429 \ 432 /rt:routing/rt:control-plane-protocols\ 433 /rt:control-plane-protocol/ospf:ospf\ 434 435 436 438 RPC reply, when a difference is detected: 440 443 446 447 ospf router-id 448 diff between operational and intended 449 450 1 451 replace 452 /ietf-ospf:explicit-router-id 453 454 1.1.1.1 456 457 458 2.2.2.2 460 461 2 462 create 463 /ietf-ospf:preference 464 465 200 467 468 469 470 471 473 The same request in RESTCONF (using JSON format): 475 POST /restconf/operations/ietf-nmda-compare:compare HTTP/1.1 476 Host: example.com 477 Content-Type: application/yang-data+json 478 Accept: application/yang-data+json 480 { "ietf-nmda-compare:input" { 481 "source" : "ietf-datastores:operational", 482 "target" : "ietf-datastores:intended". 483 "xpath-filter" : \ 484 "/ietf-routing:routing/control-plane-protocols\ 485 /control-plane-protocol/ietf-ospf:ospf" 486 } 487 } 489 The same response in RESTCONF (using JSON format): 491 HTTP/1.1 200 OK 492 Date: Thu, 26 Jan 2019 20:56:30 GMT 493 Server: example-server 494 Content-Type: application/yang-data+json 496 { "ietf-nmda-compare:output" : { 497 "differences" : { 498 "ietf-yang-patch:yang-patch" : { 499 "patch-id" : "ospf router-id", 500 "comment" : "diff between operational and intended", 501 "edit" : [ 502 { 503 "edit-id" : "1", 504 "operation" : "replace", 505 "target" : "/ietf-ospf:explicit-router-id", 506 "value" : { 507 "ietf-ospf:explicit-router-id" : "1.1.1.1" 508 "@ietf-ospf:explicit-router-id" : { 509 "ietf-origin:origin" : "ietf-origin:system" 510 } 511 "source-value" : { 512 "ietf-ospf:explicit-router-id" : "2.2.2.2" 513 "@ietf-ospf:explicit-router-id" : { 514 "ietf-origin:origin" : "ietf-origin:intended" 515 } 516 "edit-id" : "2", 517 "operation" : "create", 518 "target" : "/ietf-ospf:preference", 519 "value" : { 520 "ietf-ospf:preference" : "200" 521 "@ietf-ospf:preference" : { 522 "ietf-origin:origin" : "ietf-origin:system" 523 } 524 } 525 ] 526 } 527 } 528 } 529 } 531 7. Open Issues 533 Currently, origin metadata is included in RPC output per default in 534 comparisons that involve . It is conceivable to 535 introduce an input parameter that controls whether this origin 536 metadata should in fact be included. 538 Currently the comparison filter is defined using subtree and XPath as 539 in NETCONF[RFC6241]. It is not clear whether there is a requirement 540 to allow for the definition of filters that relate instead to target 541 resources per RESTCONF [RFC7950]. 543 8. Possible Future Extensions 545 It is conceivable to extend the compare operation with a number of 546 possible additional features in the future. 548 Specifically, it is possible to define an extension with an optional 549 feature for dampening. This will allow clients to specify a minimum 550 time period for which a difference must persist for it to be 551 reported. This will enable clients to distinguish between 552 differences that are only fleeting from ones that are not and that 553 may represent a real operational issue and inconsistency within the 554 device. 556 For this purpose, an additional input parameter can be added to 557 specify the dampening period. Only differences that pertain for at 558 least the dampening time are reported. A value of 0 or omission of 559 the parameter indicates no dampening. Reporting of differences MAY 560 correspondingly be delayed by the dampening period from the time the 561 request is received. 563 To implement this feature, a server implementation might run a 564 comparison when the RPC is first invoked and temporarily store the 565 result. Subsequently, it could wait until after the end of the 566 dampening period to check whether the same differences are still 567 observed. The differences that still persist are then returned. 569 9. IANA Considerations 571 9.1. Updates to the IETF XML Registry 573 This document registers one URI in the IETF XML registry [RFC3688]. 574 Following the format in [RFC3688], the following registration is 575 requested: 577 URI: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 579 Registrant Contact: The IESG. 581 XML: N/A, the requested URI is an XML namespace. 583 9.2. Updates to the YANG Module Names Registry 585 This document registers a YANG module in the YANG Module Names 586 registry [RFC7950]. Following the format in [RFC7950], the following 587 registration is requested: 589 name: ietf-nmda-compare 591 namespace: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 593 prefix: cp 595 reference: RFC XXXX 597 10. Security Considerations 599 The YANG module specified in this document defines a schema for data 600 that is designed to be accessed via network management protocols such 601 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 602 is the secure transport layer, and the mandatory-to-implement secure 603 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 604 is HTTPS, and the mandatory-to-implement secure transport is TLS 605 [RFC8446]. 607 The NETCONF access control model [RFC8341] provides the means to 608 restrict access for particular NETCONF or RESTCONF users to a 609 preconfigured subset of all available NETCONF or RESTCONF protocol 610 operations and content. 612 The RPC operation defined in this YANG module, "compare", may be 613 considered sensitive or vulnerable in some network environments. It 614 is thus important to control access to this operation. This is the 615 sensitivity/vulnerability of RPC operation "compare": 617 Comparing datastores for differences requires a certain amount of 618 processing resources at the server. An attacker could attempt to 619 attack a server by making a high volume of comparison requests. 620 Server implementations can guard against such scenarios in several 621 ways. For one, they can implement the NETCONF access control model 622 in order to require proper authorization for requests to be made. 623 Second, server implementations can limit the number of requests that 624 they serve to a client in any one time interval, rejecting requests 625 made at a higher frequency than the implementation can reasonably 626 sustain. 628 11. Acknowledgments 630 We thank Rob Wilton, Martin Bjorklund, Mahesh Jethanandani, Lou 631 Berger, Kent Watsen, Phil Shafer, Ladislav Lhotka for valuable 632 feedback and suggestions. 634 12. References 636 12.1. Normative References 638 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 639 Requirement Levels", BCP 14, RFC 2119, 640 DOI 10.17487/RFC2119, March 1997, 641 . 643 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 644 DOI 10.17487/RFC3688, January 2004, 645 . 647 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 648 and A. Bierman, Ed., "Network Configuration Protocol 649 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 650 . 652 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 653 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 654 . 656 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 657 RFC 7950, DOI 10.17487/RFC7950, August 2016, 658 . 660 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 661 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 662 . 664 [RFC8072] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Patch 665 Media Type", RFC 8072, DOI 10.17487/RFC8072, February 666 2017, . 668 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 669 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 670 May 2017, . 672 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 673 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 674 . 676 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 677 Access Control Model", STD 91, RFC 8341, 678 DOI 10.17487/RFC8341, March 2018, 679 . 681 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 682 and R. Wilton, "Network Management Datastore Architecture 683 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 684 . 686 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 687 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 688 . 690 12.2. Informative References 692 [I-D.ietf-ospf-yang] 693 Yeung, D., Qu, Y., Zhang, Z., Chen, I., and A. Lindem, 694 "YANG Data Model for OSPF Protocol", draft-ietf-ospf- 695 yang-23 (work in progress), July 2019. 697 Authors' Addresses 699 Alexander Clemm 700 Futurewei 701 2330 Central Expressway 702 Santa Clara, CA 95050 703 USA 705 Email: ludwig@clemm.org 707 Yingzhen Qu 708 Futurewei 709 2330 Central Expressway 710 Santa Clara, CA 95050 711 USA 713 Email: yqu@futurewei.com 715 Jeff Tantsura 716 Apstra 718 Email: jefftant.ietf@gmail.com 719 Andy Bierman 720 YumaWorks 722 Email: andy@yumaworks.com