idnits 2.17.1 draft-ietf-netconf-subscribed-notifications-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 438 has weird spacing: '...ntifier sub...' -- The document date (April 19, 2017) is 2563 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) ** Obsolete normative reference: RFC 6536 (Obsoleted by RFC 8341) -- Possible downref: Non-RFC (?) normative reference: ref. 'XPATH' -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 2 errors (**), 0 flaws (~~), 3 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: October 21, 2017 Huawei 6 A. Gonzalez Prieto 7 E. Nilsen-Nygaard 8 A. Tripathy 9 Cisco Systems 10 April 19, 2017 12 Custom Subscription to Event Notifications 13 draft-ietf-netconf-subscribed-notifications-02 15 Abstract 17 This document defines capabilities and operations for the customized 18 establishment of subscriptions upon a publisher's event streams. 19 Also defined are delivery mechanisms for instances of the resulting 20 events. Effectively this allows a subscriber to request and receive 21 a continuous, custom influx of publisher generated information. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at http://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on October 21, 2017. 40 Copyright Notice 42 Copyright (c) 2017 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (http://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 58 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 60 1.3. Solution Overview . . . . . . . . . . . . . . . . . . . . 5 61 2. Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 6 62 2.1. Event Streams . . . . . . . . . . . . . . . . . . . . . . 6 63 2.2. Filters . . . . . . . . . . . . . . . . . . . . . . . . . 6 64 2.3. Subscription State Model at the Publisher . . . . . . . . 7 65 3. Data Model Trees . . . . . . . . . . . . . . . . . . . . . . 8 66 4. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . . . 12 67 4.1. Establishing a Subscription . . . . . . . . . . . . . . . 12 68 4.2. Modifying a Subscription . . . . . . . . . . . . . . . . 13 69 4.3. Deleting a Subscription . . . . . . . . . . . . . . . . . 13 70 4.4. Killing a Subscription . . . . . . . . . . . . . . . . . 13 71 5. Configured Subscriptions . . . . . . . . . . . . . . . . . . 14 72 5.1. Establishing a Configured Subscription . . . . . . . . . 14 73 5.2. Modifying a Configured Subscription . . . . . . . . . . . 16 74 5.3. Deleting a Configured Subscription . . . . . . . . . . . 16 75 6. Event (Data Plane) Notifications . . . . . . . . . . . . . . 17 76 7. Subscription State Notifications . . . . . . . . . . . . . . 18 77 7.1. subscription-started . . . . . . . . . . . . . . . . . . 19 78 7.2. subscription-modified . . . . . . . . . . . . . . . . . . 19 79 7.3. subscription-terminated . . . . . . . . . . . . . . . . . 19 80 7.4. subscription-suspended . . . . . . . . . . . . . . . . . 19 81 7.5. subscription-resumed . . . . . . . . . . . . . . . . . . 20 82 7.6. notification-complete . . . . . . . . . . . . . . . . . . 20 83 7.7. replay-complete . . . . . . . . . . . . . . . . . . . . . 20 84 8. Administrative Functions . . . . . . . . . . . . . . . . . . 20 85 8.1. Subscription Monitoring . . . . . . . . . . . . . . . . . 20 86 8.2. Capability Advertisement . . . . . . . . . . . . . . . . 21 87 8.3. Event Stream Discovery . . . . . . . . . . . . . . . . . 21 88 9. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 21 89 10. Considerations . . . . . . . . . . . . . . . . . . . . . . . 42 90 10.1. Implementation Considerations . . . . . . . . . . . . . 42 91 10.2. Security Considerations . . . . . . . . . . . . . . . . 43 92 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 44 93 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 94 12.1. Normative References . . . . . . . . . . . . . . . . . . 44 95 12.2. Informative References . . . . . . . . . . . . . . . . . 44 96 Appendix A. Relationships to other drafts . . . . . . . . . . . 46 97 A.1. ietf-netconf-netconf-event-notif . . . . . . . . . . . . 46 98 A.2. ietf-netconf-restconf-notif . . . . . . . . . . . . . . . 46 99 A.3. ietf-netconf-yang-push . . . . . . . . . . . . . . . . . 46 100 A.4. voit-notifications2 . . . . . . . . . . . . . . . . . . . 47 101 Appendix B. Issues that are currently being worked and resolved 47 102 Appendix C. Changes between revisions . . . . . . . . . . . . . 47 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 49 105 1. Introduction 107 This document defines capabilities and operations for the customized 108 establishment of subscriptions upon system generated event streams. 109 Also defined are asynchronous delivery mechanisms, where the 110 resulting event instances are placed within notification messages and 111 sent to targeted receivers. Effectively this enables a "Subscribe 112 then Publish" capability where the customized information needs of 113 each target receiver are understood by the publisher before events 114 are marshalled and pushed. The receiver then gets a continuous, 115 custom influx of publisher generated events. 117 While the functionality defined in this document is transport- 118 agnostic, subscription control plane operations bindings exist for 119 both NETCONF [RFC6241] and RESTCONF [RFC8040]. In addition, bindings 120 for the pushed event instances have been defined for protocols such 121 as NETCONF and HTTP2 [RFC7540]. For specifics on these bindings see 122 [I-D.ietf-netconf-netconf-event-notif]) and 123 [I-D.ietf-netconf-restconf-notif]. 125 The capabilities and operations defined in this document with 126 implemented in conjunction with 127 [I-D.ietf-netconf-netconf-event-notif] are intended to obsolete 128 [RFC5277]. 130 1.1. Motivation 132 There are various [RFC5277] limitations, many of which have been 133 exposed in [RFC7923] which needed to be solved. Key capabilities 134 supported by this document include: 136 o multiple subscriptions on a single transport session 138 o support for dynamic and statically configured subscriptions 140 o modification of an existing subscription 142 o operational counters and instrumentation 144 o negotiation of subscription parameters 145 o promise theory based interaction model 147 o state change notifications (e.g., publisher driven suspension, 148 parameter modification) 150 o independence from transport protocol 152 1.2. Terminology 154 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 155 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 156 document are to be interpreted as described in RFC 2119 [RFC2119]. 158 Configured subscription: A subscription installed via a configuration 159 interface which persists across reboots. 161 Dynamic subscription: A subscription agreed between subscriber and 162 publisher created via RPC subscription state signaling messages. 164 Event: An occurrence of something that may be of interest. (e.g., a 165 configuration change, a fault, a change in status, crossing a 166 threshold, or an external input to the system.) 168 Event notification: A set of information intended for a Receiver 169 indicating that one or more Event(s) have occurred. Details of the 170 Event(s) may be included within the Notification. 172 Filter: Evaluation criteria, which may be applied against a targeted 173 set of objects/events in a subscription. Information traverses the 174 filter only if specified filter criteria are met. 176 NACM: NETCONF Access Control Model. 178 Publisher: An entity responsible for streaming event notifications 179 per the terms of a Subscriptions 181 Receiver: A target to which a publisher pushes event notifications. 182 For dynamic subscriptions, the receiver and subscriber will often be 183 the same entity. 185 Stream (also referred to as "event stream"): A continuous ordered set 186 of events grouped under an explicit criteria. 188 Subscriber: An entity able to request and negotiate a contract for 189 the receipt of event notifications from a publisher. 191 Subscription: A contract with a publisher, stipulating which 192 information receiver(s) wishes to have pushed from the publisher 193 without the need for further solicitation. 195 1.3. Solution Overview 197 This document describes a transport protocol-agnostic mechanisms for 198 subscribing to and receiving event notifications from an event 199 publisher. Two types of subscriptions are supported: 201 1. Dynamic subscriptions, where a subscriber initiates a 202 subscription negotiation with a publisher via RPC. If the 203 publisher wants to serve this request, it will accept it, and 204 then start pushing event notifications. If the publisher does 205 not wish to serve it as requested, then an error response is 206 returned. This response may include hints at subscription 207 parameters which would have been accepted. 209 2. Configured subscriptions, which allows the managing subscriptions 210 via a configuration interface so that a publisher can send event 211 notifications to configured receiver(s). Support for this 212 capability is optional. 214 Additional characteristics differentiating configured from dynamic 215 subscriptions include: 217 o The lifetime of a dynamic subscription is limited by the lifetime 218 of the subscriber session used to establish it. Typically loss of 219 the transport session tears down any dependent dynamic 220 subscriptions. The lifetime of a configured subscription is 221 driven by relevent configuration being present on the running 222 configuration. This implies configured subscriptions persist 223 across reboots, and persists even when transport is unavailable. 225 o Configured subscriptions can be modified by any configuration 226 client with write rights on the configuration of the subscription. 227 Dynamic subscriptions can only be modified via an RPC request made 228 upon the original subscribing transport session. 230 Note that there is no mixing-and-matching of dynamic and configured 231 subscriptions. Specifically, a configured subscription cannot be 232 modified or deleted using RPC. Similarly, a subscription established 233 via RPC cannot be modified through configuration operations. 235 The publisher may decide to terminate a dynamic subscription at any 236 time. Similarly, it may decide to temporarily suspend the sending of 237 event notifications for either configured or dynamic subscriptions. 238 Such termination or suspension may be driven by the publisher running 239 out of resources to serve the subscription, or by internal errors on 240 the publisher. 242 2. Solution 244 2.1. Event Streams 246 An event stream is a named entity on a publisher which exposes a 247 continuously updating set of events. Each event stream is available 248 for subscription. It is out of the scope of this document to 249 identify a) how streams are defined, b) how events are defined/ 250 generated, and c) how events are assigned to streams. 252 There are two standardized event streams within this document: 253 NETCONF and SYSLOG. The NETCONF event stream contains all NETCONF 254 XML event information supported by the publisher, except for where it 255 has been explicitly indicated that this the event must be excluded 256 from the NETCONF stream. The SYSLOG event stream mirrors the 257 discrete set entries which are concurrently being placed into a 258 device's local Syslog. Beyond these two, additional streams can be 259 added via model augmentation. 261 As events are raised by a system, they may be assigned to one or more 262 streams. The event is distributed to receivers where: (1) a 263 subscription includes the identified stream, and (2) subscription 264 filtering allows the event to traverse. 266 If access control permissions are in use to secure publisher content, 267 then for notifications to be sent to a receiver, that receiver must 268 be allowed access to the stream. If permissions change during the 269 lifecycle of the of a subscription, then events must be sent or 270 restricted accordingly. This can be be done by re-establishing a 271 subscription with the updated permissions, or by seamlessly updating 272 the permissions of an existing subscription. 274 2.2. Filters 276 A publisher implementation MUST support the ability to perform 277 filtering of notification records. Two filtering syntaxes supported 278 are [XPATH] and [RFC6241]. Events which evaluate to "true" as a 279 result of the evaluation by the filter must traverse the filter in 280 their entirety. A subset of information is never stripped from 281 within the event. 283 2.3. Subscription State Model at the Publisher 285 Below is the state machine of a subscription for the publisher for a 286 dyanmic subscription. It is important to note that such a 287 subscription doesn't exist at the publisher until it is accepted and 288 made active. The mere request by a subscriber to establish a 289 subscription is insufficient for that asserted subscription to be 290 externally visible via this state machine. 292 .-------. 293 | start | 294 '-------' 295 | 296 establish 297 | 298 | .----------modify------------. 299 v v ' 300 .-----------. .-----------. 301 .--------. | |-----suspend------->| | 302 modify '| active | | suspended | 303 '--------->| |<----resume---------| | 304 '-----------' '-----------' 305 | | 306 delete/kill delete/kill 307 | | 308 v | 309 .-------. | 310 | end |<---------------------------' 311 '-------' 313 Figure 1: Subscription states at publisher 315 Of interest in this state machine are the following: 317 o Successful establish or modify RPCs put the subscription into an 318 active state. 320 o Failed modify RPCs will leave the subscription in its previous 321 state, with no visible change to any streaming updates. 323 o A delete or kill RPC will end the subscription. 325 o Suspend and resume state changes are driven by internal process 326 and prioritization. There are no external controls over suspend 327 and resume. 329 An equivalent state machine exists for configured subscriptions. 330 However the transition between states is via configuration operations 331 rather than via RPC. 333 3. Data Model Trees 335 module: ietf-subscribed-notifications 336 +--rw filters 337 | +--rw filter* [identifier] 338 | +--rw identifier filter-id 339 | +--rw filter-type filter-type 340 | +--rw filter 341 +--rw subscription-config {configured-subscriptions}? 342 | +--rw subscription* [identifier] 343 | +--rw identifier subscription-id 344 | +--rw encoding? encoding 345 | +--rw (target) 346 | | +--:(event-stream) 347 | | +--rw stream stream 348 | +--rw (applied-filter) 349 | | +--:(by-reference) 350 | | | +--rw filter-ref filter-ref 351 | | +--:(locally-configured) 352 | | +--rw filter-type filter-type 353 | | +--rw filter 354 | +--rw stop-time? yang:date-and-time 355 | +--rw receivers 356 | | +--rw receiver* [address port] 357 | | +--rw address inet:host 358 | | +--rw port inet:port-number 359 | | +--rw protocol? transport-protocol 360 | +--rw (notification-origin)? 361 | +--:(interface-originated) 362 | | +--rw source-interface? if:interface-ref 363 | +--:(address-originated) 364 | +--rw source-vrf? string 365 | +--rw source-address inet:ip-address-no-zone 366 +--ro subscriptions 367 +--ro subscription* [identifier] 368 +--ro identifier subscription-id 369 +--ro configured-subscription? empty 370 | {configured-subscriptions}? 371 +--ro encoding? encoding 372 +--ro (target) 373 | +--:(event-stream) 374 | +--ro stream stream 375 | +--ro replay-start-time? yang:date-and-time {replay}? 376 +--ro (applied-filter) 377 | +--:(by-reference) 378 | | +--ro filter-ref filter-ref 379 | +--:(locally-configured) 380 | +--ro filter-type filter-type 381 | +--ro filter 382 +--ro stop-time? yang:date-and-time 383 +--ro (notification-origin)? 384 | +--:(interface-originated) 385 | | +--ro source-interface? if:interface-ref 386 | +--:(address-originated) 387 | +--ro source-vrf? string 388 | +--ro source-address inet:ip-address-no-zone 389 +--ro receivers 390 +--ro receiver* [address port] 391 +--ro address inet:host 392 +--ro port inet:port-number 393 +--ro protocol? transport-protocol 394 +--ro pushed-notifications? yang:counter64 395 +--ro excluded-notifications? yang:counter64 396 +--ro subscription-status? subscription-status 398 rpcs: 399 +---x establish-subscription 400 | +---w input 401 | | +---w encoding? encoding 402 | | +---w (target) 403 | | | +--:(event-stream) 404 | | | +---w stream stream 405 | | | +---w replay-start-time? yang:date-and-time {replay}? 406 | | +---w (applied-filter) 407 | | | +--:(by-reference) 408 | | | | +---w filter-ref filter-ref 409 | | | +--:(locally-configured) 410 | | | +---w filter-type filter-type 411 | | | +---w filter 412 | | +---w stop-time? yang:date-and-time 413 | +--ro output 414 | +--ro subscription-result subscription-result 415 | +--ro (result)? 416 | +--:(no-success) 417 | | +--ro filter-failure? string 418 | | +--ro replay-start-time-hint? yang:date-and-time 419 | +--:(success) 420 | +--ro identifier subscription-id 421 +---x modify-subscription 422 | +---w input 423 | | +---w identifier? subscription-id 424 | | +---w (applied-filter) 425 | | | +--:(by-reference) 426 | | | | +---w filter-ref filter-ref 427 | | | +--:(locally-configured) 428 | | | +---w filter-type filter-type 429 | | | +---w filter 430 | | +---w stop-time? yang:date-and-time 431 | +--ro output 432 | +--ro subscription-result subscription-result 433 | +--ro (result)? 434 | +--:(no-success) 435 | +--ro filter-failure? string 436 +---x delete-subscription 437 | +---w input 438 | | +---w identifier subscription-id 439 | +--ro output 440 | +--ro subscription-result subscription-result 441 +---x kill-subscription 442 +---w input 443 | +---w identifier subscription-id 444 +--ro output 445 +--ro subscription-result subscription-result 447 notifications: 448 +---n replay-complete 449 | +--ro identifier subscription-id 450 +---n notification-complete 451 | +--ro identifier subscription-id 452 +---n subscription-started 453 | +--ro identifier subscription-id 454 | +--ro encoding? encoding 455 | +--ro (target) 456 | | +--:(event-stream) 457 | | +--ro stream stream 458 | | +--ro replay-start-time? yang:date-and-time {replay}? 459 | +--ro (applied-filter) 460 | | +--:(by-reference) 461 | | | +--ro filter-ref filter-ref 462 | | +--:(locally-configured) 463 | | +--ro filter-type filter-type 464 | | +--ro filter 465 | +--ro stop-time? yang:date-and-time 466 +---n subscription-resumed 467 | +--ro identifier subscription-id 468 +---n subscription-modified 469 | +--ro identifier subscription-id 470 | +--ro encoding? encoding 471 | +--ro (target) 472 | | +--:(event-stream) 473 | | +--ro stream stream 474 | | +--ro replay-start-time? yang:date-and-time {replay}? 475 | +--ro (applied-filter) 476 | | +--:(by-reference) 477 | | | +--ro filter-ref filter-ref 478 | | +--:(locally-configured) 479 | | +--ro filter-type filter-type 480 | | +--ro filter 481 | +--ro stop-time? yang:date-and-time 482 +---n subscription-terminated 483 | +--ro identifier subscription-id 484 | +--ro error-id subscription-errors 485 | +--ro filter-failure? string 486 +---n subscription-suspended 487 +--ro identifier subscription-id 488 +--ro error-id subscription-errors 489 +--ro filter-failure? string 491 The top-level decompositions of data model are as follows: 493 o "Streams" contains a list of event streams that are supported by 494 the publisher and against which subscription is allowed. 496 o "Filters" contains a configurable list of filters that can be 497 applied to a subscription. This allows users to reference an 498 existing filter definition as an alternative to defining a filter 499 inline for each subscription. 501 o "Subscription-config" contains the configuration of configured 502 subscriptions. The parameters of each configured subscription are 503 a superset of the parameters of a dynamic subscription and use the 504 same groupings. In addition, the configured subscriptions must 505 also specify intended receivers and may specify the push source 506 from which to send the stream of notification messages. 508 o "Subscriptions" contains a list of all subscriptions on a 509 publisher, both configured and dynamic. It can be used to 510 retrieve information about the subscriptions which a publisher is 511 serving. 513 The data model also contains a number of notifications that allow a 514 publisher to signal information about a subscription. Finally, the 515 data model contains a number of RPC definitions that are used to 516 manage dynamic subscriptions. 518 4. Dynamic Subscriptions 520 Dynamic subscriptions are managed via RPC. 522 4.1. Establishing a Subscription 524 The operation allows a subscriber to request 525 the creation of a subscription via RPC. 527 The input parameters of the operation are: 529 o A filter which identifies what is being subscribed to, as well as 530 what should be included (or not) in the pushed results. 532 o A stream which identifies the domain of events against which the 533 subscription is applied. 535 o The desired encoding for the returned events. By default, updates 536 are encoded using XML. Other encodings may be supported, such as 537 JSON. 539 o An optional stop time for the subscription. 541 o An optional start time which indicates that this subscription is 542 requesting a replay push of events previously generated. 544 If the publisher cannot satisfy the request, 545 it sends a negative element. If the subscriber 546 has no authorization to establish the subscription, the 547 indicates an authorization error. Optionally, 548 the may include one or more hints on 549 alternative input parameters and value which would have resulted in 550 an accepted subscription. 552 Subscription requests must fail if a filter with invalid syntax is 553 provided or if the name of a non-existent stream is provided. 555 4.1.1. Replay Subscription 557 Only viable for dynamic subscriptions made on event streams, if the 558 replay feature is supported, a subscription may request that 559 previously generated events be sent. These would then be followed by 560 events generated after the subscription is established. 562 The presence of a start time is the indicator that there is requested 563 replay for this subscription. The start time must be earlier than 564 the current time. If the start time points earlier than the 565 maintained history of Publisher's event buffer, then the subscription 566 must be rejected. In this case the error response to the request should include a start time supportable by the 568 Publisher. 570 4.2. Modifying a Subscription 572 The operation permits changing the terms of an 573 existing dynamic subscription previously established on that 574 transport session. Subscriptions created by configuration operations 575 cannot be modified via this RPC. Dynamic subscriptions can be 576 modified one or multiple times. If the publisher accepts the 577 requested modifications, it immediately starts sending events based 578 on the new terms, completely ignoring the previous ones. If the 579 publisher rejects the request, the subscription remains as prior to 580 the request. That is, the request has no impact whatsoever. The 581 contents of a such a rejected modification may include one or more 582 hints on alternative input parameters and value which would have 583 resulted in a successfully modified subscription. 585 Dynamic subscriptions established via RPC can only be modified (or 586 deleted) via RPC using the same transport session used to establish 587 that subscription. 589 4.3. Deleting a Subscription 591 The operation permits canceling an existing 592 subscription previously established on that transport session. If 593 the publisher accepts the request, it immediately stops sending 594 events for the subscription. If the publisher rejects the request, 595 all subscriptions remain as prior to the request. That is, the 596 request has no impact whatsoever. 598 Subscriptions established via RPC can only be deleted via RPC using 599 the same transport session used for subscription establishment. 600 Configured subscriptions cannot be deleted using RPCs. Instead, 601 configured subscriptions are deleted as part of regular configuration 602 operations. Publishers MUST reject any RPC attempt to delete 603 configured subscriptions. 605 4.4. Killing a Subscription 607 The operation permits an operator to end any 608 dynamic subscription. The publisher must accept the request for any 609 dynamic subscription, and immediately stop sending events. 611 Configured subscriptions cannot be kill using this RPC. Instead, 612 configured subscriptions are deleted as part of regular configuration 613 operations. Publishers MUST reject any RPC attempt to kill a 614 configured subscription. 616 5. Configured Subscriptions 618 A configured subscription is a subscription installed via a 619 configuration interface. 621 Configured subscriptions persist across reboots, and persist even 622 when transport is unavailable. 624 Configured subscriptions can be modified by any configuration client 625 with write permissions for the configuration of the subscription. 626 Subscriptions can be modified or terminated via the configuration 627 interface at any point of their lifetime. 629 Supporting configured subscriptions is optional and advertised using 630 the "configured-subscriptions" feature. 632 In addition to subscription parameters that apply to dynamic 633 subscriptions, the following additional parameters apply to 634 configured subscriptions: 636 o One or more receiver IP addresses (and corresponding 637 ports)intended as the destination for push updates for each 638 subscription. In addition, the transport protocol for each 639 destination may be defined. 641 o Optional parameters to identify an egress interface or IP address 642 / VRF where a subscription updates should be pushed from the 643 publisher. If not included, push updates will go off a default 644 interface for the device. 646 5.1. Establishing a Configured Subscription 648 Configured subscriptions are established using configuration 649 operations against the top-level subtree subscription-config. There 650 are two key differences between RPC and RPC operations 651 for subscription establishment. Firstly, operations 652 install a subscription without question, while RPCs may support 653 negotiation and rejection of requests. Secondly, while RPCs mandate 654 that the subscriber establishing the subscription is the only 655 receiver of the notifications, operations permit 656 specifying receivers independent of any tracked subscriber. 657 Immediately after a subscription is successfully established, the 658 publisher sends to any newly active receivers a control-plane 659 notification stating the subscription has been established 660 (subscription-started). 662 Because there is no explicit association with an existing transport 663 session, operations require additional parameters to 664 indicate the receivers of the notifications and possibly the source 665 of the notifications such as a specific egress interface. 667 For example at subscription establishment if NETCONF transport is 668 being used, a client may send: 670 673 674 675 676 677 679 680 681 1922 682 683 684 foo 685 686 687
688 1.2.3.4 689
690 691 1234 692 693
694
695
696
697
699 Figure 2: Configured subscription creation via NETCONF 701 if the request is accepted, the publisher would reply: 703 705 706 708 Figure 3: Successful NETCONF configured subscription response 710 if the request is not accepted because the publisher cannot serve it, 711 the publisher may reply: 713 714 715 application 716 resource-denied 717 error 718 719 Temporarily the publisher cannot serve this 720 subscription due to the current workload. 721 722 723 725 Figure 4: A NETCONF response for a failed configured subscription 726 creation 728 5.2. Modifying a Configured Subscription 730 Configured subscriptions can be modified using configuration 731 operations against the top-level subtree subscription-config. 733 Immediately after a subscription is successfully modified, the 734 publisher sends to the existing receivers a control-plane 735 notification stating the subscription has been modified (i.e., 736 subscription-modified). 738 If the modification involved adding and/or removing receivers, those 739 modified receivers are sent control-plane notifications, indicating 740 they have been added (i.e, subscription-started to a specific 741 receiver) or removed (i.e., subscription-terminated to a specific 742 receiver.) 744 5.3. Deleting a Configured Subscription 746 Subscriptions can be deleted using configuration operations against 747 the top-level subtree subscription-config. For example, in RESTCONF: 749 DELETE /subscription-config/subscription=1922 HTTP/1.1 750 Host: example.com 752 HTTP/1.1 204 No Content 753 Date: Sun, 24 Jul 2016 11:23:40 GMT 754 Server: example-server 756 Figure 5: Deleting a configured subscription 758 Immediately after a subscription is successfully deleted, the 759 publisher sends to all receivers of that subscription a control-plane 760 notification stating the subscription has been terminated 761 (subscription-terminated). 763 6. Event (Data Plane) Notifications 765 Once a subscription has been set up, the publisher streams 766 (asynchronously) notifications per the terms of the subscription. We 767 refer to these as event notifications. For dynamic subscriptions set 768 up via RPC operations, event notifications are sent over the session 769 used to establish the subscription. For configured subscriptions, 770 event notifications are sent over the specified connections. 772 An event notification is sent to a receiver when something of 773 interest occurs which is able to traverse all specified filtering and 774 access control criteria. At a minimum this event notification must 775 include: 777 o a subscription-id element of type uint32 which corresponds to the 778 responsible subscription in the Publisher. 780 o a timestamp indicating when event was identified and recorded by 781 the event source. This timestamp must support the indication of 782 time zone. The default timestamp is the eventTime element of type 783 dateTime and compliant to [RFC3339]. Additional timestamp 784 elements and formats are outside the scope of this document. 786 o the event notification content tagged and provided by a source in 787 the publisher. 789 Additional header and event bundling capabilities not defined in this 790 document may transparently be included within the event notification. 792 The following is an example of a compliant event notification. This 793 example extending the example within [RFC7950] section 7.16.3 to 794 include the mandatory information described above: 796 798 2007-09-01T10:00:00Z 799 500 800 801 so-1/2/3.0 802 up 803 down 804 805 807 Figure 6: Data plane notification 809 While this extended [RFC7950] section 7.16 notification provides a 810 valid method of encapsulating subscribed notifications, other 811 transport encapsulation methods are also viable. Improvements may be 812 achieved in some implementations in the following ways: 814 o transport efficiency may be gained by allowing the encapsulation 815 and bundled push of multiple events within the same event 816 notification. 818 o identifiers to designate the current and previous event 819 notification can be used to discover duplicated and dropped 820 notifications 822 o additional header types can be used to pass relevant metadata. 824 o a signature or hash can be included to verify the efficacy of the 825 Publisher 827 This is being explored in NETMOD Notifications 2.0 828 [I-D.voit-notifications2]. 830 7. Subscription State Notifications 832 In addition to data plane notifications, a publisher may send 833 subscription state notifications to indicate to receivers that an 834 event related to the subscription management has occurred. 836 Subscription state notifications are unlike other notifications in 837 that they are not general-purpose notifications. They cannot be 838 filtered out, and they are delivered only to directly impacted 839 receiver(s) of a subscription. The definition of subscription state 840 notifications is distinct from other notifications by making use of a 841 YANG extension tagging them as subscription state notification. 843 Subscription state notifications include indications that a replay of 844 events has been completed, that a subscription is done because an end 845 time has been reached, and that a subscription has started, been 846 modified, been terminated, or been suspended. They are described in 847 the following subsections. 849 7.1. subscription-started 851 This notification indicates that a configured subscription has 852 started and data updates are beginning to be sent. This notification 853 includes the parameters of the subscription, except for the 854 receiver(s) addressing information and push-source information. Note 855 that for RPC-based subscriptions, no such notifications are sent. 857 7.2. subscription-modified 859 This notification indicates that a configured subscription has been 860 modified successfully. This notification includes the parameters of 861 the subscription, except for the receiver(s) addressing information 862 and push-source information. Note that for RPC-based subscriptions, 863 no such notifications are sent. 865 7.3. subscription-terminated 867 This notification indicates that a subscription has been terminated 868 by the publisher. The notification includes the reason for the 869 termination. The publisher may decide to terminate a subscription 870 when it is running out of resources for serving it, an internal error 871 occurs, etc. Publisher-driven terminations are notified to all 872 receivers. The management plane can also terminate configured 873 subscriptions using configuration operations. 875 Subscribers can terminate via RPC subscriptions established via a 876 delete-subscription RPC. In such cases, no subscription-terminated 877 notifications are sent. However if a kill-subscription RPC is sent, 878 or some other event results in the end of a susbcription, then there 879 must be a notification that the subscription has been ended. 881 7.4. subscription-suspended 883 This notification indicates that a publisher has suspended a 884 subscription. The notification includes the reason for the 885 suspension. A possible reason is the lack of resources to serve it. 886 No further data plane notifications will be sent until the 887 subscription resumes. Suspensions are notified to the subscriber (in 888 the case of dynamic subscriptions) and all receivers (in the case of 889 configured subscriptions). 891 7.5. subscription-resumed 893 This notification indicates that a previously suspended subscription 894 has been resumed. Data plane notifications generated in the future 895 will be sent after the subscription terms. Resumptions are notified 896 to the subscriber (in the case of dynamic subscriptions) and all 897 receivers (in the case of configured subscriptions). 899 7.6. notification-complete 901 This notification is sent to indicate that a subscription, which 902 includes a stop time, has finished passing events. 904 7.7. replay-complete 906 This notification indicates that all of the events prior to the 907 current time have been sent. This includes new events generated 908 since the start of the subscription. This notification must not be 909 sent for any other reason. 911 If subscription contains no stop time, or has a stop time which has 912 not been reached, then after the replay-complete notification has 913 been sent events will be sent in sequence as they arise naturally 914 within the system. 916 8. Administrative Functions 918 8.1. Subscription Monitoring 920 Container "subscriptions" in the YANG module below contains the state 921 of all subscriptions that are currently active. This includes 922 subscriptions that were established (and have not yet been deleted) 923 using RPCs, as well as subscriptions that have been configured as 924 part of configuration. Using the operation with NETCONF, or 925 subscribing to this information via [I-D.ietf-netconf-yang-push] 926 allows the status of subscriptions to be monitored. 928 Each subscription is represented as a list element. The associated 929 information includes an identifier for the subscription, recevier 930 counter information, the status of the subscription, as well as the 931 various subscription parameters that are in effect. The subscription 932 status indicates the subscription's state with each receiver (e.g., 933 is currently active or suspended). Leaf "configured-subscription" 934 indicates whether the subscription came into being via configuration 935 or via RPC. 937 Subscriptions that were established by RPC are removed from the list 938 once they expire (reaching stop-time) or when they are terminated. 940 Subscriptions that were established by configuration need to be 941 deleted from the configuration by a configuration editing operation 942 even if the stop time has been passed. 944 8.2. Capability Advertisement 946 Capabilities are advertised in messages sent by each peer during 947 session establishment [RFC6241]. Publishers supporting the features 948 in this document must advertise the capability 949 "urn:ietf:params:netconf:capability:notification:2.0". 951 The mechanism defined in this document is identified by 952 "urn:ietf:params:netconf:capability:notification:2.0". If a 953 subscriber only supports [RFC5277] and not this specification, then 954 they will recognize the capability 955 "urn:ietf:params:netconf:capability:notification:1.0" and ignore the 956 capability defined in this document. 958 8.3. Event Stream Discovery 960 A publisher maintains a list of available event streams as 961 operational data. This list contains both standardized and vendor- 962 specific event streams. A client can retrieve this list like any 963 other YANG-defined data, for example using the operation when 964 using NETCONF. 966 9. Data Model 968 file "ietf-subscribed-notifications.yang" 969 module ietf-subscribed-notifications { 970 namespace 971 "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; 973 prefix sn; 975 import ietf-yang-types { 976 prefix yang; 977 } 978 import ietf-inet-types { 979 prefix inet; 980 } 981 import ietf-interfaces { 982 prefix if; 983 } 985 organization "IETF"; 986 contact 987 "WG Web: 988 WG List: 990 WG Chair: Mahesh Jethanandani 991 993 WG Chair: Mehmet Ersue 994 996 Editor: Alexander Clemm 997 999 Editor: Eric Voit 1000 1002 Editor: Alberto Gonzalez Prieto 1003 1005 Editor: Einar Nilsen-Nygaard 1006 1008 Editor: Ambika Prasad Tripathy 1009 "; 1011 description 1012 "This module contains conceptual YANG specification for 1013 subscribing to events an receiving event notifications."; 1015 revision 2017-04-19 { 1016 description 1017 "Filtering and stream structures updated, replay a feature."; 1018 reference 1019 "draft-ietf-netconf-subscribed-notifications-02"; 1020 } 1022 /* 1023 * FEATURES 1024 */ 1026 feature json { 1027 description 1028 "This feature indicates that JSON encoding of notifications 1029 is supported."; 1030 } 1032 feature configured-subscriptions { 1033 description 1034 "This feature indicates that management plane configuration 1035 of subscription is supported."; 1036 } 1038 feature replay { 1039 description 1040 "This feature indicates that historical event replay is 1041 supported. With replay, it is possible for past events to be 1042 will be streamed in chronological order."; 1043 } 1045 /* 1046 * EXTENSIONS 1047 */ 1049 extension subscription-state-notif { 1050 description 1051 "This statement applies only to notifications. It indicates that 1052 the notification is a subscription state notification (aka OAM 1053 notification). Therefore it does not participate in a regular 1054 event stream and does not need to be specifically subscribed 1055 in order to receive notifications."; 1056 } 1058 /* 1059 * IDENTITIES 1060 */ 1062 /* Identities for streams */ 1063 identity stream { 1064 description 1065 "Base identity to represent a generic stream of event 1066 notifications exposed for subscription by a system."; 1067 } 1069 identity NETCONF { 1070 base stream; 1071 description 1072 "Default NETCONF event stream, containing events based on 1073 notifications defined as YANG modules that are supported by the 1074 system. As a historical reference, this contains the same set 1075 of events in a default RFC-5277 NETCONF stream."; 1076 } 1078 identity SYSLOG { 1079 base stream; 1080 description 1081 "A stream of events mirroring the discrete set entries 1082 concurrently being placed into a device's local Syslog."; 1084 } 1086 /* Identities for filters */ 1087 identity filter { 1088 description 1089 "Base identity to represent a filter. A filter is used to 1090 specify the data nodes used as match criteria against, objects, 1091 subtree/subtrees, of a target for the filter. A match with 1092 filter criteria will allow information to traverse the filter. "; 1093 } 1095 identity xpath { 1096 base filter; 1097 description 1098 "A filter which follows the syntax specified in yang:xpath1.0."; 1099 reference "XPATH: http://www.w3.org/TR/1999/REC-xpath-19991116"; 1100 } 1102 /* Identities for subscription results */ 1103 identity subscription-result { 1104 description 1105 "Base identity for RPC responses to requests surrounding 1106 management (e.g. creation, modification, deletion) of 1107 subscriptions."; 1108 } 1110 identity ok { 1111 base subscription-result; 1112 description 1113 "OK - RPC was successful and was performed as requested."; 1114 } 1116 identity error { 1117 base subscription-result; 1118 description 1119 "RPC was not successful. 1120 Base identity for error return codes."; 1121 } 1123 /* Identities for subscription stream status */ 1124 identity subscription-status { 1125 description 1126 "Base identity for the status of subscriptions and datastreams."; 1127 } 1129 identity active { 1130 base subscription-status; 1131 description 1132 "Status is active and healthy."; 1133 } 1135 identity inactive { 1136 base subscription-status; 1137 description 1138 "Status is inactive, for example outside the interval between 1139 start time and stop time."; 1140 } 1142 identity suspended { 1143 base subscription-status; 1144 description 1145 "The status is suspended, meaning that the publisher is currently 1146 unable to provide the negotiated updates for the subscription."; 1147 } 1149 identity in-error { 1150 base subscription-status; 1151 description 1152 "The status is in error or degraded, meaning that stream and/or 1153 subscription is currently unable to provide the negotiated 1154 notifications."; 1155 } 1157 /* Identities for subscription errors */ 1159 identity internal-error { 1160 base error; 1161 description 1162 "Error within publisher prohibits operation."; 1163 } 1165 identity suspension-timeout { 1166 base error; 1167 description 1168 "Termination of previously suspended subscription. The publisher 1169 has eliminated the subscription as it exceeded a time limit for 1170 suspension."; 1171 } 1173 identity stream-unavailable { 1174 base error; 1175 description 1176 "Stream does not exist or is not available to the receiver."; 1177 } 1179 identity encoding-unavailable { 1180 base error; 1181 description 1182 "Encoding not supported"; 1183 } 1185 identity replay-unsupported { 1186 base error; 1187 description 1188 "Replay cannot be performed for this subscription. The publisher 1189 does not provide the requested historic information via replay."; 1190 } 1192 identity history-unavailable { 1193 base error; 1194 description 1195 "Replay request too far into the past. The publisher does store 1196 historic information for all parts of requested subscription, but 1197 not back to the requested timestamp."; 1198 } 1200 identity filter-unavailable { 1201 base error; 1202 description 1203 "Referenced filter does not exist"; 1204 } 1206 identity filter-unsupported { 1207 base error; 1208 description 1209 "Cannot parse syntax within the filter. Failure can be from a 1210 syntax error, or a syntax too complex to be processed by the 1211 platform. The supplemental info should include the invalid part 1212 of the filter."; 1213 } 1215 identity namespace-unavailable { 1216 base error; 1217 description 1218 "Referenced namespace doesn't exist or is unavailable 1219 to the receiver."; 1220 } 1222 identity no-such-subscription { 1223 base error; 1224 description 1225 "Referenced subscription doesn't exist. This may be as a result of 1226 a non-existent subscription ID, an ID which belongs to another 1227 subscriber, or an ID for acceptable subscription which has been 1228 statically configured."; 1229 } 1231 identity error-insufficient-resources { 1232 base error; 1233 description 1234 "The server has insufficient resources to support the 1235 subscription as requested."; 1236 } 1238 identity error-no-such-option { 1239 base error; 1240 description 1241 "A requested parameter setting is not supported."; 1242 } 1244 /* Identities for encodings */ 1245 identity encodings { 1246 description 1247 "Base identity to represent data encodings"; 1248 } 1250 identity encode-xml { 1251 base encodings; 1252 description 1253 "Encode data using XML"; 1254 } 1256 identity encode-json { 1257 base encodings; 1258 description 1259 "Encode data using JSON"; 1260 } 1262 /* Identities for transports */ 1263 identity transport { 1264 description 1265 "An identity that represents a transport protocol for event 1266 notifications"; 1267 } 1269 identity netconf { 1270 base transport; 1271 description 1272 "Netconf notifications as a transport."; 1273 } 1275 identity http2 { 1276 base transport; 1277 description 1278 "HTTP2 notifications as a transport"; 1279 } 1281 /* 1282 * TYPEDEFs 1283 */ 1285 typedef subscription-id { 1286 type uint32; 1287 description 1288 "A type for subscription identifiers."; 1289 } 1291 typedef filter-id { 1292 type uint32; 1293 description 1294 "A type to identify filters which can be associated with a 1295 subscription."; 1296 } 1298 typedef subscription-result { 1299 type identityref { 1300 base subscription-result; 1301 } 1302 description 1303 "The result of a subscription operation"; 1304 } 1306 typedef subscription-errors { 1307 type identityref { 1308 base error; 1309 } 1310 description 1311 "The reason for the failure of an RPC request or the sending of a 1312 subscription suspension or termination notification"; 1313 } 1315 typedef encoding { 1316 type identityref { 1317 base encodings; 1318 } 1319 description 1320 "Specifies a data encoding, e.g. for a data subscription."; 1321 } 1323 typedef filter-type { 1324 type identityref { 1325 base filter; 1326 } 1327 description 1328 "Specifies a known type of filter."; 1329 } 1331 typedef subscription-status { 1332 type identityref { 1333 base subscription-status; 1334 } 1335 description 1336 "Specifies the status of a subscription."; 1337 } 1339 typedef transport-protocol { 1340 type identityref { 1341 base transport; 1342 } 1343 description 1344 "Specifies transport protocol used to send notifications to a 1345 receiver."; 1346 } 1348 typedef notification-origin { 1349 type enumeration { 1350 enum "interface-originated" { 1351 description 1352 "Notifications will be sent from a specific interface on a 1353 publisher"; 1354 } 1355 enum "address-originated" { 1356 description 1357 "Notifications will be sent from a specific address on a 1358 publisher"; 1359 } 1360 } 1361 description 1362 "Specifies from where notifications will be sourced when 1363 being sent by the publisher."; 1364 } 1366 typedef stream { 1367 type identityref { 1368 base stream; 1369 } 1370 description 1371 "Specifies a system-provided datastream."; 1373 } 1375 typedef filter-ref { 1376 type leafref { 1377 path "/sn:filters/sn:filter/sn:identifier"; 1378 } 1379 description 1380 "This type is used to reference a filter."; 1381 } 1383 /* 1384 * GROUPINGS 1385 */ 1387 grouping base-filter { 1388 description 1389 "This grouping defines the base for filters for notification 1390 events."; 1391 leaf filter-type { 1392 type filter-type; 1393 mandatory true; 1394 description 1395 "A filter needs to be a known and understood syntax if it is to 1396 be interpretable by a device."; 1397 } 1398 anyxml filter { 1399 mandatory true; 1400 description 1401 "Filter where the syntax is of type filter-type. If the filter 1402 is applied against a stream and the match criteria are not met, 1403 excludes the entire event from being passed along."; 1404 } 1405 } 1407 grouping subscription-policy-non-modifiable { 1408 description 1409 "This grouping describes the information in a subscription which 1410 should not change during the life of the subscription."; 1411 leaf encoding { 1412 type encoding; 1413 default "encode-xml"; 1414 description 1415 "The type of encoding for the subscribed data. Default is XML"; 1416 } 1417 choice target { 1418 mandatory true; 1419 description 1420 "A filter must be applied against some source of information. 1422 This identifies the target for the filter."; 1423 case event-stream { 1424 leaf stream { 1425 type stream; 1426 mandatory true; 1427 description 1428 "Indicates a stream of events against which to apply 1429 a filter."; 1430 } 1431 } 1432 } 1433 } 1435 grouping subscription-policy-modifiable { 1436 description 1437 "This grouping describes all objects which may be changed 1438 in a subscription via an RPC."; 1439 choice applied-filter { 1440 mandatory true; 1441 description 1442 "A filter must be applied to a subscription. And that filter 1443 will come either referenced from a global list, or be provided 1444 within the subscription itself."; 1445 case by-reference { 1446 description 1447 "Incorporate a filter that has been configured separately."; 1448 leaf filter-ref { 1449 type filter-ref; 1450 mandatory true; 1451 description 1452 "References an existing filter which is to be applied to 1453 the subscription."; 1454 } 1455 } 1456 case locally-configured { 1457 uses base-filter; 1458 description 1459 "Local definition allows a filter to have the same lifecycle 1460 as the subscription."; 1461 } 1462 } 1463 leaf stop-time { 1464 type yang:date-and-time; 1465 description 1466 "Identifies a time after which notification events should not 1467 be sent. If stop-time is not present, the notifications will 1468 continue until the subscription is terminated. If 1469 replay-start-time exists, stop-time must for a subsequent time. 1471 If replay-start-time doesn't exist, stop-time must for a future 1472 time."; 1473 } 1474 } 1476 grouping subscription-policy { 1477 description 1478 "This grouping describes information concerning a subscription."; 1479 uses subscription-policy-non-modifiable { 1480 augment target/event-stream { 1481 description 1482 "Adds additional objects which must be set just by RPC."; 1483 leaf replay-start-time { 1484 if-feature "replay"; 1485 type yang:date-and-time; 1486 description 1487 "Used to trigger the replay feature and indicate that the 1488 replay should start at the time specified. If 1489 replay-start-time is not present, this is not a replay 1490 subscription and event pushes should start immediately. It 1491 is never valid to specify start times that are later than 1492 or equal to the current time."; 1493 } 1494 } 1495 } 1496 uses subscription-policy-modifiable; 1497 } 1499 grouping notification-origin-info { 1500 description 1501 "Defines the sender source from which notifications for a 1502 configured subscription are sent."; 1503 choice notification-origin { 1504 description 1505 "Identifies the egress interface on the Publisher from which 1506 notifications will or are being sent."; 1507 case interface-originated { 1508 description 1509 "When the push source is out of an interface on the 1510 Publisher established via static configuration."; 1511 leaf source-interface { 1512 type if:interface-ref; 1513 description 1514 "References the interface for notifications."; 1515 } 1516 } 1517 case address-originated { 1518 description 1519 "When the push source is out of an IP address on the 1520 Publisher established via static configuration."; 1521 leaf source-vrf { 1522 type string; 1523 description 1524 "Network instance name for the VRF. This could also have 1525 been a leafref to draft-ietf-rtgwg-ni-model, but that model 1526 in not complete, and may not be implemented on a box."; 1527 } 1528 leaf source-address { 1529 type inet:ip-address-no-zone; 1530 mandatory true; 1531 description 1532 "The source address for the notifications."; 1533 } 1534 } 1535 } 1536 } 1538 grouping receiver-info { 1539 description 1540 "Defines where and how to get notifications for a configured 1541 subscriptions to one or more targeted recipient. This includes 1542 specifying the destination addressing as well as a transport 1543 protocol acceptable to the receiver."; 1544 container receivers { 1545 description 1546 "Set of receivers in a subscription."; 1547 list receiver { 1548 key "address port"; 1549 min-elements 1; 1550 description 1551 "A single host or multipoint address intended as a target 1552 for the notifications for a subscription."; 1553 leaf address { 1554 type inet:host; 1555 mandatory true; 1556 description 1557 "Specifies the address for the traffic to reach a remote 1558 host. One of the following must be specified: an ipv4 1559 address, an ipv6 address, or a host name."; 1560 } 1561 leaf port { 1562 type inet:port-number; 1563 mandatory true; 1564 description 1565 "This leaf specifies the port number to use for messages 1566 destined for a receiver."; 1568 } 1569 leaf protocol { 1570 type transport-protocol; 1571 default "netconf"; 1572 description 1573 "This leaf specifies the transport protocol used 1574 to deliver messages destined for the receiver. Each 1575 protocol may use the address and port information 1576 differently as applicable."; 1577 } 1578 } 1579 } 1580 } 1582 grouping error-identifier { 1583 description 1584 "A code passed back within an RPC response to describe why the RFC 1585 has failed, or within a state change notification to describe why 1586 the change has occurred."; 1587 leaf error-id { 1588 type subscription-errors; 1589 mandatory true; 1590 description 1591 "Identifies the subscription error condition."; 1592 } 1593 } 1595 grouping error-hints { 1596 description 1597 "Objects passed back within an RPC response to describe why the 1598 RFC has failed, or within a state change notification to 1599 describe why the change has occurred."; 1600 leaf filter-failure { 1601 type string; 1602 description 1603 "Information describing where and/or why a provided filter was 1604 unsupportable for a subscription."; 1605 } 1606 } 1608 grouping subscription-response-with-hints { 1609 description 1610 "Defines the output for the establish-subscription and 1611 modify-subscription RPCs."; 1612 leaf subscription-result { 1613 type subscription-result; 1614 mandatory true; 1615 description 1616 "Indicates whether subscription is operational, or if a problem 1617 was encountered."; 1618 } 1619 choice result { 1620 description 1621 "Depending on the subscription result, different data is 1622 returned."; 1623 case no-success { 1624 description 1625 "This case applies when a subscription request was not 1626 successful and no subscription was created (or modified) as a 1627 result. In this case, information MAY be returned that 1628 indicates suggested parameter settings that would have a 1629 high likelihood of succeeding in a subsequent establish- 1630 subscription or modify-subscription request."; 1631 uses error-hints; 1632 } 1633 } 1634 } 1636 /* 1637 * RPCs 1638 */ 1640 rpc establish-subscription { 1641 description 1642 "This RPC allows a subscriber to create (and possibly negotiate) 1643 a subscription on its own behalf. If successful, the 1644 subscription remains in effect for the duration of the 1645 subscriber's association with the publisher, or until the 1646 subscription is terminated. In case an error (as indicated by 1647 subscription-result) is returned, the subscription is not 1648 created. In that case, the RPC output MAY include suggested 1649 parameter settings that would have a high likelihood of 1650 succeeding in a subsequent establish-subscription request."; 1651 input { 1652 uses subscription-policy; 1653 } 1654 output { 1655 uses subscription-response-with-hints { 1656 augment "result" { 1657 description 1658 "Allows information to be passed back as part of a 1659 successful subscription establishment."; 1660 case success { 1661 description 1662 "This case is used when the subscription request was 1663 successful."; 1665 leaf identifier { 1666 type subscription-id; 1667 mandatory true; 1668 description 1669 "Identifier used for this subscription."; 1670 } 1671 } 1672 } 1673 augment "result/no-success" { 1674 description 1675 "Contains establish RPC specific objects which can be 1676 returned as hints for future attempts."; 1677 leaf replay-start-time-hint { 1678 type yang:date-and-time; 1679 description 1680 "If a replay has been requested, but the requested replay 1681 time cannot be honored, this may provide a hint at an 1682 alternate time which may be supportable."; 1683 } 1684 } 1685 } 1686 } 1687 } 1689 rpc modify-subscription { 1690 description 1691 "This RPC allows a subscriber to modify a subscription that was 1692 previously created using establish-subscription. If successful, 1693 the changed subscription remains in effect for the duration of 1694 the subscriber's association with the publisher, or until the 1695 subscription is again modified or terminated. In case an error 1696 is returned (as indicated by subscription-result), the 1697 subscription is not modified and the original subscription 1698 parameters remain in effect. In that case, the rpc error 1699 response MAY include suggested parameter hints that would have 1700 a high likelihood of succeeding in a subsequent 1701 modify-subscription request."; 1702 input { 1703 leaf identifier { 1704 type subscription-id; 1705 description 1706 "Identifier to use for this subscription."; 1707 } 1708 uses subscription-policy-modifiable; 1709 } 1710 output { 1711 uses subscription-response-with-hints; 1712 } 1714 } 1716 rpc delete-subscription { 1717 description 1718 "This RPC allows a subscriber to delete a subscription that 1719 was previously created from by that same subscriber using the 1720 establish-subscription RPC."; 1721 input { 1722 leaf identifier { 1723 type subscription-id; 1724 mandatory true; 1725 description 1726 "Identifier of the subscription that is to be deleted. 1727 Only subscriptions that were created using 1728 establish-subscription can be deleted via this RPC."; 1729 } 1730 } 1731 output { 1732 leaf subscription-result { 1733 type subscription-result; 1734 mandatory true; 1735 description 1736 "Indicates whether subscription is operational, or if a 1737 problem was encountered."; 1738 } 1739 } 1740 } 1742 rpc kill-subscription { 1743 description 1744 "This RPC allows an operator to delete a dynamic subscription 1745 without restrictions on the originating subscriber or underlying 1746 transport session."; 1747 input { 1748 leaf identifier { 1749 type subscription-id; 1750 mandatory true; 1751 description 1752 "Identifier of the subscription that is to be deleted. Only 1753 subscriptions that were created using establish-subscription 1754 can be deleted via this RPC."; 1755 } 1756 } 1757 output { 1758 leaf subscription-result { 1759 type subscription-result; 1760 mandatory true; 1761 description 1762 "Indicates whether subscription is operational, or if a 1763 problem was encountered."; 1764 } 1765 } 1766 } 1768 /* 1769 * NOTIFICATIONS 1770 */ 1772 notification replay-complete { 1773 sn:subscription-state-notif; 1774 description 1775 "This notification is sent to indicate that all of the replay 1776 notifications have been sent. It must not be sent for any other 1777 reason."; 1778 leaf identifier { 1779 type subscription-id; 1780 mandatory true; 1781 description 1782 "This references the affected subscription."; 1783 } 1784 } 1786 notification notification-complete { 1787 sn:subscription-state-notif; 1788 description 1789 "This notification is sent to indicate that a subscription, has 1790 finished passing events."; 1791 leaf identifier { 1792 type subscription-id; 1793 mandatory true; 1794 description 1795 "This references the affected subscription."; 1796 } 1797 } 1799 notification subscription-started { 1800 sn:subscription-state-notif; 1801 description 1802 "This notification indicates that a subscription has started and 1803 notifications are beginning to be sent. This notification shall 1804 only be sent to receivers of a subscription; it does not 1805 constitute a general-purpose notification."; 1806 leaf identifier { 1807 type subscription-id; 1808 mandatory true; 1809 description 1810 "This references the affected subscription."; 1811 } 1812 uses subscription-policy; 1813 } 1815 notification subscription-resumed { 1816 sn:subscription-state-notif; 1817 description 1818 "This notification indicates that a subscription that had 1819 previously been suspended has resumed. Notifications will once 1820 again be sent."; 1821 leaf identifier { 1822 type subscription-id; 1823 mandatory true; 1824 description 1825 "This references the affected subscription."; 1826 } 1827 } 1829 notification subscription-modified { 1830 sn:subscription-state-notif; 1831 description 1832 "This notification indicates that a subscription has been 1833 modified. Notifications sent from this point on will conform to 1834 the modified terms of the subscription. For completeness, this 1835 notification includes both modified and non-modified aspects of 1836 a subscription "; 1837 leaf identifier { 1838 type subscription-id; 1839 mandatory true; 1840 description 1841 "This references the affected subscription."; 1842 } 1843 uses subscription-policy; 1844 } 1846 notification subscription-terminated { 1847 sn:subscription-state-notif; 1848 description 1849 "This notification indicates that a subscription has been 1850 terminated."; 1851 leaf identifier { 1852 type subscription-id; 1853 mandatory true; 1854 description 1855 "This references the affected subscription."; 1856 } 1857 uses error-identifier; 1858 uses error-hints; 1859 } 1861 notification subscription-suspended { 1862 sn:subscription-state-notif; 1863 description 1864 "This notification indicates that a suspension of the 1865 subscription by the publisher has occurred. No further 1866 notifications will be sent until the subscription resumes. 1867 This notification shall only be sent to receivers of a 1868 subscription; it does not constitute a general-purpose 1869 notification."; 1870 leaf identifier { 1871 type subscription-id; 1872 mandatory true; 1873 description 1874 "This references the affected subscription."; 1875 } 1876 uses error-identifier; 1877 uses error-hints; 1878 } 1880 /* 1881 * DATA NODES 1882 */ 1884 container filters { 1885 description 1886 "This container contains a list of configurable filters 1887 that can be applied to subscriptions. This facilitates 1888 the reuse of complex filters once defined."; 1889 list filter { 1890 key "identifier"; 1891 description 1892 "A list of configurable filters that can be applied to 1893 subscriptions."; 1894 leaf identifier { 1895 type filter-id; 1896 description 1897 "An identifier to differentiate between filters."; 1898 } 1899 uses base-filter; 1900 } 1901 } 1902 container subscription-config { 1903 if-feature "configured-subscriptions"; 1904 description 1905 "Contains the list of subscriptions that are configured, 1906 as opposed to established via RPC or other means."; 1907 list subscription { 1908 key "identifier"; 1909 description 1910 "Content of a subscription."; 1911 leaf identifier { 1912 type subscription-id; 1913 description 1914 "Identifier to use for this subscription."; 1915 } 1916 uses subscription-policy-non-modifiable; 1917 uses subscription-policy-modifiable; 1918 uses receiver-info { 1919 if-feature "configured-subscriptions"; 1920 } 1921 uses notification-origin-info { 1922 if-feature "configured-subscriptions"; 1923 } 1924 } 1925 } 1926 container subscriptions { 1927 config false; 1928 description 1929 "Contains the list of currently active subscriptions, i.e. 1930 subscriptions that are currently in effect, used for subscription 1931 management and monitoring purposes. This includes subscriptions 1932 that have been setup via RPC primitives as well as subscriptions 1933 that have been established via configuration."; 1934 list subscription { 1935 key "identifier"; 1936 config false; 1937 description 1938 "Content of a subscription. Subscriptions can be created using 1939 a control channel or RPC, or be established through 1940 configuration."; 1941 leaf identifier { 1942 type subscription-id; 1943 description 1944 "Identifier of this subscription."; 1945 } 1946 leaf configured-subscription { 1947 if-feature "configured-subscriptions"; 1948 type empty; 1949 description 1950 "The presence of this leaf indicates that the subscription 1951 originated from configuration, not through a control channel 1952 or RPC."; 1953 } 1954 uses subscription-policy; 1955 uses notification-origin-info { 1956 if-feature "configured-subscriptions"; 1957 } 1958 uses receiver-info { 1959 refine receivers/receiver { 1960 min-elements "1"; 1961 } 1962 augment receivers/receiver { 1963 description 1964 "include operational data for receivers."; 1965 leaf pushed-notifications { 1966 type yang:counter64; 1967 description 1968 "Operational data which provides the number of update 1969 notifications pushed to a receiver."; 1970 } 1971 leaf excluded-notifications { 1972 type yang:counter64; 1973 description 1974 "Operational data which provides the number of non- 1975 datastore update notifications explicitly removed via 1976 filtering so that they are not sent to a receiver."; 1977 } 1978 leaf status { 1979 type subscription-status; 1980 mandatory true; 1981 description 1982 "The status of the subscription."; 1983 } 1984 } 1985 } 1986 } 1987 } 1988 } 1989 1991 10. Considerations 1993 10.1. Implementation Considerations 1995 For a deployment including both configured and dynamic subscriptions, 1996 split subscription identifiers into static and dynamic halves. That 1997 way there should not be collisions if the configured subscriptions 1998 attempt to set a subscription-id which might have already been 1999 dynamically allocated. 2001 The elements are never sent before the transport 2002 layer, including capabilities exchange, has been established. 2004 10.2. Security Considerations 2006 For dynamic subscriptions the publisher must authenticate and 2007 authorize all RPC requests. 2009 Subscriptions could overload a publisher's CPU. For this reason, the 2010 publisher must have the ability to decline a dynamic subscription 2011 request, and provide the appropriate RPC error response to a 2012 subscriber should the proposed subscription overly deplete the 2013 publisher's resources. 2015 A publisher needs to be able to suspend an existing dynamic or 2016 configured subscription based on capacity constraints. When this 2017 occur, the subscription status must be updated accordingly and the 2018 receivers notified with subscription state notifications. 2020 If a malicious or buggy subscriber sends an unexpectedly large number 2021 of RPCs, this may use up system resources. In such a situation, 2022 subscription interactions may be terminated by terminating the 2023 transport session. 2025 For both configured and dynamic subscriptions the publisher must 2026 authenticate and authorize a receiver via some transport level 2027 mechanism before sending any updates. 2029 A secure transport is highly recommended and the publisher must 2030 ensure that the user has sufficient authorization to perform the 2031 function they are requesting against the specific subset of content 2032 involved. 2034 A publisher MUST NOT include any content in a notification for which 2035 the user has not been authorized. 2037 With configured subscriptions, one or more publishers could be used 2038 to overwhelm a receiver. No push updates should be sent to any 2039 receiver which doesn't even support subscriptions. Subscribers that 2040 do not want pushed data need only terminate or refuse any transport 2041 sessions from the publisher. 2043 The NETCONF Authorization Control Model [RFC6536] SHOULD be used to 2044 control and restrict authorization of subscription configuration. 2045 This control models permits specifying per-user permissions to 2046 receive events from specific streams. 2048 Where NACM is available, the NACM "very-secure" tag should be placed 2049 on the RPC so that only administrators can 2050 access. 2052 One subscription id can be used for two or more receivers of the same 2053 configured subscription. But due to the possibility of different 2054 access control permissions per receiver, it should not be assumed 2055 that each receiver is getting identical updates. 2057 11. Acknowledgments 2059 For their valuable comments, discussions, and feedback, we wish to 2060 acknowledge Andy Bierman, Tim Jenkins, Balazs Lengyel, Sharon 2061 Chisholm, Hector Trevino, Susan Hares, Kent Watsen, Michael Scharf, 2062 and Guangying Zheng. 2064 12. References 2066 12.1. Normative References 2068 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2069 Requirement Levels", BCP 14, RFC 2119, 2070 DOI 10.17487/RFC2119, March 1997, 2071 . 2073 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 2074 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 2075 . 2077 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 2078 Protocol (NETCONF) Access Control Model", RFC 6536, 2079 DOI 10.17487/RFC6536, March 2012, 2080 . 2082 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2083 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2084 . 2086 [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) 2087 Version 1.0", November 1999, 2088 . 2090 12.2. Informative References 2092 [I-D.ietf-netconf-netconf-event-notif] 2093 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 2094 Nilsen-Nygaard, E., Tripathy, A., Chisholm, S., and H. 2095 Trevino, "NETCONF support for event notifications", August 2096 2016, . 2099 [I-D.ietf-netconf-restconf-notif] 2100 Voit, Eric., Clemm, Alexander., Tripathy, A., Nilsen- 2101 Nygaard, E., and Alberto. Gonzalez Prieto, "Restconf and 2102 HTTP transport for event notifications", August 2016, 2103 . 2106 [I-D.ietf-netconf-yang-push] 2107 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 2108 Tripathy, A., Nilsen-Nygaard, E., Bierman, A., and B. 2109 Lengyel, "Subscribing to YANG datastore push updates", 2110 February 2017, . 2113 [I-D.voit-notifications2] 2114 Voit, Eric., Clemm, Alexander., Bierman, A., and T. 2115 Jenkins, "YANG Notification Headers and Bundles", February 2116 2017, . 2119 [RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event 2120 Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, 2121 . 2123 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 2124 and A. Bierman, Ed., "Network Configuration Protocol 2125 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 2126 . 2128 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2129 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2130 DOI 10.17487/RFC7540, May 2015, 2131 . 2133 [RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements 2134 for Subscription to YANG Datastores", RFC 7923, 2135 DOI 10.17487/RFC7923, June 2016, 2136 . 2138 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 2139 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 2140 . 2142 Appendix A. Relationships to other drafts 2144 There are other related drafts which are progressing in the NETCONF 2145 WG. This section details the relationship of this draft to those 2146 others. 2148 A.1. ietf-netconf-netconf-event-notif 2150 The [I-D.ietf-netconf-restconf-notif] draft augments this subscribed- 2151 notifications specification by defining NETCONF transport specifics. 2152 Included are: 2154 o bindings for RPC communications and Event Notifications over 2155 NETCONF. 2157 o encoded examples 2159 A.2. ietf-netconf-restconf-notif 2161 The [I-D.ietf-netconf-restconf-notif] draft augments this subscribed- 2162 notifications specification by defining transport specific guidance 2163 where some form of HTTP is used underneath. Included are: 2165 o bindings for RPC communications over RESTCONF 2167 o bindings for Event Notifications over HTTP2 and HTTP1.1 2169 o encoded examples 2171 o end-to-end deployment guidance for Call Home and TLS Heartbeat 2173 A.3. ietf-netconf-yang-push 2175 The draft [I-D.ietf-netconf-yang-push] builds upon this subscribed- 2176 notifications specification in order to allow a Publisher to stream 2177 YANG datastore objects. In this case, the application of either an 2178 on-change or periodic triggers upon a YANG Datastore replace the 2179 system generated events within this document. 2181 If you wish to subscribe to a YANG datastore rather than a existing 2182 event stream on a publisher, please refer to this specification. 2184 A.4. voit-notifications2 2186 The draft [I-D.voit-notifications2] is not required to implement this 2187 subscribed-notifications specification. Instead it defines data 2188 plane notification elements which improve the delivered experience. 2189 The following capabilities are specified: 2191 o Defines common encapsulation headers objects to support 2192 functionality such as event severity, message signing, message 2193 loss discovery, message de-duplication, originating process 2194 identification. 2196 o Defines how to bundle multiple event records into a single 2197 notification message. 2199 These are the enhanced capabilies alluded to in the Event (Data 2200 Plane) Notification seciton above. This draft is not yet adopted by 2201 the NETCONF WG. 2203 Appendix B. Issues that are currently being worked and resolved 2205 (To be removed by RFC editor prior to publication) 2207 Issue #6: Data plane notifications and layered headers 2209 How to allow for seamless integration with non-standard encodings and 2210 transports (like GPB/GRPC). Specify requirements encoding and 2211 transport must meet, provide examples. 2213 Appendix C. Changes between revisions 2215 (To be removed by RFC editor prior to publication) 2217 v01 - v02 2219 o Subscription status moved under receiver. 2221 v00 - v01 2223 o Security considerations updated 2225 o Intro rewrite, as well as scattered text changes 2227 o Added Appendix A, to help match this to related drafts in progress 2229 o Updated filtering definitions, and filter types in yang file, and 2230 moved to identities for filter types 2232 o Added Syslog as a stream 2234 o HTTP2 moved in from YANG-Push as a transport option 2236 o Replay made an optional feature for events. Won't apply to 2237 datastores 2239 o Enabled notification timestamp to have different formats. 2241 o Two error codes added. 2243 v01 5277bis - v00 subscribed notifications 2245 o Kill subscription RPC added. 2247 o Renamed from 5277bis to Subscribed Notifications. 2249 o Changed the notification capabilities version from 1.1 to 2.0. 2251 o Extracted create-subscription and other elements of RFC5277. 2253 o Error conditions added, and made specific in return codes. 2255 o Simplified yang model structure for removal of 'basic' grouping. 2257 o Added a grouping for items which cannot be statically configured. 2259 o Operational counters per receiver. 2261 o Subscription-id and filter-id renamed to identifier 2263 o Section for replay added. Replay now cannot be configured. 2265 o Control plane notification renamed to subscription state 2266 notification 2268 o Source address: Source-vrf changed to string, default address 2269 option added 2271 o In yang model: 'info' changed to 'policy' 2273 o Scattered text clarifications 2275 v00 - v01 of 5277bis 2277 o YANG Model changes. New groupings for subscription info to allow 2278 restriction of what is changeable via RPC. Removed notifications 2279 for adding and removing receivers of configured subscriptions. 2281 o Expanded/renamed definitions from event server to publisher, and 2282 client to subscriber as applicable. Updated the definitions to 2283 include and expand on RFC 5277. 2285 o Removal of redundancy with other drafts 2287 o Many other clean-ups of wording and terminology 2289 Authors' Addresses 2291 Eric Voit 2292 Cisco Systems 2294 Email: evoit@cisco.com 2296 Alexander Clemm 2297 Huawei 2299 Email: ludwig@clemm.org 2301 Alberto Gonzalez Prieto 2302 Cisco Systems 2304 Email: albertgo@cisco.com 2306 Einar Nilsen-Nygaard 2307 Cisco Systems 2309 Email: einarnn@cisco.com 2311 Ambika Prasad Tripathy 2312 Cisco Systems 2314 Email: ambtripa@cisco.com