idnits 2.17.1 draft-clemm-netmod-nmda-diff-00.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 218 has weird spacing: '...atch-id str...' == Line 222 has weird spacing: '...eration enu...' -- The document date (June 12, 2018) is 2139 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-11 Summary: 1 error (**), 0 flaws (~~), 4 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 Huawei 5 Expires: December 14, 2018 J. Tantsura 6 Nuage Networks 7 A. Bierman 8 YumaWorks 9 June 12, 2018 11 Comparison of NMDA datastores 12 draft-clemm-netmod-nmda-diff-00 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 December 14, 2018. 36 Copyright Notice 38 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 59 7. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 10 60 8. Possible Future Extensions . . . . . . . . . . . . . . . . . 10 61 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 62 9.1. Updates to the IETF XML Registry . . . . . . . . . . . . 11 63 9.2. Updates to the YANG Module Names Registry . . . . . . . . 11 64 10. Security Considerations . . . . . . . . . . . . . . . . . . . 12 65 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 66 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 67 12.1. Normative References . . . . . . . . . . . . . . . . . . 12 68 12.2. Informative References . . . . . . . . . . . . . . . . . 13 69 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 13 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 encoded per RFC8072, i.e. specifying which patches would need to 187 be applied to the source to produce the target. When the target 188 datastore is , "origin" metadata is included as part 189 of the patch. Including origin metadata can help explain the 190 cause of a difference, for example when a data node is part of 191 but the origin of the same data node in 192 is reported as "system". 194 The data model is defined in the ietf-nmda-compare YANG module. Its 195 structure is shown in the following figure. The notation syntax 196 follows [RFC8340]. 198 module: ietf-nmda-compare 200 rpcs: 201 +---x compare 202 +---w input 203 | +---w source identityref 204 | +---w target identityref 205 | +---w all? empty 206 | +---w (filter-spec)? 207 | +--:(subtree-filter) 208 | | +---w subtree-filter? 209 | +--:(xpath-filter) 210 | +---w xpath-filter? yang:xpath1.0 {nc:xpath}? 211 +--ro output 212 +--ro (compare-response)? 213 +--:(no-matches) 214 | +--ro no-matches? empty 215 +--:(differences) 216 +--ro differences 217 +--ro yang-patch 218 +--ro patch-id string 219 +--ro comment? string 220 +--ro edit* [edit-id] 221 +--ro edit-id string 222 +--ro operation enumeration 223 +--ro target target-resource-offset 224 +--ro point? target-resource-offset 225 +--ro where? enumeration 226 +--ro value? 228 Structure of ietf-nmda-compare 230 5. YANG Data Model 232 file "ietf-nmda-compare@2018-06-12.yang" 233 module ietf-nmda-compare { 235 yang-version 1.1; 236 namespace "urn:ietf:params:xml:ns:yang:ietf-nmda-compare"; 238 prefix cp; 240 import ietf-yang-types { 241 prefix yang; 242 } 243 import ietf-datastores { 244 prefix ds; 245 } 246 import ietf-yang-patch { 247 prefix ypatch; 248 } 249 import ietf-netconf { 250 prefix nc; 251 } 253 organization "IETF"; 254 contact 255 "WG Web: 256 WG List: 258 Author: Alexander Clemm 259 261 Author: Yingzhen Qu 262 264 Author: Jeff Tantsura 265 267 Author: Andy Bierman 268 "; 270 description 271 "The YANG data model defines a new operation, , that 272 can be used to compare NMDA datastores."; 274 revision 2018-06-12 { 275 description 276 "Initial revision"; 277 reference 278 "RFC XXXX: Comparison of NMDA datastores"; 279 } 281 /* RPC */ 282 rpc compare { 283 description 284 "NMDA compare operation."; 285 input { 286 leaf source { 287 type identityref { 288 base ds:datastore; 289 } 290 mandatory true; 291 description 292 "The source datastore to be compared."; 293 } 294 leaf target { 295 type identityref { 296 base ds:datastore; 297 } 298 mandatory true; 299 description 300 "The target datastore to be compared."; 301 } 302 leaf all { 303 type empty; 304 description 305 "When this leaf is provided, all data nodes are compared, 306 whether their schema node pertains to both datastores or 307 not. When this leaf is omitted, a prefiltering step is 308 automatically applied that excludes data nodes from the 309 comparison that can occur in only one datastore but not 310 the other. Specifically, if one of the datastores 311 (source or target) contains only configuration data and 312 the other datastore is , data nodes for 313 which config is false are excluded from the comparison."; 314 } 315 choice filter-spec { 316 description 317 "Identifies the portions of the datastores to be 318 compared."; 319 anydata subtree-filter { 320 description 321 "This parameter identifies the portions of the 322 target datastore to retrieve."; 323 reference "RFC 6241, Section 6."; 324 } 325 leaf xpath-filter { 326 if-feature nc:xpath; 327 type yang:xpath1.0; 328 description 329 "This parameter contains an XPath expression 330 identifying the portions of the target 331 datastore to retrieve."; 333 } 334 } 335 } 336 output { 337 choice compare-response { 338 leaf no-matches { 339 type empty; 340 description 341 "This leaf indicates that the filter did not match anything 342 and nothing was compared."; 343 } 344 container differences { 345 uses ypatch:yang-patch; 346 description 347 "The list of differences, encoded per RFC8072."; 348 } 349 description 350 "Comparision results."; 351 } 352 } 353 } 354 } 355 357 6. Example 359 The following example compares the difference between 360 and for object "explicit-router-id", as defined in data 361 module [I-D.ietf-ospf-yang]. 363 RPC request: 365 367 369 ds:operational 370 ds:intended 371 \ 374 /rt:routing/rt:control-plane-protocols\ 375 /rt:control-plane-protocol/ospf:ospf\ 376 377 378 380 RPC reply, when a difference is detected: 382 385 388 389 ospf router-id 390 diff between operational and intended 391 392 1 393 replace 394 /ietf-ospf:explicit-router-id 395 396 1.1.1.1 398 399 400 401 402 404 RPC reply when no difference is detected: 406 409 411 413 The same request in RESTCONF (using JSON format): 415 POST /restconf/operations/ietf-nmda-compare:compare HTTP/1.1 416 Host: example.com 417 Content-Type: application/yang-data+json 418 Accept: application/yang-data+json 420 { "ietf-nmda-compare:input" { 421 "source" : "ietf-datastores:operational", 422 "target" : "ietf-datastores:intended". 423 "xpath-filter" : \ 424 "/ietf-routing:routing/control-plane-protocols\ 425 /control-plane-protocol/ietf-ospf:ospf" 426 } 427 } 429 The same response in RESTCONF (using JSON format): 431 HTTP/1.1 200 OK 432 Date: Thu, 26 Jan 2017 20:56:30 GMT 433 Server: example-server 434 Content-Type: application/yang-data+json 436 { "ietf-nmda-compare:output" : { 437 "differences" : { 438 "ietf-yang-patch:yang-patch" : { 439 "patch-id" : "ospf router-id", 440 "comment" : "diff between operational and intended", 441 "edit" : [ 442 { 443 "edit-id" : "1", 444 "operation" : "replace", 445 "target" : "/ietf-ospf:explicit-router-id", 446 "value" : { 447 "ietf-ospf:explicit-router-id" : "1.1.1.1" 448 "@ietf-ospf:explicit-router-id" : { 449 "ietf-origin:origin" : "ietf-origin:system" 450 } 451 } 452 } 453 ] 454 } 455 } 456 } 457 } 459 7. Open Issues 461 Currently, origin metadata is included in RPC output per default in 462 comparisons that involve . It is conceivable to 463 introduce an input parameter that controls whether origin metadata 464 should in fact be included. 466 Currently the comparison filter is defined using subtree and XPath as 467 in NETCONF[RFC6241]. It is not clear whether there is a requirement 468 to allow for the definition of filters that relate instead to target 469 resources per RESTCONF [RFC7950]. 471 8. Possible Future Extensions 473 It is conceivable to extend the compare operation with a number of 474 possible additional features in the future. 476 Specifically, it is possible to define an extension with an optional 477 feature for dampening. This will allow clients to specify a minimum 478 time period for which a difference must persist for it to be 479 reported. This will enable clients to distinguish between 480 differences that are only fleeting from ones that are not and that 481 may represent a real operational issue and inconsistency within the 482 device. 484 For this purpose, an additional input parameter can be added to 485 specify the dampening period. Only differences that pertain for at 486 least the dampening time are reported. A value of 0 or omission of 487 the parameter indicates no dampening. Reporting of differences MAY 488 correspondingly be delayed by the dampening period from the time the 489 request is received. 491 To implement this feature, a server implementation might run a 492 comparison when the RPC is first invoked and temporarily store the 493 result. Subsequently, it could wait until after the end of the 494 dampening period to check whether the same differences are still 495 observed. The differences that still persist are then returned. 497 9. IANA Considerations 499 9.1. Updates to the IETF XML Registry 501 This document registers one URI in the IETF XML registry [RFC3688]. 502 Following the format in [RFC3688], the following registration is 503 requested: 505 URI: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 507 Registrant Contact: The IESG. 509 XML: N/A, the requested URI is an XML namespace. 511 9.2. Updates to the YANG Module Names Registry 513 This document registers a YANG module in the YANG Module Names 514 registry [RFC7950]. Following the format in [RFC7950], the following 515 registration is requested: 517 name: ietf-nmda-compare 519 namespace: urn:ietf:params:xml:ns:yang:ietf-nmda-compare 521 prefix: cp 523 reference: RFC XXXX 525 10. Security Considerations 527 Comparing discrepancies between datastores requires a certain amount 528 of processing resources at the server. An attacker could attempt to 529 attack a server by making a high volume of comparison requests. 530 Server implementations can guard against such scenarios in several 531 ways. For one, they can implement NACM in order to require proper 532 authorization for requests to be made. Second, server 533 implementations can limit the number of requests that they serve in 534 any one time interval, potentially rejecting requests made at a 535 higher frequency than the implementation can reasonably sustain. 537 11. Acknowledgments 539 We thank Rob Wilton, Martin Bjorklund, Mahesh Jethanandani, Lou 540 Berger, and Kent Watsen for valuable feedback and suggestions on an 541 earlier revision of this document. 543 12. References 545 12.1. Normative References 547 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 548 Requirement Levels", BCP 14, RFC 2119, 549 DOI 10.17487/RFC2119, March 1997, 550 . 552 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 553 DOI 10.17487/RFC3688, January 2004, 554 . 556 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 557 and A. Bierman, Ed., "Network Configuration Protocol 558 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 559 . 561 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 562 RFC 7950, DOI 10.17487/RFC7950, August 2016, 563 . 565 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 566 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 567 . 569 [RFC8072] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Patch 570 Media Type", RFC 8072, DOI 10.17487/RFC8072, February 571 2017, . 573 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 574 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 575 May 2017, . 577 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 578 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 579 . 581 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 582 and R. Wilton, "Network Management Datastore Architecture 583 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 584 . 586 12.2. Informative References 588 [I-D.ietf-ospf-yang] 589 Yeung, D., Qu, Y., Zhang, Z., Chen, I., and A. Lindem, 590 "Yang Data Model for OSPF Protocol", draft-ietf-ospf- 591 yang-11 (work in progress), April 2018. 593 Authors' Addresses 595 Alexander Clemm 596 Huawei 597 2330 Central Expressway 598 Santa Clara, CA 95050 599 USA 601 Email: ludwig@clemm.org 603 Yingzhen Qu 604 Huawei 605 2330 Central Expressway 606 Santa Clara, CA 95050 607 USA 609 Email: yingzhen.qu@huawei.com 611 Jeff Tantsura 612 Nuage Networks 614 Email: jefftant.ietf@gmail.com 615 Andy Bierman 616 YumaWorks 618 Email: andy@yumaworks.com