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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061
|
<pre>Internet Engineering Task Force (IETF) E. Voit
Request for Comments: 8640 Cisco Systems
Category: Standards Track A. Clemm
ISSN: 2070-1721 Futurewei
A. Gonzalez Prieto
Microsoft
E. Nilsen-Nygaard
A. Tripathy
Cisco Systems
September 2019
<span class="h1">Dynamic Subscription to YANG Events and Datastores over NETCONF</span>
Abstract
This document provides a Network Configuration Protocol (NETCONF)
binding to the dynamic subscription capability of both subscribed
notifications and YANG-Push.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc7841#section-2">Section 2 of RFC 7841</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc8640">https://www.rfc-editor.org/info/rfc8640</a>.
<span class="grey">Voit, et al. Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a>) 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.
This document may contain material from IETF Documents or IETF
Contributions published or made publicly available before November
10, 2008. The person(s) controlling the copyright in some of this
material may not have granted the IETF Trust the right to allow
modifications of such material outside the IETF Standards Process.
Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other
than English.
<span class="grey">Voit, et al. Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-3">3</a>
<a href="#section-2">2</a>. Terminology .....................................................<a href="#page-3">3</a>
3. Compatibility with <create-subscription> as Defined in
<a href="./rfc5277">RFC 5277</a> ........................................................<a href="#page-4">4</a>
<a href="#section-4">4</a>. Mandatory XML, Event Stream, and Datastore Support ..............<a href="#page-4">4</a>
<a href="#section-5">5</a>. NETCONF Connectivity and Dynamic Subscriptions ..................<a href="#page-4">4</a>
<a href="#section-6">6</a>. Notification Messages ...........................................<a href="#page-5">5</a>
<a href="#section-7">7</a>. Dynamic Subscriptions and RPC Error Responses ...................<a href="#page-5">5</a>
<a href="#section-8">8</a>. Security Considerations .........................................<a href="#page-7">7</a>
<a href="#section-9">9</a>. IANA Considerations .............................................<a href="#page-7">7</a>
<a href="#section-10">10</a>. References .....................................................<a href="#page-7">7</a>
<a href="#section-10.1">10.1</a>. Normative References ......................................<a href="#page-7">7</a>
<a href="#section-10.2">10.2</a>. Informative References ....................................<a href="#page-8">8</a>
<a href="#appendix-A">Appendix A</a>. Examples ...............................................<a href="#page-9">9</a>
<a href="#appendix-A.1">A.1</a>. Event Stream Discovery ......................................<a href="#page-9">9</a>
<a href="#appendix-A.2">A.2</a>. Dynamic Subscriptions ......................................<a href="#page-10">10</a>
<a href="#appendix-A.3">A.3</a>. Subscription State Notifications ...........................<a href="#page-15">15</a>
<a href="#appendix-A.4">A.4</a>. Filter Examples ............................................<a href="#page-17">17</a>
Acknowledgments ...................................................<a href="#page-19">19</a>
Authors' Addresses ................................................<a href="#page-19">19</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
This document specifies the binding of a stream of events that form
part of a dynamic subscription to the Network Configuration Protocol
(NETCONF) [<a href="./rfc6241" title=""Network Configuration Protocol (NETCONF)"">RFC6241</a>]. Dynamic subscriptions are defined in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>].
In addition, as [<a href="./rfc8641" title=""Subscription to YANG Notifications for Datastore Updates"">RFC8641</a>] is itself built upon [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>], this
document enables a NETCONF client to request via a dynamic
subscription, and receive, updates from a YANG datastore located on a
NETCONF server.
This document assumes that the reader is familiar with the
terminology and concepts defined in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>].
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
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
<a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>] [<a href="./rfc8174" title=""Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"">RFC8174</a>] when, and only when, they appear in all
capitals, as shown here.
The following terms are defined in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>]: dynamic subscription,
event stream, notification message, publisher, receiver, subscriber,
and subscription. This document does not define any additional
terms.
<span class="grey">Voit, et al. Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Compatibility with <create-subscription> as Defined in <a href="./rfc5277">RFC 5277</a></span>
A publisher is allowed to concurrently support dynamic subscription
RPCs as defined in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>] at the same time as the
<create-subscription> RPC defined in [<a href="./rfc5277" title=""NETCONF Event Notifications"">RFC5277</a>]. However, a single
NETCONF transport session MUST NOT support both this specification
and a subscription established by the <create-subscription> RPC
defined in [<a href="./rfc5277" title=""NETCONF Event Notifications"">RFC5277</a>]. To protect against any attempts to use a
single NETCONF transport session in this way:
o A solution MUST reply with the <rpc-error> element [<a href="./rfc6241" title=""Network Configuration Protocol (NETCONF)"">RFC6241</a>]
containing the "error-tag" value of "operation-not-supported" if a
<create-subscription> RPC is received on a NETCONF session where
an established subscription per [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>] exists.
o A solution MUST reply with the <rpc-error> element [<a href="./rfc6241" title=""Network Configuration Protocol (NETCONF)"">RFC6241</a>]
containing the "error-tag" value of "operation-not-supported" if
an "establish-subscription" request has been received on a NETCONF
session where the <create-subscription> RPC [<a href="./rfc5277" title=""NETCONF Event Notifications"">RFC5277</a>] has
successfully created a subscription.
If a publisher supports this specification but not subscriptions via
[<a href="./rfc5277" title=""NETCONF Event Notifications"">RFC5277</a>], the publisher MUST NOT advertise
"urn:ietf:params:netconf:capability:notification:1.0".
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Mandatory XML, Event Stream, and Datastore Support</span>
The "encode-xml" feature of [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>] MUST be supported. This
indicates that XML is a valid encoding for RPCs, state change
notifications, and subscribed content.
A NETCONF publisher supporting event stream subscription via
[<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>] MUST support the "NETCONF" event stream identified in that
document.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. NETCONF Connectivity and Dynamic Subscriptions</span>
Management of dynamic subscriptions occurs via RPCs as defined in
[<a href="./rfc8641" title=""Subscription to YANG Notifications for Datastore Updates"">RFC8641</a>] and [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>]. For a dynamic subscription, if the NETCONF
session involved with the "establish-subscription" terminates, the
subscription MUST be terminated.
For a dynamic subscription, any "modify-subscription",
"delete-subscription", or "resync-subscription" RPCs MUST be sent
using the same NETCONF session upon which the referenced subscription
was established.
<span class="grey">Voit, et al. Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Notification Messages</span>
Notification messages transported over NETCONF MUST be encoded in a
<notification> message as defined in <a href="./rfc5277#section-4">[RFC5277], Section 4</a>. And per
the <eventTime> object definition provided in [<a href="./rfc5277" title=""NETCONF Event Notifications"">RFC5277</a>], <eventTime>
is populated with the event occurrence time.
For dynamic subscriptions, all notification messages MUST use the
NETCONF transport session used by the "establish-subscription" RPC.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Dynamic Subscriptions and RPC Error Responses</span>
When an RPC error occurs as defined in <a href="./rfc8639#section-2.4.6">[RFC8639], Section 2.4.6</a> and
<a href="./rfc8641#appendix-A">[RFC8641], Appendix A</a>, the NETCONF RPC reply MUST include an
<rpc-error> element per [<a href="./rfc6241" title=""Network Configuration Protocol (NETCONF)"">RFC6241</a>] with the error information
populated as follows:
o An "error-type" node of "application".
o An "error-tag" node, where the value is a string that corresponds
to an identity associated with the error. For the mechanisms
specified in this document, this "error-tag" will correspond to
the error identities in either (1) <a href="./rfc8639#section-2.4.6">[RFC8639], Section 2.4.6</a>, for
general subscription errors:
error identity uses error-tag
---------------------- -----------------------
dscp-unavailable invalid-value
encoding-unsupported invalid-value
filter-unsupported invalid-value
insufficient-resources resource-denied
no-such-subscription invalid-value
replay-unsupported operation-not-supported
or (2) <a href="./rfc8641#appendix-A.1">[RFC8641], Appendix A.1</a>, for subscription errors specific
to YANG datastores:
error identity uses error-tag
--------------------------- -----------------------
cant-exclude operation-not-supported
datastore-not-subscribable invalid-value
no-such-subscription-resync invalid-value
on-change-unsupported operation-not-supported
on-change-sync-unsupported operation-not-supported
period-unsupported invalid-value
update-too-big too-big
sync-too-big too-big
unchanging-selection operation-failed
<span class="grey">Voit, et al. Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
o An "error-severity" of "error" (this MAY be included).
o An "error-app-tag" node, where the value is a string that
corresponds to an identity associated with the error, as defined
in <a href="./rfc8639#section-2.4.6">[RFC8639], Section 2.4.6</a> for general subscriptions and
<a href="./rfc8641#appendix-A.1">[RFC8641], Appendix A.1</a> for datastore subscriptions. The specific
identity to use depends on the RPC for which the error occurred.
Each error identity will be inserted as the "error-app-tag"
following the form <modulename>:<identityname>. An example of
such a valid encoding would be
"ietf-subscribed-notifications:no-such-subscription". Viable
errors for different RPCs are as follows:
RPC has base identity
---------------------- ----------------------------
establish-subscription establish-subscription-error
modify-subscription modify-subscription-error
delete-subscription delete-subscription-error
kill-subscription delete-subscription-error
resync-subscription resync-subscription-error
o In the case of error responses to an "establish-subscription" or
"modify-subscription" request, there is the option of including an
"error-info" node. This node may contain XML-encoded data with
hints for parameter settings that might lead to successful RPC
requests in the future. The yang-data structures from [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>]
and [<a href="./rfc8641" title=""Subscription to YANG Notifications for Datastore Updates"">RFC8641</a>] that may be returned are as follows:
establish-subscription returns hints in yang-data structure
---------------------- -------------------------------------------
target: event stream establish-subscription-stream-error-info
target: datastore establish-subscription-datastore-error-info
modify-subscription returns hints in yang-data structure
---------------------- ----------------------------------------
target: event stream modify-subscription-stream-error-info
target: datastore modify-subscription-datastore-error-info
The yang-data included in "error-info" SHOULD NOT include the
optional leaf "reason", as such a leaf would be redundant with
information that is already placed in the "error-app-tag".
In the case of an RPC error resulting from a "delete-subscription",
"kill-subscription", or "resync-subscription" request, no
"error-info" needs to be included, as the "subscription-id" is the
only RPC input parameter and no hints regarding this RPC input
parameter need to be provided.
<span class="grey">Voit, et al. Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Security Considerations</span>
This document does not introduce additional security considerations
for dynamic subscriptions beyond those discussed in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>]. But
there is one consideration worthy of more refinement based on the
connection-oriented nature of NETCONF. Specifically, if a buggy or
compromised NETCONF subscriber sends a number of "establish-
subscription" requests, then these subscriptions accumulate and may
use up system resources. In such a situation, subscriptions MAY be
terminated by terminating the underlying NETCONF session. The
publisher MAY also suspend or terminate a subset of the active
subscriptions on that NETCONF session in order to reclaim resources
and preserve normal operation for the other subscriptions.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. IANA Considerations</span>
This document has no IANA actions.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. References</span>
<span class="h3"><a class="selflink" id="section-10.1" href="#section-10.1">10.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
DOI 10.17487/RFC2119, March 1997,
<<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>>.
[<a id="ref-RFC5277">RFC5277</a>] Chisholm, S. and H. Trevino, "NETCONF Event
Notifications", <a href="./rfc5277">RFC 5277</a>, DOI 10.17487/RFC5277, July 2008,
<<a href="https://www.rfc-editor.org/info/rfc5277">https://www.rfc-editor.org/info/rfc5277</a>>.
[<a id="ref-RFC6241">RFC6241</a>] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
and A. Bierman, Ed., "Network Configuration Protocol
(NETCONF)", <a href="./rfc6241">RFC 6241</a>, DOI 10.17487/RFC6241, June 2011,
<<a href="https://www.rfc-editor.org/info/rfc6241">https://www.rfc-editor.org/info/rfc6241</a>>.
[<a id="ref-RFC8174">RFC8174</a>] Leiba, B., "Ambiguity of Uppercase vs Lowercase in
<a href="./rfc2119">RFC 2119</a> Key Words", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc8174">RFC 8174</a>,
DOI 10.17487/RFC8174, May 2017,
<<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>>.
[<a id="ref-RFC8639">RFC8639</a>] Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard,
E., and A. Tripathy, "Subscription to YANG Notifications",
<a href="./rfc8639">RFC 8639</a>, DOI 10.17487/RFC8639, September 2019,
<<a href="https://www.rfc-editor.org/info/rfc8639">https://www.rfc-editor.org/info/rfc8639</a>>.
<span class="grey">Voit, et al. Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
[<a id="ref-RFC8641">RFC8641</a>] Clemm, A. and E. Voit, "Subscription to YANG Notifications
for Datastore Updates", <a href="./rfc8641">RFC 8641</a>, DOI 10.17487/RFC8641,
September 2019, <<a href="https://www.rfc-editor.org/info/rfc8641">https://www.rfc-editor.org/info/rfc8641</a>>.
[<a id="ref-W3C.REC-xml-20081126">W3C.REC-xml-20081126</a>]
Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
Edition)", World Wide Web Consortium Recommendation
REC-xml-20081126, November 2008,
<<a href="https://www.w3.org/TR/2008/REC-xml-20081126">https://www.w3.org/TR/2008/REC-xml-20081126</a>>.
<span class="h3"><a class="selflink" id="section-10.2" href="#section-10.2">10.2</a>. Informative References</span>
[<a id="ref-RFC8347">RFC8347</a>] Liu, X., Ed., Kyparlis, A., Parikh, R., Lindem, A., and M.
Zhang, "A YANG Data Model for the Virtual Router
Redundancy Protocol (VRRP)", <a href="./rfc8347">RFC 8347</a>,
DOI 10.17487/RFC8347, March 2018,
<<a href="https://www.rfc-editor.org/info/rfc8347">https://www.rfc-editor.org/info/rfc8347</a>>.
[<a id="ref-XPATH">XPATH</a>] Clark, J. and S. DeRose, "XML Path Language (XPath)
Version 1.0", November 1999,
<<a href="https://www.w3.org/TR/1999/REC-xpath-19991116">https://www.w3.org/TR/1999/REC-xpath-19991116</a>>.
<span class="grey">Voit, et al. Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Examples</span>
This appendix is non-normative. Additionally, the subscription "id"
values of 22, 23, 39, and 99 used below are just examples. In
production, the actual values of "id" might not be small integers.
<span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a>. Event Stream Discovery</span>
As defined in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>], an event stream exposes a continuous set of
events available for subscription. A NETCONF client can retrieve the
list of available event streams from a NETCONF publisher using the
<get> operation against the top-level "streams" container defined in
<a href="./rfc8639#section-3.1">[RFC8639], Section 3.1</a>.
The following XML example [<a href="#ref-W3C.REC-xml-20081126">W3C.REC-xml-20081126</a>] illustrates the
retrieval of the list of available event streams:
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="subtree">
<streams
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/>
</filter>
</get>
</rpc>
Figure 1: <get> Request for Retrieval of Event Streams
After such a request, the NETCONF publisher returns a list of
available event streams as well as additional information that might
exist in the container.
<span class="grey">Voit, et al. Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a>. Dynamic Subscriptions</span>
<span class="h4"><a class="selflink" id="appendix-A.2.1" href="#appendix-A.2.1">A.2.1</a>. Establishing Dynamic Subscriptions</span>
Figure 2 shows two successful "establish-subscription" RPC requests
as per [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>]. The first request is given a subscription "id"
of 22, and the second is given an "id" of 23.
+------------+ +-----------+
| Subscriber | | Publisher |
+------------+ +-----------+
| |
| Capability Exchange |
|<---------------------------->|
| |
| |
| establish-subscription |
|----------------------------->| (a)
| RPC Reply: OK, id = 22 |
|<-----------------------------| (b)
| |
| notification message (for 22)|
|<-----------------------------|
| |
| |
| establish-subscription |
|----------------------------->|
| notification message (for 22)|
|<-----------------------------|
| RPC Reply: OK, id = 23 |
|<-----------------------------|
| |
| |
| notification message (for 22)|
|<-----------------------------|
| notification message (for 23)|
|<-----------------------------|
| |
Figure 2: Multiple Subscriptions over a NETCONF Session
<span class="grey">Voit, et al. Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
To provide examples of the information being transported, example
messages for interactions (a) and (b) in Figure 2 are detailed below
(Figures 3 and 4):
<rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<establish-subscription
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<stream-xpath-filter xmlns:ex="https://example.com/events">
/ex:foo/
</stream-xpath-filter>
<stream>NETCONF</stream>
<dscp>10</dscp>
</establish-subscription>
</rpc>
Figure 3: "establish-subscription" Request (a)
As the NETCONF publisher was able to fully satisfy the request (a),
the publisher sends the subscription "id" of the accepted
subscription in its reply message (b):
<rpc-reply message-id="102"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<id
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
22
</id>
</rpc-reply>
Figure 4: A Successful "establish-subscription" (b)
<span class="grey">Voit, et al. Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
If the NETCONF publisher had not been able to fully satisfy the
request or the subscriber has no authorization to establish the
subscription, the publisher would have sent an RPC error response.
For instance, if the "dscp" value of 10 asserted by the subscriber in
Figure 3 proved unacceptable, the publisher may have returned:
<rpc-reply message-id="102"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-app-tag>
ietf-subscribed-notifications:dscp-unavailable
</error-app-tag>
</rpc-error>
</rpc-reply>
Figure 5: An Unsuccessful "establish-subscription"
The subscriber can use this information in future attempts to
establish a subscription.
<span class="h4"><a class="selflink" id="appendix-A.2.2" href="#appendix-A.2.2">A.2.2</a>. Modifying Dynamic Subscriptions</span>
An existing subscription may be modified. The following exchange
shows a negotiation of such a modification via several exchanges
between a subscriber and a publisher. This negotiation consists of a
failed RPC modification request/response followed by a
successful one.
<span class="grey">Voit, et al. Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
+------------+ +-----------+
| Subscriber | | Publisher |
+------------+ +-----------+
| |
| notification message (for 23)|
|<-----------------------------|
| |
| modify-subscription (id = 23)|
|----------------------------->| (c)
| RPC error (with hint) |
|<-----------------------------| (d)
| |
| modify-subscription (id = 23)|
|----------------------------->|
| RPC Reply: OK |
|<-----------------------------|
| |
| notification message (for 23)|
|<-----------------------------|
| |
Figure 6: Interaction Model for Successful Subscription Modification
If the subscription being modified in Figure 6 is a datastore
subscription as per [<a href="./rfc8641" title=""Subscription to YANG Notifications for Datastore Updates"">RFC8641</a>], the modification request made in (c)
may look like that shown in Figure 7. As can be seen, the
modifications being attempted are the application of a new XPath
filter as well as the setting of a new periodic time interval.
<rpc message-id="303"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modify-subscription
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"
xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<id>23</id>
<yp:datastore-xpath-filter xmlns:ex="https://example.com/datastore">
/ex:foo/ex:bar
</yp:datastore-xpath-filter>
<yp:periodic>
<yp:period>500</yp:period>
</yp:periodic>
</modify-subscription>
</rpc>
Figure 7: Subscription Modification Request (c)
<span class="grey">Voit, et al. Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
If the NETCONF publisher can satisfy both changes, the publisher
sends a positive result for the RPC. If the NETCONF publisher cannot
satisfy either of the proposed changes, the publisher sends an RPC
error response (d). Figure 8 shows an example RPC error response for
(d) that includes a hint. This hint is an alternative time period
value that might have resulted in a successful modification:
<rpc-reply message-id="303"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-app-tag>
ietf-yang-push:period-unsupported
</error-app-tag>
<error-info>
<modify-subscription-datastore-error-info
xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<period-hint>
3000
</period-hint>
</modify-subscription-datastore-error-info>
</error-info>
</rpc-error>
</rpc-reply>
Figure 8: "modify-subscription" Failure with Hint (d)
<span class="h4"><a class="selflink" id="appendix-A.2.3" href="#appendix-A.2.3">A.2.3</a>. Deleting Dynamic Subscriptions</span>
Figure 9 demonstrates the deletion of a subscription. This
subscription may have been to either a stream or a datastore.
<rpc message-id="103"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<delete-subscription
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<id>22</id>
</delete-subscription>
</rpc>
Figure 9: "delete-subscription"
<span class="grey">Voit, et al. Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
If the NETCONF publisher can satisfy the request, the publisher
returns a reply indicating success.
If the NETCONF publisher cannot satisfy the request, the publisher
sends an <rpc-error> element indicating that the modification didn't
work. Figure 10 shows a valid response for an existing valid
subscription "id", but that subscription "id" was created on a
different NETCONF transport session:
<rpc-reply message-id="103"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-app-tag>
ietf-subscribed-notifications:no-such-subscription
</error-app-tag>
</rpc-error>
</rpc-reply>
Figure 10: An Unsuccessful "delete-subscription"
<span class="h3"><a class="selflink" id="appendix-A.3" href="#appendix-A.3">A.3</a>. Subscription State Notifications</span>
A publisher will send subscription state notifications for dynamic
subscriptions according to the definitions in [<a href="./rfc8639" title=""Subscription to YANG Notifications"">RFC8639</a>].
<span class="h4"><a class="selflink" id="appendix-A.3.1" href="#appendix-A.3.1">A.3.1</a>. "subscription-modified"</span>
As per <a href="./rfc8639#section-2.7.2">Section 2.7.2 of [RFC8639]</a>, a "subscription-modified" might be
sent over NETCONF if the definition of a configured filter changes.
A subscription state notification encoded in XML would look like:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2007-09-01T10:00:00Z</eventTime>
<subscription-modified
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<id>39</id>
<stream-xpath-filter xmlns:ex="https://example.com/events">
/ex:foo
</stream-xpath-filter>
<stream>NETCONF</stream>
</subscription-modified>
</notification>
Figure 11: "subscription-modified" Subscription State Notification
<span class="grey">Voit, et al. Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h4"><a class="selflink" id="appendix-A.3.2" href="#appendix-A.3.2">A.3.2</a>. "subscription-resumed" and "replay-complete"</span>
A "subscription-resumed" would look like:
<notification
xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2007-09-01T10:00:00Z</eventTime>
<subscription-resumed
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<id>39</id>
</subscription-resumed>
</notification>
Figure 12: "subscription-resumed" Notification
The "replay-complete" is virtually identical, with "subscription-
resumed" simply being replaced by "replay-complete".
<span class="h4"><a class="selflink" id="appendix-A.3.3" href="#appendix-A.3.3">A.3.3</a>. "subscription-terminated" and "subscription-suspended"</span>
A "subscription-terminated" would look like:
<notification
xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2007-09-01T10:00:00Z</eventTime>
<subscription-terminated
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<id>39</id>
<reason>
suspension-timeout
</reason>
</subscription-terminated>
</notification>
Figure 13: "subscription-terminated" Subscription State Notification
The "subscription-suspended" is virtually identical, with
"subscription-terminated" simply being replaced by "subscription-
suspended".
<span class="grey">Voit, et al. Standards Track [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
<span class="h3"><a class="selflink" id="appendix-A.4" href="#appendix-A.4">A.4</a>. Filter Examples</span>
This appendix provides examples that illustrate both XPath and
subtree methods of filtering event record contents. The examples are
based on the YANG notification "vrrp-protocol-error-event" as defined
per the ietf-vrrp YANG data model in [<a href="./rfc8347" title=""A YANG Data Model for the Virtual Router Redundancy Protocol (VRRP)"">RFC8347</a>]. Event records based
on this specification that are generated by the publisher might
appear as:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2018-09-14T08:22:33.44Z</eventTime>
<vrrp-protocol-error-event
xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp">
<protocol-error-reason>checksum-error</protocol-error-reason>
</vrrp-protocol-error-event>
</notification>
Figure 14: Example VRRP Notification per <a href="./rfc8347">RFC 8347</a>
Suppose that a subscriber wanted to establish a subscription that
only passes instances of event records where there is a
"checksum-error" as part of a Virtual Router Redundancy Protocol
(VRRP) protocol event. Also, assume that the publisher places such
event records into the NETCONF stream. To get a continuous series of
matching event records, the subscriber might request the application
of an XPath filter against the NETCONF stream. An "establish-
subscription" RPC to meet this objective might be:
<rpc message-id="601" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<establish-subscription
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<stream>NETCONF</stream>
<stream-xpath-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp">
/vrrp-protocol-error-event[
vrrp:protocol-error-reason="vrrp:checksum-error"]
</stream-xpath-filter>
</establish-subscription>
</rpc>
Figure 15: Establishing a Subscription Error Reason via XPath
For more examples of XPath filters, see [<a href="#ref-XPATH" title=""XML Path Language (XPath) Version 1.0"">XPATH</a>].
<span class="grey">Voit, et al. Standards Track [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
Suppose that the "establish-subscription" in Figure 15 was accepted.
And suppose that a subscriber decided later on that they wanted to
broaden this subscription to cover all VRRP protocol events (i.e.,
not just those with a "checksum-error"). The subscriber might
attempt to modify the subscription in a way that replaces the XPath
filter with a subtree filter that sends all VRRP protocol events to a
subscriber. Such a "modify-subscription" RPC might look like:
<rpc message-id="602" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modify-subscription
xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<id>99</id>
<stream-subtree-filter>
<vrrp-protocol-error-event
xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp"/>
</stream-subtree-filter>
</modify-subscription>
</rpc>
Figure 16: Example "modify-subscription" RPC
For more examples of subtree filters, see <a href="./rfc6241#section-6.4">[RFC6241], Section 6.4</a>.
<span class="grey">Voit, et al. Standards Track [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc8640">RFC 8640</a> NETCONF Notifications September 2019</span>
Acknowledgments
We wish to acknowledge the helpful contributions, comments, and
suggestions that were received from Andy Bierman, Yan Gang, Sharon
Chisholm, Hector Trevino, Peipei Guo, Susan Hares, Tim Jenkins,
Balazs Lengyel, Martin Bjorklund, Mahesh Jethanandani, Kent Watsen,
Qin Wu, and Guangying Zheng.
Authors' Addresses
Eric Voit
Cisco Systems
Email: evoit@cisco.com
Alexander Clemm
Futurewei
Email: ludwig@clemm.org
Alberto Gonzalez Prieto
Microsoft
Email: alberto.gonzalez@microsoft.com
Einar Nilsen-Nygaard
Cisco Systems
Email: einarnn@cisco.com
Ambika Prasad Tripathy
Cisco Systems
Email: ambtripa@cisco.com
Voit, et al. Standards Track [Page 19]
</pre>
|