idnits 2.17.1 draft-ietf-netmod-nmda-diff-01.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 : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 3 characters in excess of 72. 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 (May 23, 2019) is 1793 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-21 Summary: 1 error (**), 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: November 24, 2019 J. Tantsura 6 Apstra 7 A. Bierman 8 YumaWorks 9 May 23, 2019 11 Comparison of NMDA datastores 12 draft-ietf-netmod-nmda-diff-01 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 November 24, 2019. 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 . . . . . . . . . . . . . . . . . . . . . . . . . 11 60 8. Possible Future Extensions . . . . . . . . . . . . . . . . . 11 61 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 62 9.1. Updates to the IETF XML Registry . . . . . . . . . . . . 12 63 9.2. Updates to the YANG Module Names Registry . . . . . . . . 12 64 10. Security Considerations . . . . . . . . . . . . . . . . . . . 13 65 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 13 66 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 67 12.1. Normative References . . . . . . . . . . . . . . . . . . 13 68 12.2. Informative References . . . . . . . . . . . . . . . . . 14 69 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 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 explain the cause of a difference, for example when a data node is 194 part of but the origin of the same data node in 195 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-05-23.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-05-23 { 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 379 6. Example 381 The following example compares the difference between 382 and for object "explicit-router-id", as defined in data 383 module [I-D.ietf-ospf-yang]. 385 RPC request: 387 389 391 ds:operational 392 ds:intended 393 \ 396 /rt:routing/rt:control-plane-protocols\ 397 /rt:control-plane-protocol/ospf:ospf\ 398 399 400 402 RPC reply, when a difference is detected: 404 407 410 411 ospf router-id 412 diff between operational and intended 413 414 1 415 replace 416 /ietf-ospf:explicit-router-id 417 418 1.1.1.1 420 421 422 423 424 426 RPC reply when no difference is detected: 428 431 433 435 The same request in RESTCONF (using JSON format): 437 POST /restconf/operations/ietf-nmda-compare:compare HTTP/1.1 438 Host: example.com 439 Content-Type: application/yang-data+json 440 Accept: application/yang-data+json 442 { "ietf-nmda-compare:input" { 443 "source" : "ietf-datastores:operational", 444 "target" : "ietf-datastores:intended". 445 "xpath-filter" : \ 446 "/ietf-routing:routing/control-plane-protocols\ 447 /control-plane-protocol/ietf-ospf:ospf" 448 } 449 } 451 The same response in RESTCONF (using JSON format): 453 HTTP/1.1 200 OK 454 Date: Thu, 26 Jan 2017 20:56:30 GMT 455 Server: example-server 456 Content-Type: application/yang-data+json 458 { "ietf-nmda-compare:output" : { 459 "differences" : { 460 "ietf-yang-patch:yang-patch" : { 461 "patch-id" : "ospf router-id", 462 "comment" : "diff between operational and intended", 463 "edit" : [ 464 { 465 "edit-id" : "1", 466 "operation" : "replace", 467 "target" : "/ietf-ospf:explicit-router-id", 468 "value" : { 469 "ietf-ospf:explicit-router-id" : "1.1.1.1" 470 "@ietf-ospf:explicit-router-id" : { 471 "ietf-origin:origin" : "ietf-origin:system" 472 } 473 } 474 } 475 ] 476 } 477 } 478 } 479 } 481 7. Open Issues 483 Currently, origin metadata is included in RPC output per default in 484 comparisons that involve . It is conceivable to 485 introduce an input parameter that controls whether origin metadata 486 should in fact be included. 488 Currently the comparison filter is defined using subtree and XPath as 489 in NETCONF[RFC6241]. It is not clear whether there is a requirement 490 to allow for the definition of filters that relate instead to target 491 resources per RESTCONF [RFC7950]. 493 8. Possible Future Extensions 495 It is conceivable to extend the compare operation with a number of 496 possible additional features in the future. 498 Specifically, it is possible to define an extension with an optional 499 feature for dampening. This will allow clients to specify a minimum 500 time period for which a difference must persist for it to be 501 reported. This will enable clients to distinguish between 502 differences that are only fleeting from ones that are not and that 503 may represent a real operational issue and inconsistency within the 504 device. 506 For this purpose, an additional input parameter can be added to 507 specify the dampening period. Only differences that pertain for at 508 least the dampening time are reported. A value of 0 or omission of 509 the parameter indicates no dampening. Reporting of differences MAY 510 correspondingly be delayed by the dampening period from the time the 511 request is received. 513 To implement this feature, a server implementation might run a 514 comparison when the RPC is first invoked and temporarily store the 515 result. Subsequently, it could wait until after the end of the 516 dampening period to check whether the same differences are still 517 observed. The differences that still persist are then returned. 519 9. IANA Considerations 521 9.1. Updates to the IETF XML Registry 523 This document registers one URI in the IETF XML registry [RFC3688]. 524 Following the format in [RFC3688], the following registration is 525 requested: 527 URI: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 529 Registrant Contact: The IESG. 531 XML: N/A, the requested URI is an XML namespace. 533 9.2. Updates to the YANG Module Names Registry 535 This document registers a YANG module in the YANG Module Names 536 registry [RFC7950]. Following the format in [RFC7950], the following 537 registration is requested: 539 name: ietf-nmda-compare 541 namespace: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 543 prefix: cp 545 reference: RFC XXXX 547 10. Security Considerations 549 Comparing discrepancies between datastores requires a certain amount 550 of processing resources at the server. An attacker could attempt to 551 attack a server by making a high volume of comparison requests. 552 Server implementations can guard against such scenarios in several 553 ways. For one, they can implement NACM in order to require proper 554 authorization for requests to be made. Second, server 555 implementations can limit the number of requests that they serve in 556 any one time interval, potentially rejecting requests made at a 557 higher frequency than the implementation can reasonably sustain. 559 11. Acknowledgments 561 We thank Rob Wilton, Martin Bjorklund, Mahesh Jethanandani, Lou 562 Berger, Kent Watsen, Phil Shafer, Ladislav Lhotka for valuable 563 feedback and suggestions. 565 12. References 567 12.1. Normative References 569 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 570 Requirement Levels", BCP 14, RFC 2119, 571 DOI 10.17487/RFC2119, March 1997, 572 . 574 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 575 DOI 10.17487/RFC3688, January 2004, 576 . 578 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 579 and A. Bierman, Ed., "Network Configuration Protocol 580 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 581 . 583 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 584 RFC 7950, DOI 10.17487/RFC7950, August 2016, 585 . 587 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 588 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 589 . 591 [RFC8072] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Patch 592 Media Type", RFC 8072, DOI 10.17487/RFC8072, February 593 2017, . 595 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 596 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 597 May 2017, . 599 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 600 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 601 . 603 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 604 and R. Wilton, "Network Management Datastore Architecture 605 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 606 . 608 12.2. Informative References 610 [I-D.ietf-ospf-yang] 611 Yeung, D., Qu, Y., Zhang, Z., Chen, I., and A. Lindem, 612 "YANG Data Model for OSPF Protocol", draft-ietf-ospf- 613 yang-21 (work in progress), January 2019. 615 Authors' Addresses 617 Alexander Clemm 618 Futurewei 619 2330 Central Expressway 620 Santa Clara, CA 95050 621 USA 623 Email: ludwig@clemm.org 625 Yingzhen Qu 626 Futurewei 627 2330 Central Expressway 628 Santa Clara, CA 95050 629 USA 631 Email: yqu@futurewei.com 633 Jeff Tantsura 634 Apstra 636 Email: jefftant.ietf@gmail.com 637 Andy Bierman 638 YumaWorks 640 Email: andy@yumaworks.com