-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-ietf-netconf-subscribed-notifications-06.txt
2910 lines (2185 loc) · 103 KB
/
draft-ietf-netconf-subscribed-notifications-06.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
PRE-Release working version (sourced from Github)
NETCONF E. Voit
Internet-Draft Cisco Systems
Intended status: Standards Track A. Clemm
Expires: April 26, 2018 Huawei
A. Gonzalez Prieto
VMWare
E. Nilsen-Nygaard
A. Tripathy
Cisco Systems
October 23, 2017
Custom Subscription to Event Streams
draft-ietf-netconf-subscribed-notifications-06
Abstract
This document defines capabilities and operations for the customized
establishment of subscriptions upon a publisher's event streams.
Also defined are delivery mechanisms for instances of the resulting
notification messages. Effectively this allows a subscriber to
request and receive a continuous, custom feed of publisher generated
information.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 26, 2018.
Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
Voit, et al. Expires April 26, 2018 [Page 1]
Internet-Draft Subscribed Notifications October 2017
(https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Solution Overview . . . . . . . . . . . . . . . . . . . . 5
1.4. Relationship to RFC-5277 . . . . . . . . . . . . . . . . 6
2. Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Event Streams . . . . . . . . . . . . . . . . . . . . . . 6
2.2. Event Stream Filters . . . . . . . . . . . . . . . . . . 7
2.3. Subscription State Model at the Publisher . . . . . . . . 7
3. Data Model Trees . . . . . . . . . . . . . . . . . . . . . . 9
4. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . . . 14
4.1. Establishing a Subscription . . . . . . . . . . . . . . . 14
4.2. Modifying a Subscription . . . . . . . . . . . . . . . . 16
4.3. Deleting a Subscription . . . . . . . . . . . . . . . . . 16
4.4. Killing a Subscription . . . . . . . . . . . . . . . . . 16
5. Configured Subscriptions . . . . . . . . . . . . . . . . . . 17
5.1. Creating a Configured Subscription . . . . . . . . . . . 17
5.2. Modifying a Configured Subscription . . . . . . . . . . . 19
5.3. Deleting a Configured Subscription . . . . . . . . . . . 20
6. Deleting a Configured Subscription . . . . . . . . . . . . . 20
7. Asynchronous Subscribed Event Delivery . . . . . . . . . . . 20
8. Subscription State Notifications . . . . . . . . . . . . . . 21
8.1. subscription-started . . . . . . . . . . . . . . . . . . 21
8.2. subscription-modified . . . . . . . . . . . . . . . . . . 22
8.3. subscription-terminated . . . . . . . . . . . . . . . . . 22
8.4. subscription-suspended . . . . . . . . . . . . . . . . . 22
8.5. subscription-resumed . . . . . . . . . . . . . . . . . . 22
8.6. subscription-completed . . . . . . . . . . . . . . . . . 23
8.7. replay-completed . . . . . . . . . . . . . . . . . . . . 23
9. Administrative Functions . . . . . . . . . . . . . . . . . . 23
9.1. Subscription Monitoring . . . . . . . . . . . . . . . . . 23
9.2. Advertisement . . . . . . . . . . . . . . . . . . . . . . 24
9.3. Event Stream Discovery . . . . . . . . . . . . . . . . . 24
10. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 24
11. Considerations . . . . . . . . . . . . . . . . . . . . . . . 46
11.1. Implementation Considerations . . . . . . . . . . . . . 46
11.2. Security Considerations . . . . . . . . . . . . . . . . 46
12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 47
Voit, et al. Expires April 26, 2018 [Page 2]
Internet-Draft Subscribed Notifications October 2017
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 48
13.1. Normative References . . . . . . . . . . . . . . . . . . 48
13.2. Informative References . . . . . . . . . . . . . . . . . 48
Appendix A. Changes between revisions . . . . . . . . . . . . . 49
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 52
1. Introduction
This document defines capabilities and operations for the customized
establishment of subscriptions upon system generated event streams.
Effectively this enables a "Subscribe then Publish" capability where
the customized information needs of each target receiver are
understood by the publisher before subscribed event records are
marshalled and pushed. The receiver then gets a continuous, custom
feed of publisher generated information.
While the functionality defined in this document is transport-
agnostic, protocols like NETCONF [RFC6241] or RESTCONF [RFC8040] can
be used to configure or dynamically signal subscriptions, and there
are bindings defined for subscribed event record delivery for NETCONF
within [I-D.draft-ietf-netconf-netconf-event-notifications], and for
HTTP2 or HTTP1.1 within [I-D.draft-ietf-netconf-restconf-notif].
1.1. Motivation
There are various [RFC5277] limitations, many of which have been
exposed in [RFC7923] which needed to be solved. Key capabilities
supported by this document include:
o multiple subscriptions on a single transport session
o support for dynamic and statically configured subscriptions
o modification of an existing subscription
o operational counters and instrumentation
o negotiation of subscription parameters (through the use of hints
returned as part of declined subscription requests)
o state change notifications (e.g., publisher driven suspension,
parameter modification)
o independence from transport protocol
Voit, et al. Expires April 26, 2018 [Page 3]
Internet-Draft Subscribed Notifications October 2017
1.2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
Configured subscription: A subscription installed via a configuration
interface which persists across reboots.
Dynamic subscription: A subscription agreed between subscriber and
publisher created via RPC subscription state signaling messages.
Event: An occurrence of something that may be of interest. (e.g., a
configuration change, a fault, a change in status, crossing a
threshold, or an external input to the system.)
Event record: A set of information detailing an event.
Event filter: Evaluation criteria which may be applied against a
event records. Event records pass the filter when specified filter
criteria are met.
NACM: NETCONF Access Control Model.
Notification message: A set of information intended for a receiver
indicating that one or more event(s) have occurred. A notification
message may include event records.
Publisher: An entity responsible for streaming notification messages
per the terms of a Subscription.
Receiver: A target to which a publisher pushes subscribed event
records. For dynamic subscriptions, the receiver and subscriber are
the same entity.
Stream (also referred to as "event stream"): A continuous ordered set
of events aggregated under some context.
Subscribed event records: Event records which have met the terms of
the subscription. This include terms (such as security checks)
enforced by the publisher.
Subscriber: An entity able to request and negotiate a contract for
the generation and push of event records from a publisher.
Subscription: A contract with a publisher, stipulating which
information one or more receivers wish to have pushed from the
publisher without the need for further solicitation.
Voit, et al. Expires April 26, 2018 [Page 4]
Internet-Draft Subscribed Notifications October 2017
1.3. Solution Overview
This document describes a transport agnostic mechanism for
subscribing to and receiving content from a stream instantiated
within a publisher. This mechanism is through the use of a
subscription.
Two types of subscriptions are supported:
1. Dynamic subscriptions, where a subscriber initiates a
subscription negotiation with a publisher via RPC. If the
publisher wants to serve this request, it accepts it, and then
starts pushing notification messages. If the publisher does not
wish to serve it as requested, then an error response is
returned. This response MAY include hints at subscription
parameters which would have been accepted.
2. Configured subscriptions, which allow the management of
subscriptions via a configuration interface so that a publisher
can send notification messages to configured receiver(s).
Support for this capability is optional.
Additional characteristics differentiating configured from dynamic
subscriptions include:
o The lifetime of a dynamic subscription is bounded by the transport
session used to establish it. For connection-oriented stateful
transport like NETCONF, the loss of the transport session will
result in the immediate termination of associated dynamic
subscriptions. For connectionless or stateless transports like
HTTP, it is the lack of receipt acknowledgement of a sequential
set of notification messages and/or keep-alives which will
terminate dynamic subscriptions. The lifetime of a configured
subscription is driven by relevant configuration being present on
the running configuration. This implies configured subscriptions
persist across reboots, and persist even when transport is
unavailable.
o Configured subscriptions can be modified by any configuration
client with write permission on the configuration of the
subscription. Dynamic subscriptions can only be modified via an
RPC request made upon the original subscribing transport session.
Note that there is no mixing-and-matching of dynamic and configured
subscriptions. Specifically, a configured subscription cannot be
modified or deleted using RPC. Similarly, a subscription established
via RPC cannot be modified through configuration operations (if
needed, an operator may use a kill RPC however).
Voit, et al. Expires April 26, 2018 [Page 5]
Internet-Draft Subscribed Notifications October 2017
The publisher MAY decide to terminate a dynamic subscription at any
time. Similarly, it MAY decide to temporarily suspend the sending of
notification messages for either configured or dynamic subscriptions.
Such termination or suspension MAY be driven by the publisher running
out of resources to serve the subscription, or by internal errors on
the publisher.
1.4. Relationship to RFC-5277
This document is intended to provide a superset of the subscription
capabilities initially defined within [RFC5277]. Especially when
extending an existing [RFC5277] implementation, it is important to
understand what has been reused and what has been replaced. Key
realtionships between these two documents include:
o the data model in this document replaces the data model in
[RFC5277].
o the RPC operations in this draft replaces the symetrical
operations of [RFC5277], section 4.
o the one way operation of [RFC5277] is still used. However this
operation will no longer be required with the availability of
[I.D.draft-ietf-netconf-notification-messages].
o the definition and contents of the NETCONF stream are identical
between this document and [RFC5277].
o a publisher MAY implement both the data model and RPCs defined in
[RFC5277] and this new document concurrently, in order to support
old clients. However the use of both alternatives on a single
transport session is prohibited.
2. Solution
2.1. Event Streams
An event stream is a named entity on a publisher which exposes a
continuously updating set of events. Each event stream is available
for subscription. It is out of the scope of this document to
identify a) how streams are defined, b) how events are defined/
generated, and c) how events are assigned to streams.
There is only one reserved event stream within this document:
NETCONF. The NETCONF event stream contains all NETCONF XML event
record information supported by the publisher, except for where it
has been explicitly indicated that this the event record MUST be
Voit, et al. Expires April 26, 2018 [Page 6]
Internet-Draft Subscribed Notifications October 2017
excluded from the NETCONF stream. Beyond NETCONF, implementations
are free to add additional event streams.
As events are raised by a system, they may be assigned to one or more
streams. The event record is distributed to receivers where: (1) a
subscription includes the identified stream, and (2) subscription
filtering does not exclude the event record from that receiver.
If access control permissions are in use to secure publisher content,
then for notification messages to be sent to a receiver, that
receiver MUST be allowed access to all the event records on the
stream. If subscriber permissions change during the lifecycle of a
subscription, then the subscription MUST be continued or terminated
accordingly.
2.2. Event Stream Filters
This document defines an extensible filtering mechanism. Two
filtering syntaxes supported are [XPATH]which is mandatory, and
subtree [RFC6241] which is optional. The subsets of these filtering
syntaxes supported are left to each implementation. A subset of
information is never stripped from within the event record.
If no event stream filter is provided, all event records on a stream
are to be sent.
2.3. Subscription State Model at the Publisher
Below is the state machine of a subscription for the publisher for a
dynamic subscription. It is important to note that such a
subscription doesn't exist at the publisher until it is accepted and
made active. The mere request by a subscriber to establish a
subscription is insufficient for that asserted subscription to be
externally visible via this state machine.
Voit, et al. Expires April 26, 2018 [Page 7]
Internet-Draft Subscribed Notifications October 2017
.-------.
| start |
'-------'
|
establish
|
| .----------modify------------.
v v '
.-----------. .-----------.
.--------. | |-----suspend------->| |
modify '| active | | suspended |
'--------->| |<----resume---------| |
'-----------' '-----------'
| |
delete/kill delete/kill
| |
v |
.-------. |
| end |<---------------------------'
'-------'
Figure 1: Dynamic subscription states
Of interest in this state machine are the following:
o Successful establish or modify RPCs put the subscription into an
active state.
o Failed modify RPCs will leave the subscription in its previous
state, with no visible change to any streaming updates.
o A delete or kill RPC will end the subscription.
o Suspend and resume state changes are driven by internal process
and prioritization. There are no external controls over suspend
and resume.
As shown below, a very similar state machine exists for configured
subscriptions. Creation, modification, and deletion is via
configuration operations rather than via RPC. The status of each
receiver (active or suspended) is managed by the publisher, and is
non-configurable. Individual receivers are provided no information
about other receivers from the publisher.
Voit, et al. Expires April 26, 2018 [Page 8]
Internet-Draft Subscribed Notifications October 2017
.-------.
| start |
'-------'
|
create
|
v
.---------------------------------------------------.
.--------. | Subscription |
modify '| |
'--------->| .---------------. -suspend-> .------------------. |
| |active receiver| |suspended receiver| |
| '---------------' <--resume- '------------------' |
'---------------------------------------------------'
|
delete
|
v
.-------.
| end |
'-------'
Figure 2: Per Receiver Configured subscription states
The interaction model described in this section is mirrored in the
RPCs and Notifications later in the document. It should be noted
that these RPCs and Notifications have been designed to be extensible
and allow subscriptions into targets other than event streams.
[I-D.ietf-netconf-yang-push] provides an example of such an
extension.
3. Data Model Trees
module: ietf-subscribed-notifications
+--ro streams
| +--ro stream* [name]
| +--ro name stream
| +--ro description string
| +--ro replay-support? empty {replay}?
| +--ro replay-log-creation-time? yang:date-and-time {replay}?
| +--ro replay-log-aged-time? yang:date-and-time {replay}?
+--rw filters
| +--rw event-stream-filter* [identifier]
| +--rw identifier filter-id
| +--rw (filter-spec)?
| +--:(subtree-filter)
| | +--rw subtree-filter? {encode-xml}?
| +--:(xpath-filter)
Voit, et al. Expires April 26, 2018 [Page 9]
Internet-Draft Subscribed Notifications October 2017
| +--rw xpath-filter? yang:xpath1.0
+--rw subscription-config {configured-subscriptions}?
| +--rw subscription* [identifier]
| +--rw identifier subscription-id
| +--rw encoding encoding
| +--rw (target)
| | +--:(stream)
| | +--rw (event-stream-filter)?
| | | +--:(by-reference)
| | | | +--rw event-stream-filter-ref
| | | | event-stream-filter-ref
| | | +--:(within-subscription)
| | | +--rw (filter-spec)?
| | | +--:(subtree-filter)
| | | | +--rw subtree-filter? {encode-xml}?
| | | +--:(xpath-filter)
| | | +--rw xpath-filter? yang:xpath1.0
| | +--rw stream stream
| | +--rw replay-start-time? yang:date-and-time {replay}?
| +--rw stop-time? yang:date-and-time
| +--rw receivers
| | +--rw receiver* [address port]
| | +--rw address inet:host
| | +--rw port inet:port-number
| | +--rw protocol? transport
| +--rw (notification-origin)?
| +--:(interface-originated)
| | +--rw source-interface? if:interface-ref
| +--:(address-originated)
| +--rw source-vrf? string
| +--rw source-address? inet:ip-address-no-zone
+--ro subscriptions
+--ro subscription* [identifier]
+--ro identifier subscription-id
+--ro configured-subscription?
| empty {configured-subscriptions}?
+--ro encoding encoding
+--ro (target)
| +--:(stream)
| +--ro (event-stream-filter)?
| | +--:(by-reference)
| | | +--ro event-stream-filter-ref
| | | event-stream-filter-ref
| | +--:(within-subscription)
| | +--ro (filter-spec)?
| | +--:(subtree-filter)
| | | +--ro subtree-filter? {encode-xml}?
| | +--:(xpath-filter)
Voit, et al. Expires April 26, 2018 [Page 10]
Internet-Draft Subscribed Notifications October 2017
| | +--ro xpath-filter? yang:xpath1.0
| +--ro stream stream
| +--ro replay-start-time? yang:date-and-time {replay}?
+--ro stop-time? yang:date-and-time
+--ro (notification-origin)?
| +--:(interface-originated)
| | +--ro source-interface? if:interface-ref
| +--:(address-originated)
| +--ro source-vrf? string
| +--ro source-address? inet:ip-address-no-zone
+--ro receivers
+--ro receiver* [address port]
+--ro address inet:host
+--ro port inet:port-number
+--ro protocol? transport
+--ro pushed-notifications? yang:counter64
+--ro excluded-notifications? yang:counter64
+--ro status subscription-status
rpcs:
+---x establish-subscription
| +---w input
| | +---w encoding encoding
| | +---w (target)
| | | +--:(stream)
| | | +---w (event-stream-filter)?
| | | | +--:(by-reference)
| | | | | +---w event-stream-filter-ref
| | | | | event-stream-filter-ref
| | | | +--:(within-subscription)
| | | | +---w (filter-spec)?
| | | | +--:(subtree-filter)
| | | | | +---w subtree-filter? {encode-xml}?
| | | | +--:(xpath-filter)
| | | | +---w xpath-filter? yang:xpath1.0
| | | +---w stream stream
| | | +---w replay-start-time? yang:date-and-time {replay}?
| | +---w stop-time? yang:date-and-time
| +--ro output
| +--ro subscription-result subscription-result
| +--ro (result)?
| +--:(no-success)
| | +--ro filter-failure? string
| | +--ro replay-start-time-hint? yang:date-and-time
| +--:(success)
| +--ro identifier subscription-id
+---x modify-subscription
| +---w input
Voit, et al. Expires April 26, 2018 [Page 11]
Internet-Draft Subscribed Notifications October 2017
| | +---w identifier? subscription-id
| | +---w (target)
| | | +--:(stream)
| | | +---w (event-stream-filter)?
| | | +--:(by-reference)
| | | | +---w event-stream-filter-ref
| | | | event-stream-filter-ref
| | | +--:(within-subscription)
| | | +---w (filter-spec)?
| | | +--:(subtree-filter)
| | | | +---w subtree-filter? {encode-xml}?
| | | +--:(xpath-filter)
| | | +---w xpath-filter? yang:xpath1.0
| | +---w stop-time? yang:date-and-time
| +--ro output
| +--ro subscription-result subscription-result
| +--ro (result)?
| +--:(no-success)
| +--ro filter-failure? string
+---x delete-subscription
| +---w input
| | +---w identifier subscription-id
| +--ro output
| +--ro subscription-result subscription-result
+---x kill-subscription
+---w input
| +---w identifier subscription-id
+--ro output
+--ro subscription-result subscription-result
notifications:
+---n replay-completed {replay}?
| +--ro identifier subscription-id
+---n subscription-completed
| +--ro identifier subscription-id
+---n subscription-started {configured-subscriptions}?
| +--ro identifier subscription-id
| +--ro encoding encoding
| +--ro (target)
| | +--:(stream)
| | +--ro (event-stream-filter)?
| | | +--:(by-reference)
| | | | +--ro event-stream-filter-ref
| | | | event-stream-filter-ref
| | | +--:(within-subscription)
| | | +--ro (filter-spec)?
| | | +--:(subtree-filter)
| | | | +--ro subtree-filter? {encode-xml}?
Voit, et al. Expires April 26, 2018 [Page 12]
Internet-Draft Subscribed Notifications October 2017
| | | +--:(xpath-filter)
| | | +--ro xpath-filter? yang:xpath1.0
| | +--ro stream stream
| | +--ro replay-start-time? yang:date-and-time {replay}?
| +--ro stop-time? yang:date-and-time
+---n subscription-resumed
| +--ro identifier subscription-id
+---n subscription-modified {configured-subscriptions}?
| +--ro identifier subscription-id
| +--ro encoding encoding
| +--ro (target)
| | +--:(stream)
| | +--ro (event-stream-filter)?
| | | +--:(by-reference)
| | | | +--ro event-stream-filter-ref event-stream-filter-ref
| | | +--:(within-subscription)
| | | +--ro (filter-spec)?
| | | +--:(subtree-filter)
| | | | +--ro subtree-filter? {encode-xml}?
| | | +--:(xpath-filter)
| | | +--ro xpath-filter? yang:xpath1.0
| | +--ro stream stream
| | +--ro replay-start-time? yang:date-and-time {replay}?
| +--ro stop-time? yang:date-and-time
+---n subscription-terminated
| +--ro identifier subscription-id
| +--ro error-id subscription-errors
| +--ro filter-failure? string
+---n subscription-suspended
+--ro identifier subscription-id
+--ro error-id subscription-errors
+--ro filter-failure? string
The top-level decompositions of data model are as follows:
o "Streams" contains a list of event streams that are supported by
the publisher and against which subscription is allowed.
o "Filters" contains a configurable list of filters that can be
applied to a subscription. This allows users to reference an
existing filter definition as an alternative to defining a filter
inline for each subscription.
o "Subscription-config" contains the configuration of configured
subscriptions. The parameters of each configured subscription are
a superset of the parameters of a dynamic subscription and use the
same groupings. In addition, the configured subscriptions MUST
Voit, et al. Expires April 26, 2018 [Page 13]
Internet-Draft Subscribed Notifications October 2017
also specify intended receivers and MAY specify the push source
from which to send the stream of notification messages.
o "Subscriptions" contains a list of all subscriptions on a
publisher, both configured and dynamic. It can be used to
retrieve information about the subscriptions which a publisher is
serving.
The data model also contains a number of YANG Notifications that
allow a publisher to signal information about a subscription.
Finally, the data model contains a number of RPC definitions that are
used to manage dynamic subscriptions.
4. Dynamic Subscriptions
Dynamic subscriptions are managed via RPC, and are made against
targets located within the publisher. These RPCs have been designed
extensibly so that they may be augmented for targets beyond event
streams.
4.1. Establishing a Subscription
The "establish-subscription" operation allows a subscriber to request
the creation of a subscription via RPC. Multiple establish
subscription RPC requests can be made within the same transport
session.
The input parameters of the operation are:
o A stream name which identifies the continuous feed of events
against which the subscription is applied.
o An event filter which may reduce the set of event records pushed.
o The desired encoding for the notification message.
o An optional stop time for the subscription.
o An optional start time which indicates that this subscription is
requesting a replay of previously generated information from the
event stream.
If the publisher cannot satisfy the "establish-subscription" request,
it sends a negative "subscription-result" element. If the subscriber
has no authorization to establish the subscription, the
"subscription-result" indicates an authorization error. Optionally,
the "subscription-result" MAY include one or more hints on
Voit, et al. Expires April 26, 2018 [Page 14]
Internet-Draft Subscribed Notifications October 2017
alternative input parameters and value which would have resulted in
an accepted subscription.
Subscription requests MUST fail if a filter with invalid syntax is
provided or if a non-existent stream is referenced.
4.1.1. Replay Subscription
Replay provides the ability to establish an subscription which is
also capable of passing along recently generated event records. In
other words, as the subscription initializes itself, it sends any
previously generated content from within target event stream which
meet the filter and timeframe criteria. These historical event
records would then be followed by event records generated after the
subscription has been established. All event records will be
delivered in the order generated. Replay is only viable for dynamic
subscriptions. Replay is an optional feature. Replay is dependent
on an event stream supporting some form of logging, although it puts
no restrictions on the size or form of the log, or where it resides
within the device.
The inclusion of a replay-start-time within an "establish-
subscription" RPC indicates a replay request. If the "replay-start-
time" contains a value that is earlier than content stored within the
publisher's replay buffer, then the subscription MUST be rejected,
and the leaf "replay-start-time-hint" MUST be set in the reply.
An end time MAY be specified using the optional stop-time parameter,
which only in the case of replay MAY also be earlier than the current
time. If no stop-time is present, notification messages will
continue to be sent until the subscription is terminated. The
publisher MUST NOT accept a replay-start-time for a future time.
If the replay-start-time is later than any information stored in the
replay buffer, then the publisher MUST send a "replay-completed"
notification immediately after the "subscription-started"
notification.
Not all streams will support replay. Those that do MUST include they
do via the "replay-support" object. In addition, a event stream that
does support replay is not expected to have an unlimited supply of
saved notifications available to accommodate any given replay
request. Subscribers MAY do a get on "replay-log-creation-time" and
"replay-log-aged-time" to assess the availability of replay. The
actual size of the replay log at any given time is a publisher
specific matter. Control parameters for this aspect of the feature
are outside the scope of this document.
Voit, et al. Expires April 26, 2018 [Page 15]
Internet-Draft Subscribed Notifications October 2017
4.2. Modifying a Subscription
The "modify-subscription" operation permits changing the terms of an
existing dynamic subscription previously established on that
transport session. Subscriptions created by configuration operations
cannot be modified via this RPC. Dynamic subscriptions can be
modified one or multiple times. If the publisher accepts the
requested modifications, it replies that this change has been made,
then immediately starts sending event records based on the new terms.
If the publisher rejects the request, the subscription remains as
prior to the request. That is, the request has no impact whatsoever.
The contents of a such a rejected modification MAY include one or
more hints on alternative input parameters and value which would have
resulted in a successfully modified subscription.
Dynamic subscriptions established via RPC can only be modified via
RPC using the same transport session used to establish that
subscription.
4.3. Deleting a Subscription
The "delete-subscription" operation permits canceling an existing
subscription previously established on that transport session. If
the publisher accepts the request, and the publisher has indicated
this successful reply has been sent, the publisher MUST NOT send any
more notification messages for this subscription. If the publisher
rejects the request, all subscriptions remain as prior to the
request. That is, the request has no impact whatsoever.
Subscriptions established via RPC can only be deleted via RPC using
the same transport session used for subscription establishment.
Configured subscriptions cannot be deleted using RPCs.
4.4. Killing a Subscription
The "kill-subscription" operation permits an operator to end a
dynamic subscription which is not associated the transport session
used for the RPC. This operation MUST be secured so that only
connections with sufficiently privileged access rights are able to
invoke this RPC. A publisher MUST terminate any dynamic subscription
identified by RPC request. An operator may find subscription
identifiers which may be used with "kill-subscription" by searching
for the ip address of a receiver within the yang tree.
Configured subscriptions cannot be killed using this RPC. Instead,
configured subscriptions are deleted as part of regular configuration
operations. Publishers MUST reject any RPC attempt to kill a
configured subscription.
Voit, et al. Expires April 26, 2018 [Page 16]
Internet-Draft Subscribed Notifications October 2017
5. Configured Subscriptions
A configured subscription is a subscription installed via a
configuration interface.
Configured subscriptions persist across reboots, and persist even
when transport is unavailable.
Configured subscriptions can be modified by any configuration client
with write permissions for the configuration of the subscription.
Subscriptions can be modified or terminated via the configuration
interface at any point of their lifetime.
Configured subscriptions are considered active as long event records
are not being dropped due to buffer overflow. A configured
subscription MUST be moved to a suspended state if a buffer is
overflowing and notification messages are being lost. A configured
subscription SHOULD be returned to an active state as soon as
transport connectivity is re-established, and a receiver acknowledges
receipt of a "subscription-resumed".
Supporting configured subscriptions is optional and advertised using
the "configured-subscriptions" feature.
In addition to subscription parameters that apply to dynamic
subscriptions, the following additional parameters apply to
configured subscriptions:
o One or more receiver IP addresses (and corresponding ports)
intended as the destination for notification messages for each
subscription. In addition, the transport for each destination MAY
be defined.
o Optional parameters to identify an egress interface, a host IP
address, a VRF, or an IP address plus VRF out of which
notification messages should be pushed from the publisher. Where
any of this info is not explicitly included, or where just the VRF
is provided, notification messages MUST egress the publisher's
default interface towards that receiver.
5.1. Creating a Configured Subscription
Configured subscriptions are established using configuration
operations against the top-level subtree subscription-config. There
are two key differences between RPCs and configuration operations for
subscription creation. Firstly, configuration operations install a
subscription without question, while RPCs are designed to the support
negotiation and rejection of requests. Secondly, while RPCs mandate
Voit, et al. Expires April 26, 2018 [Page 17]
Internet-Draft Subscribed Notifications October 2017
that the subscriber establishing the subscription is the only
receiver of the notification messages, configuration operations
permit specifying receivers independent of any tracked subscriber.
Because there is no explicit association with an existing transport
session, configuration operations require additional parameters
beyond those of dynamic subscriptions to indicate receivers, and
possibly whether the notification messages need to come from a
specific egress interface on the publisher.
After a subscription is successfully created, the publisher
immediately sends a subscription-started state change notification to
each receiver. It is quite possible that upon configuration, reboot,
or even steady-state operations, a transport session may not be
currently available to the receiver. In this case, when there is
something to transport for an active subscription, transport specific
call-home operations will be used to establish the connection. When
transport connectivity is available, as successful receipt of the
subscription start change notification by a particular receiver
indicated, notification messages may then be pushed.
As an example at subscription creation using configuration operations
over NETCONF, a client might send:
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<subscription-config
xmlns="urn:ietf:params:xml:ns:yang:"+
"ietf-subscribed-notifications:1.0">
<subscription>
<subscription-id>1922</subscription-id>
<stream>
<name>NETCONF</name>
<receiver>
<address>1.2.3.4</address>
<port>1234</port>
</receiver>
</stream>
</subscription>
</subscription-config>
</edit-config>
</rpc>