idnits 2.17.1 draft-ietf-netconf-subscribed-notifications-13.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 656 has weird spacing: '...ntifier sub...' == Line 685 has weird spacing: '...ntifier sub...' == Line 1262 has weird spacing: '...ntifier sub...' == Line 1297 has weird spacing: '...ntifier sub...' == Line 1314 has weird spacing: '...ntifier sub...' == (4 more instances...) -- The document date (June 18, 2018) is 2138 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 (-12) exists of draft-ietf-rtgwg-ni-model-11 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) -- Possible downref: Non-RFC (?) normative reference: ref. 'XPATH' -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 1 error (**), 0 flaws (~~), 8 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NETCONF E. Voit 3 Internet-Draft Cisco Systems 4 Intended status: Standards Track A. Clemm 5 Expires: December 20, 2018 Huawei 6 A. Gonzalez Prieto 7 VMWare 8 E. Nilsen-Nygaard 9 A. Tripathy 10 Cisco Systems 11 June 18, 2018 13 Customized Subscriptions to a Publisher's Event Streams 14 draft-ietf-netconf-subscribed-notifications-13 16 Abstract 18 This document defines a YANG data model and associated mechanisms 19 enabling subscriber-specific subscriptions to a publisher's event 20 streams. Applying these elements allows a subscriber to request for 21 and receive a continuous, custom feed of publisher generated 22 information. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on December 20, 2018. 41 Copyright Notice 43 Copyright (c) 2018 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 59 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 60 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 61 1.3. Solution Overview . . . . . . . . . . . . . . . . . . . . 5 62 1.4. Relationship to RFC-5277 . . . . . . . . . . . . . . . . 6 63 2. Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 6 64 2.1. Event Streams . . . . . . . . . . . . . . . . . . . . . . 7 65 2.2. Event Stream Filters . . . . . . . . . . . . . . . . . . 7 66 2.3. QoS . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 67 2.4. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 9 68 2.5. Configured Subscriptions . . . . . . . . . . . . . . . . 16 69 2.6. Event Record Delivery . . . . . . . . . . . . . . . . . . 23 70 2.7. Subscription State Notifications . . . . . . . . . . . . 24 71 2.8. Subscription Monitoring . . . . . . . . . . . . . . . . . 30 72 2.9. Advertisement . . . . . . . . . . . . . . . . . . . . . . 31 73 3. YANG Data Model Trees . . . . . . . . . . . . . . . . . . . . 31 74 3.1. Event Streams Container . . . . . . . . . . . . . . . . . 31 75 3.2. Filters Container . . . . . . . . . . . . . . . . . . . . 32 76 3.3. Subscriptions Container . . . . . . . . . . . . . . . . . 32 77 4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 34 78 5. Considerations . . . . . . . . . . . . . . . . . . . . . . . 61 79 5.1. IANA Considerations . . . . . . . . . . . . . . . . . . . 61 80 5.2. Implementation Considerations . . . . . . . . . . . . . . 61 81 5.3. Transport Requirements . . . . . . . . . . . . . . . . . 62 82 5.4. Security Considerations . . . . . . . . . . . . . . . . . 62 83 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 66 84 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 66 85 7.1. Normative References . . . . . . . . . . . . . . . . . . 66 86 7.2. Informative References . . . . . . . . . . . . . . . . . 68 87 Appendix A. Changes between revisions . . . . . . . . . . . . . 69 88 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 73 90 1. Introduction 92 This document defines a YANG data model and associated mechanisms 93 enabling subscriber-specific subscriptions to a publisher's event 94 streams. Effectively this enables a 'subscribe then publish' 95 capability where the customized information needs and access 96 permissions of each target receiver are understood by the publisher 97 before subscribed event records are marshaled and pushed. The 98 receiver then gets a continuous, custom feed of publisher generated 99 information. 101 While the functionality defined in this document is transport- 102 agnostic, transports like NETCONF [RFC6241] or RESTCONF [RFC8040] can 103 be used to configure or dynamically signal subscriptions, and there 104 are bindings defined for subscribed event record delivery for NETCONF 105 within [I-D.draft-ietf-netconf-netconf-event-notifications], and for 106 HTTP2 or HTTP1.1 within [I-D.draft-ietf-netconf-restconf-notif]. 108 The YANG model in this document conforms to the Network Management 109 Datastore Architecture defined in [RFC8342]. 111 1.1. Motivation 113 Various limitations in [RFC5277] are discussed in [RFC7923]. 114 Resolving these issues is the primary motivation for this work. Key 115 capabilities supported by this document include: 117 o multiple subscriptions on a single transport session 119 o support for dynamic and configured subscriptions 121 o modification of an existing subscription in progress 123 o per-subscription operational counters 125 o negotiation of subscription parameters (through the use of hints 126 returned as part of declined subscription requests) 128 o subscription state change notifications (e.g., publisher driven 129 suspension, parameter modification) 131 o independence from transport 133 1.2. Terminology 135 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 136 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 137 "OPTIONAL" in this document are to be interpreted as described in BCP 138 14 [RFC2119] [RFC8174] when, and only when, they appear in all 139 capitals, as shown here. 141 Client: defined in [RFC8342]. 143 Configuration: defined in [RFC8342]. 145 Configuration datastore: defined in [RFC8342]. 147 Configured subscription: A subscription installed via configuration 148 into a configuration datastore. 150 Dynamic subscription: A subscription created dynamically by a 151 subscriber via a remote procedure call. 153 Event: An occurrence of something that may be of interest. Examples 154 include a configuration change, a fault, a change in status, crossing 155 a threshold, or an external input to the system. 157 Event occurrence time: a timestamp matching the time an originating 158 process identified as when an event happened. 160 Event record: A set of information detailing an event. 162 Event stream: A continuous, chronologically ordered set of events 163 aggregated under some context. 165 Event stream filter: Evaluation criteria which may be applied against 166 event records within an event stream. Event records pass the filter 167 when specified criteria are met. 169 Notification message: Information intended for a receiver indicating 170 that one or more event(s) have occurred. 172 Publisher: An entity responsible for streaming notification messages 173 per the terms of a subscription. 175 Receiver: A target to which a publisher pushes subscribed event 176 records. For dynamic subscriptions, the receiver and subscriber are 177 the same entity. 179 Subscriber: A client able to request and negotiate a contract for the 180 generation and push of event records from a publisher. For dynamic 181 subscriptions, the receiver and subscriber are the same entity. 183 Subscription: A contract with a publisher, stipulating which 184 information one or more receivers wish to have pushed from the 185 publisher without the need for further solicitation. 187 All YANG tree diagrams used in this document follow the notation 188 defined in [I-D.ietf-netmod-yang-tree-diagrams]. 190 1.3. Solution Overview 192 This document describes a transport agnostic mechanism for 193 subscribing to and receiving content from an event stream within a 194 publisher. This mechanism is through the use of a subscription. 196 Two types of subscriptions are supported: 198 1. Dynamic subscriptions, where a subscriber initiates a 199 subscription negotiation with a publisher via an RPC. If the 200 publisher is able to serve this request, it accepts it, and then 201 starts pushing notification messages back to the subscriber. If 202 the publisher is not able to serve it as requested, then an error 203 response is returned. This response MAY include hints at 204 subscription parameters that, had they been present, would have 205 enabled the dynamic subscription request to be accepted. 207 2. Configured subscriptions, which allow the management of 208 subscriptions via a configuration so that a publisher can send 209 notification messages to a receiver of a configured subscription. 210 Support for configured subscriptions is optional, with its 211 availability advertised via a YANG feature. 213 Additional characteristics differentiating configured from dynamic 214 subscriptions include: 216 o The lifetime of a dynamic subscription is bound by the transport 217 session used to establish it. For connection-oriented stateful 218 transports like NETCONF, the loss of the transport session will 219 result in the immediate termination of any associated dynamic 220 subscriptions. For connectionless or stateless transports like 221 HTTP, a lack of receipt acknowledgment of a sequential set of 222 notification messages and/or keep-alives can be used to trigger a 223 termination of a dynamic subscription. Contrast this to the 224 lifetime of a configured subscription. This lifetime is driven by 225 relevant configuration being present within the publisher's 226 applied configuration. Being tied to configuration operations 227 implies configured subscriptions can be configured to persist 228 across reboots, and implies a configured subscription can persist 229 even when its publisher is fully disconnected from any network. 231 o Configured subscriptions can be modified by any configuration 232 client with write permission on the configuration of the 233 subscription. Dynamic subscriptions can only be modified via an 234 RPC request made by the original subscriber, or a change to 235 configuration data referenced by the subscription. 237 Note that there is no mixing-and-matching of dynamic and configured 238 operations on a single subscription. Specifically, a configured 239 subscription cannot be modified or deleted using RPCs defined in this 240 document. Similarly, a subscription established via RPC cannot be 241 modified through configuration operations. Also note that transport 242 specific transport drafts based on this specification MUST detail the 243 life cycles of both dynamic and configured subscriptions. 245 A publisher MAY terminate a dynamic subscription at any time. 246 Similarly, it MAY decide to temporarily suspend the sending of 247 notification messages for any dynamic subscription, or for one or 248 more receivers of a configured subscription. Such termination or 249 suspension is driven by internal considerations of the publisher. 251 1.4. Relationship to RFC-5277 253 This document is intended to provide a superset of the subscription 254 capabilities initially defined within [RFC5277]. Especially when 255 extending an existing [RFC5277] implementation, it is important to 256 understand what has been reused and what has been replaced. Key 257 relationships between these two documents include: 259 o this document defines a transport independent capability, 260 [RFC5277] is specific to NETCONF. 262 o the data model in this document is used instead of the data model 263 in Section 3.4 of [RFC5277] for the new operations. 265 o the RPC operations in this draft replaces the operation "create- 266 subscription" defined in [RFC5277], section 4. 268 o the message of [RFC5277], Section 4 is used. 270 o the included contents of the "NETCONF" event stream are identical 271 between this document and [RFC5277]. 273 o a publisher MAY implement both the Notification Management Schema 274 and RPCs defined in [RFC5277] and this new document concurrently. 276 o unlike [RFC5277], this document enables a single transport session 277 to intermix of notification messages and RPCs for different 278 subscriptions. 280 2. Solution 282 Per the overview provided in Section 1.3, this section details the 283 overall context, state machines, and subsystems which may be 284 assembled to allow the subscription of events from a publisher. 286 2.1. Event Streams 288 An event stream is a named entity on a publisher which exposes a 289 continuously updating set of event records. Each event stream is 290 available for subscription. It is out of the scope of this document 291 to identify a) how streams are defined (other than the NETCONF 292 stream), b) how event records are defined/generated, and c) how event 293 records are assigned to streams. 295 There is only one reserved event stream name within this document: 296 "NETCONF". The "NETCONF" event stream contains all NETCONF XML event 297 record information supported by the publisher, except for the 298 subscription state notifications described in Section 2.7. Among 299 these included NETCONF XML event records are individual YANG 1.1 300 notifications described in section 7.16 of [RFC7950]. Each of these 301 YANG 1.1 notifications will be treated as a distinct event record. 302 Beyond the "NETCONF" stream, implementations MAY define additional 303 event streams. 305 As event records are created by a system, they may be assigned to one 306 or more streams. The event record is distributed to a subscription's 307 receiver(s) where: (1) a subscription includes the identified stream, 308 and (2) subscription filtering does not exclude the event record from 309 that receiver. 311 Access control permissions may be used to silently exclude event 312 records from within an event stream for which the receiver has no 313 read access. As an example of how this might be accomplished, see 314 [RFC8341] section 3.4.6. Note that per Section 2.7 of this document, 315 subscription state change notifications are never filtered out. 317 If no access control permissions are in place for event records on an 318 event stream, then a receiver MUST be allowed access to all the event 319 records. If subscriber permissions change during the lifecycle of a 320 subscription and event stream access is no longer permitted, then the 321 subscription MUST be terminated. 323 Event records MUST NOT be delivered to a receiver in a different 324 order than they were placed onto an event stream. 326 2.2. Event Stream Filters 328 This document defines an extensible filtering mechanism. The filter 329 itself is a boolean test which is placed on the content of an event 330 record. A 'false' filtering result causes the event message to be 331 excluded from delivery to a receiver. A filter never results in 332 information being stripped from within an event record prior to that 333 event record being encapsulated within a notification message. The 334 two optional event stream filtering syntaxes supported are [XPATH] 335 and subtree [RFC6241]. 337 If no event stream filter is provided within a subscription, all 338 event records on an event stream are to be sent. 340 2.3. QoS 342 This document provide for several QoS parameters. These parameters 343 indicate the treatment of a subscription relative to other traffic 344 between publisher and receiver. Included are: 346 o A "dscp" marking to differentiate prioritization of notification 347 messages during network transit. 349 o A "weighting" so that bandwidth proportional to this weighting can 350 be allocated to this subscription relative to other subscriptions 351 destined for that receiver. 353 o a "dependency" upon another subscription. 355 If the publisher supports the "dscp" feature, then a subscription 356 with a "dscp" leaf MUST result in a corresponding [RFC2474] DSCP 357 marking being placed within the IP header of any resulting 358 notification messages and subscription state change notifications. 360 For the "weighting" parameter, when concurrently dequeuing 361 notification messages from multiple subscriptions to a receiver, the 362 publisher MUST allocate bandwidth to each subscription proportionally 363 to the weights assigned to those subscriptions. "Weighting" is an 364 optional capability of the publisher; support for it is identified 365 via the "qos" feature. 367 If a subscription has the "dependency" parameter set, then any 368 buffered notification messages containing event records selected by 369 the parent subscription MUST be dequeued prior to the notification 370 messages of the dependent subscription. If notification messages 371 have dependencies on each other, the notification message queued the 372 longest MUST go first. If a "dependency" included within an RPC 373 references a subscription which does not exist or is no longer 374 accessible to that subscriber, that "dependency" MUST be silently 375 removed. "Dependency" is an optional capability of the publisher; 376 support for it is identified via the "qos" feature. 378 2.4. Dynamic Subscriptions 380 Dynamic subscriptions are managed via protocol operations (in the 381 form of [RFC7950], Section 7.14 RPCs) made against targets located 382 within the publisher. These RPCs have been designed extensibly so 383 that they may be augmented for subscription targets beyond event 384 streams. For examples of such augmentations, see the RPC 385 augmentations within [I-D.ietf-netconf-yang-push]'s YANG model. 387 2.4.1. Dynamic Subscription State Model 389 Below is the publisher's state machine for a dynamic subscription. 390 Each state is shown in its own box. It is important to note that 391 such a subscription doesn't exist at the publisher until an 392 "establish-subscription" RPC is accepted. The mere request by a 393 subscriber to establish a subscription is insufficient for that 394 subscription to be externally visible. Start and end states are 395 depicted to reflect subscription creation and deletion events. 397 ......... 398 : start : 399 :.......: 400 | 401 establish-subscription 402 | 403 | .-------modify-subscription--------. 404 v v | 405 .-----------. .-----------. 406 .--------. | receiver |--insufficient CPU, b/w-->| receiver | 407 modify- '| active | | suspended | 408 subscription | |<----CPU, b/w sufficient--| | 409 ---------->'-----------' '-----------' 410 | | 411 delete/kill-subscription delete/kill- 412 | subscription 413 v | 414 ......... | 415 : end :<---------------------------------' 416 :.......: 418 Figure 1: Publisher's state for a dynamic subscription 420 Of interest in this state machine are the following: 422 o Successful "establish-subscription" or "modify-subscription" RPCs 423 put the subscription into the active state. 425 o Failed "modify-subscription" RPCs will leave the subscription in 426 its previous state, with no visible change to any streaming 427 updates. 429 o A delete or kill RPC will end the subscription, as will the 430 reaching of a "stop-time". 432 o A publisher may choose to suspend a subscription when there is 433 insufficient CPU or bandwidth available to service the 434 subscription. This is notified to a subscriber with a 435 "subscription-suspended" state change notification. 437 o A suspended subscription may be modified by the subscriber (for 438 example in an attempt to use fewer resources). Successful 439 modification returns the subscription to an active state. 441 o Even without a "modify-subscription" request, a publisher may 442 return a subscription to the active state should the resource 443 constraints become sufficient again. This is announced to the 444 subscriber via the "subscription-resumed" subscription state 445 change notification. 447 2.4.2. Establishing a Dynamic Subscription 449 The "establish-subscription" RPC allows a subscriber to request the 450 creation of a subscription. The transport selected by the subscriber 451 to reach the publisher MUST be able to support multiple "establish- 452 subscription" requests made within the same transport session. 454 The input parameters of the operation are: 456 o A "stream" name which identifies the targeted event stream against 457 which the subscription is applied. 459 o An event stream filter which may reduce the set of event records 460 pushed. 462 o Where the transport used by the RPC supports multiple encodings, 463 an optional "encoding" for the event records pushed. Note: If no 464 "encoding" is included, the encoding of the RPC MUST be used. 466 o An optional "stop-time" for the subscription. If no "stop-time" 467 is present, notification messages will continue to be sent until 468 the subscription is terminated. 470 o An optional "start-time" for the subscription. The "start-time" 471 MUST be in the past and indicates that the subscription is 472 requesting a replay of previously generated information from the 473 event stream. For more on replay, see Section 2.4.2.1. Where 474 there is no "start-time", the subscription starts immediately. 476 If the publisher can satisfy the "establish-subscription" request, it 477 replies with an identifier for the subscription, and then immediately 478 starts streaming notification messages. 480 Below is a tree diagram for "establish-subscription". All objects 481 contained in this tree are described within the included YANG model 482 within Section 4. 484 +---x establish-subscription 485 +---w input 486 | +---w (target) 487 | | +--:(stream) 488 | | +---w (stream-filter)? 489 | | | +--:(by-reference) 490 | | | | +---w stream-filter-ref 491 | | | | stream-filter-ref 492 | | | +--:(within-subscription) 493 | | | +---w (filter-spec)? 494 | | | +--:(stream-subtree-filter) 495 | | | | +---w stream-subtree-filter? 496 | | | | {subtree}? 497 | | | +--:(stream-xpath-filter) 498 | | | +---w stream-xpath-filter? 499 | | | yang:xpath1.0 {xpath}? 500 | | +---w stream stream-ref 501 | | +---w replay-start-time? yang:date-and-time 502 | | {replay}? 503 | +---w stop-time? yang:date-and-time 504 | +---w dscp? inet:dscp {dscp}? 505 | +---w weighting? uint8 {qos}? 506 | +---w dependency? subscription-id {qos}? 507 | +---w encoding? encoding 508 +--ro output 509 +--ro identifier subscription-id 510 +--ro replay-start-time-revision? yang:date-and-time 511 {replay}? 513 Figure 2: establish-subscription RPC tree diagram 515 A publisher MAY reject the "establish-subscription" RPC for many 516 reasons as described in Section 2.4.6. The contents of the resulting 517 RPC error response MAY include details on input parameters which if 518 considered in a subsequent "establish-subscription" RPC, may result 519 in a successful subscription establishment. Any such hints MUST be 520 transported within a yang-data "establish-subscription-stream-error- 521 info" container included within the RPC error response. 523 yang-data establish-subscription-stream-error-info 524 +--ro establish-subscription-stream-error-info 525 +--ro reason? identityref 526 +--ro filter-failure-hint? string 528 Figure 3: establish-subscription RPC yang-data tree diagram 530 2.4.2.1. Requesting a replay of event records 532 Replay provides the ability to establish a subscription which is also 533 capable of passing recently generated event records. In other words, 534 as the subscription initializes itself, it sends any previously 535 generated content from within the target event stream which meets the 536 filter and timeframe criteria. The end of these historical event 537 records is identified via a "replay-completed" state change 538 notification. Any event records generated since the subscription 539 establishment may then follow. For a particular subscription, all 540 event records will be delivered in the order they are placed into the 541 stream. 543 Replay is an optional feature which is dependent on an event stream 544 supporting some form of logging. This document puts no restrictions 545 on the size or form of the log, where it resides within the 546 publisher, or when event record entries in the log are purged. 548 The inclusion of a "replay-start-time" within an "establish- 549 subscription" RPC indicates a replay request. If the "replay-start- 550 time" contains a value that is earlier than what a publisher's 551 retained history supports, then if the subscription is accepted, the 552 actual publisher's revised start time MUST be set in the returned 553 "replay-start-time-revision" object. 555 A "stop-time" parameter may be included in a replay subscription. 556 For a replay subscription, the "stop-time" MAY be earlier than the 557 current time, but MUST be later than the "replay-start-time". 559 If the time the replay starts is later than the time marked within 560 any event records retained within the replay buffer, then the 561 publisher MUST send a "replay-completed" notification immediately 562 after a successful establish-subscription RPC response. 564 If an event stream supports replay, the "replay-support" leaf is 565 present in the "/streams/stream" list entry for the stream. An event 566 stream that does support replay is not expected to have an unlimited 567 supply of saved notifications available to accommodate any given 568 replay request. To assess the timeframe available for replay, 569 subscribers can read the leafs "replay-log-creation-time" and 570 "replay-log-aged-time". See Figure 18 for the YANG tree, and 571 Section 4 for the YANG model describing these elements. The actual 572 size of the replay log at any given time is a publisher specific 573 matter. Control parameters for the replay log are outside the scope 574 of this document. 576 2.4.3. Modifying a Dynamic Subscription 578 The "modify-subscription" operation permits changing the terms of an 579 existing dynamic subscription. Dynamic subscriptions can be modified 580 any number of times. If the publisher accepts the requested 581 modifications, it acknowledges success to the subscriber, then 582 immediately starts sending event records based on the new terms. 584 Subscriptions created by configuration cannot be modified via this 585 RPC. However configuration may be used to modify objects referenced 586 by the subscription (such as a referenced filter). 588 Below is a tree diagram for "modify-subscription". All objects 589 contained in this tree are described within the included YANG model 590 within Section 4. 592 +---x modify-subscription 593 +---w input 594 +---w identifier subscription-id 595 +---w (target) 596 | +--:(stream) 597 | +---w (stream-filter)? 598 | +--:(by-reference) 599 | | +---w stream-filter-ref 600 | | stream-filter-ref 601 | +--:(within-subscription) 602 | +---w (filter-spec)? 603 | +--:(stream-subtree-filter) 604 | | +---w stream-subtree-filter? 605 | | {subtree}? 606 | +--:(stream-xpath-filter) 607 | +---w stream-xpath-filter? 608 | yang:xpath1.0 {xpath}? 609 +---w stop-time? yang:date-and-time 611 Figure 4: modify-subscription RPC tree diagram 613 If the publisher accepts the requested modifications on a currently 614 suspended subscription, the subscription will immediately be resumed 615 (i.e., the modified subscription is returned to the active state.) 616 The publisher MAY immediately suspend this newly modified 617 subscription through the "subscription-suspended" notification before 618 any event records are sent. 620 If the publisher rejects the RPC request, the subscription remains as 621 prior to the request. That is, the request has no impact whatsoever. 622 Rejection of the RPC for any reason is indicated by via RPC error as 623 described in Section 2.4.6. The contents of such a rejected RPC MAY 624 include hints on inputs which (if considered) may result in a 625 successfully modified subscription. These hints MUST be transported 626 within a yang-data "modify-subscription-stream-error-info" container 627 inserted into the RPC error response. 629 Below is a tree diagram for "modify-subscription-RPC-yang-data". All 630 objects contained in this tree are described within the included YANG 631 model within Section 4. 633 yang-data modify-subscription-stream-error-info 634 +--ro modify-subscription-stream-error-info 635 +--ro reason? identityref 636 +--ro filter-failure-hint? string 638 Figure 5: modify-subscription RPC yang-data tree diagram 640 2.4.4. Deleting a Dynamic Subscription 642 The "delete-subscription" operation permits canceling an existing 643 subscription. If the publisher accepts the request, and the 644 publisher has indicated success, the publisher MUST NOT send any more 645 notification messages for this subscription. If the delete request 646 matches a known subscription established on the same transport 647 session, then it MUST be deleted; otherwise it MUST be rejected with 648 no changes to the publisher. 650 Below is a tree diagram for "delete-subscription". All objects 651 contained in this tree are described within the included YANG model 652 within Section 4. 654 +---x delete-subscription 655 +---w input 656 +---w identifier subscription-id 658 Figure 6: delete-subscription RPC tree diagram 660 Dynamic subscriptions can only be deleted via this RPC using the same 661 transport session previously used for subscription establishment. 662 Configured subscriptions cannot be deleted using RPCs. 664 2.4.5. Killing a Dynamic Subscription 666 The "kill-subscription" operation permits an operator to end a 667 dynamic subscription which is not associated with the transport 668 session used for the RPC. A publisher MUST terminate any dynamic 669 subscription identified by RPC request. An operator may find 670 subscription identifiers which may be used with "kill-subscription" 671 by searching for the IP address of a receiver within 672 "/subscriptions/subscription/receivers/receiver/address". 674 Configured subscriptions cannot be killed using this RPC. Instead, 675 configured subscriptions are deleted as part of regular configuration 676 operations. Publishers MUST reject any RPC attempt to kill a 677 configured subscription. 679 Below is a tree diagram for "kill-subscription". All objects 680 contained in this tree are described within the included YANG model 681 within Section 4. 683 +---x kill-subscription 684 +---w input 685 +---w identifier subscription-id 687 Figure 7: kill-subscription RPC tree diagram 689 2.4.6. RPC Failures 691 Whenever an RPC is unsuccessful, the publisher returns relevant 692 information as part of the RPC error response. Transport level error 693 processing MUST be done before RPC error processing described in this 694 section. In all cases, RPC error information returned will use 695 existing transport layer RPC structures, such as those seen with 696 NETCONF in [RFC6241] Appendix A, or with RESTCONF in [RFC8040] 697 Section 7.1. These structures MUST be able to encode subscription 698 specific errors identified below and defined within this document's 699 YANG model. 701 As a result of this mixture, how subscription errors are encoded 702 within an RPC error response is transport dependent. Following are 703 valid errors which can occur for each RPC: 705 establish-subscription modify-subscription 706 ---------------------- ------------------- 707 dscp-unavailable filter-unsupported 708 encoding-unsupported insufficient-resources 709 filter-unsupported no-such-subscription 710 history-unavailable 711 insufficient-resources 712 replay-unsupported 714 delete-subscription kill-subscription 715 ---------------------- ---------------------- 716 no-such-subscription no-such-subscription 718 To see a NETCONF based example of an error response from above, see 719 [I-D.draft-ietf-netconf-netconf-event-notifications], Figure 10. 721 There is one final set of transport independent RPC error elements 722 included in the YANG model. These are the following three yang-data 723 structures for failed event stream subscriptions: 725 1. "establish-subscription-stream-error-info": This MUST be returned 726 if an RPC error reason has not been placed elsewhere within the 727 transport portion of a failed "establish-subscription" RPC 728 response. This MUST be sent if hints on how to overcome the RPC 729 error are included. 731 2. "modify-subscription-stream-error-info": This MUST be returned if 732 an RPC error reason has not been placed elsewhere within the 733 transport portion of a failed "modify-subscription" RPC response. 734 This MUST be sent if hints on how to overcome the RPC error are 735 included. 737 3. "delete-subscription-error-info": This MUST be returned if an RPC 738 error reason has not been placed elsewhere within the transport 739 portion of a failed "delete-subscription" or "kill-subscription" 740 RPC response. 742 2.5. Configured Subscriptions 744 A configured subscription is a subscription installed via 745 configuration. Configured subscriptions may be modified by any 746 configuration client with the proper permissions. Subscriptions can 747 be modified or terminated via configuration at any point of their 748 lifetime. 750 Configured subscriptions have several characteristics distinguishing 751 them from dynamic subscriptions: 753 o persistence across publisher reboots, 755 o persistence even when transport is unavailable, and 757 o an ability to send notification messages to more than one receiver 758 (note that receivers are unaware of the existence of any other 759 receivers.) 761 On the publisher, supporting configured subscriptions is optional and 762 advertised using the "configured" feature. On a receiver of a 763 configured subscription, support for dynamic subscriptions is 764 optional except where replaying missed event records is required. 766 In addition to the subscription parameters available to dynamic 767 subscriptions described in Section 2.4.2, the following additional 768 parameters are also available to configured subscriptions: 770 o A "transport" which identifies the transport protocol to use to 771 connect with all subscription receivers. 773 o One or more receivers, each with an "address", where each address 774 is intended as the destination for event records. 776 o Optional parameters to identify where traffic should egress a 777 publisher: 779 * A "source-interface" which identifies the egress interface to 780 use from the publisher. Publisher support for this is optional 781 and advertised using the "interface-designation" feature. 783 * A "source-address" address, which identifies the IP address to 784 stamp on notification messages destined for the receiver. 786 * A "source-vrf" which identifies the VRF on which to reach 787 receivers. This VRF is a network instance as defined within 788 [I-D.draft-ietf-rtgwg-ni-model]. Publisher support for VRFs is 789 optional and advertised using the "supports-vrf" feature. 791 If none of the above parameters are set, notification messages 792 MUST egress the publisher's default interface. 794 A tree diagram describing these parameters is shown in Figure 20 795 within Section 3.3. All parameters are described within the YANG 796 model in Section 4. 798 2.5.1. Configured Subscription State Model 800 Below is the state machine for a configured subscription on the 801 publisher. This state machine describes the three states (valid, 802 invalid, and concluded), as well as the transitions between these 803 states. Start and end states are depicted to reflect configured 804 subscription creation and deletion events. The creation or 805 modification of a configured subscription initiates an evaluation by 806 the publisher to determine if the subscription is in valid or invalid 807 states. The publisher uses its own criteria in making this 808 determination. If in the valid state, the subscription becomes 809 operational. See (1) in the diagram below. 811 ......... 812 : start :-. 813 :.......: | 814 create .---modify-----.----------------------------------. 815 | | | | 816 V V .-------. ....... .---------. 817 .----[evaluate]--no--->|invalid|-delete->: end :<-delete-|concluded| 818 | '-------' :.....: '---------' 819 |-[evaluate]--no-(2). ^ ^ ^ 820 | ^ | | | | 821 yes | '->unsupportable delete stop-time 822 | modify (subscription- (subscription- (subscription- 823 | | terminated*) terminated*) concluded*) 824 | | | | | 825 (1) | (3) (4) (5) 826 | .---------------------------------------------------------------. 827 '-->| valid | 828 '---------------------------------------------------------------' 830 Legend: 831 dotted boxes: subscription added or removed via configuration 832 dashed boxes: states for a subscription 833 [evaluate]: decision point on whether the subscription is supportable 834 (*): resulting subscription state change notification 836 Figure 8: Publisher state model for a configured subscription 838 A subscription in the valid state may move to the invalid state in 839 one of two ways. First, it may be modified in a way which fails a 840 re-evaluation. See (2) in the diagram. Second, the publisher might 841 determine that the subscription is no longer supportable. This could 842 be for reasons of an unexpected but sustained increase in an event 843 stream's event records, degraded CPU capacity, a more complex 844 referenced filter, or other higher priority subscriptions which have 845 usurped resources. See (3) in the diagram. No matter the case, a 846 "subscription-terminated" notification is sent to any receivers in an 847 active or suspended state. A subscription in the valid state may 848 also transition to the concluded state via (5) if a configured stop 849 time has been reached. In this case, a "subscription-concluded" 850 notification is sent to any receivers in active or suspended states. 851 Finally, a subscription may be deleted by configuration (4). 853 When a subscription is in the valid state, a publisher will attempt 854 to connect with all receivers of a configured subscription and 855 deliver notification messages. Below is the state machine for each 856 receiver of a configured subscription. This receiver state machine 857 is fully contained within the state machine of the configured 858 subscription, and is only relevant when the configured subscription 859 is in the valid state. 861 .-----------------------------------------------------------------. 862 | valid | 863 | .----------. .--------. | 864 | | receiver |---timeout---------------->|receiver| | 865 | |connecting|<----------------reset--(c)|timeout | | 866 | | |<-transport '--------' | 867 | '----------' loss,reset------------------------------. | 868 | (a) | | | 869 | subscription- (b) (b) | 870 | started* .--------. .---------. | 871 | '----->| |(d)-insufficient CPU,------->| | | 872 | |receiver| buffer overflow |receiver | | 873 | subscription-| active | |suspended| | 874 | modified* | |<----CPU, b/w sufficient,-(e)| | | 875 | '---->'--------' subscription-modified* '---------' | 876 '-----------------------------------------------------------------' 878 Legend: 879 dashed boxes which include the word 'receiver' show the possible 880 states for an individual receiver of a valid configured subscription. 881 * indicates a state change notification 883 Figure 9: Receiver state for a configured subscription on a Publisher 885 When a configured subscription first moves to the valid state, the 886 "state" leaf of each receiver is initialized to "connecting". If 887 transport connectivity is not available to any receiver and there are 888 any notification messages to deliver, a transport session is 889 established (e.g., through [RFC8071]). Individual receivers are 890 moved to the active state when a "subscription-started" state change 891 notification is successfully passed to that receiver (a). Event 892 records are only sent to active receivers. Receivers of a configured 893 subscription remain active if both transport connectivity can be 894 verified to the receiver, and event records are not being dropped due 895 to a publisher buffer overflow. The result is that a receiver will 896 remain active on the publisher as long as events aren't being lost, 897 or the receiver cannot be reached. In addition, a configured 898 subscription's receiver MUST be moved to connecting if transport 899 connectivity cannot be achieved, or if the receiver is reset via the 900 "reset" action (b), (c). For more on reset, see Section 2.5.5. 902 A configured subscription's receiver MUST be moved to the suspended 903 state if there is transport connectivity between the publisher and 904 receiver, but notification messages are failing to be delivered due 905 to publisher buffer overflow, or notification messages are not able 906 to be generated for that receiver due to insufficient CPU (d). This 907 is indicated to the receiver by the "subscription-suspended" state 908 change notification. 910 A configured subscription receiver MUST be returned to the active 911 state from the suspended state when notification messages are able to 912 be generated, bandwidth is sufficient to handle the notification 913 messages, and a receiver has successfully been sent a "subscription- 914 resumed" or "subscription-modified" state change notification (e). 915 The choice as to which of these two state change notifications is 916 sent is determined by whether the subscription was modified during 917 the period of suspension. 919 Modification of a configured subscription is possible at any time. A 920 "subscription-modified" state change notification will be sent to all 921 active receivers, immediately followed by notification messages 922 conforming to the new parameters. Suspended receivers will also be 923 informed of the modification. However this notification will await 924 the end of the suspension for that receiver (e). 926 The mechanisms described above are mirrored in the RPCs and 927 notifications within the document. It should be noted that these 928 RPCs and notifications have been designed to be extensible and allow 929 subscriptions into targets other than event streams. For instance, 930 the YANG module defined in Section 5 of [I-D.ietf-netconf-yang-push] 931 augments "/sn:modify-subscription/sn:input/sn:target". 933 2.5.2. Creating a Configured Subscription 935 Configured subscriptions are established using configuration 936 operations against the top-level "subscriptions" subtree. 938 Because there is no explicit association with an existing transport 939 session, configuration operations require additional parameters 940 beyond those of dynamic subscriptions to indicate receivers, and 941 possibly whether the notification messages need to come from a 942 specific egress interface on the publisher. 944 After a subscription is successfully established, the publisher 945 immediately sends a "subscription-started" state change notification 946 to each receiver. It is quite possible that upon configuration, 947 reboot, or even steady-state operations, a transport session may not 948 be currently available to the receiver. In this case, when there is 949 something to transport for an active subscription, transport specific 950 call-home operations will be used to establish the connection. When 951 transport connectivity is available, notification messages may then 952 be pushed. 954 With active configured subscriptions, it is allowable to buffer event 955 records even after a "subscription-started" has been sent. However 956 if events are lost (rather than just delayed) due to replay buffer 957 overflow, a new "subscription-started" must be sent. This new 958 "subscription-started" indicates an event record discontinuity. 960 To see an example of subscription creation using configuration 961 operations over NETCONF, see Appendix A of 962 [I-D.draft-ietf-netconf-netconf-event-notifications]. 964 Note that is possible to configure replay on a configured 965 subscription. This capability is to allow a configured subscription 966 to exist on a system so that event records generated during boot can 967 be buffered and pushed as soon as the transport session is 968 established. 970 2.5.3. Modifying a Configured Subscription 972 Configured subscriptions can be modified using configuration 973 operations against the top-level "subscriptions" subtree. 975 If the modification involves adding receivers, added receivers are 976 placed in the connecting state. If a receiver is removed, the state 977 change notification "subscription-terminated" is sent to that 978 receiver if that receiver is active or suspended. 980 If the modification involves changing the policies for the 981 subscription, the publisher sends to currently active receivers a 982 "subscription-modified" notification. For any suspended receivers, a 983 "subscription-modified" notification will be delayed until the 984 receiver is resumed. (Note: in this case, the "subscription- 985 modified" notification informs the receiver that the subscription has 986 been resumed, so no additional "subscription-resumed" need be sent. 987 Also note that if multiple modifications have occurred during the 988 suspension, only the latest one need be sent to the receiver.) 990 2.5.4. Deleting a Configured Subscription 992 Subscriptions can be deleted through configuration against the top- 993 level "subscriptions" subtree. 995 Immediately after a subscription is successfully deleted, the 996 publisher sends to all receivers of that subscription a state change 997 notification stating the subscription has ended (i.e., "subscription- 998 terminated"). 1000 2.5.5. Resetting a Configured Subscription Receiver 1002 It is possible that a configured subscription to a receiver needs to 1003 be reset. This is accomplished via the "reset" action within the 1004 YANG model at "/subscriptions/subscription/receivers/receiver/reset". 1005 This re-initialization may be useful in cases where a publisher has 1006 timed out trying to reach a receiver. When such a reset occurs, a 1007 transport session will be initiated if necessary, and a new 1008 "subscription-started" notification will be sent. This action does 1009 not have any effect on transport connectivity if the needed 1010 connectivity already exists. 1012 2.5.6. Replay for a Configured Subscription 1014 It is possible to place a start time on a configured subscription. 1015 This enables streaming of logged information immediately after 1016 restart. 1018 Replay of events records created since restart can be quite useful. 1019 This allows event records generated before transport connectivity was 1020 supportable by a publisher to be passed to a receiver. In addition, 1021 event records logged before restart are not sent. This avoids the 1022 potential for accidental event record duplication. Such duplication 1023 might otherwise be likely as a configured subscription's identifier 1024 before and after the reboot is the same, and there may be not be 1025 evidence to a receiver that a restart has occurred. By establishing 1026 restart as the earliest potential time for event records to be 1027 included in notification messages, a well-understood timeframe for 1028 replay is defined. 1030 Therefore, when any such configured subscription receivers become 1031 active, buffered event records (if any) will be sent immediately 1032 after the "subscription-started" notification. The leading event 1033 record sent will be the first event record subsequent to the latest 1034 of four different times: the "replay-log-creation-time", "replay-log- 1035 aged-time", "replay-start-time", or the most recent publisher boot 1036 time. The "replay-log-creation-time" and "replay-log-aged-time" are 1037 discussed in Section 2.4.2.1, and "replay-start-time" in 1038 Section 2.7.1. The most recent publisher boot time ensures that 1039 duplicate event records are not replayed from a previous time the 1040 publisher was booted. 1042 It is quite possible that a receiver might want to retrieve event 1043 records from a stream prior to the latest boot. If such records 1044 exist, on a configured replay, the publisher MUST send the time of 1045 the event record immediately preceding the "replay-start-time" within 1046 the "replay-previous-event-time" leaf. With the "replay-previous- 1047 event-time", the receiver will know that earlier events exist, and if 1048 it was previously receiving event records with the same subscription 1049 id, it can determine if there was a timegap where records generated 1050 on the publisher were not successully received. With this 1051 information, the receiver can dynamically subscribe to the stream to 1052 retrieve any event records placed into the stream before the most 1053 recent boot time. 1055 All other replay functionality remains the same as with dynamic 1056 subscriptions as described in Section 2.4.2.1. 1058 2.6. Event Record Delivery 1060 Whether dynamic or configured, once a subscription has been set up, 1061 the publisher streams event records via notification messages per the 1062 terms of the subscription. For dynamic subscriptions, notification 1063 messages are sent over the session used to establish the 1064 subscription. For configured subscriptions, notification messages 1065 are sent over the connections specified by the transport and each 1066 receiver of a configured subscription. 1068 A notification message is sent to a receiver when an event record is 1069 not blocked by either the specified filter criteria or receiver 1070 permissions. This notification message MUST be encoded in a 1071 message as defined within [RFC5277], Section 4. And 1072 per [RFC5277]'s "eventTime" object definition, the "eventTime" is 1073 populated with the event occurrence time. 1075 The following example within [RFC7950] section 7.16.3 is an example 1076 of a compliant message: 1078 1080 2007-09-01T10:00:00Z 1081 1082 so-1/2/3.0 1083 up 1084 down 1085 1086 1088 Figure 10: subscribed notification message 1090 When a dynamic subscription has been started or modified, with 1091 "establish-subscription" or "modify-subscription" respectively, event 1092 records matching the newly applied filter criteria MUST NOT be sent 1093 until after the RPC reply has been sent. 1095 When a configured subscription has been started or modified, event 1096 records matching the newly applied filter criteria MUST NOT be sent 1097 until after the "subscription-started" or "subscription-modified" 1098 notifications has been sent, respectively. 1100 2.7. Subscription State Notifications 1102 In addition to sending event records to receivers, a publisher MUST 1103 also send subscription state notifications when events related to 1104 subscription management have occurred. 1106 Subscription state notifications are unlike other notifications in 1107 that they are never included in any stream. Instead, they are 1108 inserted (as defined in this section) within the sequence of 1109 notification messages sent to a particular receiver. Subscription 1110 state notifications cannot be filtered out, they cannot be stored in 1111 replay buffers, and they are delivered only to impacted receivers of 1112 a subscription. The identification of subscription state 1113 notifications is easy to separate from other notification messages 1114 through the use of the YANG extension "subscription-state-notif". 1115 This extension tags a notification as a subscription state 1116 notification. 1118 The complete set of subscription state notifications is described in 1119 the following subsections. 1121 2.7.1. subscription-started 1123 This notification indicates that a configured subscription has 1124 started, and event records may be sent. Included in this state 1125 change notification are all the parameters of the subscription, 1126 except for the receiver(s) addressing information and origin 1127 information indicating where notification messages will egress the 1128 publisher. Note that if a referenced filter from the "filters" 1129 container has been used within the subscription, the notification 1130 still provides the contents of that referenced filter under the 1131 "within-subscription" subtree. 1133 Note that for dynamic subscriptions, no "subscription-started" 1134 notifications are ever sent. 1136 Below is a tree diagram for "subscription-started". All objects 1137 contained in this tree are described within the included YANG model 1138 within Section 4. 1140 +---n subscription-started {configured}? 1141 +--ro identifier 1142 | subscription-id 1143 +--ro (target) 1144 | +--:(stream) 1145 | +--ro (stream-filter)? 1146 | | +--:(by-reference) 1147 | | | +--ro stream-filter-ref 1148 | | | stream-filter-ref 1149 | | +--:(within-subscription) 1150 | | +--ro (filter-spec)? 1151 | | +--:(stream-subtree-filter) 1152 | | | +--ro stream-subtree-filter? 1153 | | | {subtree}? 1154 | | +--:(stream-xpath-filter) 1155 | | +--ro stream-xpath-filter? yang:xpath1.0 1156 | | {xpath}? 1157 | +--ro stream stream-ref 1158 | +--ro replay-start-time? 1159 | | yang:date-and-time {replay}? 1160 | +--ro replay-previous-event-time? 1161 | yang:date-and-time {replay}? 1162 +--ro stop-time? 1163 | yang:date-and-time 1164 +--ro dscp? inet:dscp 1165 | {dscp}? 1166 +--ro weighting? uint8 {qos}? 1167 +--ro dependency? 1168 | subscription-id {qos}? 1169 +--ro transport transport 1170 | {configured}? 1171 +--ro encoding? encoding 1172 +--ro purpose? string 1173 {configured}? 1175 Figure 11: subscription-started notification tree diagram 1177 2.7.2. subscription-modified 1179 This notification indicates that a subscription has been modified by 1180 configuration operations. It is delivered directly after the last 1181 event records processed using the previous subscription parameters, 1182 and before any event records processed after the modification. 1184 Below is a tree diagram for "subscription-modified". All objects 1185 contained in this tree are described within the included YANG model 1186 within Section 4. 1188 +---n subscription-modified 1189 +--ro identifier subscription-id 1190 +--ro (target) 1191 | +--:(stream) 1192 | +--ro (stream-filter)? 1193 | | +--:(by-reference) 1194 | | | +--ro stream-filter-ref stream-filter-ref 1195 | | +--:(within-subscription) 1196 | | +--ro (filter-spec)? 1197 | | +--:(stream-subtree-filter) 1198 | | | +--ro stream-subtree-filter? 1199 | | | {subtree}? 1200 | | +--:(stream-xpath-filter) 1201 | | +--ro stream-xpath-filter? yang:xpath1.0 1202 | | {xpath}? 1203 | +--ro stream stream-ref 1204 | +--ro replay-start-time? yang:date-and-time 1205 | {replay}? 1206 +--ro stop-time? yang:date-and-time 1207 +--ro dscp? inet:dscp {dscp}? 1208 +--ro weighting? uint8 {qos}? 1209 +--ro dependency? subscription-id {qos}? 1210 +--ro transport transport {configured}? 1211 +--ro encoding? encoding 1212 +--ro purpose? string {configured}? 1214 Figure 12: subscription-modified notification tree diagram 1216 A publisher most often sends this notification directly after the 1217 modification of any configuration parameters impacting a configured 1218 subscription. But it may also be sent at two other times: 1220 1. Where a configured subscription has been modified during the 1221 suspension of a receiver, the notification will be delayed until 1222 the receiver's suspension is lifted. In this situation, the 1223 notification indicates that the subscription has been both 1224 modified and resumed. 1226 2. While this state change will most commonly be used with 1227 configured subscriptions, with dynamic subscriptions, there is 1228 also one time this notification will be sent. A "subscription- 1229 modified" state change notification MUST be sent if the contents 1230 of the filter identified by the subscription's "stream-filter- 1231 ref" leaf has changed. 1233 2.7.3. subscription-terminated 1235 This notification indicates that no further event records for this 1236 subscription should be expected from the publisher. A publisher may 1237 terminate the sending event records to a receiver for the following 1238 reasons: 1240 1. Configuration which removes a configured subscription, or a 1241 "kill-subscription" RPC which ends a dynamic subscription. These 1242 are identified via the reason "no-such-subscription". 1244 2. A referenced filter is no longer accessible. This is identified 1245 by "filter-unavailable". 1247 3. The event stream referenced by a subscription is no longer 1248 accessible by the receiver. This is identified by "stream- 1249 unavailable". 1251 4. A suspended subscription has exceeded some timeout. This is 1252 identified by "suspension-timeout". 1254 Each of the reasons above correspond one-to-one with a "reason" 1255 identityref specified within the YANG model. 1257 Below is a tree diagram for "subscription-terminated". All objects 1258 contained in this tree are described within the included YANG model 1259 within Section 4. 1261 +---n subscription-terminated 1262 +--ro identifier subscription-id 1263 +--ro reason identityref 1265 Figure 13: subscription-terminated notification tree diagram 1267 Note: this state change notification MUST be sent to a dynamic 1268 subscription's receiver when the subscription ends unexpectedly. The 1269 cases when this might happen are when a "kill-subscription" RPC is 1270 successful, or when some other event not including the reaching the 1271 subscription's "stop-time" results in a publisher choosing to end the 1272 subscription. 1274 2.7.4. subscription-suspended 1276 This notification indicates that a publisher has suspended the 1277 sending of event records to a receiver, and also indicates the 1278 possible loss of events. Suspension happens when capacity 1279 constraints stop a publisher from serving a valid subscription. The 1280 two conditions where is this possible are: 1282 1. "insufficient-resources" when a publisher is unable to produce 1283 the requested event stream of notification messages, and 1285 2. "unsupportable-volume" when the bandwidth needed to get generated 1286 notification messages to a receiver exceeds a threshold. 1288 These conditions are encoded within the "reason" object. No further 1289 notification will be sent until the subscription resumes or is 1290 terminated. 1292 Below is a tree diagram for "subscription-suspended". All objects 1293 contained in this tree are described within the included YANG model 1294 within Section 4. 1296 +---n subscription-suspended 1297 +--ro identifier subscription-id 1298 +--ro reason identityref 1300 Figure 14: subscription-suspended notification tree diagram 1302 2.7.5. subscription-resumed 1304 This notification indicates that a previously suspended subscription 1305 has been resumed under the unmodified terms previously in place. 1306 Subscribed event records generated after the issuance of this state 1307 change notification may now be sent. 1309 Below is the tree diagram for "subscription-resumed". All objects 1310 contained in this tree are described within the included YANG model 1311 within Section 4. 1313 +---n subscription-resumed 1314 +--ro identifier subscription-id 1316 Figure 15: subscription-resumed notification tree diagram 1318 2.7.6. subscription-completed 1320 This notification indicates that a subscription that includes a 1321 "stop-time" has successfully finished passing event records upon the 1322 reaching of that time. 1324 Below is a tree diagram for "subscription-completed". All objects 1325 contained in this tree are described within the included YANG model 1326 within Section 4. 1328 +---n subscription-completed 1329 +--ro identifier subscription-id 1331 Figure 16: subscription-completed notification tree diagram 1333 2.7.7. replay-completed 1335 This notification indicates that all of the event records prior to 1336 the current time have been passed to a receiver. It is sent before 1337 any notification message containing an event record with a timestamp 1338 later than (1) the "stop-time" or (2) the subscription's start time. 1340 If a subscription contains no "stop-time", or has a "stop-time" that 1341 has not been reached, then after the "replay-completed" notification 1342 has been sent, additional event records will be sent in sequence as 1343 they arise naturally on the publisher. 1345 Below is a tree diagram for "replay-completed". All objects 1346 contained in this tree are described within the included YANG model 1347 within Section 4. 1349 +---n replay-completed 1350 +--ro identifier subscription-id 1352 Figure 17: replay-completed notification tree diagram 1354 2.8. Subscription Monitoring 1356 In the operational datastore, the container "subscriptions" maintains 1357 the state of all dynamic subscriptions, as well as all configured 1358 subscriptions. Using datastore retrieval operations, or subscribing 1359 to the "subscriptions" container [I-D.ietf-netconf-yang-push] allows 1360 the state of subscriptions and their connectivity to receivers to be 1361 monitored. 1363 Each subscription in the operational datastore is represented as a 1364 list element. Included in this list are event counters for each 1365 receiver, the state of each receiver, as well as the subscription 1366 parameters currently in effect. The appearance of the leaf 1367 "configured-subscription-state" indicates that a particular 1368 subscription came into being via configuration. This leaf also 1369 indicates if current state of that subscription is valid, invalid, 1370 and concluded. 1372 To understand the flow of event records within a subscription, there 1373 are two counters available for each configured and dynamic receiver. 1374 The first counter is "count-sent" which shows the quantity of events 1375 actually identified for sending to a receiver. The second counter is 1376 "count-excluded" which shows event records not sent to receiver. 1377 "count-excluded" shows the combined results of both access control 1378 and per-subscription filtering. For configured subscriptions, 1379 counters are reset whenever the subscription is evaluated to valid 1380 (see (1) in Figure 8). 1382 Dynamic subscriptions are removed from the operational datastore once 1383 they expire (reaching stop-time) or when they are terminated. While 1384 many subscription objects are shown as configurable, dynamic 1385 subscriptions are only included within the operational datastore and 1386 as a result are not configurable. 1388 2.9. Advertisement 1390 Publishers supporting this document MUST indicate support of the YANG 1391 model "ietf-subscribed-notifications" within the YANG library of the 1392 publisher. In addition support for optional features "encode-xml", 1393 "encode-json", "configured" "supports-vrf", "qos", "xpath", 1394 "subtree", "interface-designation", "dscp", and "replay" MUST be 1395 indicated if supported. 1397 3. YANG Data Model Trees 1399 This section contains tree diagrams for nodes defined in Section 4. 1400 For tree diagrams of state change notifications, see Section 2.7. Or 1401 for the tree diagrams for the RPCs, see Section 2.4. 1403 3.1. Event Streams Container 1405 A publisher maintains a list of available event streams as 1406 operational data. This list contains both standardized and vendor- 1407 specific event streams. This enables subscribers to discover what 1408 streams a publisher supports. 1410 +--ro streams 1411 +--ro stream* [name] 1412 +--ro name string 1413 +--ro description string 1414 +--ro replay-support? empty {replay}? 1415 +--ro replay-log-creation-time yang:date-and-time {replay}? 1416 +--ro replay-log-aged-time? yang:date-and-time {replay}? 1418 Figure 18: Stream Container tree diagram 1420 Above is a tree diagram for the streams container. All objects 1421 contained in this tree are described within the included YANG model 1422 within Section 4. 1424 3.2. Filters Container 1426 The "filters" container maintains a list of all subscription filters 1427 that persist outside the life-cycle of a single subscription. This 1428 enables pre-defined filters which may be referenced by more than one 1429 subscription. 1431 +--rw filters 1432 +--rw stream-filter* [identifier] 1433 +--rw identifier filter-id 1434 +--rw (filter-spec)? 1435 +--:(stream-subtree-filter) 1436 | +--rw stream-subtree-filter? {subtree}? 1437 +--:(stream-xpath-filter) 1438 +--rw stream-xpath-filter? yang:xpath1.0 {xpath}? 1440 Figure 19: Filter Container tree diagram 1442 Above is a tree diagram for the filters container. All objects 1443 contained in this tree are described within the included YANG model 1444 within Section 4. 1446 3.3. Subscriptions Container 1448 The "subscriptions" container maintains a list of all subscriptions 1449 on a publisher, both configured and dynamic. It can be used to 1450 retrieve information about the subscriptions which a publisher is 1451 serving. 1453 +--rw subscriptions 1454 +--rw subscription* [identifier] 1455 +--rw identifier 1456 | subscription-id 1457 +--rw (target) 1458 | +--:(stream) 1459 | +--rw (stream-filter)? 1460 | | +--:(by-reference) 1461 | | | +--rw stream-filter-ref 1462 | | | stream-filter-ref 1463 | | +--:(within-subscription) 1464 | | +--rw (filter-spec)? 1465 | | +--:(stream-subtree-filter) 1466 | | | +--rw stream-subtree-filter? 1467 | | | {subtree}? 1468 | | +--:(stream-xpath-filter) 1469 | | +--rw stream-xpath-filter? yang:xpath1.0 1470 | | {xpath}? 1471 | +--rw stream stream-ref 1472 | +--rw replay-start-time? 1473 | yang:date-and-time {replay}? 1474 +--rw stop-time? 1475 | yang:date-and-time 1476 +--rw dscp? inet:dscp 1477 | {dscp}? 1478 +--rw weighting? uint8 {qos}? 1479 +--rw dependency? 1480 | subscription-id {qos}? 1481 +--rw transport transport 1482 | {configured}? 1483 +--rw encoding? encoding 1484 +--rw purpose? string 1485 | {configured}? 1486 +--rw (notification-message-origin)? {configured}? 1487 | +--:(interface-originated) 1488 | | +--rw source-interface? 1489 | | if:interface-ref {interface-designation}? 1490 | +--:(address-originated) 1491 | +--rw source-vrf? 1492 | | -> /ni:network-instances/network-instance/name 1493 | | {supports-vrf}? 1494 | +--rw source-address? 1495 | inet:ip-address-no-zone 1496 +--ro configured-subscription-state? enumeration 1497 | {configured}? 1498 +--rw receivers 1499 +--rw receiver* [name] 1500 +--rw name string 1501 +--rw address? inet:host 1502 +--ro count-sent? yang:zero-based-counter64 1503 +--ro count-excluded? yang:zero-based-counter64 1504 +--ro state enumeration 1505 +---x reset {configured}? 1506 +--ro output 1507 +--ro time yang:date-and-time 1509 Figure 20: Subscriptions tree diagram 1511 Above is a tree diagram for the subscriptions container. All objects 1512 contained in this tree are described within the included YANG model 1513 within Section 4. 1515 4. Data Model 1517 This module imports typedefs from [RFC6991], [RFC8343], and 1518 [RFC8040], and it references [I-D.draft-ietf-rtgwg-ni-model], 1519 [XPATH], [RFC6241], [RFC7540], [RFC7951] and [RFC7950]. 1521 [ note to the RFC Editor - please replace XXXX within this YANG model 1522 with the number of this document, and XXXY with the number of 1523 [I-D.draft-ietf-rtgwg-ni-model] ] 1525 [ note to the RFC Editor - please replace the two dates within the 1526 YANG module with the date of publication ] 1528 file "ietf-subscribed-notifications@2018-06-15.yang" 1529 module ietf-subscribed-notifications { 1530 yang-version 1.1; 1531 namespace 1532 "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; 1534 prefix sn; 1536 import ietf-inet-types { 1537 prefix inet; 1538 reference 1539 "RFC 6991: Common YANG Data Types"; 1540 } 1541 import ietf-interfaces { 1542 prefix if; 1543 reference 1544 "RFC 8343: A YANG Data Model for Interface Management"; 1545 } 1546 import ietf-network-instance { 1547 prefix ni; 1548 reference 1549 "draft-ietf-rtgwg-ni-model-11: YANG Model for Network Instances"; 1550 } 1551 import ietf-restconf { 1552 prefix rc; 1553 reference 1554 "RFC 8040 - RESTCONF Protocol"; 1555 } 1556 import ietf-yang-types { 1557 prefix yang; 1558 reference 1559 "RFC 6991: Common YANG Data Types"; 1560 } 1562 organization "IETF NETCONF (Network Configuration) Working Group"; 1563 contact 1564 "WG Web: 1565 WG List: 1567 Author: Alexander Clemm 1568 1570 Author: Eric Voit 1571 1573 Author: Alberto Gonzalez Prieto 1574 1576 Author: Einar Nilsen-Nygaard 1577 1579 Author: Ambika Prasad Tripathy 1580 "; 1582 description 1583 "Contains a YANG specification for subscribing to event records 1584 and receiving matching content within notification messages. 1586 Copyright (c) 2018 IETF Trust and the persons identified as authors 1587 of the code. All rights reserved. 1589 Redistribution and use in source and binary forms, with or without 1590 modification, is permitted pursuant to, and subject to the license 1591 terms contained in, the Simplified BSD License set forth in Section 1592 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents 1593 (https://trustee.ietf.org/license-info). 1595 This version of this YANG module is part of RFC XXXX; see the RFC 1596 itself for full legal notices."; 1598 revision 2018-06-15 { 1599 description 1600 "Initial version"; 1601 reference 1602 "RFC XXXX: Customized Subscriptions to a Publisher's Event Streams"; 1603 } 1605 /* 1606 * FEATURES 1607 */ 1609 feature configured { 1610 description 1611 "This feature indicates that configuration of subscription is 1612 supported."; 1613 } 1615 feature dscp { 1616 description 1617 "This feature indicates a publisher supports the placement of 1618 suggested prioritization levels for network transport within 1619 notification messages."; 1620 } 1622 feature encode-json { 1623 description 1624 "This feature indicates that JSON encoding of notification 1625 messages is supported."; 1626 } 1628 feature encode-xml { 1629 description 1630 "This feature indicates that XML encoding of notification 1631 messages is supported."; 1632 } 1634 feature interface-designation { 1635 description 1636 "This feature indicates a publisher supports sourcing all receiver 1637 interactions for a configured subscription from a single 1638 designated egress interface."; 1639 } 1641 feature qos { 1642 description 1643 "This feature indicates a publisher supports absolute dependencies 1644 of one subscription's traffic over another, as well as weighted 1645 bandwidth sharing between subscriptions. Both of these are 1646 Quality of Service (QoS) features which allow differentiated 1647 treatment of notification messages between a publisher and a 1648 specific receiver."; 1649 } 1651 feature replay { 1652 description 1653 "This feature indicates that historical event record replay is 1654 supported. With replay, it is possible for past event records to 1655 be streamed in chronological order."; 1656 } 1658 feature subtree { 1659 description 1660 "This feature indicates support for YANG subtree filtering."; 1661 reference "RFC 6241, Section 6."; 1662 } 1664 feature supports-vrf { 1665 description 1666 "This feature indicates a publisher supports VRF configuration 1667 for configured subscriptions. VRF support for dynamic 1668 subscriptions does not require this feature."; 1669 reference "RFC XXXY, Section 6."; 1670 } 1672 feature xpath { 1673 description 1674 "This feature indicates support for xpath filtering."; 1675 reference "http://www.w3.org/TR/1999/REC-xpath-19991116"; 1676 } 1678 /* 1679 * EXTENSIONS 1680 */ 1682 extension subscription-state-notification { 1683 description 1684 "This statement applies only to notifications. It indicates that 1685 the notification is a subscription state notification. Therefore 1686 it does not participate in a regular event stream and does not 1687 need to be specifically subscribed to in order to be received. 1688 This statement can only occur as a substatement to the YANG 1689 'notification' statement. This statement is not for use outside 1690 of this YANG module."; 1691 } 1693 /* 1694 * IDENTITIES 1695 */ 1697 /* Identities for RPC and Notification errors */ 1699 identity delete-subscription-error { 1700 description 1701 "Problem found while attempting to fulfill either a 1702 'delete-subscription' RPC request or a 'kill-subscription' 1703 RPC request."; 1704 } 1706 identity establish-subscription-error { 1707 description 1708 "Problem found while attempting to fulfill an 1709 'establish-subscription' RPC request."; 1710 } 1712 identity modify-subscription-error { 1713 description 1714 "Problem found while attempting to fulfill a 1715 'modify-subscription' RPC request."; 1716 } 1718 identity subscription-suspended-reason { 1719 description 1720 "Problem condition communicated to a receiver as part of a 1721 'subscription-terminated' notification."; 1722 } 1724 identity subscription-terminated-reason { 1725 description 1726 "Problem condition communicated to a receiver as part of a 1727 'subscription-terminated' notification."; 1728 } 1730 identity dscp-unavailable { 1731 base establish-subscription-error; 1732 if-feature "dscp"; 1733 description 1734 "The publisher is unable mark notification messages with a 1735 prioritization information in a way which will be respected during 1736 network transit."; 1737 } 1739 identity encoding-unsupported { 1740 base establish-subscription-error; 1741 description 1742 "Unable to encode notification messages in the desired format."; 1743 } 1745 identity filter-unavailable { 1746 base subscription-terminated-reason; 1747 description 1748 "Referenced filter does not exist. This means a receiver is 1749 referencing a filter which doesn't exist, or to which they do not 1750 have access permissions."; 1751 } 1753 identity filter-unsupported { 1754 base establish-subscription-error; 1755 base modify-subscription-error; 1756 description 1757 "Cannot parse syntax within the filter. This failure can be from 1758 a syntax error, or a syntax too complex to be processed by the 1759 publisher."; 1760 } 1762 identity history-unavailable { 1763 base establish-subscription-error; 1764 if-feature "replay"; 1765 description 1766 "Replay request too far into the past. This means the publisher 1767 does store historic information for the requested stream, but 1768 not back to the requested timestamp."; 1769 } 1771 identity insufficient-resources { 1772 base establish-subscription-error; 1773 base modify-subscription-error; 1774 base subscription-suspended-reason; 1775 description 1776 "The publisher has insufficient resources to support the 1777 requested subscription. An example might be that allocated CPU 1778 is too limited to generate the desired set of notification 1779 messages."; 1780 } 1782 identity no-such-subscription { 1783 base modify-subscription-error; 1784 base delete-subscription-error; 1785 base subscription-terminated-reason; 1786 description 1787 "Referenced subscription doesn't exist. This may be as a result of 1788 a non-existent subscription ID, an ID which belongs to another 1789 subscriber, or an ID for configured subscription."; 1790 } 1792 identity replay-unsupported { 1793 base establish-subscription-error; 1794 if-feature "replay"; 1795 description 1796 "Replay cannot be performed for this subscription. This means the 1797 publisher will not provide the requested historic information from 1798 the event stream via replay to this receiver."; 1799 } 1801 identity stream-unavailable { 1802 base subscription-terminated-reason; 1803 description 1804 "Not a subscribable stream. This means the referenced event stream 1805 is not available for subscription by the receiver."; 1806 } 1808 identity suspension-timeout { 1809 base subscription-terminated-reason; 1810 description 1811 "Termination of previously suspended subscription. The publisher 1812 has eliminated the subscription as it exceeded a time limit for 1813 suspension."; 1814 } 1816 identity unsupportable-volume { 1817 base subscription-suspended-reason; 1818 description 1819 "The publisher does not have the network bandwidth needed to get 1820 the volume of generated information intended for a receiver."; 1821 } 1823 /* Identities for encodings */ 1825 identity configurable-encoding { 1826 description 1827 "If a transport identity derives from this identity, it means 1828 that it supports configurable encodings."; 1829 } 1831 identity encoding { 1832 description 1833 "Base identity to represent data encodings"; 1834 } 1836 identity encode-xml { 1837 base encoding; 1838 if-feature "encode-xml"; 1839 description 1840 "Encode data using XML as described in RFC 7950"; 1841 reference 1842 "RFC 7950 - The YANG 1.1 Data Modeling Language"; 1843 } 1845 identity encode-json { 1846 base encoding; 1847 if-feature "encode-json"; 1848 description 1849 "Encode data using JSON as described in RFC 7951"; 1850 reference 1851 "RFC 7951 - JSON Encoding of Data Modeled with YANG"; 1852 } 1854 /* Identities for transports */ 1855 identity transport { 1856 description 1857 "An identity that represents the underlying mechanism for 1858 passing notification messages."; 1859 } 1861 identity inline-address { 1862 description 1863 "A transport identity can derive from this identity in order to 1864 allow inline definition of the host address in the 1865 'receiver' list"; 1866 } 1868 /* 1869 * TYPEDEFs 1870 */ 1872 typedef encoding { 1873 type identityref { 1874 base encoding; 1875 } 1876 description 1877 "Specifies a data encoding, e.g. for a data subscription."; 1878 } 1880 typedef filter-id { 1881 type string; 1882 description 1883 "A type to identify filters which can be associated with a 1884 subscription."; 1885 } 1887 typedef stream-filter-ref { 1888 type leafref { 1889 path "/sn:filters/sn:stream-filter/sn:identifier"; 1890 } 1891 description 1892 "This type is used to reference an event stream filter."; 1893 } 1895 typedef stream-ref { 1896 type leafref { 1897 path "/sn:streams/sn:stream/sn:name"; 1898 } 1899 description 1900 "This type is used to reference a system-provided stream."; 1901 } 1903 typedef subscription-id { 1904 type uint32; 1905 description 1906 "A type for subscription identifiers."; 1907 } 1909 typedef transport { 1910 type identityref { 1911 base transport; 1912 } 1913 description 1914 "Specifies transport used to send notification messages to a 1915 receiver."; 1916 } 1918 /* 1919 * GROUPINGS 1920 */ 1922 grouping stream-filter-elements { 1923 description 1924 "This grouping defines the base for filters applied to event 1925 streams."; 1926 choice filter-spec { 1927 description 1928 "The content filter specification for this request."; 1929 anydata stream-subtree-filter { 1930 if-feature "subtree"; 1931 description 1932 "Event stream evaluation criteria encoded in the syntax of a 1933 subtree filter as defined in RFC 6241, Section 6. 1935 The subtree filter is applied to the representation of 1936 individual, delineated event records as contained within the 1937 event stream. For example, if the notification message 1938 contains an instance of a notification defined in YANG, then 1939 the top-level element is the name of the YANG notification. 1941 If the subtree filter returns a non-empty node set, the filter 1942 matches the event record, and the event record is included in 1943 the notification message sent to the receivers."; 1944 reference "RFC 6241, Section 6."; 1945 } 1946 leaf stream-xpath-filter { 1947 if-feature "xpath"; 1948 type yang:xpath1.0; 1949 description 1950 "Event stream evaluation criteria encoded in the syntax of 1951 an XPath 1.0 expression. 1953 The XPath expression is evaluated on the representation of 1954 individual, delineated event records as contained within 1955 the event stream. For example, if the notification message 1956 contains an instance of a notification defined in YANG, 1957 then the top-level element is the name of the YANG 1958 notification, and the root node has this top-level element 1959 as the only child. 1961 The result of the XPath expression is converted to a 1962 boolean value using the standard XPath 1.0 rules. If the 1963 boolean value is 'true', the filter matches the event record, 1964 and the event record is included in the notification message 1965 sent to the receivers. 1967 The expression is evaluated in the following XPath context: 1969 o The set of namespace declarations are those in scope on 1970 the 'stream-xpath-filter' leaf element. 1972 o The set of variable bindings is empty. 1974 o The function library is the core function library, and 1975 the XPath functions defined in section 10 in RFC 7950. 1977 o The context node is the root node."; 1978 reference 1979 "http://www.w3.org/TR/1999/REC-xpath-19991116 1980 RFC 7950, Section 10."; 1982 } 1983 } 1984 } 1986 grouping update-qos { 1987 description 1988 "This grouping describes Quality of Service information 1989 concerning a subscription. This information is passed to lower 1990 layers for transport prioritization and treatment"; 1991 leaf dscp { 1992 if-feature "dscp"; 1993 type inet:dscp; 1994 default "0"; 1995 description 1996 "The desired network transport priority level. This is the 1997 priority set on notification messages encapsulating the results 1998 of the subscription. This transport priority is shared for all 1999 receivers of a given subscription."; 2000 } 2001 leaf weighting { 2002 if-feature "qos"; 2003 type uint8 { 2004 range "0 .. 255"; 2005 } 2006 description 2007 "Relative weighting for a subscription. Allows an underlying 2008 transport layer perform informed load balance allocations 2009 between various subscriptions"; 2010 reference 2011 "RFC-7540, section 5.3.2"; 2012 } 2013 leaf dependency { 2014 if-feature "qos"; 2015 type subscription-id; 2016 description 2017 "Provides the 'subscription-id' of a parent subscription which 2018 has absolute precedence should that parent have push updates 2019 ready to egress the publisher. In other words, there should be 2020 no streaming of objects from the current subscription if 2021 the parent has something ready to push. 2023 If a dependency is asserted via configuration or via RPC, but 2024 the referenced 'subscription-id' does not exist, the dependency 2025 is silently discarded. If a referenced subscription is deleted 2026 this dependency is removed."; 2027 reference 2028 "RFC-7540, section 5.3.1"; 2029 } 2030 } 2032 grouping subscription-policy-modifiable { 2033 description 2034 "This grouping describes all objects which may be changed 2035 in a subscription."; 2036 choice target { 2037 mandatory true; 2038 description 2039 "Identifies the source of information against which a 2040 subscription is being applied, as well as specifics on the 2041 subset of information desired from that source."; 2042 case stream { 2043 choice stream-filter { 2044 description 2045 "An event stream filter can be applied to a subscription. 2046 That filter will come either referenced from a global list, 2047 or be provided within the subscription itself."; 2048 case by-reference { 2049 description 2050 "Apply a filter that has been configured separately."; 2051 leaf stream-filter-ref { 2052 type stream-filter-ref; 2053 mandatory true; 2054 description 2055 "References an existing stream filter which is to 2056 be applied to an event stream for the subscription."; 2057 } 2058 } 2059 case within-subscription { 2060 description 2061 "Local definition allows a filter to have the same 2062 lifecycle as the subscription."; 2063 uses stream-filter-elements; 2064 } 2065 } 2066 } 2067 } 2068 leaf stop-time { 2069 type yang:date-and-time; 2070 description 2071 "Identifies a time after which notification messages for a 2072 subscription should not be sent. If 'stop-time' is not present, 2073 the notification messages will continue until the subscription 2074 is terminated. If 'replay-start-time' exists, 'stop-time' must 2075 be for a subsequent time. If 'replay-start-time' doesn't exist, 2076 'stop-time' when established must be for a future time."; 2077 } 2078 } 2080 grouping subscription-policy-dynamic { 2081 description 2082 "This grouping describes the only information concerning a 2083 subscription which can be passed over the RPCs defined in this 2084 model."; 2085 uses subscription-policy-modifiable { 2086 augment target/stream { 2087 description 2088 "Adds additional objects which can be modified by RPC."; 2089 leaf stream { 2090 type stream-ref { 2091 require-instance false; 2092 } 2093 mandatory true; 2094 description 2095 "Indicates the event stream to be considered for 2096 this subscription."; 2097 } 2098 leaf replay-start-time { 2099 if-feature "replay"; 2100 type yang:date-and-time; 2101 description 2102 "Used to trigger the replay feature and indicate that the 2103 replay should start at the time specified. If 2104 'replay-start-time' is not present, this is not a replay 2105 subscription and event record push should start immediately. 2106 It is never valid to specify start times that are later than 2107 or equal to the current time."; 2108 } 2109 } 2110 } 2111 uses update-qos; 2112 } 2114 grouping subscription-policy { 2115 description 2116 "This grouping describes the full set of policy information 2117 concerning both dynamic and configured subscriptions, with the 2118 exclusion of both receivers and networking information specific to 2119 the publisher such as what interface should be used to transmit 2120 notification messages."; 2121 uses subscription-policy-dynamic; 2122 leaf transport { 2123 if-feature "configured"; 2124 type transport; 2125 mandatory true; 2126 description 2127 "This leaf specifies the transport used to deliver 2128 messages destined to all receivers of a subscription."; 2129 } 2130 leaf encoding { 2131 when 'not(../transport) or derived-from(../transport, 2132 "sn:configurable-encoding")'; 2133 type encoding; 2134 description 2135 "The type of encoding for notification messages. For a 2136 dynamic subscription, if not included as part of an establish- 2137 subscription RPC, the encoding will be populated with the 2138 encoding used by that RPC. For a configured subscription, if 2139 not explicitly configured the encoding with be the default 2140 encoding for an underlying transport."; 2141 } 2142 leaf purpose { 2143 if-feature "configured"; 2144 type string; 2145 description 2146 "Open text allowing a configuring entity to embed the 2147 originator or other specifics of this subscription."; 2148 } 2149 } 2151 /* 2152 * RPCs 2153 */ 2155 rpc establish-subscription { 2156 description 2157 "This RPC allows a subscriber to create (and possibly negotiate) 2158 a subscription on its own behalf. If successful, the 2159 subscription remains in effect for the duration of the 2160 subscriber's association with the publisher, or until the 2161 subscription is terminated. In case an error occurs, or the 2162 publisher cannot meet the terms of a subscription, an RPC error 2163 is returned, the subscription is not created. In that case, the 2164 RPC reply's 'error-info' MAY include suggested parameter settings 2165 that would have a higher likelihood of succeeding in a subsequent 2166 'establish-subscription' request."; 2167 input { 2168 uses subscription-policy-dynamic; 2169 leaf encoding { 2170 type encoding; 2171 description 2172 "The type of encoding for the subscribed data. If not 2173 included as part of the RPC, the encoding MUST be set by the 2174 publisher to be the encoding used by this RPC."; 2175 } 2176 } 2177 output { 2178 leaf identifier { 2179 type subscription-id; 2180 mandatory true; 2181 description 2182 "Identifier used for this subscription."; 2183 } 2184 leaf replay-start-time-revision { 2185 if-feature "replay"; 2186 type yang:date-and-time; 2187 description 2188 "If a replay has been requested, this represents the 2189 earliest time covered by the event buffer for the requested 2190 stream. The value of this object is the 2191 'replay-log-aged-time' if it exists. Otherwise it is the 2192 'replay-log-creation-time'. All buffered event records 2193 after this time will be replayed to a receiver. This 2194 object will only be sent if the starting time has been 2195 revised to be later than the time requested by the 2196 subscriber."; 2197 } 2198 } 2199 } 2201 rc:yang-data establish-subscription-stream-error-info { 2202 container establish-subscription-stream-error-info { 2203 description 2204 "If any 'establish-subscription' RPC parameters are 2205 unsupportable against the event stream, a subscription is not 2206 created and the RPC error response MUST indicate the reason 2207 why the subscription failed to be created. This yang-data MAY be 2208 inserted as structured data within a subscription's RPC error 2209 response to indicate the failure reason. This yang-data MUST be 2210 inserted if hints are to be provided back to the subscriber."; 2211 leaf reason { 2212 type identityref { 2213 base establish-subscription-error; 2214 } 2215 description 2216 "Indicates the reason why the subscription has failed to 2217 be created to a targeted stream."; 2218 } 2219 leaf filter-failure-hint { 2220 type string; 2221 description 2222 "Information describing where and/or why a provided filter 2223 was unsupportable for a subscription."; 2224 } 2225 } 2226 } 2228 rpc modify-subscription { 2229 description 2230 "This RPC allows a subscriber to modify a dynamic subscription's 2231 parameters. If successful, the changed subscription 2232 parameters remain in effect for the duration of the subscription, 2233 until the subscription is again modified, or until the 2234 subscription is terminated. In case of an error or an inability 2235 to meet the modified parameters, the subscription is not modified 2236 and the original subscription parameters remain in effect. 2237 In that case, the RPC error MAY include 'error-info' suggested 2238 parameter hints that would have a high likelihood of succeeding 2239 in a subsequent 'modify-subscription' request. A successful 2240 'modify-subscription' will return a suspended subscription to an 2241 'active' state."; 2242 input { 2243 leaf identifier { 2244 type subscription-id; 2245 mandatory true; 2246 description 2247 "Identifier to use for this subscription."; 2248 } 2249 uses subscription-policy-modifiable; 2250 } 2251 } 2253 rc:yang-data modify-subscription-stream-error-info { 2254 container modify-subscription-stream-error-info { 2255 description 2256 "This yang-data MAY be provided as part of a subscription's RPC 2257 error response when there is a failure of a 2258 'modify-subscription' RPC which has been made against a 2259 stream. This yang-data MUST be used if hints are to be 2260 provided back to the subscriber."; 2261 leaf reason { 2262 type identityref { 2263 base modify-subscription-error; 2264 } 2265 description 2266 "Information in a 'modify-subscription' RPC error response 2267 which indicates the reason why the subscription to an event 2268 stream has failed to be modified."; 2269 } 2270 leaf filter-failure-hint { 2271 type string; 2272 description 2273 "Information describing where and/or why a provided filter 2274 was unsupportable for a subscription."; 2275 } 2276 } 2277 } 2279 rpc delete-subscription { 2280 description 2281 "This RPC allows a subscriber to delete a subscription that 2282 was previously created from by that same subscriber using the 2283 'establish-subscription' RPC. 2285 If an error occurs, the server replies with an 'rpc-error' where 2286 the 'error-info' field MAY contain an 2287 'delete-subscription-error-info' structure."; 2288 input { 2289 leaf identifier { 2290 type subscription-id; 2291 mandatory true; 2292 description 2293 "Identifier of the subscription that is to be deleted. 2294 Only subscriptions that were created using 2295 'establish-subscription' from the same origin as this RPC 2296 can be deleted via this RPC."; 2297 } 2298 } 2299 } 2301 rpc kill-subscription { 2302 description 2303 "This RPC allows an operator to delete a dynamic subscription 2304 without restrictions on the originating subscriber or underlying 2305 transport session. 2307 If an error occurs, the server replies with an 'rpc-error' where 2308 the 'error-info' field MAY contain an 2309 'delete-subscription-error-info' structure."; 2310 input { 2311 leaf identifier { 2312 type subscription-id; 2313 mandatory true; 2314 description 2315 "Identifier of the subscription that is to be deleted. Only 2316 subscriptions that were created using 2317 'establish-subscription' can be deleted via this RPC."; 2318 } 2319 } 2320 } 2322 rc:yang-data delete-subscription-error-info { 2323 container delete-subscription-error-info { 2324 description 2325 "If a 'delete-subscription' RPC or a 'kill-subscription' RPC 2326 fails, the subscription is not deleted and the RPC error 2327 response MUST indicate the reason for this failure. This 2328 yang-data MAY be inserted as structured data within a 2329 subscription's RPC error response to indicate the failure 2330 reason."; 2332 leaf reason { 2333 type identityref { 2334 base delete-subscription-error; 2335 } 2336 mandatory true; 2337 description 2338 "Indicates the reason why the subscription has failed to be 2339 deleted."; 2340 } 2341 } 2342 } 2344 /* 2345 * NOTIFICATIONS 2346 */ 2348 notification replay-completed { 2349 sn:subscription-state-notification; 2350 if-feature "replay"; 2351 description 2352 "This notification is sent to indicate that all of the replay 2353 notifications have been sent. It must not be sent for any other 2354 reason."; 2355 leaf identifier { 2356 type subscription-id; 2357 mandatory true; 2358 description 2359 "This references the affected subscription."; 2360 } 2361 } 2363 notification subscription-completed { 2364 sn:subscription-state-notification; 2365 if-feature "configured"; 2366 description 2367 "This notification is sent to indicate that a subscription has 2368 finished passing event records, as the 'stop-time' has been 2369 reached."; 2370 leaf identifier { 2371 type subscription-id; 2372 mandatory true; 2373 description 2374 "This references the gracefully completed subscription."; 2375 } 2376 } 2378 notification subscription-modified { 2379 sn:subscription-state-notification; 2380 description 2381 "This notification indicates that a subscription has been 2382 modified. Notification messages sent from this point on will 2383 conform to the modified terms of the subscription. For 2384 completeness, this state change notification includes both 2385 modified and non-modified aspects of a subscription."; 2386 leaf identifier { 2387 type subscription-id; 2388 mandatory true; 2389 description 2390 "This references the affected subscription."; 2391 } 2392 uses subscription-policy { 2393 refine "target/stream/stream-filter/within-subscription" { 2394 description 2395 "Filter applied to the subscription. If the 2396 'stream-filter-ref' is populated, the filter within the 2397 subscription came from the 'filters' container. Otherwise it 2398 is populated in-line as part of the subscription."; 2399 } 2400 } 2401 } 2403 notification subscription-resumed { 2404 sn:subscription-state-notification; 2405 description 2406 "This notification indicates that a subscription that had 2407 previously been suspended has resumed. Notifications will once 2408 again be sent. In addition, a 'subscription-resumed' indicates 2409 that no modification of parameters has occurred since the last 2410 time event records have been sent."; 2411 leaf identifier { 2412 type subscription-id; 2413 mandatory true; 2414 description 2415 "This references the affected subscription."; 2416 } 2417 } 2419 notification subscription-started { 2420 sn:subscription-state-notification; 2421 if-feature "configured"; 2422 description 2423 "This notification indicates that a subscription has started and 2424 notifications are beginning to be sent. This notification shall 2425 only be sent to receivers of a subscription; it does not 2426 constitute a general-purpose notification."; 2427 leaf identifier { 2428 type subscription-id; 2429 mandatory true; 2430 description 2431 "This references the affected subscription."; 2432 } 2433 uses subscription-policy { 2434 refine "target/stream/replay-start-time" { 2435 description 2436 "Indicates the time that a replay using for the streaming of 2437 buffered event records. This will be populated with the most 2438 recent of the following: 'replay-log-creation-time', 2439 'replay-log-aged-time', 'replay-start-time', or the most 2440 recent publisher boot time."; 2441 } 2442 refine "target/stream/stream-filter/within-subscription" { 2443 description 2444 "Filter applied to the subscription. If the 2445 'stream-filter-ref' is populated, the filter within the 2446 subscription came from the 'filters' container. Otherwise it 2447 is populated in-line as part of the subscription."; 2448 } 2449 augment "target/stream" { 2450 description 2451 "This augmentation adds additional parameters specific to a 2452 subscription-started notification."; 2453 leaf replay-previous-event-time { 2454 when "../replay-start-time"; 2455 if-feature "replay"; 2456 type yang:date-and-time; 2457 description 2458 "If there is at least one event in the replay buffer prior 2459 to 'replay-start-time', this gives the time of the event 2460 generated immediately prior to the 'replay-start-time'. 2462 If a receiver previously received event records for this 2463 configured subscription, it can compare this time to the 2464 last event record previously received. If the two are not 2465 the same (perhaps due to a reboot), then a dynamic replay 2466 can be initiated to acquire any missing event records."; 2467 } 2468 } 2469 } 2470 } 2472 notification subscription-suspended { 2473 sn:subscription-state-notification; 2474 description 2475 "This notification indicates that a suspension of the 2476 subscription by the publisher has occurred. No further 2477 notifications will be sent until the subscription resumes. 2478 This notification shall only be sent to receivers of a 2479 subscription; it does not constitute a general-purpose 2480 notification."; 2481 leaf identifier { 2482 type subscription-id; 2483 mandatory true; 2484 description 2485 "This references the affected subscription."; 2486 } 2487 leaf reason { 2488 type identityref { 2489 base subscription-suspended-reason; 2490 } 2491 mandatory true; 2492 description 2493 "Identifies the condition which resulted in the suspension."; 2494 } 2495 } 2497 notification subscription-terminated { 2498 sn:subscription-state-notification; 2499 description 2500 "This notification indicates that a subscription has been 2501 terminated."; 2502 leaf identifier { 2503 type subscription-id; 2504 mandatory true; 2505 description 2506 "This references the affected subscription."; 2507 } 2508 leaf reason { 2509 type identityref { 2510 base subscription-terminated-reason; 2511 } 2512 mandatory true; 2513 description 2514 "Identifies the condition which resulted in the termination ."; 2515 } 2516 } 2518 /* 2519 * DATA NODES 2520 */ 2522 container streams { 2523 config false; 2524 description 2525 "This container contains information on the built-in streams 2526 provided by the publisher."; 2527 list stream { 2528 key "name"; 2529 description 2530 "Identifies the built-in event streams that are supported by the 2531 publisher."; 2532 leaf name { 2533 type string; 2534 description 2535 "A handle for a system-provided event stream made up of a 2536 sequential set of event records, each of which is 2537 characterized by its own domain and semantics."; 2538 } 2539 leaf description { 2540 type string; 2541 mandatory true; 2542 description 2543 "A description of the event stream, including such information 2544 as the type of event records that are available within this 2545 event stream."; 2546 } 2547 leaf replay-support { 2548 if-feature "replay"; 2549 type empty; 2550 description 2551 "Indicates that event record replay is available on this 2552 stream."; 2553 } 2554 leaf replay-log-creation-time { 2555 when "../replay-support"; 2556 if-feature "replay"; 2557 type yang:date-and-time; 2558 mandatory true; 2559 description 2560 "The timestamp of the creation of the log used to support the 2561 replay function on this stream. This time might be earlier 2562 than the earliest available information contained in the log. 2563 This object is updated if the log resets for some reason."; 2564 } 2565 leaf replay-log-aged-time { 2566 if-feature "replay"; 2567 type yang:date-and-time; 2568 description 2569 "The timestamp associated with last event record which has 2570 been aged out of the log. This timestamp identifies how far 2571 back into history this replay log extends, if it doesn't 2572 extend back to the 'replay-log-creation-time'. This object 2573 MUST be present if replay is supported and any event records 2574 have been aged out of the log."; 2575 } 2576 } 2577 } 2579 container filters { 2580 description 2581 "This container contains a list of configurable filters 2582 that can be applied to subscriptions. This facilitates 2583 the reuse of complex filters once defined."; 2584 list stream-filter { 2585 key "identifier"; 2586 description 2587 "A list of pre-configured filters that can be applied to 2588 subscriptions."; 2589 leaf identifier { 2590 type filter-id; 2591 description 2592 "An identifier to differentiate between filters."; 2593 } 2594 uses stream-filter-elements; 2595 } 2596 } 2598 container subscriptions { 2599 description 2600 "Contains the list of currently active subscriptions, i.e. 2601 subscriptions that are currently in effect, used for subscription 2602 management and monitoring purposes. This includes subscriptions 2603 that have been setup via RPC primitives as well as subscriptions 2604 that have been established via configuration."; 2605 list subscription { 2606 key "identifier"; 2607 description 2608 "The identity and specific parameters of a subscription. 2609 Subscriptions within this list can be created using a control 2610 channel or RPC, or be established through configuration. 2612 If configuration operations or the 'kill-subscription' RPC are 2613 used to delete a subscription, a 'subscription-terminated' 2614 message is sent to any active or suspended receivers."; 2615 leaf identifier { 2616 type subscription-id; 2617 description 2618 "Identifier of a subscription; unique within a publisher"; 2620 } 2621 uses subscription-policy { 2622 refine "target/stream/stream" { 2623 description 2624 "Indicates the event stream to be considered for this 2625 subscription. If an event stream has been removed, 2626 and no longer can be referenced by an active subscription, 2627 send a 'subscription-terminated' notification with 2628 'stream-unavailable' as the reason. If a configured 2629 subscription refers to a non-existent stream, move that 2630 subscription to the 'invalid' state."; 2631 } 2632 } 2633 choice notification-message-origin { 2634 if-feature "configured"; 2635 description 2636 "Identifies the egress interface on the publisher from which 2637 notification messages are to be sent."; 2638 case interface-originated { 2639 description 2640 "When notification messages to egress a specific, designated 2641 interface on the publisher."; 2642 leaf source-interface { 2643 if-feature "interface-designation"; 2644 type if:interface-ref; 2645 description 2646 "References the interface for notification messages."; 2647 } 2648 } 2649 case address-originated { 2650 description 2651 "When notification messages are to depart from a publisher 2652 using specific originating address and/or routing context 2653 information."; 2654 leaf source-vrf { 2655 if-feature "supports-vrf"; 2656 type leafref { 2657 path "/ni:network-instances/ni:network-instance/ni:name"; 2658 } 2659 description 2660 "VRF from which notification messages should egress a 2661 publisher."; 2662 } 2663 leaf source-address { 2664 type inet:ip-address-no-zone; 2665 description 2666 "The source address for the notification messages. If a 2667 source VRF exists, but this object doesn't, a publisher's 2668 default address for that VRF must be used."; 2669 } 2670 } 2671 } 2672 leaf configured-subscription-state { 2673 if-feature "configured"; 2674 type enumeration { 2675 enum valid { 2676 value 1; 2677 description 2678 "Connection is active and healthy."; 2679 } 2680 enum invalid { 2681 value 2; 2682 description 2683 "The subscription as a whole is unsupportable with its 2684 current parameters."; 2685 } 2686 enum concluded { 2687 value 3; 2688 description 2689 "A subscription is inactive as it has hit a stop time, 2690 but not yet been removed from configuration."; 2691 } 2692 } 2693 config false; 2694 description 2695 "The presence of this leaf indicates that the subscription 2696 originated from configuration, not through a control channel 2697 or RPC. The value indicates the system established state 2698 of the subscription."; 2699 } 2700 container receivers { 2701 description 2702 "Set of receivers in a subscription."; 2703 list receiver { 2704 key "name"; 2705 min-elements 1; 2706 description 2707 "A host intended as a recipient for the notification 2708 messages of a subscription. For configured subscriptions 2709 the 'address' may identify a receiver. Additional ways of 2710 specifying receivers of a configured subscriptions may be 2711 added through an augmentation to the objects within this 2712 list."; 2713 leaf name { 2714 type string; 2715 description 2716 "Identifies a unique receiver for a subscription."; 2717 } 2718 leaf address { 2719 when 2720 'derived-from(../../../transport, "sn:inline-address")'; 2721 type inet:host; 2722 description 2723 "Specifies the address for the traffic to reach a remote 2724 host using the subscription's transport. One of the 2725 following must be specified: an ipv4 address, an ipv6 2726 address, or a host name."; 2727 } 2728 leaf count-sent { 2729 type yang:zero-based-counter64; 2730 config false; 2731 description 2732 "The number of event records sent to the receiver. The 2733 count is initialized when a dynamic subscription is 2734 established, or when a configured subscription 2735 transitions to the valid state."; 2736 } 2737 leaf count-excluded { 2738 type yang:zero-based-counter64; 2739 config false; 2740 description 2741 "The number of event records explicitly removed either 2742 via an event stream filter or an access control filter so 2743 that they are not passed to a receiver. This count is 2744 set to zero each time 'count-sent' is initialized."; 2745 } 2746 leaf state { 2747 type enumeration { 2748 enum active { 2749 value 1; 2750 description 2751 "Receiver is currently being sent any applicable 2752 notification messages for the subscription."; 2753 } 2754 enum suspended { 2755 value 2; 2756 description 2757 "Receiver state is 'suspended', so the publisher 2758 is currently unable to provide notification messages 2759 for the subscription."; 2760 } 2761 enum connecting { 2762 value 3; 2763 if-feature "configured"; 2764 description 2765 "A subscription has been configured, but a 2766 'subscription-started' state change notification needs 2767 to be successfully received before notification 2768 messages are sent. 2770 If the 'reset' action is invoked for a receiver of an 2771 active configured subscription, the state must be 2772 moved to 'connecting'."; 2773 } 2774 enum timeout { 2775 value 4; 2776 if-feature "configured"; 2777 description 2778 "A subscription has failed in sending a subscription 2779 started state change to the receiver. 2780 Additional attempts at connection attempts are not 2781 currently being made."; 2782 } 2783 } 2784 config false; 2785 mandatory true; 2786 description 2787 "Specifies the state of a subscription from the 2788 perspective of a particular receiver. With this info it 2789 is possible to determine whether a subscriber is currently 2790 generating notification messages intended for that 2791 receiver."; 2792 } 2793 action reset { 2794 if-feature "configured"; 2795 description 2796 "Allows the reset of this configured subscription receiver 2797 to the 'connecting' state. This enables the 2798 connection process to be re-initiated."; 2799 output { 2800 leaf time { 2801 type yang:date-and-time; 2802 mandatory true; 2803 description 2804 "Time a publisher returned the receiver to a 2805 'connecting' state."; 2806 } 2807 } 2808 } 2809 } 2810 } 2811 } 2813 } 2814 } 2815 2817 5. Considerations 2819 5.1. IANA Considerations 2821 This document registers the following namespace URI in the "IETF XML 2822 Registry" [RFC3688]: 2824 URI: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications 2825 Registrant Contact: The IESG. 2826 XML: N/A; the requested URI is an XML namespace. 2828 This document registers the following YANG module in the "YANG Module 2829 Names" registry [RFC6020]: 2831 Name: ietf-subscribed-notifications 2832 Namespace: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications 2833 Prefix: sn 2834 Reference: draft-ietf-netconf-ietf-subscribed-notifications-11.txt 2835 (RFC form) 2837 5.2. Implementation Considerations 2839 To support deployments including both configured and dynamic 2840 subscriptions, it is recommended to split subscription identifiers 2841 into static and dynamic halves. That way it eliminates the 2842 possibility of collisions if the configured subscriptions attempt to 2843 set a subscription-id which might have already been dynamically 2844 allocated. A best practice is to use lower half the "identifier" 2845 object's integer space when that "identifier" is assigned by an 2846 external entity (such as with a configured subscription). This 2847 leaves the upper half of subscription identifiers available to be 2848 dynamically assigned by the publisher. 2850 If a subscription is unable to marshal a series of filtered event 2851 records into transmittable notification messages, the receiver should 2852 be suspended with the reason "unsupportable-volume". 2854 For configured subscriptions, operations are against the set of 2855 receivers using the subscription identifier as a handle for that set. 2856 But for streaming updates, state change notifications are local to a 2857 receiver. In this specification it is the case that receivers get no 2858 information from the publisher about the existence of other 2859 receivers. But if a network operator wants to let the receivers 2860 correlate results, it is useful to use the subscription identifier 2861 across the receivers to allow that correlation. 2863 For configured replay subscriptions, the receiver is protected from 2864 duplicated events being pushed after a publisher is rebooted. 2865 However it is possible that a receiver might want to acquire event 2866 records which failed to be delivered just prior to the reboot. 2867 Delivering these event records be accomplished by leveraging the 2868 "eventTime" from the last event record received prior to the receipt 2869 of a "subscription-started" state change notification. With this 2870 "eventTime" and the "replay-start-time" from the "subscription- 2871 started" notification, an independent dynamic subscription can be 2872 established which retrieves any event records which may have been 2873 generated but not sent to the receiver. 2875 5.3. Transport Requirements 2877 This section provides requirements for any subscribed notification 2878 transport supporting the solution presented in this document. 2880 For both configured and dynamic subscriptions the publisher MUST 2881 authenticate a receiver via some transport level mechanism before 2882 sending any event records for which they are authorized to see. In 2883 addition, the receiver MUST authenticate the publisher at the 2884 transport level. The result is mutual authentication between the 2885 two. 2887 A secure transport is highly recommended and the publisher MUST 2888 ensure that the receiver has sufficient authorization to perform the 2889 function they are requesting against the specific subset of content 2890 involved. 2892 A specific transport specification built upon this document may or 2893 may not choose to require the use of the same logical channel for the 2894 RPCs and the event records. However the event records and the 2895 subscription state notifications MUST be sent on the same transport 2896 session to ensure the properly ordered delivery. 2898 Additional transport requirements will be dictated by the choice of 2899 transport used with a subscription. For an example of such 2900 requirements with NETCONF transport, see 2901 [I-D.draft-ietf-netconf-netconf-event-notifications]. 2903 5.4. Security Considerations 2905 The YANG module specified in this document defines a schema for data 2906 that is designed to be accessed via network management transports 2907 such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF 2908 layer is the secure transport layer, and the mandatory-to-implement 2909 secure transport is Secure Shell (SSH) [RFC6242]. The lowest 2910 RESTCONF layer is HTTPS, and the mandatory-to-implement secure 2911 transport is TLS [RFC5246]. 2913 The NETCONF Access Control Model (NACM) [RFC8341] provides the means 2914 to restrict access for particular NETCONF or RESTCONF users to a 2915 preconfigured subset of all available NETCONF or RESTCONF operations 2916 and content. 2918 One subscription identifier can be used for two or more receivers of 2919 the same configured subscription. But due to the possibility of 2920 different access control permissions per receiver, it cannot be 2921 assumed that each receiver is getting identical updates. 2923 With configured subscriptions, one or more publishers could be used 2924 to overwhelm a receiver. Notification messages SHOULD NOT be sent to 2925 any receiver which does not support this specification. Receivers 2926 that do not want notification messages need only terminate or refuse 2927 any transport sessions from the publisher. 2929 When a receiver of a configured subscription gets a new 2930 "subscription-started" message for a known subscription where it is 2931 already consuming events, the receiver SHOULD retrieve any event 2932 records generated since the last event record was received. This can 2933 be accomplish by establishing a separate dynamic replay subscription 2934 with the same filtering criteria with the publisher", assuming the 2935 publisher supports the "replay" feature. 2937 There are a number of data nodes defined in this YANG module that are 2938 writable/creatable/deletable (i.e., config true, which is the 2939 default). These data nodes may be considered sensitive or vulnerable 2940 in some network environments. Write operations (e.g., edit-config) 2941 to these data nodes without proper protection can have a negative 2942 effect on network operations. These are the subtrees and data nodes 2943 where there is a specific sensitivity/vulnerability: 2945 Container: "/filters" 2947 o "stream-subtree-filter": updating a filter could increase the 2948 computational complexity of all referencing subscriptions. 2950 o "stream-xpath-filter": updating a filter could increase the 2951 computational complexity of all referencing subscriptions. 2953 Container: "/subscriptions" 2954 The following considerations are only relevant for configuration 2955 operations made upon configured subscriptions: 2957 o "address": can be used to attempt to send traffic to an unwilling 2958 receiver. 2960 o "dependency": can be used to force important traffic to be queued 2961 behind less important updates. 2963 o "dscp": if unvalidated, can result in the sending of traffic with 2964 a higher priority marking than warranted. 2966 o "identifier": can overwrite an existing subscription, perhaps one 2967 configured by another entity. 2969 o "replay-start-time": can be used to push very large logs, wasting 2970 resources. 2972 o "source-address": the configured address might not be able to 2973 reach a desired receiver. 2975 o "source-interface": the configured interface might not be able to 2976 reach a desired receiver. 2978 o "source-vrf": can place a subscription into a virtual network 2979 where receivers are not entitled to view the subscribed content. 2981 o "stop-time": could be used to terminate content at an inopportune 2982 time. 2984 o "stream": could set a subscription to an event stream containing 2985 no content permitted for the targeted receivers. 2987 o "stream-filter-ref": could be set to a filter which is irrelevant 2988 to the event stream. 2990 o "stream-subtree-filter": a complex filter can increase the 2991 computational resources for this subscription. 2993 o "stream-xpath-filter": a complex filter can increase the 2994 computational resources for this subscription. 2996 o "weighting": placing a large weight can overwhelm the dequeuing of 2997 other subscriptions. 2999 Some of the readable data nodes in this YANG module may be considered 3000 sensitive or vulnerable in some network environments. It is thus 3001 important to control read access (e.g., via get, get-config, or 3002 notification) to these data nodes. These are the subtrees and data 3003 nodes and their sensitivity/vulnerability: 3005 Container: "/streams" 3007 o "name": if access control is not properly configured, can expose 3008 system internals to those who should have no access to this 3009 information. 3011 o "replay-support": if access control is not properly configured, 3012 can expose logs to those who should have no access. 3014 Container: "/subscriptions" 3016 o "count-excluded": leaf can provide information about filtered 3017 event records. A network operator should have permissions to know 3018 about such filtering. 3020 o "subscription": different operational teams might have a desire to 3021 set varying subsets of subscriptions. Access control should be 3022 designed to permit read access to just the allowed set. 3024 Some of the RPC operations in this YANG module may be considered 3025 sensitive or vulnerable in some network environments. It is thus 3026 important to control access to these operations. These are the 3027 operations and their sensitivity/vulnerability: 3029 RPC: all 3031 o If a malicious or buggy subscriber sends an unexpectedly large 3032 number of RPCs, the result might be an excessive use of system 3033 resources on the publisher just to determine that these 3034 subscriptions should be declined. In such a situation, 3035 subscription interactions MAY be terminated by terminating the 3036 transport session. 3038 RPC: "delete-subscription" 3040 o No special considerations. 3042 RPC: "establish-subscription" 3044 o Subscriptions could overload a publisher's resources. For this 3045 reason, publishers MUST ensure that they have sufficient resources 3046 to fulfill this request or otherwise reject the request. 3048 RPC: "kill-subscription" 3049 o The "kill-subscription" RPC MUST be secured so that only 3050 connections with administrative rights are able to invoke this 3051 RPC. 3053 RPC: "modify-subscription" 3055 o Subscriptions could overload a publisher's resources. For this 3056 reason, publishers MUST ensure that they have sufficient resources 3057 to fulfill this request or otherwise reject the request. 3059 6. Acknowledgments 3061 For their valuable comments, discussions, and feedback, we wish to 3062 acknowledge Andy Bierman, Tim Jenkins, Martin Bjorklund, Kent Watsen, 3063 Balazs Lengyel, Robert Wilton, Sharon Chisholm, Hector Trevino, Susan 3064 Hares, Michael Scharf, and Guangying Zheng. 3066 7. References 3068 7.1. Normative References 3070 [I-D.draft-ietf-rtgwg-ni-model] 3071 Berger, L., Hopps, C., and A. Lindem, "YANG Network 3072 Instances", draft-ietf-rtgwg-ni-model-11 (work in 3073 progress), March 2018. 3075 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3076 Requirement Levels", BCP 14, RFC 2119, 3077 DOI 10.17487/RFC2119, March 1997, 3078 . 3080 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, 3081 "Definition of the Differentiated Services Field (DS 3082 Field) in the IPv4 and IPv6 Headers", RFC 2474, 3083 DOI 10.17487/RFC2474, December 1998, 3084 . 3086 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3087 DOI 10.17487/RFC3688, January 2004, 3088 . 3090 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3091 (TLS) Protocol Version 1.2", RFC 5246, 3092 DOI 10.17487/RFC5246, August 2008, 3093 . 3095 [RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event 3096 Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, 3097 . 3099 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 3100 the Network Configuration Protocol (NETCONF)", RFC 6020, 3101 DOI 10.17487/RFC6020, October 2010, 3102 . 3104 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 3105 and A. Bierman, Ed., "Network Configuration Protocol 3106 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 3107 . 3109 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 3110 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 3111 . 3113 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3114 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3115 . 3117 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 3118 RFC 7950, DOI 10.17487/RFC7950, August 2016, 3119 . 3121 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 3122 RFC 7951, DOI 10.17487/RFC7951, August 2016, 3123 . 3125 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 3126 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 3127 . 3129 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3130 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3131 May 2017, . 3133 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 3134 Access Control Model", STD 91, RFC 8341, 3135 DOI 10.17487/RFC8341, March 2018, 3136 . 3138 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 3139 and R. Wilton, "Network Management Datastore Architecture 3140 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 3141 . 3143 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 3144 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 3145 . 3147 [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) 3148 Version 1.0", November 1999, 3149 . 3151 7.2. Informative References 3153 [I-D.draft-ietf-netconf-netconf-event-notifications] 3154 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 3155 Nilsen-Nygaard, E., and A. Tripathy, "NETCONF support for 3156 event notifications", May 2018, 3157 . 3160 [I-D.draft-ietf-netconf-restconf-notif] 3161 Voit, Eric., Clemm, Alexander., Tripathy, A., Nilsen- 3162 Nygaard, E., and Alberto. Gonzalez Prieto, "Restconf and 3163 HTTP transport for event notifications", May 2018, 3164 . 3167 [I-D.ietf-netconf-yang-push] 3168 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 3169 Tripathy, A., Nilsen-Nygaard, E., Bierman, A., and B. 3170 Lengyel, "YANG Datastore Subscription", May 2018, 3171 . 3174 [I-D.ietf-netmod-yang-tree-diagrams] 3175 Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft- 3176 ietf-netmod-yang-tree-diagrams-06 (work in progress), 3177 February 2018. 3179 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 3180 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 3181 DOI 10.17487/RFC7540, May 2015, 3182 . 3184 [RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements 3185 for Subscription to YANG Datastores", RFC 7923, 3186 DOI 10.17487/RFC7923, June 2016, 3187 . 3189 [RFC8071] Watsen, K., "NETCONF Call Home and RESTCONF Call Home", 3190 RFC 8071, DOI 10.17487/RFC8071, February 2017, 3191 . 3193 Appendix A. Changes between revisions 3195 (To be removed by RFC editor prior to publication) 3197 v12 - v13 3199 o Tweaks from Kent's comments 3201 o Referenced in YANG model updated per Tom Petch's comments 3203 o Added leaf replay-previous-event-time 3205 o Renamed the event counters, downshifted the subscription states 3207 v11 - v12 3209 o Tweaks from Kent's, Tim's, and Martin's comments 3211 o Clarified dscp text, and made its own feature 3213 o YANG model tweaks alphabetizing, features. 3215 v10 - v11 3217 o access control filtering of events in streams included to match 3218 RFC5277 behavior 3220 o security considerations updated based on YANG template. 3222 o dependency QoS made non-normative on HTTP2 QoS 3224 o tree diagrams referenced for each figure using them 3226 o reference numbers placed into state machine figures 3228 o broke configured replay into its own section 3230 o many tweaks updates based on LC and YANG doctor reviews 3232 o trees and YANG model reconciled were deltas existed 3234 o new feature for interface originated. 3236 o dscp removed from the qos feature 3237 o YANG model updated in a way which collapses groups only used once 3238 so that they are part of the 'subscriptions' container. 3240 o alternative encodings only allowed for transports which support 3241 them. 3243 v09 - v10 3245 o Typos and tweaks 3247 v08 - v09 3249 o NMDA model supported. Non NMDA version at https://github.com/ 3250 netconf-wg/rfc5277bis/ 3252 o Error mechanism revamped to match to embedded implementations. 3254 o Explicitly identified error codes relevant to each RPC/ 3255 Notification 3257 v07 - v08 3259 o Split YANG trees to separate document subsections. 3261 o Clarified configured state machine based on Balazs comments, and 3262 moved it into the configured subscription subsections. 3264 o Normative reference to Network Instance model for VRF 3266 o One transport for all receivers of configured subscriptions. 3268 o QoS section moved in from yang-push 3270 v06 - v07 3272 o Clarification on state machine for configured subscriptions. 3274 v05 - v06 3276 o Made changes proposed by Martin, Kent, and others on the list. 3277 Most significant of these are stream returned to string (with the 3278 SYSLOG identity removed), intro section on 5277 relationship, an 3279 identity set moved to an enumeration, clean up of definitions/ 3280 terminology, state machine proposed for configured subscriptions 3281 with a clean-up of subscription state options. 3283 o JSON and XML become features. Also Xpath and subtree filtering 3284 become features 3286 o Terminology updates with event records, and refinement of filters 3287 to just event stream filters. 3289 o Encoding refined in establish-subscription so it takes the RPC's 3290 encoding as the default. 3292 o Namespaces in examples fixed. 3294 v04 - v05 3296 o Returned to the explicit filter subtyping of v00 3298 o stream object changed to 'name' from 'stream' 3300 o Cleaned up examples 3302 o Clarified that JSON support needs notification-messages draft. 3304 v03 - v04 3306 o Moved back to the use of RFC5277 one-way notifications and 3307 encodings. 3309 v03 - v04 3311 o Replay updated 3313 v02 - v03 3315 o RPCs and Notification support is identified by the Notification 3316 2.0 capability. 3318 o Updates to filtering identities and text 3320 o New error type for unsupportable volume of updates 3322 o Text tweaks. 3324 v01 - v02 3326 o Subscription status moved under receiver. 3328 v00 - v01 3330 o Security considerations updated 3332 o Intro rewrite, as well as scattered text changes 3333 o Added Appendix A, to help match this to related drafts in progress 3335 o Updated filtering definitions, and filter types in yang file, and 3336 moved to identities for filter types 3338 o Added Syslog as an event stream 3340 o HTTP2 moved in from YANG-Push as a transport option 3342 o Replay made an optional feature for events. Won't apply to 3343 datastores 3345 o Enabled notification timestamp to have different formats. 3347 o Two error codes added. 3349 v01 5277bis - v00 subscribed notifications 3351 o Kill subscription RPC added. 3353 o Renamed from 5277bis to Subscribed Notifications. 3355 o Changed the notification capabilities version from 1.1 to 2.0. 3357 o Extracted create-subscription and other elements of RFC5277. 3359 o Error conditions added, and made specific in return codes. 3361 o Simplified yang model structure for removal of 'basic' grouping. 3363 o Added a grouping for items which cannot be statically configured. 3365 o Operational counters per receiver. 3367 o Subscription-id and filter-id renamed to identifier 3369 o Section for replay added. Replay now cannot be configured. 3371 o Control plane notification renamed to subscription state 3372 notification 3374 o Source address: Source-vrf changed to string, default address 3375 option added 3377 o In yang model: 'info' changed to 'policy' 3379 o Scattered text clarifications 3380 v00 - v01 of 5277bis 3382 o YANG Model changes. New groupings for subscription info to allow 3383 restriction of what is changeable via RPC. Removed notifications 3384 for adding and removing receivers of configured subscriptions. 3386 o Expanded/renamed definitions from event server to publisher, and 3387 client to subscriber as applicable. Updated the definitions to 3388 include and expand on RFC 5277. 3390 o Removal of redundancy with other drafts 3392 o Many other clean-ups of wording and terminology 3394 Authors' Addresses 3396 Eric Voit 3397 Cisco Systems 3399 Email: evoit@cisco.com 3401 Alexander Clemm 3402 Huawei 3404 Email: ludwig@clemm.org 3406 Alberto Gonzalez Prieto 3407 VMWare 3409 Email: agonzalezpri@vmware.com 3411 Einar Nilsen-Nygaard 3412 Cisco Systems 3414 Email: einarnn@cisco.com 3416 Ambika Prasad Tripathy 3417 Cisco Systems 3419 Email: ambtripa@cisco.com