idnits 2.17.1 draft-ietf-netconf-subscribed-notifications-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** 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 14, 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 16, 2017 Huawei 6 A. Gonzalez Prieto 7 E. Nilsen-Nygaard 8 A. Tripathy 9 Cisco Systems 10 April 14, 2017 12 Custom Subscription to Event Notifications 13 draft-ietf-netconf-subscribed-notifications-01 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 16, 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 . . . . . . . . . . . 45 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 . . . . . . . . . . . . . . . . . . . 46 101 Appendix B. Issues that are currently being worked and resolved 47 102 Appendix C. Changes between revisions . . . . . . . . . . . . . 47 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 48 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, a 930 subscription status, as well as the various subscription parameters 931 that are in effect. The subscription status indicates whether the 932 subscription is currently active and healthy, or if it is degraded in 933 some form. Leaf "configured-subscription" indicates whether the 934 subscription came into being via configuration or via RPC. 936 Subscriptions that were established by RPC are removed from the list 937 once they expire (reaching stop-time) or when they are terminated. 938 Subscriptions that were established by configuration need to be 939 deleted from the configuration by a configuration editing operation 940 even if the stop time has been passed. 942 8.2. Capability Advertisement 944 Capabilities are advertised in messages sent by each peer during 945 session establishment [RFC6241]. Publishers supporting the features 946 in this document must advertise the capability 947 "urn:ietf:params:netconf:capability:notification:2.0". 949 The mechanism defined in this document is identified by 950 "urn:ietf:params:netconf:capability:notification:2.0". If a 951 subscriber only supports [RFC5277] and not this specification, then 952 they will recognize the capability 953 "urn:ietf:params:netconf:capability:notification:1.0" and ignore the 954 capability defined in this document. 956 8.3. Event Stream Discovery 958 A publisher maintains a list of available event streams as 959 operational data. This list contains both standardized and vendor- 960 specific event streams. A client can retrieve this list like any 961 other YANG-defined data, for example using the operation when 962 using NETCONF. 964 9. Data Model 966 file "ietf-subscribed-notifications.yang" 967 module ietf-subscribed-notifications { 968 namespace 969 "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; 971 prefix sn; 973 import ietf-yang-types { 974 prefix yang; 975 } 976 import ietf-inet-types { 977 prefix inet; 978 } 979 import ietf-interfaces { 980 prefix if; 981 } 983 organization "IETF"; 984 contact 985 "WG Web: 986 WG List: 987 WG Chair: Mahesh Jethanandani 988 990 WG Chair: Mehmet Ersue 991 993 Editor: Alexander Clemm 994 996 Editor: Eric Voit 997 999 Editor: Alberto Gonzalez Prieto 1000 1002 Editor: Einar Nilsen-Nygaard 1003 1005 Editor: Ambika Prasad Tripathy 1006 "; 1008 description 1009 "This module contains conceptual YANG specification for 1010 subscribing to events an receiving event notifications."; 1012 revision 2017-04-13 { 1013 description 1014 "Filtering and stream structures updated, replay a feature."; 1015 reference 1016 "draft-ietf-netconf-subscribed-notifications-01"; 1017 } 1019 /* 1020 * FEATURES 1021 */ 1023 feature json { 1024 description 1025 "This feature indicates that JSON encoding of notifications 1026 is supported."; 1027 } 1029 feature configured-subscriptions { 1030 description 1031 "This feature indicates that management plane configuration 1032 of subscription is supported."; 1033 } 1034 feature replay { 1035 description 1036 "This feature indicates that historical event replay is 1037 supported. With replay, it is possible for past events to be 1038 will be streamed in chronological order."; 1039 } 1041 /* 1042 * EXTENSIONS 1043 */ 1045 extension subscription-state-notif { 1046 description 1047 "This statement applies only to notifications. It indicates that 1048 the notification is a subscription state notification (aka OAM 1049 notification). Therefore it does not participate in a regular 1050 event stream and does not need to be specifically subscribed 1051 in order to receive notifications."; 1052 } 1054 /* 1055 * IDENTITIES 1056 */ 1058 /* Identities for streams */ 1059 identity stream { 1060 description 1061 "Base identity to represent a generic stream of event 1062 notifications exposed for subscription by a system."; 1063 } 1065 identity NETCONF { 1066 base stream; 1067 description 1068 "Default NETCONF event stream, containing events based on 1069 notifications defined as YANG modules that are supported by the 1070 system. As a historical reference, this contains the same set 1071 of events in a default RFC-5277 NETCONF stream."; 1072 } 1074 identity SYSLOG { 1075 base stream; 1076 description 1077 "A stream of events mirroring the discrete set entries 1078 concurrently being placed into a device's local Syslog."; 1079 } 1081 /* Identities for filters */ 1082 identity filter { 1083 description 1084 "Base identity to represent a filter. A filter is used to 1085 specify the data nodes used as match criteria against, objects, 1086 subtree/subtrees, of a target for the filter. A match with 1087 filter criteria will allow information to traverse the filter. "; 1088 } 1090 identity xpath { 1091 base filter; 1092 description 1093 "A filter which follows the syntax specified in yang:xpath1.0."; 1094 reference "XPATH: http://www.w3.org/TR/1999/REC-xpath-19991116"; 1095 } 1097 /* Identities for subscription results */ 1098 identity subscription-result { 1099 description 1100 "Base identity for RPC responses to requests surrounding 1101 management (e.g. creation, modification, deletion) of 1102 subscriptions."; 1103 } 1105 identity ok { 1106 base subscription-result; 1107 description 1108 "OK - RPC was successful and was performed as requested."; 1109 } 1111 identity error { 1112 base subscription-result; 1113 description 1114 "RPC was not successful. 1115 Base identity for error return codes."; 1116 } 1118 /* Identities for subscription stream status */ 1119 identity subscription-status { 1120 description 1121 "Base identity for the status of subscriptions and datastreams."; 1122 } 1124 identity active { 1125 base subscription-status; 1126 description 1127 "Status is active and healthy."; 1128 } 1129 identity inactive { 1130 base subscription-status; 1131 description 1132 "Status is inactive, for example outside the interval between 1133 start time and stop time."; 1134 } 1136 identity suspended { 1137 base subscription-status; 1138 description 1139 "The status is suspended, meaning that the publisher is currently 1140 unable to provide the negotiated updates for the subscription."; 1141 } 1143 identity in-error { 1144 base subscription-status; 1145 description 1146 "The status is in error or degraded, meaning that stream and/or 1147 subscription is currently unable to provide the negotiated 1148 notifications."; 1149 } 1151 /* Identities for subscription errors */ 1153 identity internal-error { 1154 base error; 1155 description 1156 "Error within publisher prohibits operation."; 1157 } 1159 identity suspension-timeout { 1160 base error; 1161 description 1162 "Termination of previously suspended subscription. The publisher 1163 has eliminated the subscription as it exceeded a time limit for 1164 suspension."; 1165 } 1167 identity stream-unavailable { 1168 base error; 1169 description 1170 "Stream does not exist or is not available to the receiver."; 1171 } 1173 identity encoding-unavailable { 1174 base error; 1175 description 1176 "Encoding not supported"; 1178 } 1180 identity replay-unsupported { 1181 base error; 1182 description 1183 "Replay cannot be performed for this subscription. The publisher 1184 does not provide the requested historic information via replay."; 1185 } 1187 identity history-unavailable { 1188 base error; 1189 description 1190 "Replay request too far into the past. The publisher does store 1191 historic information for all parts of requested subscription, but 1192 not back to the requested timestamp."; 1193 } 1195 identity filter-unavailable { 1196 base error; 1197 description 1198 "Referenced filter does not exist"; 1199 } 1201 identity filter-unsupported { 1202 base error; 1203 description 1204 "Cannot parse syntax within the filter. Failure can be from a 1205 syntax error, or a syntax too complex to be processed by the 1206 platform. The supplemental info should include the invalid part 1207 of the filter."; 1208 } 1210 identity namespace-unavailable { 1211 base error; 1212 description 1213 "Referenced namespace doesn't exist or is unavailable 1214 to the receiver."; 1215 } 1217 identity no-such-subscription { 1218 base error; 1219 description 1220 "Referenced subscription doesn't exist. This may be as a result of 1221 a non-existent subscription ID, an ID which belongs to another 1222 subscriber, or an ID for acceptable subscription which has been 1223 statically configured."; 1224 } 1225 identity error-insufficient-resources { 1226 base error; 1227 description 1228 "The server has insufficient resources to support the 1229 subscription as requested."; 1230 } 1232 identity error-no-such-option { 1233 base error; 1234 description 1235 "A requested parameter setting is not supported."; 1236 } 1238 /* Identities for encodings */ 1239 identity encodings { 1240 description 1241 "Base identity to represent data encodings"; 1242 } 1244 identity encode-xml { 1245 base encodings; 1246 description 1247 "Encode data using XML"; 1248 } 1250 identity encode-json { 1251 base encodings; 1252 description 1253 "Encode data using JSON"; 1254 } 1256 /* Identities for transports */ 1257 identity transport { 1258 description 1259 "An identity that represents a transport protocol for event 1260 notifications"; 1261 } 1263 identity netconf { 1264 base transport; 1265 description 1266 "Netconf notifications as a transport."; 1267 } 1269 identity http2 { 1270 base transport; 1271 description 1272 "HTTP2 notifications as a transport"; 1273 } 1275 /* 1276 * TYPEDEFs 1277 */ 1279 typedef subscription-id { 1280 type uint32; 1281 description 1282 "A type for subscription identifiers."; 1283 } 1285 typedef filter-id { 1286 type uint32; 1287 description 1288 "A type to identify filters which can be associated with a 1289 subscription."; 1290 } 1292 typedef subscription-result { 1293 type identityref { 1294 base subscription-result; 1295 } 1296 description 1297 "The result of a subscription operation"; 1298 } 1300 typedef subscription-errors { 1301 type identityref { 1302 base error; 1303 } 1304 description 1305 "The reason for the failure of an RPC request or the sending of a 1306 subscription suspension or termination notification"; 1307 } 1309 typedef encoding { 1310 type identityref { 1311 base encodings; 1312 } 1313 description 1314 "Specifies a data encoding, e.g. for a data subscription."; 1315 } 1317 typedef filter-type { 1318 type identityref { 1319 base filter; 1321 } 1322 description 1323 "Specifies a known type of filter."; 1324 } 1326 typedef subscription-status { 1327 type identityref { 1328 base subscription-status; 1329 } 1330 description 1331 "Specifies the status of a subscription."; 1332 } 1334 typedef transport-protocol { 1335 type identityref { 1336 base transport; 1337 } 1338 description 1339 "Specifies transport protocol used to send notifications to a 1340 receiver."; 1341 } 1343 typedef notification-origin { 1344 type enumeration { 1345 enum "interface-originated" { 1346 description 1347 "Notifications will be sent from a specific interface on a 1348 publisher"; 1349 } 1350 enum "address-originated" { 1351 description 1352 "Notifications will be sent from a specific address on a 1353 publisher"; 1354 } 1355 } 1356 description 1357 "Specifies from where notifications will be sourced when 1358 being sent by the publisher."; 1359 } 1361 typedef stream { 1362 type identityref { 1363 base stream; 1364 } 1365 description 1366 "Specifies a system-provided datastream."; 1367 } 1368 typedef filter-ref { 1369 type leafref { 1370 path "/sn:filters/sn:filter/sn:identifier"; 1371 } 1372 description 1373 "This type is used to reference a filter."; 1374 } 1376 /* 1377 * GROUPINGS 1378 */ 1380 grouping base-filter { 1381 description 1382 "This grouping defines the base for filters for notification 1383 events."; 1384 leaf filter-type { 1385 type filter-type; 1386 mandatory true; 1387 description 1388 "A filter needs to be a known and understood syntax if it is to 1389 be interpretable by a device."; 1390 } 1391 anyxml filter { 1392 mandatory true; 1393 description 1394 "Filter where the syntax is of type filter-type. If the filter 1395 is applied against a stream and the match criteria are not met, 1396 excludes the entire event from being passed along."; 1397 } 1398 } 1400 grouping subscription-policy-non-modifiable { 1401 description 1402 "This grouping describes the information in a subscription which 1403 should not change during the life of the subscription."; 1404 leaf encoding { 1405 type encoding; 1406 default "encode-xml"; 1407 description 1408 "The type of encoding for the subscribed data. Default is XML"; 1409 } 1410 choice target { 1411 mandatory true; 1412 description 1413 "A filter must be applied against some source of information. 1414 This identifies the target for the filter."; 1415 case event-stream { 1416 leaf stream { 1417 type stream; 1418 mandatory true; 1419 description 1420 "Indicates a stream of events against which to apply 1421 a filter."; 1422 } 1423 } 1424 } 1425 } 1427 grouping subscription-policy-modifiable { 1428 description 1429 "This grouping describes all objects which may be changed 1430 in a subscription via an RPC."; 1431 choice applied-filter { 1432 mandatory true; 1433 description 1434 "A filter must be applied to a subscription. And that filter 1435 will come either referenced from a global list, or be provided 1436 within the subscription itself."; 1437 case by-reference { 1438 description 1439 "Incorporate a filter that has been configured separately."; 1440 leaf filter-ref { 1441 type filter-ref; 1442 mandatory true; 1443 description 1444 "References an existing filter which is to be applied to 1445 the subscription."; 1446 } 1447 } 1448 case locally-configured { 1449 uses base-filter; 1450 description 1451 "Local definition allows a filter to have the same lifecycle 1452 as the subscription."; 1453 } 1454 } 1455 leaf stop-time { 1456 type yang:date-and-time; 1457 description 1458 "Identifies a time after which notification events should not 1459 be sent. If stop-time is not present, the notifications will 1460 continue until the subscription is terminated. If 1461 replay-start-time exists, stop-time must for a subsequent time. 1462 If replay-start-time doesn't exist, stop-time must for a future 1463 time."; 1465 } 1466 } 1468 grouping subscription-policy { 1469 description 1470 "This grouping describes information concerning a subscription."; 1471 uses subscription-policy-non-modifiable { 1472 augment target/event-stream { 1473 description 1474 "Adds additional objects which must be set just by RPC."; 1475 leaf replay-start-time { 1476 if-feature "replay"; 1477 type yang:date-and-time; 1478 description 1479 "Used to trigger the replay feature and indicate that the 1480 replay should start at the time specified. If 1481 replay-start-time is not present, this is not a replay 1482 subscription and event pushes should start immediately. It 1483 is never valid to specify start times that are later than 1484 or equal to the current time."; 1485 } 1486 } 1487 } 1488 uses subscription-policy-modifiable; 1489 } 1491 grouping notification-origin-info { 1492 description 1493 "Defines the sender source from which notifications for a 1494 configured subscription are sent."; 1495 choice notification-origin { 1496 description 1497 "Identifies the egress interface on the Publisher from which 1498 notifications will or are being sent."; 1499 case interface-originated { 1500 description 1501 "When the push source is out of an interface on the 1502 Publisher established via static configuration."; 1503 leaf source-interface { 1504 type if:interface-ref; 1505 description 1506 "References the interface for notifications."; 1507 } 1508 } 1509 case address-originated { 1510 description 1511 "When the push source is out of an IP address on the 1512 Publisher established via static configuration."; 1514 leaf source-vrf { 1515 type string; 1516 description 1517 "Network instance name for the VRF. This could also have 1518 been a leafref to draft-ietf-rtgwg-ni-model, but that model 1519 in not complete, and may not be implemented on a box."; 1520 } 1521 leaf source-address { 1522 type inet:ip-address-no-zone; 1523 mandatory true; 1524 description 1525 "The source address for the notifications."; 1526 } 1527 } 1528 } 1529 } 1531 grouping receiver-info { 1532 description 1533 "Defines where and how to get notifications for a configured 1534 subscriptions to one or more targeted recipient. This includes 1535 specifying the destination addressing as well as a transport 1536 protocol acceptable to the receiver."; 1537 container receivers { 1538 description 1539 "Set of receivers in a subscription."; 1540 list receiver { 1541 key "address port"; 1542 min-elements 1; 1543 description 1544 "A single host or multipoint address intended as a target 1545 for the notifications for a subscription."; 1546 leaf address { 1547 type inet:host; 1548 mandatory true; 1549 description 1550 "Specifies the address for the traffic to reach a remote 1551 host. One of the following must be specified: an ipv4 1552 address, an ipv6 address, or a host name."; 1553 } 1554 leaf port { 1555 type inet:port-number; 1556 mandatory true; 1557 description 1558 "This leaf specifies the port number to use for messages 1559 destined for a receiver."; 1560 } 1561 leaf protocol { 1562 type transport-protocol; 1563 default "netconf"; 1564 description 1565 "This leaf specifies the transport protocol used 1566 to deliver messages destined for the receiver. Each 1567 protocol may use the address and port information 1568 differently as applicable."; 1569 } 1570 } 1571 } 1572 } 1574 grouping error-identifier { 1575 description 1576 "A code passed back within an RPC response to describe why the RFC 1577 has failed, or within a state change notification to describe why 1578 the change has occurred."; 1579 leaf error-id { 1580 type subscription-errors; 1581 mandatory true; 1582 description 1583 "Identifies the subscription error condition."; 1584 } 1585 } 1587 grouping error-hints { 1588 description 1589 "Objects passed back within an RPC response to describe why the 1590 RFC has failed, or within a state change notification to 1591 describe why the change has occurred."; 1592 leaf filter-failure { 1593 type string; 1594 description 1595 "Information describing where and/or why a provided filter was 1596 unsupportable for a subscription."; 1597 } 1598 } 1600 grouping subscription-response-with-hints { 1601 description 1602 "Defines the output for the establish-subscription and 1603 modify-subscription RPCs."; 1604 leaf subscription-result { 1605 type subscription-result; 1606 mandatory true; 1607 description 1608 "Indicates whether subscription is operational, or if a problem 1609 was encountered."; 1611 } 1612 choice result { 1613 description 1614 "Depending on the subscription result, different data is 1615 returned."; 1616 case no-success { 1617 description 1618 "This case applies when a subscription request was not 1619 successful and no subscription was created (or modified) as a 1620 result. In this case, information MAY be returned that 1621 indicates suggested parameter settings that would have a 1622 high likelihood of succeeding in a subsequent establish- 1623 subscription or modify-subscription request."; 1624 uses error-hints; 1625 } 1626 } 1627 } 1629 /* 1630 * RPCs 1631 */ 1633 rpc establish-subscription { 1634 description 1635 "This RPC allows a subscriber to create (and possibly negotiate) 1636 a subscription on its own behalf. If successful, the 1637 subscription remains in effect for the duration of the 1638 subscriber's association with the publisher, or until the 1639 subscription is terminated. In case an error (as indicated by 1640 subscription-result) is returned, the subscription is not 1641 created. In that case, the RPC output MAY include suggested 1642 parameter settings that would have a high likelihood of 1643 succeeding in a subsequent establish-subscription request."; 1644 input { 1645 uses subscription-policy; 1646 } 1647 output { 1648 uses subscription-response-with-hints { 1649 augment "result" { 1650 description 1651 "Allows information to be passed back as part of a 1652 successful subscription establishment."; 1653 case success { 1654 description 1655 "This case is used when the subscription request was 1656 successful."; 1657 leaf identifier { 1658 type subscription-id; 1659 mandatory true; 1660 description 1661 "Identifier used for this subscription."; 1662 } 1663 } 1664 } 1665 augment "result/no-success" { 1666 description 1667 "Contains establish RPC specific objects which can be 1668 returned as hints for future attempts."; 1669 leaf replay-start-time-hint { 1670 type yang:date-and-time; 1671 description 1672 "If a replay has been requested, but the requested replay 1673 time cannot be honored, this may provide a hint at an 1674 alternate time which may be supportable."; 1675 } 1676 } 1677 } 1678 } 1679 } 1681 rpc modify-subscription { 1682 description 1683 "This RPC allows a subscriber to modify a subscription that was 1684 previously created using establish-subscription. If successful, 1685 the changed subscription remains in effect for the duration of 1686 the subscriber's association with the publisher, or until the 1687 subscription is again modified or terminated. In case an error 1688 is returned (as indicated by subscription-result), the 1689 subscription is not modified and the original subscription 1690 parameters remain in effect. In that case, the rpc error 1691 response MAY include suggested parameter hints that would have 1692 a high likelihood of succeeding in a subsequent 1693 modify-subscription request."; 1694 input { 1695 leaf identifier { 1696 type subscription-id; 1697 description 1698 "Identifier to use for this subscription."; 1699 } 1700 uses subscription-policy-modifiable; 1701 } 1702 output { 1703 uses subscription-response-with-hints; 1704 } 1705 } 1706 rpc delete-subscription { 1707 description 1708 "This RPC allows a subscriber to delete a subscription that 1709 was previously created from by that same subscriber using the 1710 establish-subscription RPC."; 1711 input { 1712 leaf identifier { 1713 type subscription-id; 1714 mandatory true; 1715 description 1716 "Identifier of the subscription that is to be deleted. 1717 Only subscriptions that were created using 1718 establish-subscription can be deleted via this RPC."; 1719 } 1720 } 1721 output { 1722 leaf subscription-result { 1723 type subscription-result; 1724 mandatory true; 1725 description 1726 "Indicates whether subscription is operational, or if a 1727 problem was encountered."; 1728 } 1729 } 1730 } 1732 rpc kill-subscription { 1733 description 1734 "This RPC allows an operator to delete a dynamic subscription 1735 without restrictions on the originating subscriber or underlying 1736 transport session."; 1737 input { 1738 leaf identifier { 1739 type subscription-id; 1740 mandatory true; 1741 description 1742 "Identifier of the subscription that is to be deleted. Only 1743 subscriptions that were created using establish-subscription 1744 can be deleted via this RPC."; 1745 } 1746 } 1747 output { 1748 leaf subscription-result { 1749 type subscription-result; 1750 mandatory true; 1751 description 1752 "Indicates whether subscription is operational, or if a 1753 problem was encountered."; 1755 } 1756 } 1757 } 1759 /* 1760 * NOTIFICATIONS 1761 */ 1763 notification replay-complete { 1764 sn:subscription-state-notif; 1765 description 1766 "This notification is sent to indicate that all of the replay 1767 notifications have been sent. It must not be sent for any other 1768 reason."; 1769 leaf identifier { 1770 type subscription-id; 1771 mandatory true; 1772 description 1773 "This references the affected subscription."; 1774 } 1775 } 1777 notification notification-complete { 1778 sn:subscription-state-notif; 1779 description 1780 "This notification is sent to indicate that a subscription, has 1781 finished passing events."; 1782 leaf identifier { 1783 type subscription-id; 1784 mandatory true; 1785 description 1786 "This references the affected subscription."; 1787 } 1788 } 1790 notification subscription-started { 1791 sn:subscription-state-notif; 1792 description 1793 "This notification indicates that a subscription has started and 1794 notifications are beginning to be sent. This notification shall 1795 only be sent to receivers of a subscription; it does not 1796 constitute a general-purpose notification."; 1797 leaf identifier { 1798 type subscription-id; 1799 mandatory true; 1800 description 1801 "This references the affected subscription."; 1802 } 1803 uses subscription-policy; 1804 } 1806 notification subscription-resumed { 1807 sn:subscription-state-notif; 1808 description 1809 "This notification indicates that a subscription that had 1810 previously been suspended has resumed. Notifications will once 1811 again be sent."; 1812 leaf identifier { 1813 type subscription-id; 1814 mandatory true; 1815 description 1816 "This references the affected subscription."; 1817 } 1818 } 1820 notification subscription-modified { 1821 sn:subscription-state-notif; 1822 description 1823 "This notification indicates that a subscription has been 1824 modified. Notifications sent from this point on will conform to 1825 the modified terms of the subscription. For completeness, this 1826 notification includes both modified and non-modified aspects of 1827 a subscription "; 1828 leaf identifier { 1829 type subscription-id; 1830 mandatory true; 1831 description 1832 "This references the affected subscription."; 1833 } 1834 uses subscription-policy; 1835 } 1837 notification subscription-terminated { 1838 sn:subscription-state-notif; 1839 description 1840 "This notification indicates that a subscription has been 1841 terminated."; 1842 leaf identifier { 1843 type subscription-id; 1844 mandatory true; 1845 description 1846 "This references the affected subscription."; 1847 } 1848 uses error-identifier; 1849 uses error-hints; 1850 } 1851 notification subscription-suspended { 1852 sn:subscription-state-notif; 1853 description 1854 "This notification indicates that a suspension of the 1855 subscription by the publisher has occurred. No further 1856 notifications will be sent until the subscription resumes. 1857 This notification shall only be sent to receivers of a 1858 subscription; it does not constitute a general-purpose 1859 notification."; 1860 leaf identifier { 1861 type subscription-id; 1862 mandatory true; 1863 description 1864 "This references the affected subscription."; 1865 } 1866 uses error-identifier; 1867 uses error-hints; 1868 } 1870 /* 1871 * DATA NODES 1872 */ 1874 container filters { 1875 description 1876 "This container contains a list of configurable filters 1877 that can be applied to subscriptions. This facilitates 1878 the reuse of complex filters once defined."; 1879 list filter { 1880 key "identifier"; 1881 description 1882 "A list of configurable filters that can be applied to 1883 subscriptions."; 1884 leaf identifier { 1885 type filter-id; 1886 description 1887 "An identifier to differentiate between filters."; 1888 } 1889 uses base-filter; 1890 } 1891 } 1892 container subscription-config { 1893 if-feature "configured-subscriptions"; 1894 description 1895 "Contains the list of subscriptions that are configured, 1896 as opposed to established via RPC or other means."; 1897 list subscription { 1898 key "identifier"; 1899 description 1900 "Content of a subscription."; 1901 leaf identifier { 1902 type subscription-id; 1903 description 1904 "Identifier to use for this subscription."; 1905 } 1906 uses subscription-policy-non-modifiable; 1907 uses subscription-policy-modifiable; 1908 uses receiver-info { 1909 if-feature "configured-subscriptions"; 1910 } 1911 uses notification-origin-info { 1912 if-feature "configured-subscriptions"; 1913 } 1914 } 1915 } 1916 container subscriptions { 1917 config false; 1918 description 1919 "Contains the list of currently active subscriptions, i.e. 1920 subscriptions that are currently in effect, used for subscription 1921 management and monitoring purposes. This includes subscriptions 1922 that have been setup via RPC primitives as well as subscriptions 1923 that have been established via configuration."; 1924 list subscription { 1925 key "identifier"; 1926 config false; 1927 description 1928 "Content of a subscription. Subscriptions can be created using 1929 a control channel or RPC, or be established through 1930 configuration."; 1931 leaf identifier { 1932 type subscription-id; 1933 description 1934 "Identifier of this subscription."; 1935 } 1936 leaf configured-subscription { 1937 if-feature "configured-subscriptions"; 1938 type empty; 1939 description 1940 "The presence of this leaf indicates that the subscription 1941 originated from configuration, not through a control channel 1942 or RPC."; 1943 } 1944 uses subscription-policy; 1945 uses notification-origin-info { 1946 if-feature "configured-subscriptions"; 1948 } 1949 uses receiver-info { 1950 refine receivers/receiver { 1951 min-elements "1"; 1952 } 1953 augment receivers/receiver { 1954 description 1955 "include operational data on configured receivers."; 1956 leaf pushed-notifications { 1957 type yang:counter64; 1958 description 1959 "Operational data which provides the number of update 1960 notifications pushed to a receiver."; 1961 } 1962 leaf excluded-notifications { 1963 type yang:counter64; 1964 description 1965 "Operational data which provides the number of non- 1966 datastore update notifications explicitly removed via 1967 filtering so that they are not sent to a receiver."; 1968 } 1969 } 1970 } 1971 leaf subscription-status { 1972 type subscription-status; 1973 description 1974 "The status of the subscription."; 1975 } 1976 } 1977 } 1978 } 1979 1981 10. Considerations 1983 10.1. Implementation Considerations 1985 For a deployment including both configured and dynamic subscriptions, 1986 split subscription identifiers into static and dynamic halves. That 1987 way there should not be collisions if the configured subscriptions 1988 attempt to set a subscription-id which might have already been 1989 dynamically allocated. 1991 The elements are never sent before the transport 1992 layer, including capabilities exchange, has been established. 1994 10.2. Security Considerations 1996 For dynamic subscriptions the publisher must authenticate and 1997 authorize all RPC requests. 1999 Subscriptions could overload a publisher's CPU. For this reason, the 2000 publisher must have the ability to decline a dynamic subscription 2001 request, and provide the appropriate RPC error response to a 2002 subscriber should the proposed subscription overly deplete the 2003 publisher's resources. 2005 A publisher needs to be able to suspend an existing dynamic or 2006 configured subscription based on capacity constraints. When this 2007 occur, the subscription status must be updated accordingly and the 2008 receivers notified with subscription state notifications. 2010 If a malicious or buggy subscriber sends an unexpectedly large number 2011 of RPCs, this may use up system resources. In such a situation, 2012 subscription interactions may be terminated by terminating the 2013 transport session. 2015 For both configured and dynamic subscriptions the publisher must 2016 authenticate and authorize a receiver via some transport level 2017 mechanism before sending any updates. 2019 A secure transport is highly recommended and the publisher must 2020 ensure that the user has sufficient authorization to perform the 2021 function they are requesting against the specific subset of content 2022 involved. 2024 A publisher MUST NOT include any content in a notification for which 2025 the user has not been authorized. 2027 With configured subscriptions, one or more publishers could be used 2028 to overwhelm a receiver. No push updates should be sent to any 2029 receiver which doesn't even support subscriptions. Subscribers that 2030 do not want pushed data need only terminate or refuse any transport 2031 sessions from the publisher. 2033 The NETCONF Authorization Control Model [RFC6536] SHOULD be used to 2034 control and restrict authorization of subscription configuration. 2035 This control models permits specifying per-user permissions to 2036 receive events from specific streams. 2038 Where NACM is available, the NACM "very-secure" tag should be placed 2039 on the RPC so that only administrators can 2040 access. 2042 One subscription id can be used for two or more receivers of the same 2043 configured subscription. But due to the possibility of different 2044 access control permissions per receiver, it should not be assumed 2045 that each receiver is getting identical updates. 2047 11. Acknowledgments 2049 For their valuable comments, discussions, and feedback, we wish to 2050 acknowledge Andy Bierman, Tim Jenkins, Balazs Lengyel, Sharon 2051 Chisholm, Hector Trevino, Susan Hares, Kent Watsen, Michael Scharf, 2052 and Guangying Zheng. 2054 12. References 2056 12.1. Normative References 2058 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2059 Requirement Levels", BCP 14, RFC 2119, 2060 DOI 10.17487/RFC2119, March 1997, 2061 . 2063 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 2064 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 2065 . 2067 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 2068 Protocol (NETCONF) Access Control Model", RFC 6536, 2069 DOI 10.17487/RFC6536, March 2012, 2070 . 2072 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2073 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2074 . 2076 [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) 2077 Version 1.0", November 1999, 2078 . 2080 12.2. Informative References 2082 [I-D.ietf-netconf-netconf-event-notif] 2083 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 2084 Nilsen-Nygaard, E., Tripathy, A., Chisholm, S., and H. 2085 Trevino, "NETCONF support for event notifications", August 2086 2016, . 2089 [I-D.ietf-netconf-restconf-notif] 2090 Voit, Eric., Clemm, Alexander., Tripathy, A., Nilsen- 2091 Nygaard, E., and Alberto. Gonzalez Prieto, "Restconf and 2092 HTTP transport for event notifications", August 2016, 2093 . 2096 [I-D.ietf-netconf-yang-push] 2097 Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., 2098 Tripathy, A., Nilsen-Nygaard, E., Bierman, A., and B. 2099 Lengyel, "Subscribing to YANG datastore push updates", 2100 February 2017, . 2103 [I-D.voit-notifications2] 2104 Voit, Eric., Clemm, Alexander., Bierman, A., and T. 2105 Jenkins, "YANG Notification Headers and Bundles", February 2106 2017, . 2109 [RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event 2110 Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, 2111 . 2113 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 2114 and A. Bierman, Ed., "Network Configuration Protocol 2115 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 2116 . 2118 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2119 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2120 DOI 10.17487/RFC7540, May 2015, 2121 . 2123 [RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements 2124 for Subscription to YANG Datastores", RFC 7923, 2125 DOI 10.17487/RFC7923, June 2016, 2126 . 2128 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 2129 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 2130 . 2132 Appendix A. Relationships to other drafts 2134 There are other related drafts which are progressing in the NETCONF 2135 WG. This section details the relationship of this draft to those 2136 others. 2138 A.1. ietf-netconf-netconf-event-notif 2140 The [I-D.ietf-netconf-restconf-notif] draft augments this subscribed- 2141 notifications specification by defining NETCONF transport specifics. 2142 Included are: 2144 o bindings for RPC communications and Event Notifications over 2145 NETCONF. 2147 o encoded examples 2149 A.2. ietf-netconf-restconf-notif 2151 The [I-D.ietf-netconf-restconf-notif] draft augments this subscribed- 2152 notifications specification by defining transport specific guidance 2153 where some form of HTTP is used underneath. Included are: 2155 o bindings for RPC communications over RESTCONF 2157 o bindings for Event Notifications over HTTP2 and HTTP1.1 2159 o encoded examples 2161 o end-to-end deployment guidance for Call Home and TLS Heartbeat 2163 A.3. ietf-netconf-yang-push 2165 The draft [I-D.ietf-netconf-yang-push] builds upon this subscribed- 2166 notifications specification in order to allow a Publisher to stream 2167 YANG datastore objects. In this case, the application of either an 2168 on-change or periodic triggers upon a YANG Datastore replace the 2169 system generated events within this document. 2171 If you wish to subscribe to a YANG datastore rather than a existing 2172 event stream on a publisher, please refer to this specification. 2174 A.4. voit-notifications2 2176 The draft [I-D.voit-notifications2] is not required to implement this 2177 subscribed-notifications specification. Instead it defines data 2178 plane notification elements which improve the delivered experience. 2179 The following capabilities are specified: 2181 o Defines common encapsulation headers objects to support 2182 functionality such as event severity, message signing, message 2183 loss discovery, message de-duplication, originating process 2184 identification. 2186 o Defines how to bundle multiple event records into a single 2187 notification message. 2189 These are the enhanced capabilies alluded to in the Event (Data 2190 Plane) Notification seciton above. This draft is not yet adopted by 2191 the NETCONF WG. 2193 Appendix B. Issues that are currently being worked and resolved 2195 (To be removed by RFC editor prior to publication) 2197 Issue #6: Data plane notifications and layered headers 2199 How to allow for seamless integration with non-standard encodings and 2200 transports (like GPB/GRPC). Specify requirements encoding and 2201 transport must meet, provide examples. 2203 Appendix C. Changes between revisions 2205 (To be removed by RFC editor prior to publication) 2207 v00 - v01 2209 o Security considerations updated 2211 o Intro rewrite, as well as scattered text changes 2213 o Added Appendix A, to help match this to related drafts in progress 2215 o Updated filtering definitions, and filter types in yang file, and 2216 moved to identities for filter types 2218 o Added Syslog as a stream 2220 o HTTP2 moved in from YANG-Push as a transport option 2222 o Replay made an optional feature for events. Won't apply to 2223 datastores 2225 o Enabled notification timestamp to have different formats. 2227 o Two error codes added. 2229 v01 5277bis - v00 subscribed notifications 2231 o Kill subscription RPC added. 2233 o Renamed from 5277bis to Subscribed Notifications. 2235 o Changed the notification capabilities version from 1.1 to 2.0. 2237 o Extracted create-subscription and other elements of RFC5277. 2239 o Error conditions added, and made specific in return codes. 2241 o Simplified yang model structure for removal of 'basic' grouping. 2243 o Added a grouping for items which cannot be statically configured. 2245 o Operational counters per receiver. 2247 o Subscription-id and filter-id renamed to identifier 2249 o Section for replay added. Replay now cannot be configured. 2251 o Control plane notification renamed to subscription state 2252 notification 2254 o Source address: Source-vrf changed to string, default address 2255 option added 2257 o In yang model: 'info' changed to 'policy' 2259 o Scattered text clarifications 2261 v00 - v01 of 5277bis 2263 o YANG Model changes. New groupings for subscription info to allow 2264 restriction of what is changeable via RPC. Removed notifications 2265 for adding and removing receivers of configured subscriptions. 2267 o Expanded/renamed definitions from event server to publisher, and 2268 client to subscriber as applicable. Updated the definitions to 2269 include and expand on RFC 5277. 2271 o Removal of redundancy with other drafts 2273 o Many other clean-ups of wording and terminology 2275 Authors' Addresses 2277 Eric Voit 2278 Cisco Systems 2280 Email: evoit@cisco.com 2281 Alexander Clemm 2282 Huawei 2284 Email: ludwig@clemm.org 2286 Alberto Gonzalez Prieto 2287 Cisco Systems 2289 Email: albertgo@cisco.com 2291 Einar Nilsen-Nygaard 2292 Cisco Systems 2294 Email: einarnn@cisco.com 2296 Ambika Prasad Tripathy 2297 Cisco Systems 2299 Email: ambtripa@cisco.com