idnits 2.17.1 draft-ietf-netconf-yang-push-23.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 1063 has weird spacing: '...---w id sn:...' == Line 1100 has weird spacing: '...atch-id str...' == Line 1104 has weird spacing: '...eration enu...' == Line 1679 has weird spacing: '... from a tar...' == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 30, 2019) is 1816 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 (-26) exists of draft-ietf-netconf-subscribed-notifications-24 Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NETCONF A. Clemm 3 Internet-Draft Huawei USA 4 Intended status: Standards Track E. Voit 5 Expires: November 1, 2019 Cisco Systems 6 A. Gonzalez Prieto 7 Microsoft 8 A. Tripathy 9 E. Nilsen-Nygaard 10 Cisco Systems 11 A. Bierman 12 YumaWorks 13 B. Lengyel 14 Ericsson 15 April 30, 2019 17 Subscription to YANG Datastores 18 draft-ietf-netconf-yang-push-23 20 Abstract 22 Via the mechanism described in this document, subscriber applications 23 may request a continuous, customized stream of updates from a YANG 24 datastore. Providing such visibility into updates enables new 25 capabilities based on the remote mirroring and monitoring of 26 configuration and operational state. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on November 1, 2019. 45 Copyright Notice 47 Copyright (c) 2019 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 This document may contain material from IETF Documents or IETF 61 Contributions published or made publicly available before November 62 10, 2008. The person(s) controlling the copyright in some of this 63 material may not have granted the IETF Trust the right to allow 64 modifications of such material outside the IETF Standards Process. 65 Without obtaining an adequate license from the person(s) controlling 66 the copyright in such materials, this document may not be modified 67 outside the IETF Standards Process, and derivative works of it may 68 not be created outside the IETF Standards Process, except to format 69 it for publication as an RFC or to translate it into languages other 70 than English. 72 Table of Contents 74 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 75 2. Definitions and Acronyms . . . . . . . . . . . . . . . . . . 4 76 3. Solution Overview . . . . . . . . . . . . . . . . . . . . . . 5 77 3.1. Subscription Model . . . . . . . . . . . . . . . . . . . 5 78 3.2. Negotiation of Subscription Policies . . . . . . . . . . 6 79 3.3. On-Change Considerations . . . . . . . . . . . . . . . . 7 80 3.4. Reliability Considerations . . . . . . . . . . . . . . . 8 81 3.5. Data Encodings . . . . . . . . . . . . . . . . . . . . . 9 82 3.6. Defining the Selection with a Datastore . . . . . . . . . 10 83 3.7. Streaming Updates . . . . . . . . . . . . . . . . . . . . 11 84 3.8. Subscription Management . . . . . . . . . . . . . . . . . 13 85 3.9. Receiver Authorization . . . . . . . . . . . . . . . . . 15 86 3.10. On-Change Notifiable Datastore Nodes . . . . . . . . . . 16 87 3.11. Other Considerations . . . . . . . . . . . . . . . . . . 17 88 4. A YANG Data Model for Management of Datastore Push 89 Subscriptions . . . . . . . . . . . . . . . . . . . . . . . . 18 90 4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 18 91 4.2. Subscription Configuration . . . . . . . . . . . . . . . 24 92 4.3. YANG Notifications . . . . . . . . . . . . . . . . . . . 25 93 4.4. YANG RPCs . . . . . . . . . . . . . . . . . . . . . . . . 26 94 5. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 31 95 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 48 96 7. Security Considerations . . . . . . . . . . . . . . . . . . . 48 97 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 50 98 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 50 99 9.1. Normative References . . . . . . . . . . . . . . . . . . 50 100 9.2. Informative References . . . . . . . . . . . . . . . . . 51 101 Appendix A. Appendix A: Subscription Errors . . . . . . . . . . 52 102 A.1. RPC Failures . . . . . . . . . . . . . . . . . . . . . . 52 103 A.2. Notifications of Failure . . . . . . . . . . . . . . . . 53 104 Appendix B. Changes Between Revisions . . . . . . . . . . . . . 53 105 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 57 107 1. Introduction 109 Traditional approaches to providing visibility into managed entities 110 from a remote system have been built on polling. With polling, data 111 is periodically requested and retrieved by a client from a server to 112 stay up-to-date. However, there are issues associated with polling- 113 based management: 115 o Polling incurs significant latency. This latency prohibits many 116 application types. 118 o Polling cycles may be missed, requests may be delayed or get lost, 119 often when the network is under stress and the need for the data 120 is the greatest. 122 o Polling requests may undergo slight fluctuations, resulting in 123 intervals of different lengths. The resulting data is difficult 124 to calibrate and compare. 126 o For applications that monitor for changes, many remote polling 127 cycles place unwanted and ultimately wasteful load on the network, 128 devices, and applications, particularly when changes occur only 129 infrequently. 131 A more effective alternative to polling is for an application to 132 receive automatic and continuous updates from a targeted subset of a 133 datastore. Accordingly, there is a need for a service that allows 134 applications to subscribe to updates from a datastore and that 135 enables the server (also referred to as publisher) to push and in 136 effect stream those updates. The requirements for such a service 137 have been documented in [RFC7923]. 139 This document defines a corresponding solution that is built on top 140 of "Custom Subscription to Event Streams" 142 [I-D.draft-ietf-netconf-subscribed-notifications]. Supplementing 143 that work are YANG data model augmentations, extended RPCs, and new 144 datastore specific update notifications. Transport options for 145 [I-D.draft-ietf-netconf-subscribed-notifications] will work 146 seamlessly with this solution. 148 2. Definitions and Acronyms 150 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 151 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 152 "OPTIONAL" in this document are to be interpreted as described in BCP 153 14 [RFC2119] [RFC8174] when, and only when, they appear in all 154 capitals, as shown here. 156 This document uses the terminology defined in [RFC7950], [RFC8341], 157 [RFC8342], and [I-D.draft-ietf-netconf-subscribed-notifications]. In 158 addition, the following terms are introduced: 160 o Datastore node: A node in the instantiated YANG data tree 161 associated with a datastore. In this document, datastore nodes 162 are often also simply referred to as "objects" 164 o Datastore node update: A data item containing the current value of 165 a datastore node at the time the datastore node update was 166 created, as well as the path to the datastore node. 168 o Datastore subscription: A subscription to a stream of datastore 169 node updates. 171 o Datastore subtree: A datastore node and all its descendant 172 datastore nodes 174 o On-change subscription: A datastore subscription with updates that 175 are triggered when changes in subscribed datastore nodes are 176 detected. 178 o Periodic subscription: A datastore subscription with updates that 179 are triggered periodically according to some time interval. 181 o Selection filter: Evaluation and/or selection criteria, which may 182 be applied against a targeted set of objects. 184 o Update record: A representation of one or more datastore node 185 updates. In addition, an update record may contain which type of 186 update led to the datastore node update (e.g., whether the 187 datastore node was added, changed, deleted). Also included in the 188 update record may be other metadata, such as a subscription id of 189 the subscription as part of which the update record was generated. 191 In this document, update records are often also simply referred to 192 as "updates". 194 o Update trigger: A mechanism that determines when an update record 195 needs to be generated. 197 o YANG-Push: The subscription and push mechanism for datastore 198 updates that is specified in this document. 200 3. Solution Overview 202 This document specifies a solution that provides a subscription 203 service for updates from a datastore. This solution supports dynamic 204 as well as configured subscriptions to updates of datastore nodes. 205 Subscriptions specify when notification messages (also referred to as 206 "push updates") should be sent and what data to include in update 207 records. Datastore node updates are subsequently pushed from the 208 publisher to the receiver per the terms of the subscription. 210 3.1. Subscription Model 212 YANG-push subscriptions are defined using a YANG data model. This 213 model enhances the subscription model defined in 214 [I-D.draft-ietf-netconf-subscribed-notifications] with capabilities 215 that allow subscribers to subscribe to datastore node updates, 216 specifically to specify the update triggers defining when to generate 217 update records as well as what to include in an update record. Key 218 enhancements include: 220 o Specification of selection filters which identify targeted YANG 221 datastore nodes and/or datastore subtrees for which updates are to 222 be pushed. 224 o Specification of update policies contain conditions which trigger 225 the generation and pushing of new update records. There are two 226 types of subscriptions, distinguished by how updates are 227 triggered: periodic and on-change. 229 * For periodic subscriptions, the update trigger is specified by 230 two parameters that define when updates are to be pushed. 231 These parameters are the period interval with which to report 232 updates, and an "anchor time", i.e. a reference point in time 233 that can be used to calculate at which points in time periodic 234 updates need to be assembled and sent. 236 * For on-change subscriptions, an update trigger occurs whenever 237 a change in the subscribed information is detected. Included 238 are additional parameters that include: 240 + Dampening period: In an on-change subscription, detected 241 object changes should be sent as quickly as possible. 242 However it may be undesirable to send a rapid series of 243 object changes. Such behavior has the potential to exhaust 244 resources in the publisher or receiver. In order to protect 245 against that, a dampening period MAY be used to specify the 246 interval which has to pass before successive update records 247 for the same subscription are generated for a receiver. The 248 dampening period collectively applies to the set of all 249 datastore nodes selected by a single subscription. This 250 means that when there is a change to one or more subscribed 251 objects, an update record containing those objects is 252 created immediately (when no dampening period is in effect) 253 or at the end of a dampening period (when a dampening period 254 is in fact in effect). If multiple changes to a single 255 object occur during a dampening period, only the value that 256 is in effect at the time when the update record is created 257 is included. The dampening period goes into effect every 258 time an update record completes assembly. 260 + Change type: This parameter can be used to reduce the types 261 of datastore changes for which updates are sent (e.g., you 262 might only send an update when an object is created or 263 deleted, but not when an object value changes). 265 + Sync on start: defines whether or not a complete push-update 266 of all subscribed data will be sent at the beginning of a 267 subscription. Such early synchronization establishes the 268 frame of reference for subsequent updates. 270 o An encoding (using anydata) for the contents of periodic and on- 271 change push updates. 273 3.2. Negotiation of Subscription Policies 275 A dynamic subscription request SHOULD be declined if a publisher's 276 assessment is that it may be unable to provide update records meeting 277 the terms of an "establish-subscription" or "modify-subscription" RPC 278 request. In this case, a subscriber may quickly follow up with a new 279 RPC request using different parameters. 281 Random guessing of different parameters by a subscriber is to be 282 discouraged. Therefore, in order to minimize the number of 283 subscription iterations between subscriber and publisher, a dynamic 284 subscription supports a simple negotiation between subscribers and 285 publishers for subscription parameters. This negotiation is in the 286 form of supplemental information which should be inserted within 287 error responses to a failed RPC request. This returned error 288 response information, when considered, should increase the likelihood 289 of success for subsequent RPC requests. Such hints include suggested 290 periodic time intervals, acceptable dampening periods, and size 291 estimates for the number or objects which would be returned from a 292 proposed selection filter. However, there are no guarantees that 293 subsequent requests which consider these hints will be accepted. 295 3.3. On-Change Considerations 297 On-change subscriptions allow receivers to receive updates whenever 298 changes to targeted objects occur. As such, on-change subscriptions 299 are particularly effective for data that changes infrequently, yet 300 for which applications need to be quickly notified whenever a change 301 does occur with minimal delay. 303 On-change subscriptions tend to be more difficult to implement than 304 periodic subscriptions. Accordingly, on-change subscriptions may not 305 be supported by all implementations or for every object. 307 Whether or not to accept or reject on-change subscription requests 308 when the scope of the subscription contains objects for which on- 309 change is not supported is up to the publisher implementation. A 310 publisher MAY accept an on-change subscription even when the scope of 311 the subscription contains objects for which on-change is not 312 supported. In that case, updates are sent only for those objects 313 within the scope that do support on-change updates, whereas other 314 objects are excluded from update records, even if their values 315 change. In order for a subscriber to determine whether objects 316 support on-change subscriptions, objects are marked accordingly on a 317 publisher. Accordingly, when subscribing, it is the responsibility 318 of the subscriber to ensure it is aware of which objects support on- 319 change and which do not. For more on how objects are so marked, see 320 Section 3.10. 322 Alternatively, a publisher MAY decide to simply reject an on-change 323 subscription in case the scope of the subscription contains objects 324 for which on-change is not supported. In case of a configured 325 subscription, the publisher MAY suspend the subscription. 327 To avoid flooding receivers with repeated updates for subscriptions 328 containing fast-changing objects, or objects with oscillating values, 329 an on-change subscription allows for the definition of a dampening 330 period. Once an update record for a given object is generated, no 331 other updates for this particular subscription will be created until 332 the end of the dampening period. Values sent at the end of the 333 dampening period are the values that are current at the end of the 334 dampening period of all changed objects. Changed objects include 335 those which were deleted or newly created during that dampening 336 period. If an object has returned to its original value (or even has 337 been created and then deleted) during the dampening-period, that 338 value (and not the interim change) will still be sent. This will 339 indicate churn is occurring on that object. 341 On-change subscriptions can be refined to let users subscribe only to 342 certain types of changes. For example, a subscriber might only want 343 object creations and deletions, but not modifications of object 344 values. 346 Putting it all together, following is the conceptual process for 347 creating an update record as part of an on-change subscription: 349 1. Just before a change, or at the start of a dampening period, 350 evaluate any filtering and any access control rules to ensure 351 receiver is authorized to view all subscribed datastore nodes 352 (filtering out any nodes for which this is not the case). The 353 result is a set "A" of datastore nodes and subtrees. 355 2. Just after a change, or at the end of a dampening period, 356 evaluate any filtering and any (possibly new) access control 357 rules. The result is a set "B" of datastore nodes and subtrees. 359 3. Construct an update record, which takes the form of YANG patch 360 record [RFC8072] for going from A to B. 362 4. If there were any changes made between A and B which canceled 363 each other out, insert into the YANG patch record the last change 364 made, even if the new value is no different from the original 365 value (since changes that were made in the interim were canceled 366 out). In case the changes involve creating a new datastore node, 367 then deleting it, the YANG patch record will indicate deletion of 368 the datastore node. Similarly, in case the changes involve 369 deleting a new datastore node, then recreating it, the YANG patch 370 record will indicate creation of the datastore node. 372 5. If the resulting patch record is non-empty, send it to the 373 receiver. 375 Note: In cases where a subscriber wants to have separate dampening 376 periods for different objects, the subscriber has the option to 377 create multiple subscriptions with different selection filters. 379 3.4. Reliability Considerations 381 A subscription to updates from a datastore is intended to obviate the 382 need for polling. However, in order to do so, it is critical that 383 subscribers can rely on the subscription and have confidence that 384 they will indeed receive the subscribed updates without having to 385 worry about updates being silently dropped. In other words, a 386 subscription constitutes a promise on the side of the publisher to 387 provide the receivers with updates per the terms of the subscription. 389 Now, there are many reasons why a publisher may at some point no 390 longer be able to fulfill the terms of the subscription, even if the 391 subscription had been entered into with good faith. For example, the 392 volume of datastore nodes may be larger than anticipated, the 393 interval may prove too short to send full updates in rapid 394 succession, or an internal problem may prevent objects from being 395 collected. For this reason, the solution that is defined in this 396 document mandates that a publisher notifies receivers immediately and 397 reliably whenever it encounters a situation in which it is unable to 398 keep the terms of the subscription, and provides the publisher with 399 the option to suspend the subscription in such a case. This includes 400 indicating the fact that an update is incomplete as part of a push- 401 update or push-change-update notification, as well as emitting a 402 subscription-suspended notification as applicable. This is described 403 further in Section 3.11.1. 405 A publisher SHOULD reject a request for a subscription if it is 406 unlikely that the publisher will be able to fulfill the terms of that 407 subscription request. In such cases, it is preferable to have a 408 subscriber request a less resource intensive subscription than to 409 deal with frequently degraded behavior. 411 The solution builds on 412 [I-D.draft-ietf-netconf-subscribed-notifications]. As defined there, 413 any loss of underlying transport connection will be detected and 414 result in subscription termination (in case of dynamic subscriptions) 415 or suspension (in case of configured subscriptions), ensuring that 416 situations will not occur in which the loss of update notifications 417 would go unnoticed. 419 3.5. Data Encodings 421 3.5.1. Periodic Subscriptions 423 In a periodic subscription, the data included as part of an update 424 record corresponds to data that could have been read using a 425 retrieval operation. 427 3.5.2. On-Change Subscriptions 429 In an on-change subscription, update records need to indicate not 430 only values of changed datastore nodes but also the types of changes 431 that occurred since the last update. Therefore, encoding rules for 432 data in on-change updates will generally follow YANG-patch operation 433 as specified in [RFC8072]. The YANG-patch will describe what needs 434 to be applied to the earlier state reported by the preceding update, 435 to result in the now-current state. Note that contrary to [RFC8072], 436 objects encapsulated are not restricted to only configuration 437 objects. 439 A publisher indicates the type of change to a datastore node using 440 the different YANG patch operations: the "create" operation is used 441 for newly created objects (except entries in a user-ordered list), 442 the "delete" operation is used for deleted objects (including in 443 user-ordered lists), the "replace" operation is used when only the 444 object value changes, the "insert" operation is used when a new entry 445 is inserted in a list, and the "move" operation is used when an 446 existing entry in a user-ordered list is moved. 448 However, a patch must be able to do more than just describe the delta 449 from the previous state to the current state. As per Section 3.3, it 450 must also be able to identify whether transient changes have occurred 451 on an object during a dampening period. To support this, it is valid 452 to encode a YANG patch operation so that its application would result 453 in no change between the previous and current state. This indicates 454 that some churn has occurred on the object. An example of this would 455 be a patch that indicates a "create" operation for a datastore node 456 where the receiver believes one already exists, or a "replace" 457 operation which replaces a previous value with the same value. Note 458 that this means that the "create" and "delete" errors described in 459 [RFC8072] section 2.5 are not errors, and are valid operations with 460 YANG-Push. 462 3.6. Defining the Selection with a Datastore 464 A subscription must specify both the selection filters and the 465 datastore against which these selection filters will be applied. 466 This information is used to choose and subsequently push data from 467 the publisher's datastore to the receivers. 469 Only a single selection filter can be applied to a subscription at a 470 time. An RPC request proposing a new selection filter replaces any 471 existing filter. The following selection filter types are included 472 in the YANG-push data model, and may be applied against a datastore: 474 o subtree: A subtree selection filter identifies one or more 475 datastore subtrees. When specified, update records will only come 476 from the datastore nodes of selected datastore subtree(s). The 477 syntax and semantics correspond to that specified for [RFC6241] 478 section 6. 480 o xpath: An "xpath" selection filter is an XPath expression that 481 returns a node set. (XPath is a query language for selecting 482 nodes in an XML document.) When specified, updates will only come 483 from the selected datastore nodes. 485 These filters are intended to be used as selectors that define which 486 objects are within the scope of a subscription. A publisher MUST 487 support at least one type of selection filter. 489 XPath itself provides powerful filtering constructs and care must be 490 used in filter definition. Consider an XPath filter which only 491 passes a datastore node when an interface is up. It is up to the 492 receiver to understand implications of the presence or absence of 493 objects in each update. 495 When the set of selection filtering criteria is applied for a 496 periodic subscription, then they are applied whenever a periodic 497 update record is constructed, and only datastore nodes that pass the 498 filter and to which a receiver has access are provided to that 499 receiver. If the same filtering criteria is applied to an on-change 500 subscription, only the subset of those datastore nodes supporting on- 501 change is provided. A datastore node which doesn't support on-change 502 is never sent as part of an on-change subscription's "push-update" or 503 "push-change-update" (see Section 3.7). 505 3.7. Streaming Updates 507 Contrary to traditional data retrieval requests, datastore 508 subscription enables an unbounded series of update records to be 509 streamed over time. Two generic YANG notifications for update 510 records have been defined for this: "push-update" and "push-change- 511 update". 513 A "push-update" notification defines a complete, filtered update of 514 the datastore per the terms of a subscription. This type of YANG 515 notification is used for continuous updates of periodic 516 subscriptions. A "push-update" notification can also be used for the 517 on-change subscriptions in two cases. First, it MUST be used as the 518 initial "push-update" if there is a need to synchronize the receiver 519 at the start of a new subscription. It also MAY be sent if the 520 publisher later chooses to resync an on-change subscription. The 521 "push-update" update record contains an instantiated datastore 522 subtree with all of the subscribed contents. The content of the 523 update record is equivalent to the contents that would be obtained 524 had the same data been explicitly retrieved using a datastore 525 retrieval operation using the same transport with the same filters 526 applied. 528 A "push-change-update" notification is the most common type of update 529 for on-change subscriptions. The update record in this case contains 530 the set of changes that datastore nodes have undergone since the last 531 notification message. In other words, this indicates which datastore 532 nodes have been created, deleted, or have had changes to their 533 values. In cases where multiple changes have occurred over the 534 course of a dampening period and the object has not been deleted, the 535 object's most current value is reported. (In other words, for each 536 object, only one change is reported, not its entire history. Doing 537 so would defeat the purpose of the dampening period.) 539 "Push-update" and "push-change-update" are encoded and placed within 540 notification messages, and ultimately queued for egress over the 541 specified transport. 543 The following is an example of a notification message for a 544 subscription tracking the operational status of a single Ethernet 545 interface (per [RFC8343]). This notification message is encoded XML 546 over NETCONF as per 547 [I-D.draft-ietf-netconf-netconf-event-notifications]. 549 550 2017-10-25T08:00:11.22Z 551 552 1011 553 554 555 556 eth0 557 up 558 559 560 561 562 564 Figure 1: Push example 566 The following is an example of an on-change notification message for 567 the same subscription. 569 570 2017-10-25T08:22:33.44Z 571 573 89 574 575 576 0 577 578 edit1 579 replace 580 /ietf-interfaces:interfaces 581 582 584 585 eth0 586 down 587 588 589 590 591 592 593 594 596 Figure 2: Push example for on change 598 Of note in the above example is the 'patch-id' with a value of '0'. 599 Per [RFC8072], the 'patch-id' is an arbitrary string. With YANG 600 Push, the publisher SHOULD put into the 'patch-id' a counter starting 601 at '0' which increments with every 'push-change-update' generated for 602 a subscription. If used as a counter, this counter MUST be reset to 603 '0' anytime a resynchronization occurs (i.e., with the sending of a 604 'push-update'). Also if used as a counter, the counter MUST be reset 605 to '0' after passing a maximum value of '4294967295' (i.e. maximum 606 value that can be represented using uint32 data type). Such a 607 mechanism allows easy identification of lost or out-of-sequence 608 update records. 610 3.8. Subscription Management 612 The RPCs defined within 613 [I-D.draft-ietf-netconf-subscribed-notifications] have been enhanced 614 to support datastore subscription negotiation. Also, new error codes 615 have been added that are able to indicate why a datastore 616 subscription attempt has failed, along with new YANG-data that MAY be 617 used to include details on input parameters that might result in a 618 successful subsequent RPC invocation. 620 The establishment or modification of a datastore subscription can be 621 rejected for multiple reasons. This includes a too large subtree 622 request, or the inability of the publisher to push update records as 623 frequently as requested. In such cases, no subscription is 624 established. Instead, the subscription-result with the failure 625 reason is returned as part of the RPC response. As part of this 626 response, a set of alternative subscription parameters MAY be 627 returned that would likely have resulted in acceptance of the 628 subscription request. The subscriber may consider these as part of 629 future subscription attempts. 631 In the case of a rejected request for an establishment of a datastore 632 subscription, if there are hints, the hints SHOULD be transported 633 within a YANG-data "establish-subscription-datastore-error-info" 634 container inserted into the RPC error response, in lieu of the 635 "establish-subscription-stream-error-info" that is inserted in case 636 of a stream subscription. 638 Below is a tree diagram for "establish-subscription-datastore-error- 639 info". All tree diagrams used in this document follow the notation 640 defined in [RFC8340] 642 YANG-data establish-subscription-datastore-error-info 643 +--ro establish-subscription-datastore-error-info 644 +--ro reason? identityref 645 +--ro period-hint? centiseconds 646 +--ro filter-failure-hint? string 647 +--ro object-count-estimate? uint32 648 +--ro object-count-limit? uint32 649 +--ro kilobytes-estimate? uint32 650 +--ro kilobytes-limit? uint32 652 Figure 3: Tree diagram for establish-subscription-datastore-error- 653 info 655 Similarly, in the case of a rejected request for modification of a 656 datastore subscription, if there are hints, the hints SHOULD be 657 transported within a YANG-data "modify-subscription-datastore-error- 658 info" container inserted into the RPC error response, in lieu of the 659 "modify-subscription-stream-error-info" that is inserted in case of a 660 stream subscription. 662 Below is a tree diagram for "modify-subscription-datastore-error- 663 info". 665 YANG-data modify-subscription-datastore-error-info 666 +--ro modify-subscription-datasore-error-info 667 +--ro reason? identityref 668 +--ro period-hint? centiseconds 669 +--ro filter-failure-hint? string 670 +--ro object-count-estimate? uint32 671 +--ro object-count-limit? uint32 672 +--ro kilobytes-estimate? uint32 673 +--ro kilobytes-limit? uint32 675 Figure 4: Tree diagram for modify-subscription-datastore-error-info 677 3.9. Receiver Authorization 679 A receiver of subscription data MUST only be sent updates for which 680 it has proper authorization. A publisher MUST ensure that no non- 681 authorized data is included in push updates. To do so, it needs to 682 apply all corresponding checks applicable at the time of a specific 683 pushed update and if necessary silently remove any non-authorized 684 data from datastore subtrees. This enables YANG data pushed based on 685 subscriptions to be authorized equivalently to a regular data 686 retrieval (get) operation. 688 Each "push-update" and "push-change-update" MUST have access control 689 applied, as is depicted in the following diagram. This includes 690 validating that read access is permitted for any new objects selected 691 since the last notification message was sent to a particular 692 receiver. To accomplish this, implementations SHOULD support the 693 conceptual authorization model of [RFC8341], specifically section 694 3.2.4. 696 +-----------------+ +--------------------+ 697 push-update or --> | datastore node | yes | add datastore node | 698 push-change-update | access allowed? | ---> | to update record | 699 +-----------------+ +--------------------+ 701 Figure 5: Updated [RFC8341] access control for push updates 703 A publisher MUST allow for the possibility that a subscription's 704 selection filter references non-existent data or data that a receiver 705 is not allowed to access. Such support permits a receiver the 706 ability to monitor the entire lifecyle of some datastore tree without 707 needing to explicitly enumerate every individual datastore node. If, 708 after access control has been applied, there are no objects remaining 709 in an update record, then (in case of a periodic subscription) only a 710 single empty "push-update" notification MUST be sent. Empty "push- 711 change-update" messages (in case of an on-change subscription) MUST 712 NOT be sent. This is required to ensure that clients cannot 713 surreptitiously monitor objects that they do not have access to via 714 carefully crafted selection filters. By the same token, changes to 715 objects that are filtered MUST NOT affect any dampening intervals. 717 A publisher MAY choose to reject an establish-subscription request 718 which selects non-existent data or data that a receiver is not 719 allowed to access. As reason, the error identity "unchanging- 720 selection" SHOULD be returned. In addition, a publisher MAY choose 721 to terminate a dynamic subscription or suspend a configured receiver 722 when the authorization privileges of a receiver change, or the access 723 controls for subscribed objects change. In that case, the publisher 724 SHOULD include the error identity "unchanging-selection" as reason 725 when sending the "subscription-terminated" respectively 726 "subscription-suspended" notification. Such a capability enables the 727 publisher to avoid having to support continuous and total filtering 728 of a subscription's content for every update record. It also reduces 729 the possibility of leakage of access-controlled objects. 731 If read access into previously accessible nodes has been lost due to 732 a receiver permissions change, this SHOULD be reported as a patch 733 "delete" operation for on-change subscriptions. If not capable of 734 handling such receiver permission changes with such a "delete", 735 publisher implementations MUST force dynamic subscription re- 736 establishment or configured subscription re-initialization so that 737 appropriate filtering is installed. 739 3.10. On-Change Notifiable Datastore Nodes 741 In some cases, a publisher supporting on-change notifications may not 742 be able to push on-change updates for some object types. Reasons for 743 this might be that the value of the datastore node changes frequently 744 (e.g., [RFC8343]'s in-octets counter), that small object changes are 745 frequent and meaningless (e.g., a temperature gauge changing 0.1 746 degrees), or that the implementation is not capable of on-change 747 notification for a particular object. 749 In those cases, it will be important for client applications to have 750 a way to identify for which objects on-change notifications are 751 supported and for which ones they are not supported. Otherwise 752 client applications will have no way of knowing whether they can 753 indeed rely on their on-change subscription to provide them with the 754 change updates that they are interested in. In other words, if 755 implementations do not provide a solution and do not support 756 comprehensive on-change notifiability, clients of those 757 implementations will have no way of knowing what their on-change 758 subscription actually covers. 760 Implementations are therefore strongly advised to provide a solution 761 to this problem. For example, a solution might involve making 762 discoverable to clients which objects are on-change notifiable, 763 specified using another YANG data model. It is expected that such a 764 solution will be standardized at some point in the future. In the 765 meantime and until this occurs, implementations SHOULD provide their 766 own solution. 768 3.11. Other Considerations 770 3.11.1. Robustness and reliability 772 Particularly in the case of on-change updates, it is important that 773 these updates do not get lost. In case the loss of an update is 774 unavoidable, it is critical that the receiver is notified 775 accordingly. 777 Update records for a single subscription MUST NOT be resequenced 778 prior to transport. 780 It is conceivable that under certain circumstances, a publisher will 781 recognize that it is unable to include within an update record the 782 full set of objects desired per the terms of a subscription. In this 783 case, the publisher MUST act as follows. 785 o The publisher MUST set the "incomplete-update" flag on any update 786 record which is known to be missing information. 788 o The publisher MAY choose to suspend the subscription as per 789 [I-D.draft-ietf-netconf-subscribed-notifications]. If the 790 publisher does not create an update record at all, it MUST suspend 791 the subscription. 793 o When resuming an on-change subscription, the publisher SHOULD 794 generate a complete patch from the previous update record. If 795 this is not possible and the "sync-on-start" option is true for 796 the subscription, then the full datastore contents MAY be sent via 797 a "push-update" instead (effectively replacing the previous 798 contents). If neither of these are possible, then an "incomplete- 799 update" flag MUST be included on the next "push-change-update". 801 Note: It is perfectly acceptable to have a series of "push-change- 802 update" notifications (and even "push update" notifications) serially 803 queued at the transport layer awaiting transmission. It is not 804 required for the publisher to merge pending update records sent at 805 the same time. 807 On the receiver side, what action to take when a record with an 808 incomplete-update flag is received depends on the application. It 809 could simply choose to wait and do nothing. It could choose to 810 resynch, actively retrieving all subscribed information. It could 811 also choose to tear down the subscription and start a new one, 812 perhaps with a lesser scope that contains less objects. 814 3.11.2. Publisher capacity 816 It is far preferable to decline a subscription request than to accept 817 such a request when it cannot be met. 819 Whether or not a subscription can be supported will be determined by 820 a combination of several factors such as the subscription update 821 trigger (on-change or periodic), the period in which to report 822 changes (one second periods will consume more resources than one hour 823 periods), the amount of data in the datastore subtree that is being 824 subscribed to, and the number and combination of other subscriptions 825 that are concurrently being serviced. 827 4. A YANG Data Model for Management of Datastore Push Subscriptions 829 4.1. Overview 831 The YANG data model for datastore push subscriptions is depicted in 832 the following figures. The tree diagram that is used follows the 833 notation defined in [RFC8340]. New schema objects defined here 834 (i.e., beyond those from 835 [I-D.draft-ietf-netconf-subscribed-notifications]) are identified 836 with "yp". For the reader's convenience, in order to compact the 837 tree representation, some nodes that are defined in ietf-subscribed- 838 notifications and that are not essential to the understanding of the 839 data model defined here have been removed. This is indicated by 840 "..." in the diagram where applicable. 842 Because the tree diagram is quite large, its depiction is broken up 843 into several figures. The first figure depicts the augmentations 844 that are introduced in module ietf-yang-push to subscription 845 configuration specified in module ietf-subscribed-notifications. 847 module: ietf-subscribed-notifications 848 ... 849 +--rw filters 850 | ... 851 | +--rw yp:selection-filter* [filter-id] 852 | +--rw yp:filter-id string 853 | +--rw (yp:filter-spec)? 854 | +--:(yp:datastore-subtree-filter) 855 | | +--rw yp:datastore-subtree-filter? 856 | | {sn:subtree}? 857 | +--:(yp:datastore-xpath-filter) 858 | +--rw yp:datastore-xpath-filter? yang:xpath1.0 859 | {sn:xpath}? 860 +--rw subscriptions 861 +--rw subscription* [id] 862 | ... 863 +--rw (target) 864 | +--:(stream) 865 | | ... 866 | +--:(yp:datastore) 867 | +--rw yp:datastore identityref 868 | +--rw (yp:selection-filter)? 869 | +--:(yp:by-reference) 870 | | +--rw yp:selection-filter-ref 871 | | selection-filter-ref 872 | +--:(yp:within-subscription) 873 | +--rw (yp:filter-spec)? 874 | +--:(yp:datastore-subtree-filter) 875 | | +--rw yp:datastore-subtree-filter? 876 | | {sn:subtree}? 877 | +--:(yp:datastore-xpath-filter) 878 | +--rw yp:datastore-xpath-filter? 879 | yang:xpath1.0 {sn:xpath}? 880 | ... 881 +--rw (yp:update-trigger) 882 +--:(yp:periodic) 883 | +--rw yp:periodic! 884 | +--rw yp:period centiseconds 885 | +--rw yp:anchor-time? yang:date-and-time 886 +--:(yp:on-change) {on-change}? 887 +--rw yp:on-change! 888 +--rw yp:dampening-period? centiseconds 889 +--rw yp:sync-on-start? boolean 890 +--rw yp:excluded-change* change-type 892 Figure 6: Model structure: subscription configuration 894 The next figure depicts the augmentations of module ietf-yang-push 895 made to RPCs specified in module ietf-subscribed-notifications. 896 Specifically, these augmentations concern the establish-subscription 897 and modify-subscription RPCs, which are augmented with parameters 898 that are needed to specify datastore push subscriptions. 900 rpcs: 901 +---x establish-subscription 902 | +---w input 903 | | ... 904 | | +---w (target) 905 | | | +--:(stream) 906 | | | | ... 907 | | | +--:(yp:datastore) 908 | | | +---w yp:datastore identityref 909 | | | +---w (yp:selection-filter)? 910 | | | +--:(yp:by-reference) 911 | | | | +---w yp:selection-filter-ref 912 | | | | selection-filter-ref 913 | | | +--:(yp:within-subscription) 914 | | | +---w (yp:filter-spec)? 915 | | | +--:(yp:datastore-subtree-filter) 916 | | | | +---w yp:datastore-subtree-filter? 917 | | | | {sn:subtree}? 918 | | | +--:(yp:datastore-xpath-filter) 919 | | | +---w yp:datastore-xpath-filter? 920 | | | yang:xpath1.0 {sn:xpath}? 921 | | | ... 922 | | +---w (yp:update-trigger) 923 | | +--:(yp:periodic) 924 | | | +---w yp:periodic! 925 | | | +---w yp:period centiseconds 926 | | | +---w yp:anchor-time? yang:date-and-time 927 | | +--:(yp:on-change) {on-change}? 928 | | +---w yp:on-change! 929 | | +---w yp:dampening-period? centiseconds 930 | | +---w yp:sync-on-start? boolean 931 | | +---w yp:excluded-change* change-type 932 | +--ro output 933 | +--ro id subscription-id 934 | +--ro replay-start-time-revision? yang:date-and-time 935 | {replay}? 936 +---x modify-subscription 937 | +---w input 938 | ... 939 | +---w (target) 940 | | ... 942 | | +--:(yp:datastore) 943 | | +---w yp:datastore identityref 944 | | +---w (yp:selection-filter)? 945 | | +--:(yp:by-reference) 946 | | | +---w yp:selection-filter-ref 947 | | | selection-filter-ref 948 | | +--:(yp:within-subscription) 949 | | +---w (yp:filter-spec)? 950 | | +--:(yp:datastore-subtree-filter) 951 | | | +---w yp:datastore-subtree-filter? 952 | | | {sn:subtree}? 953 | | +--:(yp:datastore-xpath-filter) 954 | | +---w yp:datastore-xpath-filter? 955 | | yang:xpath1.0 {sn:xpath}? 956 | | ... 957 | +---w (yp:update-trigger) 958 | +--:(yp:periodic) 959 | | +---w yp:periodic! 960 | | +---w yp:period centiseconds 961 | | +---w yp:anchor-time? yang:date-and-time 962 | +--:(yp:on-change) {on-change}? 963 | +---w yp:on-change! 964 | +---w yp:dampening-period? centiseconds 965 +---x delete-subscription 966 | ... 967 +---x kill-subscription 968 ... 970 YANG-data (for placement into rpc error responses) 971 ... 973 Figure 7: Model structure: RPCs 975 The next figure depicts augmentations of module ietf-yang-push to the 976 notifications that are specified in module ietf-subscribed- 977 notifications. The augmentations allow the inclusion of subscription 978 configuration parameters that are specific to datastore push 979 subscriptions as part of subscription-started and subscription- 980 modified notifications. 982 notifications: 983 +---n replay-completed {replay}? 984 | ... 985 +---n subscription-completed 986 | ... 987 +---n subscription-started {configured}? 988 | | ... 989 | +--ro (target) 990 | | ... 991 | | +--:(yp:datastore) 992 | | +--ro yp:datastore identityref 993 | | +--ro (yp:selection-filter)? 994 | | +--:(yp:by-reference) 995 | | | +--ro yp:selection-filter-ref 996 | | | selection-filter-ref 997 | | +--:(yp:within-subscription) 998 | | +--ro (yp:filter-spec)? 999 | | +--:(yp:datastore-subtree-filter) 1000 | | | +--ro yp:datastore-subtree-filter? 1001 | | | {sn:subtree}? 1002 | | +--:(yp:datastore-xpath-filter) 1003 | | +--ro yp:datastore-xpath-filter? 1004 | | yang:xpath1.0 {sn:xpath}? 1005 | ... 1006 | +--ro (yp:update-trigger) 1007 | +--:(yp:periodic) 1008 | | +--ro yp:periodic! 1009 | | +--ro yp:period centiseconds 1010 | | +--ro yp:anchor-time? yang:date-and-time 1011 | +--:(yp:on-change) {on-change}? 1012 | +--ro yp:on-change! 1013 | +--ro yp:dampening-period? centiseconds 1014 | +--ro yp:sync-on-start? boolean 1015 | +--ro yp:excluded-change* change-type 1016 +---n subscription-resumed 1017 | ... 1018 +---n subscription-modified 1019 | ... 1020 | +--ro (target) 1021 | | | ... 1022 | | +--:(yp:datastore) 1023 | | +--ro yp:datastore identityref 1024 | | +--ro (yp:selection-filter)? 1025 | | +--:(yp:by-reference) 1026 | | | +--ro yp:selection-filter-ref 1027 | | | selection-filter-ref 1028 | | +--:(yp:within-subscription) 1029 | | +--ro (yp:filter-spec)? 1030 | | +--:(yp:datastore-subtree-filter) 1031 | | | +--ro yp:datastore-subtree-filter? 1032 | | | {sn:subtree}? 1033 | | +--:(yp:datastore-xpath-filter) 1034 | | +--ro yp:datastore-xpath-filter? 1035 | | yang:xpath1.0 {sn:xpath}? 1036 | ... 1037 | +--ro (yp:update-trigger)? 1038 | +--:(yp:periodic) 1039 | | +--ro yp:periodic! 1040 | | +--ro yp:period centiseconds 1041 | | +--ro yp:anchor-time? yang:date-and-time 1042 | +--:(yp:on-change) {on-change}? 1043 | +--ro yp:on-change! 1044 | +--ro yp:dampening-period? centiseconds 1045 | +--ro yp:sync-on-start? boolean 1046 | +--ro yp:excluded-change* change-type 1047 +---n subscription-terminated 1048 | ... 1049 +---n subscription-suspended 1050 ... 1052 Figure 8: Model structure: Notifications 1054 The final figure in this section depicts the parts of module ietf- 1055 yang-push that are not simply augmentations to another module, but 1056 that are newly introduced. 1058 module: ietf-yang-push 1060 rpcs: 1061 +---x resync-subscription {on-change}? 1062 +---w input 1063 +---w id sn:subscription-id 1065 YANG-data: (for placement into rpc error responses) 1066 +-- resync-subscription-error 1067 | +--ro reason? identityref 1068 | +--ro period-hint? centiseconds 1069 | +--ro filter-failure-hint? string 1070 | +--ro object-count-estimate? uint32 1071 | +--ro object-count-limit? uint32 1072 | +--ro kilobytes-estimate? uint32 1073 | +--ro kilobytes-limit? uint32 1074 +-- establish-subscription-error-datastore 1075 | +--ro reason? identityref 1076 | +--ro period-hint? centiseconds 1077 | +--ro filter-failure-hint? string 1078 | +--ro object-count-estimate? uint32 1079 | +--ro object-count-limit? uint32 1080 | +--ro kilobytes-estimate? uint32 1081 | +--ro kilobytes-limit? uint32 1082 +-- modify-subscription-error-datastore 1083 +--ro reason? identityref 1084 +--ro period-hint? centiseconds 1085 +--ro filter-failure-hint? string 1086 +--ro object-count-estimate? uint32 1087 +--ro object-count-limit? uint32 1088 +--ro kilobytes-estimate? uint32 1089 +--ro kilobytes-limit? uint32 1091 notifications: 1092 +---n push-update 1093 | +--ro id? sn:subscription-id 1094 | +--ro datastore-contents? 1095 | +--ro incomplete-update? empty 1096 +---n push-change-update {on-change}? 1097 +--ro id? sn:subscription-id 1098 +--ro datastore-changes 1099 | +--ro yang-patch 1100 | +--ro patch-id string 1101 | +--ro comment? string 1102 | +--ro edit* [edit-id] 1103 | +--ro edit-id string 1104 | +--ro operation enumeration 1105 | +--ro target target-resource-offset 1106 | +--ro point? target-resource-offset 1107 | +--ro where? enumeration 1108 | +--ro value? 1109 +--ro incomplete-update? empty 1111 Figure 9: Model structure (non-augmentation portions 1113 Selected components of the model are summarized below. 1115 4.2. Subscription Configuration 1117 Both configured and dynamic subscriptions are represented within the 1118 list "subscription". New parameters extending the basic subscription 1119 data model in [I-D.draft-ietf-netconf-subscribed-notifications] 1120 include: 1122 o The targeted datastore from which the selection is being made. 1123 The potential datastores include those from [RFC8341]. A platform 1124 may also choose to support a custom datastore. 1126 o A selection filter identifying YANG nodes of interest within a 1127 datastore. Filter contents are specified via a reference to an 1128 existing filter, or via an in-line definition for only that 1129 subscription. Referenced filters allows an implementation to 1130 avoid evaluating filter acceptability during a dynamic 1131 subscription request. The case statement differentiates the 1132 options. 1134 o For periodic subscriptions, triggered updates will occur at the 1135 boundaries of a specified time interval. These boundaries can be 1136 calculated from the periodic parameters: 1138 * a "period" which defines the duration between push updates. 1140 * an "anchor-time"; update intervals fall on the points in time 1141 that are a multiple of a "period" from an "anchor-time". If 1142 "anchor-time" is not provided, then the "anchor-time" MUST be 1143 set with the creation time of the initial update record. 1145 o For on-change subscriptions, assuming any dampening period has 1146 completed, triggering occurs whenever a change in the subscribed 1147 information is detected. On-change subscriptions have more 1148 complex semantics that is guided by its own set of parameters: 1150 * a "dampening-period" specifies the interval that must pass 1151 before a successive update for the subscription is sent. If no 1152 dampening period is in effect, the update is sent immediately. 1153 If a subsequent change is detected, another update is only sent 1154 once the dampening period has passed for this subscription. 1156 * an "excluded-change" parameter which allows restriction of the 1157 types of changes for which updates should be sent (e.g., only 1158 add to an update record on object creation). 1160 * a "sync-on-start" specifies whether a complete update with all 1161 the subscribed data is to be sent at the beginning of a 1162 subscription. 1164 4.3. YANG Notifications 1166 4.3.1. State Change Notifications 1168 Subscription state notifications and mechanism are reused from 1169 [I-D.draft-ietf-netconf-subscribed-notifications]. Notifications 1170 "subscription-started" and "subscription-modified" have been 1171 augmented to include the datastore specific objects. 1173 4.3.2. Notifications for Subscribed Content 1175 Along with the subscribed content, there are other objects which 1176 might be part of a "push-update" or "push-change-update" 1177 notification. 1179 An "id" (that identifies the subscription) MUST be transported along 1180 with the subscribed contents. This allows a receiver to 1181 differentiate which subscription resulted in a particular update 1182 record. 1184 A "time-of-update" which represents the time an update record 1185 snapshot was generated. A receiver MAY assume that at this point in 1186 time a publisher's objects have the values that were pushed. 1188 An "incomplete-update" leaf. This leaf indicates that not all 1189 changes which have occurred since the last update are actually 1190 included with this update. In other words, the publisher has failed 1191 to fulfill its full subscription obligations. (For example a 1192 datastore was unable to provide the full set of datastore nodes to a 1193 publisher process.) To facilitate re-synchronization of on-change 1194 subscriptions, a publisher MAY subsequently send a "push-update" 1195 containing a full selection snapshot of subscribed data. 1197 4.4. YANG RPCs 1199 YANG-Push subscriptions are established, modified, and deleted using 1200 RPCs augmented from 1201 [I-D.draft-ietf-netconf-subscribed-notifications]. 1203 4.4.1. Establish-subscription RPC 1205 The subscriber sends an establish-subscription RPC with the 1206 parameters in section 3.1. An example might look like: 1208 1210 1213 1215 ds:operational 1216 1217 1219 /ex:foo 1220 1221 1222 500 1223 1224 1225 1227 Figure 10: Establish-subscription RPC 1229 A positive response includes the "id" of the accepted subscription. 1230 In that case a publisher may respond: 1232 1234 1236 52 1237 1238 1240 Figure 11: Establish-subscription positive RPC response 1242 A subscription can be rejected for multiple reasons, including the 1243 lack of authorization to establish a subscription, no capacity to 1244 serve the subscription at the publisher, or the inability of the 1245 publisher to select datastore content at the requested cadence. 1247 If a request is rejected because the publisher is not able to serve 1248 it, the publisher SHOULD include in the returned error hints which 1249 help a subscriber understand subscription parameters might have been 1250 accepted for the request. These hints would be included within the 1251 YANG-data structure "establish-subscription-error-datastore". 1252 However even with these hints, there are no guarantee that subsequent 1253 requests will in fact be accepted. 1255 The specific parameters to be returned as part of the RPC error 1256 response depend on the specific transport that is used to manage the 1257 subscription. For NETCONF, those parameters are defined in 1258 [I-D.draft-ietf-netconf-netconf-event-notifications]. For example, 1259 for the following NETCONF request: 1261 1263 1267 1269 ds:operational 1270 1271 1273 /ex:foo 1274 1275 1276 100 1277 1278 1279 1281 Figure 12: Establish-subscription request example 2 1283 a publisher that cannot serve on-change updates but periodic updates 1284 might return the following NETCONF response: 1286 1289 1290 application 1291 operation-failed 1292 error 1293 /yp:periodic/yp:period 1294 1295 1296 yp:on-change-unsupported 1297 1298 1299 1300 1302 Figure 13: Establish-subscription error response example 2 1304 4.4.2. Modify-subscription RPC 1306 The subscriber MAY invoke the "modify-subscription" RPC for a 1307 subscription it previously established. The subscriber will include 1308 newly desired values in the "modify-subscription" RPC. Parameters 1309 not included MUST remain unmodified. Below is an example where a 1310 subscriber attempts to modify the period and datastore XPath filter 1311 of a subscription using NETCONF. 1313 1315 1319 1011 1320 1322 ds:operational 1323 1324 1326 /ex:bar 1327 1328 1329 250 1330 1331 1332 1334 Figure 14: Modify subscription request 1336 The publisher MUST respond to the subscription modification request. 1337 If the request is rejected, the existing subscription is left 1338 unchanged, and the publisher MUST send an RPC error response. This 1339 response might have hints encapsulated within the YANG-data structure 1340 "modify-subscription-error-datastore". A subscription MAY be 1341 modified multiple times. 1343 The specific parameters to be returned in as part of the RPC error 1344 response depend on the specific transport that is used to manage the 1345 subscription. For NETCONF, those parameters are specified in 1346 [I-D.draft-ietf-netconf-netconf-event-notifications]. 1348 A configured subscription cannot be modified using "modify- 1349 subscription" RPC. Instead, the configuration needs to be edited as 1350 needed. 1352 4.4.3. Delete-subscription RPC 1354 To stop receiving updates from a subscription and effectively delete 1355 a subscription that had previously been established using an 1356 "establish-subscription" RPC, a subscriber can send a "delete- 1357 subscription" RPC, which takes as only input the subscription's "id". 1358 This RPC is unmodified from 1359 [I-D.draft-ietf-netconf-subscribed-notifications]. 1361 4.4.4. Resync-subscription RPC 1363 This RPC is supported only for on-change subscriptions previously 1364 established using an "establish-subscription" RPC. For example: 1366 1368 1011 1371 1372 1374 Figure 15: Resync subscription 1376 On receipt, a publisher must either accept the request and quickly 1377 follow with a "push-update", or send an appropriate error within an 1378 rpc error response. Within an error response, the publisher MAY 1379 include supplemental information about the reasons within the YANG- 1380 data structure "resync-subscription-error". 1382 4.4.5. YANG Module Synchronization 1384 To make subscription requests, the subscriber needs to know the YANG 1385 datastore schemas used by the publisher, which are available via the 1386 YANG Library module, ietf-yang-library.yang from [RFC8525]. The 1387 receiver is expected to know the YANG library information before 1388 starting a subscription. 1390 The set of modules, revisions, features, and deviations can change at 1391 run-time (if supported by the publisher implementation). For this 1392 purpose, the YANG library provides a simple "yang-library-change" 1393 notification that informs the subscriber that the library has 1394 changed. In this case, a subscription may need to be updated to take 1395 the updates into account. The receiver may also need to be informed 1396 of module changes in order to process updates regarding datastore 1397 nodes from changed modules correctly. 1399 5. YANG Module 1401 This YANG module imports typedefs from [RFC6991], identities from 1402 [RFC8342], the YANG-data extension from [RFC8040], and the yang-patch 1403 grouping from [RFC8072]. In addition, it imports and augments many 1404 definitions from [I-D.draft-ietf-netconf-subscribed-notifications]. 1406 file "ietf-yang-push@2019-04-30.yang" 1407 module ietf-yang-push { 1408 yang-version 1.1; 1409 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-push"; 1410 prefix yp; 1412 import ietf-yang-types { 1413 prefix yang; 1414 reference 1415 "RFC 6991: Common YANG Data Types"; 1416 } 1417 import ietf-subscribed-notifications { 1418 prefix sn; 1419 reference 1420 "draft-ietf-netconf-subscribed-notifications: 1421 Customized Subscriptions to a Publisher's Event Streams 1422 NOTE TO RFC Editor: Please replace above reference to 1423 draft-ietf-netconf-subscribed-notifications with RFC number 1424 when published (i.e. RFC xxxx)."; 1425 } 1426 import ietf-datastores { 1427 prefix ds; 1428 reference 1429 "RFC 8342: Network Management Datastore Architecture (NMDA)"; 1430 } 1431 import ietf-restconf { 1432 prefix rc; 1433 reference 1434 "RFC 8040: RESTCONF Protocol"; 1435 } 1436 import ietf-yang-patch { 1437 prefix ypatch; 1438 reference 1439 "RFC 8072: YANG Patch Media Type"; 1440 } 1442 organization 1443 "IETF NETCONF Working Group"; 1444 contact 1445 "WG Web: 1446 WG List: 1448 Editor: Alexander Clemm 1449 1450 Editor: Eric Voit 1451 1452 Editor: Alberto Gonzalez Prieto 1453 1454 Editor: Ambika Prasad Tripathy 1455 1456 Editor: Einar Nilsen-Nygaard 1457 1458 Editor: Andy Bierman 1459 1460 Editor: Balazs Lengyel 1461 "; 1462 description 1463 "This module contains YANG specifications for YANG push. 1465 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 1466 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 1467 'MAY', and 'OPTIONAL' in this document are to be interpreted as 1468 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 1469 they appear in all capitals, as shown here. 1471 Copyright (c) 2019 IETF Trust and the persons identified as 1472 authors of the code. All rights reserved. 1474 Redistribution and use in source and binary forms, with or 1475 without modification, is permitted pursuant to, and subject to 1476 the license terms contained in, the Simplified BSD License set 1477 forth in Section 4.c of the IETF Trust's Legal Provisions 1478 Relating to IETF Documents 1479 (https://trustee.ietf.org/license-info). 1481 This version of this YANG module is part of RFC XXXX; 1482 see the RFC itself for full legal notices."; 1484 // RFC Ed.: replace XXXX with actual RFC number and remove this 1485 // note. 1487 revision 2019-04-30 { 1488 description 1489 "Initial revision. 1490 NOTE TO RFC EDITOR: 1491 (1)Please replace the above revision date to 1492 the date of RFC publication when published. 1493 (2) Please replace the date in the file name 1494 (ietf-yang-push@2019-04-30.yang) to the date of RFC 1495 publication. 1496 (3) Please replace the following reference to 1497 draft-ietf-netconf-yang-push-23 with RFC number when 1498 published (i.e. RFC xxxx)."; 1499 reference 1500 "draft-ietf-netconf-yang-push-23"; 1501 } 1503 /* 1504 * FEATURES 1505 */ 1507 feature on-change { 1508 description 1509 "This feature indicates that on-change triggered subscriptions 1510 are supported."; 1511 } 1513 /* 1514 * IDENTITIES 1515 */ 1517 /* Error type identities for datastore subscription */ 1519 identity resync-subscription-error { 1520 description 1521 "Problem found while attempting to fulfill an 1522 'resync-subscription' RPC request."; 1523 } 1525 identity cant-exclude { 1526 base sn:establish-subscription-error; 1527 description 1528 "Unable to remove the set of 'excluded-changes'. This means 1529 the publisher is unable to restrict 'push-change-update's to 1530 just the change types requested for this subscription."; 1531 } 1533 identity datastore-not-subscribable { 1534 base sn:establish-subscription-error; 1535 base sn:subscription-terminated-reason; 1536 description 1537 "This is not a subscribable datastore."; 1538 } 1540 identity no-such-subscription-resync { 1541 base resync-subscription-error; 1542 description 1543 "Referenced subscription doesn't exist. This may be as a result 1544 of a non-existent subscription ID, an ID which belongs to 1545 another subscriber, or an ID for configured subscription."; 1546 } 1548 identity on-change-unsupported { 1549 base sn:establish-subscription-error; 1550 description 1551 "On-change is not supported for any objects which are 1552 selectable by this filter."; 1553 } 1555 identity on-change-sync-unsupported { 1556 base sn:establish-subscription-error; 1557 description 1558 "Neither sync on start nor resynchronization are supported for 1559 this subscription. This error will be used for two 1560 reasons. First if an 'establish-subscription' RPC includes 1561 'sync-on-start', yet the publisher can't support sending a 1562 'push-update' for this subscription for reasons other than 1563 'on-change-unsupported' or 'sync-too-big'. And second, if the 1564 'resync-subscription' RPC is invoked either for an existing 1565 periodic subscription, or for an on-change subscription which 1566 can't support resynchronization."; 1567 } 1569 identity period-unsupported { 1570 base sn:establish-subscription-error; 1571 base sn:modify-subscription-error; 1572 base sn:subscription-suspended-reason; 1573 description 1574 "Requested time period or dampening-period is too short. This 1575 can be for both periodic and on-change subscriptions (with or 1576 without dampening.) Hints suggesting alternative periods may 1577 be returned as supplemental information."; 1578 } 1580 identity update-too-big { 1581 base sn:establish-subscription-error; 1582 base sn:modify-subscription-error; 1583 base sn:subscription-suspended-reason; 1584 description 1585 "Periodic or on-change push update datatrees exceed a maximum 1586 size limit. Hints on estimated size of what was too big may 1587 be returned as supplemental information."; 1588 } 1589 identity sync-too-big { 1590 base sn:establish-subscription-error; 1591 base sn:modify-subscription-error; 1592 base resync-subscription-error; 1593 base sn:subscription-suspended-reason; 1594 description 1595 "Sync-on-start or resynchronization datatree exceeds a maximum 1596 size limit. Hints on estimated size of what was too big may 1597 be returned as supplemental information."; 1598 } 1600 identity unchanging-selection { 1601 base sn:establish-subscription-error; 1602 base sn:modify-subscription-error; 1603 base sn:subscription-terminated-reason; 1604 description 1605 "Selection filter is unlikely to ever select datatree nodes. 1606 This means that based on the subscriber's current access 1607 rights, the publisher recognizes that the selection filter is 1608 unlikely to ever select datatree nodes which change. Examples 1609 for this might be that node or subtree doesn't exist, read 1610 access is not permitted for a receiver, or static objects that 1611 only change at reboot have been chosen."; 1612 } 1614 /* 1615 * TYPE DEFINITIONS 1616 */ 1618 typedef change-type { 1619 type enumeration { 1620 enum create { 1621 description 1622 "A change that refers to the creation of a new datastore 1623 node."; 1624 } 1625 enum delete { 1626 description 1627 "A change that refers to the deletion of a datastore 1628 node."; 1629 } 1630 enum insert { 1631 description 1632 "A change that refers to the insertion of a new 1633 user-ordered datastore node."; 1634 } 1635 enum move { 1636 description 1637 "A change that refers to a reordering of the target 1638 datastore node."; 1639 } 1640 enum replace { 1641 description 1642 "A change that refers to a replacement of the target 1643 datastore node's value."; 1644 } 1645 } 1646 description 1647 "Specifies different types of datastore changes. 1649 This type is based on the edit operations defined for YANG 1650 Patch, with the difference that it is valid for a receiver to 1651 process an update record which performs a create operation on 1652 a datastore node the receiver believes exists, or to process a 1653 delete on a datastore node the receiver believes is missing."; 1654 reference 1655 "RFC 8072: YANG Patch Media Type, section 2.5"; 1656 } 1658 typedef selection-filter-ref { 1659 type leafref { 1660 path "/sn:filters/yp:selection-filter/yp:filter-id"; 1661 } 1662 description 1663 "This type is used to reference a selection filter."; 1664 } 1666 typedef centiseconds { 1667 type uint32; 1668 description 1669 "A period of time, measured in units of 0.01 seconds."; 1670 } 1672 /* 1673 * GROUP DEFINITIONS 1674 */ 1676 grouping datastore-criteria { 1677 description 1678 "A grouping to define criteria for which selected objects 1679 from a targeted datastore should be included in push 1680 updates."; 1681 leaf datastore { 1682 type identityref { 1683 base ds:datastore; 1685 } 1686 mandatory true; 1687 description 1688 "Datastore from which to retrieve data."; 1689 } 1690 uses selection-filter-objects; 1691 } 1693 grouping selection-filter-types { 1694 description 1695 "This grouping defines the types of selectors for objects 1696 from a datastore."; 1697 choice filter-spec { 1698 description 1699 "The content filter specification for this request."; 1700 anydata datastore-subtree-filter { 1701 if-feature "sn:subtree"; 1702 description 1703 "This parameter identifies the portions of the 1704 target datastore to retrieve."; 1705 reference 1706 "RFC 6241: Network Configuration Protocol, Section 6."; 1707 } 1708 leaf datastore-xpath-filter { 1709 if-feature "sn:xpath"; 1710 type yang:xpath1.0; 1711 description 1712 "This parameter contains an XPath expression identifying 1713 the portions of the target datastore to retrieve. 1715 If the expression returns a node-set, all nodes in the 1716 node-set are selected by the filter. Otherwise, if the 1717 expression does not return a node-set, the filter 1718 doesn't select any nodes. 1720 The expression is evaluated in the following XPath 1721 context: 1723 o The set of namespace declarations is the set of prefix 1724 and namespace pairs for all YANG modules implemented 1725 by the server, where the prefix is the YANG module 1726 name and the namespace is as defined by the 1727 'namespace' statement in the YANG module. 1729 If the leaf is encoded in XML, all namespace 1730 declarations in scope on the 'stream-xpath-filter' 1731 leaf element are added to the set of namespace 1732 declarations. If a prefix found in the XML is 1733 already present in the set of namespace declarations, 1734 the namespace in the XML is used. 1736 o The set of variable bindings is empty. 1738 o The function library is the core function library, and 1739 the XPath functions defined in section 10 in RFC 7950. 1741 o The context node is the root node of the target 1742 datastore."; 1743 } 1744 } 1745 } 1747 grouping selection-filter-objects { 1748 description 1749 "This grouping defines a selector for objects from a 1750 datastore."; 1751 choice selection-filter { 1752 description 1753 "The source of the selection filter applied to the 1754 subscription. This will come either referenced from a global 1755 list, or be provided within the subscription itself."; 1756 case by-reference { 1757 description 1758 "Incorporate a filter that has been configured 1759 separately."; 1760 leaf selection-filter-ref { 1761 type selection-filter-ref; 1762 mandatory true; 1763 description 1764 "References an existing selection filter which is to be 1765 applied to the subscription."; 1766 } 1767 } 1768 case within-subscription { 1769 description 1770 "Local definition allows a filter to have the same 1771 lifecycle as the subscription."; 1772 uses selection-filter-types; 1773 } 1774 } 1775 } 1777 grouping update-policy-modifiable { 1778 description 1779 "This grouping describes the datastore specific subscription 1780 conditions that can be changed during the lifetime of the 1781 subscription."; 1782 choice update-trigger { 1783 description 1784 "Defines necessary conditions for sending an event record to 1785 the subscriber."; 1786 case periodic { 1787 container periodic { 1788 presence "indicates a periodic subscription"; 1789 description 1790 "The publisher is requested to notify periodically the 1791 current values of the datastore as defined by the 1792 selection filter."; 1793 leaf period { 1794 type centiseconds; 1795 mandatory true; 1796 description 1797 "Duration of time which should occur between periodic 1798 push updates, in one hundredths of a second."; 1799 } 1800 leaf anchor-time { 1801 type yang:date-and-time; 1802 description 1803 "Designates a timestamp before or after which a series 1804 of periodic push updates are determined. The next 1805 update will take place at a whole multiple interval 1806 from the anchor time. For example, for an anchor time 1807 is set for the top of a particular minute and a period 1808 interval of a minute, updates will be sent at the top 1809 of every minute this subscription is active."; 1810 } 1811 } 1812 } 1813 case on-change { 1814 if-feature "on-change"; 1815 container on-change { 1816 presence "indicates an on-change subscription"; 1817 description 1818 "The publisher is requested to notify changes in values 1819 in the datastore subset as defined by a selection 1820 filter."; 1821 leaf dampening-period { 1822 type centiseconds; 1823 default "0"; 1824 description 1825 "Specifies the minimum interval between the assembly of 1826 successive update records for a single receiver of a 1827 subscription. Whenever subscribed objects change, and 1828 a dampening period interval (which may be zero) has 1829 elapsed since the previous update record creation for 1830 a receiver, then any subscribed objects and properties 1831 which have changed since the previous update record 1832 will have their current values marshalled and placed 1833 into a new update record."; 1834 } 1835 } 1836 } 1837 } 1838 } 1840 grouping update-policy { 1841 description 1842 "This grouping describes the datastore-specific subscription 1843 conditions of a subscription."; 1844 uses update-policy-modifiable { 1845 augment "update-trigger/on-change/on-change" { 1846 description 1847 "Includes objects not modifiable once subscription is 1848 established."; 1849 leaf sync-on-start { 1850 type boolean; 1851 default "true"; 1852 description 1853 "When this object is set to false, it restricts an 1854 on-change subscription from sending push-update 1855 notifications. When false, pushing a full selection per 1856 the terms of the selection filter MUST NOT be done for 1857 this subscription. Only updates about changes, 1858 i.e. only push-change-update notifications are sent. 1859 When true (default behavior), in order to facilitate a 1860 receiver's synchronization, a full update is sent when 1861 the subscription starts using a push-update 1862 notification. After that, push-change-update 1863 notifications are exclusively sent unless the publisher 1864 chooses to resync the subscription via a new push-update 1865 notification."; 1866 } 1867 leaf-list excluded-change { 1868 type change-type; 1869 description 1870 "Use to restrict which changes trigger an update. For 1871 example, if modify is excluded, only creation and 1872 deletion of objects is reported."; 1873 } 1874 } 1875 } 1876 } 1877 grouping hints { 1878 description 1879 "Parameters associated with some error for a subscription 1880 made upon a datastore."; 1881 leaf period-hint { 1882 type centiseconds; 1883 description 1884 "Returned when the requested time period is too short. This 1885 hint can assert a viable period for either a periodic push 1886 cadence or an on-change dampening interval."; 1887 } 1888 leaf filter-failure-hint { 1889 type string; 1890 description 1891 "Information describing where and/or why a provided filter 1892 was unsupportable for a subscription."; 1893 } 1894 leaf object-count-estimate { 1895 type uint32; 1896 description 1897 "If there are too many objects which could potentially be 1898 returned by the selection filter, this identifies the 1899 estimate of the number of objects which the filter would 1900 potentially pass."; 1901 } 1902 leaf object-count-limit { 1903 type uint32; 1904 description 1905 "If there are too many objects which could be returned by 1906 the selection filter, this identifies the upper limit of 1907 the publisher's ability to service for this subscription."; 1908 } 1909 leaf kilobytes-estimate { 1910 type uint32; 1911 description 1912 "If the returned information could be beyond the capacity 1913 of the publisher, this would identify the data size which 1914 could result from this selection filter."; 1915 } 1916 leaf kilobytes-limit { 1917 type uint32; 1918 description 1919 "If the returned information would be beyond the capacity 1920 of the publisher, this identifies the upper limit of the 1921 publisher's ability to service for this subscription."; 1922 } 1923 } 1924 /* 1925 * RPCs 1926 */ 1928 rpc resync-subscription { 1929 if-feature "on-change"; 1930 description 1931 "This RPC allows a subscriber of an active on-change 1932 subscription to request a full push of objects. 1934 A successful invocation results in a push-update of all 1935 datastore nodes that the subscriber is permitted to access. 1936 This RPC can only be invoked on the same session on which the 1937 subscription is currently active. In case of an error, a 1938 resync-subscription-error is sent as part of an error 1939 response."; 1940 input { 1941 leaf id { 1942 type sn:subscription-id; 1943 mandatory true; 1944 description 1945 "Identifier of the subscription that is to be resynced."; 1946 } 1947 } 1948 } 1950 rc:yang-data resync-subscription-error { 1951 container resync-subscription-error { 1952 description 1953 "If a 'resync-subscription' RPC fails, the subscription is 1954 not resynced and the RPC error response MUST indicate the 1955 reason for this failure. This YANG-data MAY be inserted as 1956 structured data within a subscription's RPC error response 1957 to indicate the failure reason."; 1958 leaf reason { 1959 type identityref { 1960 base resync-subscription-error; 1961 } 1962 mandatory true; 1963 description 1964 "Indicates the reason why the publisher has declined a 1965 request for subscription resynchronization."; 1966 } 1967 uses hints; 1968 } 1969 } 1971 augment "/sn:establish-subscription/sn:input" { 1972 description 1973 "This augmentation adds additional subscription parameters 1974 that apply specifically to datastore updates to RPC input."; 1975 uses update-policy; 1976 } 1978 augment "/sn:establish-subscription/sn:input/sn:target" { 1979 description 1980 "This augmentation adds the datastore as a valid target 1981 for the subscription to RPC input."; 1982 case datastore { 1983 description 1984 "Information specifying the parameters of an request for a 1985 datastore subscription."; 1986 uses datastore-criteria; 1987 } 1988 } 1990 rc:yang-data establish-subscription-datastore-error-info { 1991 container establish-subscription-datastore-error-info { 1992 description 1993 "If any 'establish-subscription' RPC parameters are 1994 unsupportable against the datastore, a subscription is not 1995 created and the RPC error response MUST indicate the reason 1996 why the subscription failed to be created. This YANG-data 1997 MAY be inserted as structured data within a subscription's 1998 RPC error response to indicate the failure reason. This 1999 YANG-data MUST be inserted if hints are to be provided back 2000 to the subscriber."; 2001 leaf reason { 2002 type identityref { 2003 base sn:establish-subscription-error; 2004 } 2005 description 2006 "Indicates the reason why the subscription has failed to 2007 be created to a targeted datastore."; 2008 } 2009 uses hints; 2010 } 2011 } 2013 augment "/sn:modify-subscription/sn:input" { 2014 description 2015 "This augmentation adds additional subscription parameters 2016 specific to datastore updates."; 2017 uses update-policy-modifiable; 2018 } 2019 augment "/sn:modify-subscription/sn:input/sn:target" { 2020 description 2021 "This augmentation adds the datastore as a valid target 2022 for the subscription to RPC input."; 2023 case datastore { 2024 description 2025 "Information specifying the parameters of an request for a 2026 datastore subscription."; 2027 uses datastore-criteria; 2028 } 2029 } 2031 rc:yang-data modify-subscription-datastore-error-info { 2032 container modify-subscription-datastore-error-info { 2033 description 2034 "This YANG-data MAY be provided as part of a subscription's 2035 RPC error response when there is a failure of a 2036 'modify-subscription' RPC which has been made against a 2037 datastore. This YANG-data MUST be used if hints are to be 2038 provides back to the subscriber."; 2039 leaf reason { 2040 type identityref { 2041 base sn:modify-subscription-error; 2042 } 2043 description 2044 "Indicates the reason why the subscription has failed to 2045 be modified."; 2046 } 2047 uses hints; 2048 } 2049 } 2051 /* 2052 * NOTIFICATIONS 2053 */ 2055 notification push-update { 2056 description 2057 "This notification contains a push update, containing data 2058 subscribed to via a subscription. This notification is sent 2059 for periodic updates, for a periodic subscription. It can 2060 also be used for synchronization updates of an on-change 2061 subscription. This notification shall only be sent to 2062 receivers of a subscription. It does not constitute a 2063 general-purpose notification that would be subscribable as 2064 part of the NETCONF event stream by any receiver."; 2065 leaf id { 2066 type sn:subscription-id; 2067 description 2068 "This references the subscription which drove the 2069 notification to be sent."; 2070 } 2071 anydata datastore-contents { 2072 description 2073 "This contains the updated data. It constitutes a snapshot 2074 at the time-of-update of the set of data that has been 2075 subscribed to. The snapshot corresponds to the same 2076 snapshot that would be returned in a corresponding get 2077 operation with the same selection filter parameters 2078 applied."; 2079 } 2080 leaf incomplete-update { 2081 type empty; 2082 description 2083 "This is a flag which indicates that not all datastore 2084 nodes subscribed to are included with this update. In 2085 other words, the publisher has failed to fulfill its full 2086 subscription obligations, and despite its best efforts is 2087 providing an incomplete set of objects."; 2088 } 2089 } 2091 notification push-change-update { 2092 if-feature "on-change"; 2093 description 2094 "This notification contains an on-change push update. This 2095 notification shall only be sent to the receivers of a 2096 subscription; it does not constitute a general-purpose 2097 notification."; 2098 leaf id { 2099 type sn:subscription-id; 2100 description 2101 "This references the subscription which drove the 2102 notification to be sent."; 2103 } 2104 container datastore-changes { 2105 description 2106 "This contains the set of datastore changes of the target 2107 datastore starting at the time of the previous update, per 2108 the terms of the subscription."; 2109 uses ypatch:yang-patch; 2110 } 2111 leaf incomplete-update { 2112 type empty; 2113 description 2114 "The presence of this object indicates not all changes which 2115 have occurred since the last update are included with this 2116 update. In other words, the publisher has failed to 2117 fulfill its full subscription obligations, for example in 2118 cases where it was not able to keep up with a change 2119 burst."; 2120 } 2121 } 2123 augment "/sn:subscription-started" { 2124 description 2125 "This augmentation adds datastore-specific objects to 2126 the notification that a subscription has started."; 2127 uses update-policy; 2128 } 2130 augment "/sn:subscription-started/sn:target" { 2131 description 2132 "This augmentation allows the datastore to be included as 2133 part of the notification that a subscription has started."; 2134 case datastore { 2135 uses datastore-criteria { 2136 refine "selection-filter/within-subscription" { 2137 description 2138 "Specifies the selection filter and where it originated 2139 from. If the 'selection-filter-ref' is populated, the 2140 filter within the subscription came from the 'filters' 2141 container. Otherwise it is populated in-line as part of 2142 the subscription itself."; 2143 } 2144 } 2145 } 2146 } 2148 augment "/sn:subscription-modified" { 2149 description 2150 "This augmentation adds datastore-specific objects to 2151 the notification that a subscription has been modified."; 2152 uses update-policy; 2153 } 2155 augment "/sn:subscription-modified/sn:target" { 2156 description 2157 "This augmentation allows the datastore to be included as 2158 part of the notification that a subscription has been 2159 modified."; 2160 case datastore { 2161 uses datastore-criteria { 2162 refine "selection-filter/within-subscription" { 2163 description 2164 "Specifies where the selection filter, and where it came 2165 from within the subscription and then populated within 2166 this notification. If the 'selection-filter-ref' is 2167 populated, the filter within the subscription came from 2168 the 'filters' container. Otherwise it is populated 2169 in-line as part of the subscription itself."; 2170 } 2171 } 2172 } 2173 } 2175 /* 2176 * DATA NODES 2177 */ 2179 augment "/sn:filters" { 2180 description 2181 "This augmentation allows the datastore to be included as part 2182 of the selection filtering criteria for a subscription."; 2183 list selection-filter { 2184 key "filter-id"; 2185 description 2186 "A list of pre-configured filters that can be applied 2187 to datastore subscriptions."; 2188 leaf filter-id { 2189 type string; 2190 description 2191 "An identifier to differentiate between selection 2192 filters."; 2193 } 2194 uses selection-filter-types; 2195 } 2196 } 2198 augment "/sn:subscriptions/sn:subscription" { 2199 when 'yp:datastore'; 2200 description 2201 "This augmentation adds many datastore specific objects to a 2202 subscription."; 2203 uses update-policy; 2204 } 2206 augment "/sn:subscriptions/sn:subscription/sn:target" { 2207 description 2208 "This augmentation allows the datastore to be included as 2209 part of the selection filtering criteria for a subscription."; 2210 case datastore { 2211 uses datastore-criteria; 2212 } 2213 } 2214 } 2216 2218 6. IANA Considerations 2220 This document registers the following namespace URI in the "IETF XML 2221 Registry" [RFC3688]: 2223 URI: urn:ietf:params:xml:ns:yang:ietf-yang-push 2224 Registrant Contact: The IESG. 2225 XML: N/A; the requested URI is an XML namespace. 2227 This document registers the following YANG module in the "YANG Module 2228 Names" registry [RFC6020]: 2230 Name: ietf-yang-push 2231 Namespace: urn:ietf:params:xml:ns:yang:ietf-yang-push 2232 Prefix: yp 2233 Reference: draft-ietf-netconf-yang-push-21.txt (RFC form) 2235 7. Security Considerations 2237 The YANG module specified in this document defines a schema for data 2238 that is designed to be accessed via network management protocols such 2239 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 2240 is the secure transport layer, and the mandatory-to-implement secure 2241 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 2242 is HTTPS, and the mandatory-to-implement secure transport is TLS 2243 [RFC8446]. 2245 The Network Configuration Access Control Model (NACM) [RFC8341] 2246 provides the means to restrict access for particular NETCONF or 2247 RESTCONF users to a preconfigured subset of all available NETCONF or 2248 RESTCONF protocol operations and content. 2250 There are a number of data nodes defined in this YANG module that are 2251 writable/creatable/deletable (i.e., config true, which is the 2252 default). These data nodes may be considered sensitive or vulnerable 2253 in some network environments. Write operations (e.g., edit-config) 2254 to these data nodes without proper protection can have a negative 2255 effect on network operations. These are the subtrees and data nodes 2256 and their sensitivity/vulnerability. (It should be noted that the 2257 YANG module augments the YANG module from 2259 [I-D.draft-ietf-netconf-subscribed-notifications]. All security 2260 considerations that are listed there are relevant also for datastore 2261 subscriptions. In the following, we focus on the data nodes that are 2262 newly introduced here.) 2264 o Subtree "selection-filter" under container "filters": This subtree 2265 allows to specify which objects or subtrees to include in a 2266 datastore subscription. An attacker could attempt to modify the 2267 filter. For example, the filter might be modified to result in 2268 very few objects being filtered in order to attempt to overwhelm 2269 the receiver. Alternatively, the filter might be modified to 2270 result in certain objects to be excluded from updates, in order to 2271 have certain changes go unnoticed. 2273 o Subtree "datastore" in choice "target" in list "subscription": 2274 Analogous to "selection filter", an attacker might attempt to 2275 modify the objects being filtered in order to overwhelm a receiver 2276 with a larger volume of object updates than expected, or to have 2277 certain changes go unnoticed. 2279 o Choice "update-trigger" in list "subscription": By modifying the 2280 update trigger, an attacker might alter the updates that are being 2281 sent in order to confuse a receiver, to withhold certain updates 2282 to be sent to the receiver, and/or to overwhelm a receiver. For 2283 example, an attacker might modify the period with which updates 2284 are reported for a periodic subscription, or it might modify the 2285 dampening period for an on-change subscription, resulting in 2286 greater delay of successive updates (potentially affecting 2287 responsiveness of applications that depend on the updates) or in a 2288 high volume of updates (to exhaust receiver resources). 2290 o RPC "resync-subscription": This RPC allows a subscriber of an on- 2291 change subscription to request a full push of objects in the 2292 subscription's scope. This can result in a large volume of data. 2293 An attacker could attempt to use this RPC to exhaust resources on 2294 the server to generate the data, and attempt to overwhelm a 2295 receiver with the resulting data volume. 2297 NACM provides one means to mitigate these threats on the publisher 2298 side. In order to address those threats as a subscriber, a 2299 subscriber could monitor the subscription configuration for any 2300 unexpected changes. For this, it can subscribe to updates to the 2301 YANG datastore nodes that represent his datastore subscriptions. As 2302 this data volume is small, a paranoid subscriber could even revert to 2303 occasional polling to guard against a compromised subscription 2304 against subscription configuration updates itself. 2306 8. Acknowledgments 2308 For their valuable comments, discussions, and feedback, we wish to 2309 acknowledge Tim Jenkins, Martin Bjorklund, Kent Watsen, Susan Hares, 2310 Yang Geng, Peipei Guo, Michael Scharf, Guangying Zheng, Tom Petch, 2311 Henk Birkholz, Reshad Rahman, Qin Wu, Rohit Ranade, and Rob Wilton. 2313 9. References 2315 9.1. Normative References 2317 [I-D.draft-ietf-netconf-subscribed-notifications] 2318 Voit, E., Clemm, A., Gonzalez Prieto, A., Tripathy, A., 2319 and E. Nilsen-Nygaard, "Subscription to YANG Event 2320 Notifications", draft-ietf-netconf-subscribed- 2321 notifications-24 (work in progress), April 2019. 2323 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2324 Requirement Levels", BCP 14, RFC 2119, 2325 DOI 10.17487/RFC2119, March 1997, 2326 . 2328 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 2329 DOI 10.17487/RFC3688, January 2004, 2330 . 2332 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2333 the Network Configuration Protocol (NETCONF)", RFC 6020, 2334 DOI 10.17487/RFC6020, October 2010, 2335 . 2337 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2338 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2339 . 2341 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2342 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2343 . 2345 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 2346 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 2347 . 2349 [RFC8072] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Patch 2350 Media Type", RFC 8072, DOI 10.17487/RFC8072, February 2351 2017, . 2353 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2354 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2355 May 2017, . 2357 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 2358 Access Control Model", STD 91, RFC 8341, 2359 DOI 10.17487/RFC8341, March 2018, 2360 . 2362 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2363 and R. Wilton, "Network Management Datastore Architecture 2364 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2365 . 2367 [RFC8525] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 2368 and R. Wilton, "YANG Library", RFC 8525, 2369 DOI 10.17487/RFC8525, March 2019, 2370 . 2372 9.2. Informative References 2374 [I-D.draft-ietf-netconf-netconf-event-notifications] 2375 Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard, 2376 E., and A. Tripathy, "Dynamic subscription to YANG Events 2377 and DAtastores over NETCONF", April 2019. 2379 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 2380 and A. Bierman, Ed., "Network Configuration Protocol 2381 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 2382 . 2384 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 2385 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 2386 . 2388 [RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements 2389 for Subscription to YANG Datastores", RFC 7923, 2390 DOI 10.17487/RFC7923, June 2016, 2391 . 2393 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 2394 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 2395 . 2397 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 2398 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 2399 . 2401 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2402 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2403 . 2405 Appendix A. Appendix A: Subscription Errors 2407 A.1. RPC Failures 2409 Rejection of an RPC for any reason is indicated by via RPC error 2410 response from the publisher. Valid RPC errors returned include both 2411 existing transport layer RPC error codes, such as those seen with 2412 NETCONF in [RFC6241], as well as subscription specific errors such as 2413 those defined within the YANG model. As a result, how subscription 2414 errors are encoded within an RPC error response is transport 2415 dependent. 2417 References to specific identities in the ietf-subscribed- 2418 notifications YANG model or the ietf-yang-push YANG model may be 2419 returned as part of the error responses resulting from failed 2420 attempts at datastore subscription. For errors defined as part of 2421 ietf-subscribed-notifications, please refer to 2422 [I-D.draft-ietf-netconf-subscribed-notifications]. The errors 2423 introduced in this document, grouped per RPC, are as follows: 2425 establish-subscription modify-subscription 2426 ---------------------- ------------------- 2427 cant-exclude period-unsupported 2428 datastore-not-subscribable update-too-big 2429 on-change-unsupported sync-too-big 2430 on-change-sync-unsupported unchanging-selection 2431 period-unsupported 2432 update-too-big resync-subscription 2433 sync-too-big -------------------- 2434 unchanging-selection no-such-subscription-resync 2435 sync-too-big 2437 There is one final set of transport independent RPC error elements 2438 included in the YANG model. These are the following four YANG-data 2439 structures for failed datastore subscriptions: 2441 1. YANG-data establish-subscription-error-datastore 2442 This MUST be returned if information identifying the reason for an 2443 RPC error has not been placed elsewhere within the transport 2444 portion of a failed "establish-subscription" RPC response. This 2445 MUST be sent if hints are included. 2447 2. YANG-data modify-subscription-error-datastore 2448 This MUST be returned if information identifying the reason for an 2449 RPC error has not been placed elsewhere within the transport 2450 portion of a failed "modifiy-subscription" RPC response. This 2451 MUST be sent if hints are included. 2453 3. YANG-data sn:delete-subscription-error 2454 This MUST be returned if information identifying the reason for an 2455 RPC error has not been placed elsewhere within the transport 2456 portion of a failed "delete-subscription" or "kill-subscription" 2457 RPC response. 2459 4. YANG-data resync-subscription-error 2460 This MUST be returned if information identifying the reason for an 2461 RPC error has not been placed elsewhere within the transport 2462 portion of a failed "resync-subscription" RPC response. 2464 A.2. Notifications of Failure 2466 A subscription may be unexpectedly terminated or suspended 2467 independent of any RPC or configuration operation. In such cases, 2468 indications of such a failure MUST be provided. To accomplish this, 2469 a number of errors can be returned as part of the corresponding 2470 subscription state change notification. For this purpose, the 2471 following error identities have been introduced in this document, in 2472 addition to those that were already defined in 2473 [I-D.draft-ietf-netconf-subscribed-notifications]: 2475 subscription-terminated subscription-suspended 2476 ----------------------- ---------------------- 2477 datastore-not-subscribable period-unsupported 2478 unchanging-selection update-too-big 2479 synchronization-size 2481 Appendix B. Changes Between Revisions 2483 (To be removed by RFC editor prior to publication) 2485 v21 - v22 2486 o Minor updates per Martin Bjorklund's YANG doctor review. 2488 v20 - v21 2490 o Minor updates, simplifying RPC input conditions. 2492 v19 - v20 2494 o Minor updates per WGLC comments. 2496 v18 - v19 2498 o Minor updates per WGLC comments. 2500 v17 - v18 2502 o Minor updates per WGLC comments. 2504 v16 - v17 2506 o Minor updates to YANG module, incorporating comments from Tom 2507 Petch. 2509 o Updated references. 2511 v15 - v16 2513 o Updated security considerations. 2515 o Updated references. 2517 o Addressed comments from last call review, specifically comments 2518 received from Martin Bjorklund. 2520 v14 - v15 2522 o Minor text fixes. Includes a fix to on-change update calculation 2523 to cover churn when an object changes to and from a value during a 2524 dampening period. 2526 v13 - v14 2528 o Minor text fixes. 2530 v12 - v13 2532 o Hint negotiation models now show error examples. 2534 o yang-data structures for rpc errors. 2536 v11 - v12 2538 o Included Martin's review clarifications. 2540 o QoS moved to subscribed-notifications 2542 o time-of-update removed as it is redundant with RFC5277's 2543 eventTime, and other times from notification-messages. 2545 o Error model moved to match existing implementations 2547 o On-change notifiable removed, how to do this is implementation 2548 specific. 2550 o NMDA model supported. Non NMDA version at https://github.com/ 2551 netconf-wg/yang-push/ 2553 v10 - v11 2555 o Promise model reference added. 2557 o Error added for no-such-datastore 2559 o Inherited changes from subscribed notifications (such as optional 2560 feature definitions). 2562 o scrubbed the examples for proper encodings 2564 v09 - v10 2566 o Returned to the explicit filter subtyping of v00-v05 2568 o identityref to ds:datastore made explicit 2570 o Returned ability to modify a selection filter via RPC. 2572 v08 - v09 2574 o Minor tweaks cleaning up text, removing appendicies, and making 2575 reference to revised-datastores. 2577 o Subscription-id (now:id) optional in push updates, except when 2578 encoded in RFC5277, Section 4 one-way notification. 2580 o Finished adding the text descibing the resync subscription RPC. 2582 o Removed relationships to other drafts and future technology 2583 appendicies as this work is being explored elsewhere. 2585 o Deferred the multi-line card issue to new drafts 2587 o Simplified the NACM interactions. 2589 v07 - v08 2591 o Updated YANG models with minor tweaks to accommodate changes of 2592 ietf-subscribed-notifications. 2594 v06 - v07 2596 o Clarifying text tweaks. 2598 o Clarification that filters act as selectors for subscribed 2599 datastore nodes; support for value filters not included but 2600 possible as a future extension 2602 o Filters don't have to be matched to existing YANG objects 2604 v05 - v06 2606 o Security considerations updated. 2608 o Base YANG model in [subscribe] updated as part of move to 2609 identities, YANG augmentations in this doc matched up 2611 o Terms refined and text updates throughout 2613 o Appendix talking about relationship to other drafts added. 2615 o Datastore replaces stream 2617 o Definitions of filters improved 2619 v04 to v05 2621 o Referenced based subscription document changed to Subscribed 2622 Notifications from 5277bis. 2624 o Getting operational data from filters 2626 o Extension notifiable-on-change added 2628 o New appendix on potential futures. Moved text into there from 2629 several drafts. 2631 o Subscription configuration section now just includes changed 2632 parameters from Subscribed Notifications 2634 o Subscription monitoring moved into Subscribed Notifications 2636 o New error and hint mechanisms included in text and in the YANG 2637 model. 2639 o Updated examples based on the error definitions 2641 o Groupings updated for consistency 2643 o Text updates throughout 2645 v03 to v04 2647 o Updates-not-sent flag added 2649 o Not notifiable extension added 2651 o Dampening period is for whole subscription, not single objects 2653 o Moved start/stop into rfc5277bis 2655 o Client and Server changed to subscriber, publisher, and receiver 2657 o Anchor time for periodic 2659 o Message format for synchronization (i.e. sync-on-start) 2661 o Material moved into 5277bis 2663 o QoS parameters supported, by not allowed to be modified by RPC 2665 o Text updates throughout 2667 Authors' Addresses 2669 Alexander Clemm 2670 Huawei USA 2672 Email: ludwig@clemm.org 2674 Eric Voit 2675 Cisco Systems 2677 Email: evoit@cisco.com 2678 Alberto Gonzalez Prieto 2679 Microsoft 2681 Email: albgonz@microsoft.com 2683 Ambika Prasad Tripathy 2684 Cisco Systems 2686 Email: ambtripa@cisco.com 2688 Einar Nilsen-Nygaard 2689 Cisco Systems 2691 Email: einarnn@cisco.com 2693 Andy Bierman 2694 YumaWorks 2696 Email: andy@yumaworks.com 2698 Balazs Lengyel 2699 Ericsson 2701 Email: balazs.lengyel@ericsson.com