-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-ietf-netconf-subscribed-notifications-17.txt
4262 lines (3104 loc) · 158 KB
/
draft-ietf-netconf-subscribed-notifications-17.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-DRAFT 12-Sep-2018
***********************
NETCONF E. Voit
Internet-Draft Cisco Systems
Intended status: Standards Track A. Clemm
Expires: March 15, 2019 Huawei
A. Gonzalez Prieto
Microsoft
E. Nilsen-Nygaard
A. Tripathy
Cisco Systems
September 12, 2018
Customized Subscriptions to a Publisher's Event Streams
draft-ietf-netconf-subscribed-notifications-17
Abstract
This document defines a YANG data model and associated mechanisms
enabling subscriber-specific subscriptions to a publisher's event
streams. Applying these elements allows a subscriber to request for
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 March 15, 2019.
Copyright Notice
Copyright (c) 2018 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
(https://trustee.ietf.org/license-info) in effect on the date of
Voit, et al. Expires March 15, 2019 [Page 1]
Internet-Draft Subscribed Notifications September 2018
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 . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Solution Overview . . . . . . . . . . . . . . . . . . . . 5
1.4. Relationship to RFC 5277 . . . . . . . . . . . . . . . . 6
2. Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Event Streams . . . . . . . . . . . . . . . . . . . . . . 7
2.2. Event Stream Filters . . . . . . . . . . . . . . . . . . 7
2.3. QoS . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 8
2.5. Configured Subscriptions . . . . . . . . . . . . . . . . 16
2.6. Event Record Delivery . . . . . . . . . . . . . . . . . . 23
2.7. subscription state change notifications . . . . . . . . . 24
2.8. Subscription Monitoring . . . . . . . . . . . . . . . . . 30
2.9. Advertisement . . . . . . . . . . . . . . . . . . . . . . 31
3. YANG Data Model Trees . . . . . . . . . . . . . . . . . . . . 31
3.1. Event Streams Container . . . . . . . . . . . . . . . . . 31
3.2. Filters Container . . . . . . . . . . . . . . . . . . . . 32
3.3. Subscriptions Container . . . . . . . . . . . . . . . . . 32
4. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 34
5. Considerations . . . . . . . . . . . . . . . . . . . . . . . 61
5.1. IANA Considerations . . . . . . . . . . . . . . . . . . . 61
5.2. Implementation Considerations . . . . . . . . . . . . . . 61
5.3. Transport Requirements . . . . . . . . . . . . . . . . . 62
5.4. Security Considerations . . . . . . . . . . . . . . . . . 63
6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 66
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.1. Normative References . . . . . . . . . . . . . . . . . . 66
7.2. Informative References . . . . . . . . . . . . . . . . . 68
Appendix A. Example Configured Transport Augmentation . . . . . 69
Appendix B. Changes between revisions . . . . . . . . . . . . . 71
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 75
1. Introduction
This document defines a YANG data model and associated mechanisms
enabling subscriber-specific subscriptions to a publisher's event
streams. Effectively this enables a 'subscribe then publish'
capability where the customized information needs and access
Voit, et al. Expires March 15, 2019 [Page 2]
Internet-Draft Subscribed Notifications September 2018
permissions of each target receiver are understood by the publisher
before subscribed event records are marshaled and pushed. The
receiver then gets a continuous, custom feed of publisher generated
information.
While the functionality defined in this document is transport-
agnostic, transports 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].
The YANG model in this document conforms to the Network Management
Datastore Architecture defined in [RFC8342].
1.1. Motivation
Various limitations in [RFC5277] are discussed in [RFC7923].
Resolving these issues is the primary motivation for this work. Key
capabilities supported by this document include:
o multiple subscriptions on a single transport session
o support for dynamic and configured subscriptions
o modification of an existing subscription in progress
o per-subscription operational counters
o negotiation of subscription parameters (through the use of hints
returned as part of declined subscription requests)
o subscription state change notifications (e.g., publisher driven
suspension, parameter modification)
o independence from transport
1.2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
Client: defined in [RFC8342].
Configuration: defined in [RFC8342].
Voit, et al. Expires March 15, 2019 [Page 3]
Internet-Draft Subscribed Notifications September 2018
Configuration datastore: defined in [RFC8342].
Configured subscription: A subscription installed via configuration
into a configuration datastore.
Dynamic subscription: A subscription created dynamically by a
subscriber via a remote procedure call.
Event: An occurrence of something that may be of interest. Examples
include a configuration change, a fault, a change in status, crossing
a threshold, or an external input to the system.
Event occurrence time: a timestamp matching the time an originating
process identified as when an event happened.
Event record: A set of information detailing an event.
Event stream: A continuous, chronologically ordered set of events
aggregated under some context.
Event stream filter: Evaluation criteria which may be applied against
event records within an event stream. Event records pass the filter
when specified criteria are met.
Notification message: Information intended for a receiver indicating
that one or more event(s) have occurred.
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.
Subscriber: A client able to request and negotiate a contract for the
generation and push of event records from a publisher. For dynamic
subscriptions, the receiver and subscriber are the same entity.
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.
All YANG tree diagrams used in this document follow the notation
defined in [RFC8340].
Voit, et al. Expires March 15, 2019 [Page 4]
Internet-Draft Subscribed Notifications September 2018
1.3. Solution Overview
This document describes a transport agnostic mechanism for
subscribing to and receiving content from an event stream 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 an RPC. If the
publisher is able to serve this request, it accepts it, and then
starts pushing notification messages back to the subscriber. If
the publisher is not able to serve it as requested, then an error
response is returned. This response MAY include hints at
subscription parameters that, had they been present, would have
enabled the dynamic subscription request to be accepted.
2. Configured subscriptions, which allow the management of
subscriptions via a configuration so that a publisher can send
notification messages to a receiver of a configured subscription.
Support for configured subscriptions is optional, with its
availability advertised via a YANG feature.
Additional characteristics differentiating configured from dynamic
subscriptions include:
o The lifetime of a dynamic subscription is bound by the transport
session used to establish it. For connection-oriented stateful
transports like NETCONF, the loss of the transport session will
result in the immediate termination of any associated dynamic
subscriptions. For connectionless or stateless transports like
HTTP, a lack of receipt acknowledgment of a sequential set of
notification messages and/or keep-alives can be used to trigger a
termination of a dynamic subscription. Contrast this to the
lifetime of a configured subscription. This lifetime is driven by
relevant configuration being present within the publisher's
applied configuration. Being tied to configuration operations
implies configured subscriptions can be configured to persist
across reboots, and implies a configured subscription can persist
even when its publisher is fully disconnected from any network.
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 by the original subscriber, or a change to
configuration data referenced by the subscription.
Voit, et al. Expires March 15, 2019 [Page 5]
Internet-Draft Subscribed Notifications September 2018
Note that there is no mixing-and-matching of dynamic and configured
operations on a single subscription. Specifically, a configured
subscription cannot be modified or deleted using RPCs defined in this
document. Similarly, a subscription established via RPC cannot be
modified through configuration operations. Also note that transport
specific transport drafts based on this specification MUST detail the
life cycles of both dynamic and configured subscriptions.
A publisher MAY terminate a dynamic subscription at any time.
Similarly, it MAY decide to temporarily suspend the sending of
notification messages for any dynamic subscription, or for one or
more receivers of a configured subscription. Such termination or
suspension is driven by internal considerations of 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
relationships between these two documents include:
o this document defines a transport independent capability,
[RFC5277] is specific to NETCONF.
o the data model in this document is used instead of the data model
in Section 3.4 of [RFC5277] for the new operations.
o the RPC operations in this draft replaces the operation "create-
subscription" defined in [RFC5277], section 4.
o the <notification> message of [RFC5277], Section 4 is used.
o the included contents of the "NETCONF" event stream are identical
between this document and [RFC5277].
o a publisher MAY implement both the Notification Management Schema
and RPCs defined in [RFC5277] and this new document concurrently.
o unlike [RFC5277], this document enables a single transport session
to intermix of notification messages and RPCs for different
subscriptions.
2. Solution
Per the overview provided in Section 1.3, this section details the
overall context, state machines, and subsystems which may be
assembled to allow the subscription of events from a publisher.
Voit, et al. Expires March 15, 2019 [Page 6]
Internet-Draft Subscribed Notifications September 2018
2.1. Event Streams
An event stream is a named entity on a publisher which exposes a
continuously updating set of YANG encoded event records. Each event
stream is available for subscription. It is out of the scope of this
document to identify a) how streams are defined (other than the
NETCONF stream), b) how event records are defined/generated, and c)
how event records are assigned to streams.
There is only one reserved event stream name within this document:
"NETCONF". The "NETCONF" event stream contains all NETCONF XML event
record information supported by the publisher, except where an event
record has explicitly been excluded from the stream. Beyond the
"NETCONF" stream, implementations MAY define additional event
streams.
As YANG encoded event records are created by a system, they may be
assigned to one or more streams. The event record is distributed to
a subscription's receiver(s) where: (1) a subscription includes the
identified stream, and (2) subscription filtering does not exclude
the event record from that receiver.
Access control permissions may be used to silently exclude event
records from within an event stream for which the receiver has no
read access. As an example of how this might be accomplished, see
[RFC8341] section 3.4.6. Note that per Section 2.7 of this document,
subscription state change notifications are never filtered out.
If no access control permissions are in place for event records on an
event stream, then a receiver MUST be allowed access to all the event
records. If subscriber permissions change during the lifecycle of a
subscription and event stream access is no longer permitted, then the
subscription MUST be terminated.
Event records MUST NOT be delivered to a receiver in a different
order than they were placed onto an event stream.
2.2. Event Stream Filters
This document defines an extensible filtering mechanism. The filter
itself is a boolean test which is placed on the content of an event
record. A 'false' filtering result causes the event message to be
excluded from delivery to a receiver. A filter never results in
information being stripped from within an event record prior to that
event record being encapsulated within a notification message. The
two optional event stream filtering syntaxes supported are [XPATH]
and subtree [RFC6241].
Voit, et al. Expires March 15, 2019 [Page 7]
Internet-Draft Subscribed Notifications September 2018
If no event stream filter is provided within a subscription, all
event records on an event stream are to be sent.
2.3. QoS
This document provide for several QoS parameters. These parameters
indicate the treatment of a subscription relative to other traffic
between publisher and receiver. Included are:
o A "dscp" marking to differentiate prioritization of notification
messages during network transit.
o A "weighting" so that bandwidth proportional to this weighting can
be allocated to this subscription relative to other subscriptions
destined for that receiver.
o a "dependency" upon another subscription.
If the publisher supports the "dscp" feature, then a subscription
with a "dscp" leaf MUST result in a corresponding [RFC2474] DSCP
marking being placed within the IP header of any resulting
notification messages and subscription state change notifications.
For the "weighting" parameter, when concurrently dequeuing
notification messages from multiple subscriptions to a receiver, the
publisher MUST allocate bandwidth to each subscription proportionally
to the weights assigned to those subscriptions. "Weighting" is an
optional capability of the publisher; support for it is identified
via the "qos" feature.
If a subscription has the "dependency" parameter set, then any
buffered notification messages containing event records selected by
the parent subscription MUST be dequeued prior to the notification
messages of the dependent subscription. If notification messages
have dependencies on each other, the notification message queued the
longest MUST go first. If a "dependency" included within an RPC
references a subscription which does not exist or is no longer
accessible to that subscriber, that "dependency" MUST be silently
removed. "Dependency" is an optional capability of the publisher;
support for it is identified via the "qos" feature.
2.4. Dynamic Subscriptions
Dynamic subscriptions are managed via protocol operations (in the
form of [RFC7950], Section 7.14 RPCs) made against targets located
within the publisher. These RPCs have been designed extensibly so
that they may be augmented for subscription targets beyond event
Voit, et al. Expires March 15, 2019 [Page 8]
Internet-Draft Subscribed Notifications September 2018
streams. For examples of such augmentations, see the RPC
augmentations within [I-D.ietf-netconf-yang-push]'s YANG model.
2.4.1. Dynamic Subscription State Model
Below is the publisher's state machine for a dynamic subscription.
Each state is shown in its own box. It is important to note that
such a subscription doesn't exist at the publisher until an
"establish-subscription" RPC is accepted. The mere request by a
subscriber to establish a subscription is insufficient for that
subscription to be externally visible. Start and end states are
depicted to reflect subscription creation and deletion events.
.........
: start :
:.......:
|
establish-subscription
|
| .-------modify-subscription--------.
v v |
.-----------. .-----------.
.--------. | receiver |--insufficient CPU, b/w-->| receiver |
modify- '| active | | suspended |
subscription | |<----CPU, b/w sufficient--| |
---------->'-----------' '-----------'
| |
delete/kill-subscription delete/kill-
| subscription
v |
......... |
: end :<---------------------------------'
:.......:
Figure 1: Publisher's state for a dynamic subscription
Of interest in this state machine are the following:
o Successful "establish-subscription" or "modify-subscription" RPCs
put the subscription into the active state.
o Failed "modify-subscription" RPCs will leave the subscription in
its previous state, with no visible change to any streaming
updates.
o A "delete-subscription" or "kill-subscription" RPC will end the
subscription, as will the reaching of a "stop-time".
Voit, et al. Expires March 15, 2019 [Page 9]
Internet-Draft Subscribed Notifications September 2018
o A publisher may choose to suspend a subscription when there is
insufficient CPU or bandwidth available to service the
subscription. This is notified to a subscriber with a
"subscription-suspended" subscription state change notification.
o A suspended subscription may be modified by the subscriber (for
example in an attempt to use fewer resources). Successful
modification returns the subscription to the active state.
o Even without a "modify-subscription" request, a publisher may
return a subscription to the active state should the resource
constraints become sufficient again. This is announced to the
subscriber via the "subscription-resumed" subscription state
change notification.
2.4.2. Establishing a Dynamic Subscription
The "establish-subscription" RPC allows a subscriber to request the
creation of a subscription.
The input parameters of the operation are:
o A "stream" name which identifies the targeted event stream against
which the subscription is applied.
o An event stream filter which may reduce the set of event records
pushed.
o Where the transport used by the RPC supports multiple encodings,
an optional "encoding" for the event records pushed. Note: If no
"encoding" is included, the encoding of the RPC MUST be used.
o An optional "stop-time" for the subscription. If no "stop-time"
is present, notification messages will continue to be sent until
the subscription is terminated.
o An optional "replay-start-time" for the subscription. The
"replay-start-time" MUST be in the past and indicates that the
subscription is requesting a replay of previously generated
information from the event stream. For more on replay, see
Section 2.4.2.1. Where there is no "replay-start-time", the
subscription starts immediately.
If the publisher can satisfy the "establish-subscription" request, it
replies with an identifier for the subscription, and then immediately
starts streaming notification messages.
Voit, et al. Expires March 15, 2019 [Page 10]
Internet-Draft Subscribed Notifications September 2018
Below is a tree diagram for "establish-subscription". All objects
contained in this tree are described within the included YANG model
within Section 4.
+---x establish-subscription
+---w input
| +---w (target)
| | +--:(stream)
| | +---w (stream-filter)?
| | | +--:(by-reference)
| | | | +---w stream-filter-name
| | | | stream-filter-ref
| | | +--:(within-subscription)
| | | +---w (filter-spec)?
| | | +--:(stream-subtree-filter)
| | | | +---w stream-subtree-filter? <anydata>
| | | | {subtree}?
| | | +--:(stream-xpath-filter)
| | | +---w stream-xpath-filter?
| | | yang:xpath1.0 {xpath}?
| | +---w stream stream-ref
| | +---w replay-start-time?
| | yang:date-and-time {replay}?
| +---w stop-time?
| | yang:date-and-time
| +---w dscp? inet:dscp
| | {dscp}?
| +---w weighting? uint8
| | {qos}?
| +---w dependency?
| | subscription-id {qos}?
| +---w encoding? encoding
+--ro output
+--ro id subscription-id
+--ro replay-start-time-revision? yang:date-and-time
{replay}?
Figure 2: establish-subscription RPC tree diagram
A publisher MAY reject the "establish-subscription" RPC for many
reasons as described in Section 2.4.6. The contents of the resulting
RPC error response MAY include details on input parameters which if
considered in a subsequent "establish-subscription" RPC, may result
in a successful subscription establishment. Any such hints MUST be
transported within a yang-data "establish-subscription-stream-error-
info" container included within the RPC error response.
Voit, et al. Expires March 15, 2019 [Page 11]
Internet-Draft Subscribed Notifications September 2018
yang-data establish-subscription-stream-error-info
+--ro establish-subscription-stream-error-info
+--ro reason? identityref
+--ro filter-failure-hint? string
Figure 3: establish-subscription RPC yang-data tree diagram
2.4.2.1. Requesting a replay of event records
Replay provides the ability to establish a subscription which is also
capable of passing recently generated event records. In other words,
as the subscription initializes itself, it sends any event records
within the target event stream which meet the filter criteria, which
have an event time which is after the "replay-start-time", and which
have an event time before the "stop-time" should this "stop-time"
exist. The end of these historical event records is identified via a
"replay-completed" subscription state change notification. Any event
records generated since the subscription establishment may then
follow. For a particular subscription, all event records will be
delivered in the order they are placed into the stream.
Replay is an optional feature which is dependent on an event stream
supporting some form of logging. This document puts no restrictions
on the size or form of the log, where it resides within the
publisher, or when event record entries in the log are purged.
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 what a publisher's
retained history supports, then if the subscription is accepted, the
actual publisher's revised start time MUST be set in the returned
"replay-start-time-revision" object.
A "stop-time" parameter may be included in a replay subscription.
For a replay subscription, the "stop-time" MAY be earlier than the
current time, but MUST be later than the "replay-start-time".
If the given "replay-start-time" is later than the time marked within
any event records retained within the replay buffer, then the
publisher MUST send a "replay-completed" notification immediately
after a successful establish-subscription RPC response.
If an event stream supports replay, the "replay-support" leaf is
present in the "/streams/stream" list entry for the stream. An event
stream that does support replay is not expected to have an unlimited
supply of saved notifications available to accommodate any given
replay request. To assess the timeframe available for replay,
subscribers can read the leafs "replay-log-creation-time" and
Voit, et al. Expires March 15, 2019 [Page 12]
Internet-Draft Subscribed Notifications September 2018
"replay-log-aged-time". See Figure 18 for the YANG tree, and
Section 4 for the YANG model describing these elements. The actual
size of the replay log at any given time is a publisher specific
matter. Control parameters for the replay log are outside the scope
of this document.
2.4.3. Modifying a Dynamic Subscription
The "modify-subscription" operation permits changing the terms of an
existing dynamic subscription. Dynamic subscriptions can be modified
any number of times. If the publisher accepts the requested
modifications, it acknowledges success to the subscriber, then
immediately starts sending event records based on the new terms.
Subscriptions created by configuration cannot be modified via this
RPC. However configuration may be used to modify objects referenced
by the subscription (such as a referenced filter).
Below is a tree diagram for "modify-subscription". All objects
contained in this tree are described within the included YANG model
within Section 4.
+---x modify-subscription
+---w input
+---w id
| subscription-id
+---w (target)
| +--:(stream)
| +---w (stream-filter)?
| +--:(by-reference)
| | +---w stream-filter-name
| | stream-filter-ref
| +--:(within-subscription)
| +---w (filter-spec)?
| +--:(stream-subtree-filter)
| | +---w stream-subtree-filter? <anydata>
| | {subtree}?
| +--:(stream-xpath-filter)
| +---w stream-xpath-filter?
| yang:xpath1.0 {xpath}?
+---w stop-time?
yang:date-and-time
Figure 4: modify-subscription RPC tree diagram
If the publisher accepts the requested modifications on a currently
suspended subscription, the subscription will immediately be resumed
Voit, et al. Expires March 15, 2019 [Page 13]
Internet-Draft Subscribed Notifications September 2018
(i.e., the modified subscription is returned to the active state.)
The publisher MAY immediately suspend this newly modified
subscription through the "subscription-suspended" notification before
any event records are sent.
If the publisher rejects the RPC request, the subscription remains as
prior to the request. That is, the request has no impact whatsoever.
Rejection of the RPC for any reason is indicated by via RPC error as
described in Section 2.4.6. The contents of such a rejected RPC MAY
include hints on inputs which (if considered) may result in a
successfully modified subscription. These hints MUST be transported
within a yang-data "modify-subscription-stream-error-info" container
inserted into the RPC error response.
Below is a tree diagram for "modify-subscription-RPC-yang-data". All
objects contained in this tree are described within the included YANG
model within Section 4.
yang-data modify-subscription-stream-error-info
+--ro modify-subscription-stream-error-info
+--ro reason? identityref
+--ro filter-failure-hint? string
Figure 5: modify-subscription RPC yang-data tree diagram
2.4.4. Deleting a Dynamic Subscription
The "delete-subscription" operation permits canceling an existing
subscription. If the publisher accepts the request, and the
publisher has indicated success, the publisher MUST NOT send any more
notification messages for this subscription. If the delete request
matches a known subscription established on the same transport
session, then it MUST be deleted; otherwise it MUST be rejected with
no changes to the publisher.
Below is a tree diagram for "delete-subscription". All objects
contained in this tree are described within the included YANG model
within Section 4.
+---x delete-subscription
+---w input
+---w id subscription-id
Figure 6: delete-subscription RPC tree diagram
Dynamic subscriptions can only be deleted via this RPC using the same
transport session previously used for subscription establishment.
Configured subscriptions cannot be deleted using RPCs.
Voit, et al. Expires March 15, 2019 [Page 14]
Internet-Draft Subscribed Notifications September 2018
2.4.5. Killing a Dynamic Subscription
The "kill-subscription" operation permits an operator to end a
dynamic subscription which is not associated with the transport
session used for the RPC. A publisher MUST terminate any dynamic
subscription identified by the "id" parameter in the RPC request, if
such a subscription exists.
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.
Below is a tree diagram for "kill-subscription". All objects
contained in this tree are described within the included YANG model
within Section 4.
+---x kill-subscription
+---w input
+---w id subscription-id
Figure 7: kill-subscription RPC tree diagram
2.4.6. RPC Failures
Whenever an RPC is unsuccessful, the publisher returns relevant
information as part of the RPC error response. Transport level error
processing MUST be done before RPC error processing described in this
section. In all cases, RPC error information returned will use
existing transport layer RPC structures, such as those seen with
NETCONF in [RFC6241] Appendix A, or with RESTCONF in [RFC8040]
Section 7.1. These structures MUST be able to encode subscription
specific errors identified below and defined within this document's
YANG model.
As a result of this mixture, how subscription errors are encoded
within an RPC error response is transport dependent. Following are
valid errors which can occur for each RPC:
Voit, et al. Expires March 15, 2019 [Page 15]
Internet-Draft Subscribed Notifications September 2018
establish-subscription modify-subscription
---------------------- -------------------
dscp-unavailable filter-unsupported
encoding-unsupported insufficient-resources
filter-unsupported no-such-subscription
insufficient-resources
replay-unsupported
delete-subscription kill-subscription
---------------------- ----------------------
no-such-subscription no-such-subscription
To see a NETCONF based example of an error response from above, see
[I-D.draft-ietf-netconf-netconf-event-notifications], Figure 10.
There is one final set of transport independent RPC error elements
included in the YANG model. These are the following three yang-data
structures for failed event stream subscriptions:
1. "establish-subscription-stream-error-info": This MUST be sent if
hints on how to overcome the RPC error are included in an
"establish-subscription" RPC response.
2. "modify-subscription-stream-error-info": This MUST be sent if
hints on how to overcome the RPC error are included in an
"modify-subscription" RPC response.
3. "delete-subscription-error-info".
2.5. Configured Subscriptions
A configured subscription is a subscription installed via
configuration. Configured subscriptions may be modified by any
configuration client with the proper permissions. Subscriptions can
be modified or terminated via configuration at any point of their
lifetime. Multiple configured subscriptions MUST be supportable over
a single transport session.
Configured subscriptions have several characteristics distinguishing
them from dynamic subscriptions:
o persistence across publisher reboots,
o persistence even when transport is unavailable, and
o an ability to send notification messages to more than one receiver
(note that receivers are unaware of the existence of any other
receivers.)
Voit, et al. Expires March 15, 2019 [Page 16]
Internet-Draft Subscribed Notifications September 2018
On the publisher, supporting configured subscriptions is optional and
advertised using the "configured" feature. On a receiver of a
configured subscription, support for dynamic subscriptions is
optional except where replaying missed event records is required.
In addition to the subscription parameters available to dynamic
subscriptions described in Section 2.4.2, the following additional
parameters are also available to configured subscriptions:
o A "transport" which identifies the transport protocol to use to
connect with all subscription receivers.
o One or more receivers, each intended as the destination for event
records. Note that each individual receiver is identifiable by
its "name".
o Optional parameters to identify where traffic should egress a
publisher:
* A "source-interface" which identifies the egress interface to
use from the publisher. Publisher support for this is optional
and advertised using the "interface-designation" feature.
* A "source-address" address, which identifies the IP address to
stamp on notification messages destined for the receiver.
* A "source-vrf" which identifies the VRF on which to reach
receivers. This VRF is a network instance as defined within
[I-D.draft-ietf-rtgwg-ni-model]. Publisher support for VRFs is
optional and advertised using the "supports-vrf" feature.
If none of the above parameters are set, notification messages
MUST egress the publisher's default interface.
A tree diagram describing these parameters is shown in Figure 20
within Section 3.3. All parameters are described within the YANG
model in Section 4.
2.5.1. Configured Subscription State Model
Below is the state machine for a configured subscription on the
publisher. This state machine describes the three states (valid,
invalid, and concluded), as well as the transitions between these
states. Start and end states are depicted to reflect configured
subscription creation and deletion events. The creation or
modification of a configured subscription initiates an evaluation by
the publisher to determine if the subscription is in valid or invalid
states. The publisher uses its own criteria in making this
Voit, et al. Expires March 15, 2019 [Page 17]
Internet-Draft Subscribed Notifications September 2018
determination. If in the valid state, the subscription becomes
operational. See (1) in the diagram below.
.........
: start :-.
:.......: |
create .---modify-----.----------------------------------.
| | | |
V V .-------. ....... .---------.
.----[evaluate]--no--->|invalid|-delete->: end :<-delete-|concluded|
| '-------' :.....: '---------'
|-[evaluate]--no-(2). ^ ^ ^
| ^ | | | |
yes | '->unsupportable delete stop-time
| modify (subscription- (subscription- (subscription-
| | terminated*) terminated*) concluded*)
| | | | |
(1) | (3) (4) (5)
| .---------------------------------------------------------------.
'-->| valid |
'---------------------------------------------------------------'
Legend:
dotted boxes: subscription added or removed via configuration
dashed boxes: states for a subscription
[evaluate]: decision point on whether the subscription is supportable
(*): resulting subscription state change notification
Figure 8: Publisher state model for a configured subscription
A subscription in the valid state may move to the invalid state in
one of two ways. First, it may be modified in a way which fails a
re-evaluation. See (2) in the diagram. Second, the publisher might
determine that the subscription is no longer supportable. This could
be for reasons of an unexpected but sustained increase in an event
stream's event records, degraded CPU capacity, a more complex
referenced filter, or other higher priority subscriptions which have
usurped resources. See (3) in the diagram. No matter the case, a
"subscription-terminated" notification is sent to any receivers in an
active or suspended state. A subscription in the valid state may
also transition to the concluded state via (5) if a configured stop