<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="exp" consensus="true" docName="draft-ietf-netconf-adaptive-subscription-18" number="10086" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3">
  <front>
    <title abbrev="Adaptive Subscription">Adaptive Subscription to YANG Notifications</title>
    <seriesInfo name="RFC" value="10086"/>
    

    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>
          <city>Nanjing</city>
          <region>Jiangsu</region>
          <code>210012</code>
          <country>China</country>
        </postal>
        <email>bill.wu@huawei.com</email>
      </address>
    </author>
    <author fullname="Peng Liu" initials="P." surname="Liu">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <street>32 Xuanwumen West St, Xicheng District</street>
          <city>Beijing</city>
          <code>100053</code>
          <country>China</country>
        </postal>
        <email>liupengyjy@chinamobile.com</email>
      </address>
    </author>
    <author fullname="Qiufang Ma" initials="Q." surname="Ma">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>
          <city>Nanjing</city>
          <region>Jiangsu</region>
          <code>210012</code>
          <country>China</country>
        </postal>
        <email>maqiufang1@huawei.com</email>
      </address>
    </author>
    <author fullname="Wei Wang" initials="W." surname="Wang">
      <organization>China Telecom</organization>
      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>
          <city>Beijing</city>
          <code>102209</code>
          <country>China</country>
        </postal>
        <email>weiwang94@foxmail.com</email>
      </address>
    </author>
    <author fullname="Zhixiong Niu" initials="Z." surname="Niu">
      <organization>Microsoft</organization>
      <address>
        <email>Zhixiong.Niu@microsoft.com</email>
      </address>
    </author>
    <date year="2026" month="November"/>
    <area>OPS</area>
    <workgroup>NETCONF Working Group</workgroup>
    <keyword>adaptive subscription</keyword>
    <keyword>telemetry</keyword>
    <keyword>YANG-Push</keyword>
    
<abstract>
      <t>This document defines an experimental mechanism and its companion
      YANG data model to enable adaptive subscriptions to YANG notifications.
      The publisher can dynamically adjust the periodic update interval based
      on the evaluation of preconfigured conditions (e.g., thresholds or
      expressions). This allows for finer-grained telemetry by increasing
      update frequency when certain criteria are met and reducing it
      otherwise.</t>
    </abstract>
  </front>
  <middle>

    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>YANG-Push subscriptions <xref target="RFC8641" format="default"/> allow subscriber
      applications to request a continuous customized stream of updates from a
      YANG datastore without needing to poll. It defines a mechanism called
      an "update trigger" to determine when an update record needs to be generated.
      Two types of subscriptions are introduced in <xref section="3.1" sectionFormat="of" target="RFC8641" format="default"/>, distinguished by how updates are
      triggered: periodic and on-change.</t>
      <ul spacing="normal">
        <li>
          <t>Periodic subscription allows subscribed data to be streamed to
          the destination at a configured fixed time interval.</t>
        </li>
        <li>
          <t>On-change subscription allows updates to be triggered whenever a
          change in the subscribed information is detected.</t>
        </li>
      </ul>
      <t>However, in some deployments involving an increased data-collection
      rate or on-change subscription to push updates that change more
      frequently than the receiver can effectively process, it becomes more
      likely that both the receiver and the publisher could be temporarily
      overwhelmed with a burst of streamed data, and network and computation
      resources could be excessively consumed. Therefore, it may be expensive
      to continuously monitor operational data at a high collection rate, and
      on-change subscriptions are only suitable for data that changes
      infrequently and may not be supported by all implementations or every
      data object. Conversely, if a stream of data is collected at a lower
      rate or some low-priority data is allowed to be dropped, insufficient
      data might not be able to detect and diagnose service problems.</t>
      <t>A client might choose to monitor the operational state and send a
      request to modify the data-collection rate on the server (also referred
      to as the "publisher") as needed. But, how often the client evaluates if
      the modification of the data-collection rate is required highly depends
      on the current collection rate; collecting a stream of data at a low
      rate prevents the subscriber from capturing sufficient data for timely
      decision-making.</t>
      <t>This document defines an experimental mechanism and its companion
      YANG data model to enable adaptive subscription to YANG notifications.
      Servers can be configured with multiple different time periods and
      corresponding period update conditions that allow servers/publishers to
      automatically switch to different time periods according to the
      network-condition changes without the interaction with the client for
      policy-update instructions. Applying adaptive subscription allows
      publishers to adjust the subscription period dynamically based on
      predefined thresholds for finer-grained network telemetry data sent to
      receivers.</t>
      <section numbered="true" toc="default">
        <name>Terminology</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
        "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
        NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
        "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
        "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be
        interpreted as described in BCP&nbsp;14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/>
        when, and only when, they appear in all capitals, as shown here.</t>
        <t>The following terms are defined in <xref target="RFC5277" format="default"/>, <xref target="RFC7950" format="default"/>, <xref target="RFC8342" format="default"/>, <xref target="RFC8639" format="default"/>, and <xref target="RFC8641" format="default"/>; they are not redefined
        here:</t>
        <ul spacing="compact">
          <li>
            <t>Event</t>
          </li>
          <li>
            <t>Client</t>
          </li>
          <li>
            <t>Server</t>
          </li>
          <li>
            <t>Configuration</t>
          </li>
          <li>
            <t>Configured subscription</t>
          </li>
          <li>
            <t>Configuration datastore</t>
          </li>
          <li>
            <t>Notification message</t>
          </li>
          <li>
            <t>Publisher</t>
          </li>
          <li>
            <t>Receiver</t>
          </li>
          <li>
            <t>Subscriber</t>
          </li>
          <li>
            <t>Subscription</t>
          </li>
          <li>
            <t>On-change subscription</t>
          </li>
          <li>
            <t>Periodic subscription</t>
          </li>
          <li>
            <t>Selection filter</t>
          </li>
          <li>
            <t>Datastore node</t>
          </li>
          <li>
            <t>Update trigger</t>
          </li>
          <li>
            <t>Update record</t>
          </li>
        </ul>
        <t>This document defines the following term:</t>
        <dl newline="false" spacing="normal">
          <dt>Adaptive subscription:</dt>
          <dd>A subscription that specifies the policy on
            subscription period updates on the servers when the
            subscription is initialized and allows servers or publishers to
            automatically switch to different time periods according to
            network-condition changes without interacting with the client for
            update policy instructions. This mechanism also requires the
            client to handle varying update time periods and potential
            increases in update volume resulting from interval switches.</dd>
        </dl>

	
      </section>
      <section numbered="true" toc="default">
        <name>Experimental Considerations</name>
        <t>The YANG data model and associated mechanism detailed in this
        document are designated as experimental.  The experiment aims to explore:</t>
<ul spacing="normal">
  <li>the use of XML Path Language (XPath) condition expressions, as defined in the
    "eval-expression" parameter, to determine the time period at
    which updates are reported;
  </li>
  <li>
    the selection of the "eval-interval" parameter to optimally
    balance detection effectiveness against system resource overhead;
    and
  </li>
  <li>
    how server resource availability impacts this balance.
  </li>
</ul>



        <t>RPC failures specified in <xref target="errors" format="default"/> prevent
        unspecified failures when the server cannot satisfy the adaptive
        subscription request. They may serve as safeguards against unstable
        behaviors or unpredictable states, thereby easing troubleshooting for
        operators.</t>
        <t>Moreover, the deployment also needs to assess whether the client
        can effectively handle varying time periods and potential
        increases in update volume resulting from adaptive interval switches,
        including client-side buffer management, processing overhead, and
        behavior when experiencing sudden bursts of updates.</t>

        <t>Additional implementations would be necessary in the future to
        assess the scalability, stability, and effectiveness of the proposed
        solution in this document. Parties participating
        in this experiment are encouraged to publish experimental results within one year
        of the publication of this document. The absence of published results
        after this period will be one factor considered by the community in
        assessing the interest level and maturity of the approach.
        Experimental results and feedback for the experiment should
        include:</t>
        <ul spacing="normal">
          <li>
            <t>Stability under high-frequency state change scenarios (e.g.,
            interface flapping).</t>
          </li>
          <li>
            <t>Scalability across diverse network scales and a description of
            these network scales.</t>
          </li>
          <li>
            <t>Operational impact on system resources.</t>
          </li>
          <li>
            <t>Operational impact on a client's ability to handle dynamically
            changing update intervals, including its resource consumption.</t>
          </li>
          <li>
            <t>Telemetry data transmission savings achieved through adaptive
            subscription compared with periodic subscription.</t>
          </li>
          <li>
            <t>Refinements to operational considerations and guidance based on
            experimental results and real-world deployment experience.</t>
          </li>
        </ul>
      </section>
    </section>

    <section numbered="true" toc="default">
      <name>Solution Overview</name>
      <section anchor="model" numbered="true" toc="default">
        <name>Adaptive Subscription Parameters</name>
        <t>Adaptive subscription can be implemented using either dynamic or
        configured subscriptions. Regardless of the type of adaptive
        subscription, triggered updates always occur at the boundaries of
        specified time intervals when the corresponding trigger condition is
        evaluated to be satisfied. These boundaries can be calculated from the
        following parameters:</t>
        <dl spacing="normal">
          <dt>"name":</dt>
          <dd>
            <t>represents the unique name of each adaptive period.</t>
          </dd>
          <dt>"eval-expression":</dt>
          <dd>
            <t>represents a standard XPath evaluation
            expression (<xref section="6.4" sectionFormat="of" target="RFC7950" format="default"/>) that is applied against the targeted data
            node, which is used to trigger/control the update interval
            switching within the server. It follows the rules defined in
            Section 3.4 of <xref target="XPATH1.0" format="default"/> and contains a comparison
            of a targeted node instance to the specific threshold in the XPath
            format. Different from "selection filter", which is defined in <xref target="RFC8641" format="default"/>, it monitors a specific data node instance
            change and evaluates the trigger condition associated with the
            specified threshold value to be "true" or "false" using XPath rules;
            it does not affect the event/update record output generation from
            a publisher. The updates are only pushed as the corresponding
            time period when the XPath expression is evaluated to
            "true".</t>
            <t>The represented expression defined
            in "eval-expression" is evaluated in the following XPath
            context:</t>
            <ul spacing="normal">
              <li>
                <t>The set of namespace declarations is the set of prefix and
                namespace pairs for all YANG modules implemented by the
                server, where the prefix is the YANG module name and the
                namespace is as defined by the "namespace" statement in the
                YANG module.</t>
              </li>
              <li>
                <t>If the leaf is encoded in XML, all namespace declarations
                in scope on the "eval-expression" leaf element are added to
                the set of namespace declarations. If a prefix found in the
                XML is already present in the set of namespace declarations,
                the namespace in the XML is used.</t>
              </li>
              <li>
                <t>The set of variable bindings is empty.</t>
              </li>
              <li>
                <t>The function library is the core function library defined
                in <xref target="XPATH1.0" format="default"/> and the functions defined in <xref section="10" sectionFormat="of" target="RFC7950" format="default"/>.</t>
              </li>
              <li>
                <t>The context node is the root node in the accessible tree,
                which is the operational state data in the server.</t>
              </li>
            </ul>
            <t>When specified, multiple XPath evaluation criteria inside
            the "adaptive-periodic" container <bcp14>MUST</bcp14> be mutually exclusive. For the
            cases where the "eval-expression" parameter refers to multiple
            list/leaf-list instances, XPath abbreviated syntax can be used to
            identify a particular instance, e.g., to represent a comparison
            for a leaf in a list entry: </t>

<sourcecode type="xpath"><![CDATA[/if:interfaces/if:interface[if:name="eth0"]/if:in-errors>1000]]></sourcecode>
            <t>The server <bcp14>MUST</bcp14> convert the XPath evaluation expression
            defined in "eval-expression" to a boolean value and internally
            apply the "boolean" function defined in Section 4.3 of <xref target="XPATH1.0" format="default"/> if the evaluated result is not a boolean
            value. It <bcp14>MUST</bcp14> evaluate to "false" if the target node instance to
            be compared is deleted. Only if the XPath expression is evaluated
            to "true" does the publisher switch to the corresponding period
            with which push updates are reported.</t>
          </dd>
          <dt>"eval-interval":</dt>
          <dd>
            <t>defines how often the XPath condition
            expression, as defined in "eval-expression", is evaluated to decide
            whether to switch to another time period. If an
            "eval-interval" is not provided, then the "eval-interval" is set
            with the minimum time interval that the server is able to detect
            whenever changes to the targeted data node occur. The selection of
            this minimum time interval is implementation specific and may vary
            dynamically based on the server's available resources (e.g.,
            memory, CPU).</t>
          </dd>
          <dt>"period":</dt>
          <dd>
            <t>defines the duration between push updates in units
            of 0.01 seconds. The "period" has the same definition as the
            "yp:period" for periodic subscription defined in <xref target="RFC8641" format="default"/>; it must be present with the
            "eval-expression" parameter so that the update interval can be
            switched based on trigger conditions indicated by the
            "eval-expression" parameter.</t>
          </dd>
          <dt>"anchor-time":</dt>
          <dd>
            <t>update intervals fall on the points in time that
            are a multiple of a "period" from an "anchor-time". If an
            "anchor-time" is not provided, then the "anchor-time" <bcp14>MUST</bcp14> be set
            with the creation time of the initial update record inside each
            periodic time frame. The "anchor-time" parameter, together with the
            "eval-interval" value, specifies when the initial update is to be
            pushed within each adaptive periodic time frame.</t>
          </dd>
        </dl>
        <t>Note that adaptive subscription may not be supported by
        every YANG datastore node. The solution presented in this document
        augments the "ietf-notification-capabilities" YANG module defined in
        <xref target="RFC9196" format="default"/> to enable a subscriber to discover adaptive
        subscription capabilities. A publisher <bcp14>MAY</bcp14> decide to simply reject an
        adaptive subscription with "adaptive-unsupported" (defined in <xref target="errors" format="default"/>) if the subscription contains selected data nodes
        for which adaptive subscription is not supported.</t>
      </section>
      <section anchor="errors" numbered="true" toc="default">
        <name>RPC Failures</name>
        <t>RPC error responses from the publisher are used to indicate a
        rejection of an RPC for any reason. In addition to the RPC failures
        defined in <xref target="RFC8639" format="default"/> and <xref target="RFC8641" format="default"/>, this
        document introduces the following RPC errors for the "establish-subscription"
        and "modify-subscription" RPCs.</t>

        <table anchor="tab-rpc-errors">
          <thead>
            <tr>
              <th align="left">establish-subscription</th>
              <th align="left">modify-subscription</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">adaptive-unsupported</td>
              <td align="left"></td>
            </tr>
            <tr>
              <td align="left">xpath-evaluation-unsupported</td>
              <td align="left">xpath-evaluation-unsupported</td>
            </tr>
            <tr>
              <td align="left">evaluation-interval-unsupported</td>
              <td align="left">evaluation-interval-unsupported</td>
            </tr>
            <tr>
              <td align="left">multi-xpath-criteria-conflict</td>
              <td align="left">multi-xpath-criteria-conflict</td>
            </tr>
          </tbody>
        </table>
        <t>The "adaptive-unsupported" RPC error is used to indicate that the
        adaptive subscription is not supported for the targeted set of data
        nodes that are selected by the filter.</t>
        <t>The "xpath-evaluation-unsupported" RPC error is used to indicate
        that a server failed to parse the syntax defined in "eval-expression". The
        failure can be caused by either a syntax error or some XPath 1.0
        syntax not supported against the specific data node. The
        "error-message" should provide further details to help operators
        identify the exact cause for troubleshooting purposes.</t>
        <t>The "evaluation-interval-unsupported" RPC error is used to indicate
        that the requested XPath evaluation interval represented by
        "eval-interval" is too short. Hints suggesting alternative intervals
        may be returned as supplementary information.</t>
        <t>The "multi-xpath-criteria-conflict" RPC error is used to indicate that
        the multiple XPath evaluation criteria represented by
        "eval-expression" are evaluated as conflicting, i.e., more than one
        condition expression may be evaluated to "true" at the same time.</t>
        <t>Refer to <xref target="failure_example" format="default"/> for some examples of how
        the above RPC errors can be returned.</t>
        <t>Note that existing RPC errors defined in <xref target="RFC8639" format="default"/>
        and <xref target="RFC8641" format="default"/> are still supported by this document. For
        example, if any configured period for adaptive subscription is not
        supported by the publisher, a "period-unsupported" error response
        could be used.</t>
      </section>
      <section numbered="true" toc="default">
        <name>Subscription State Change Notifications</name>
        <t>This document reuses subscription state change notifications and
        mechanisms from <xref target="RFC8639" format="default"/> and <xref target="RFC8641" format="default"/>.
        The "subscription-started" and "subscription-modified" notifications have
        been augmented to include the parameters specific to adaptive subscription.</t>
      </section>
      <section numbered="true" toc="default">
        <name>Notifications for Adaptive Subscribed Content</name>
        <t>This document also defines a new subscription state change
        notification called "adaptive-period-update" to indicate that an
        adaptive subscription time period has been switched based on its
        trigger condition. Similar to subscription state change notifications
        defined in <xref target="RFC8639" format="default"/>:</t>
	<ul>
	  <li>the adaptive period update
          notification cannot be dropped or filtered out;</li>
	  <li>it cannot be stored in
          replay buffers; and</li>
	  <li>it is delivered only to impacted receivers of a
          subscription.</li>
	</ul>
	<t>The identification of the adaptive update notification
        is easy to separate from other notification messages using the YANG
        extension "subscription-state-notification" defined in <xref target="RFC8639" format="default"/>. This extension tags a notification as a
        subscription state change notification.</t>
        <t>The elements in the "adaptive-period-update" notification
        include:</t>
        <ul spacing="normal">
          <li>
            <t>A subscription ID of the subscription for which the update
            record was generated.</t>
          </li>
          <li>
            <t>A "period" that defines the duration between push updates; the
            period can be changed based on trigger conditions.</t>
          </li>
          <li>
            <t>A "period-update-time" that refers to the timestamp when the
            server switched to another time period because the evaluated
            "eval-expression" result changed.</t>
          </li>
          <li>
            <t>A chunk of data defined as an anydata node <xref target="RFC7950" format="default"/> called "satisfied-criteria-data" to include the
            instance nodes and values specified in "eval-expression" that
            satisfy the condition and thus trigger the time period
            switching within the server. This node could be useful for
            troubleshooting.</t>
          </li>
          <li>
            <t>A selection filter to identify YANG nodes of interest in a
            datastore. Filter contents are specified via a reference to an
            existing filter or via an in-line definition for only that
            subscription based on XPath evaluation criteria (see <xref section="6.4" sectionFormat="of" target="RFC7950" format="default"/>). Referenced filters allow
            an implementation to avoid evaluating filter acceptability during
            a dynamic subscription request. The "case" statement
            differentiates the options. Note that filter contents are not
            affected by the "eval-expression" parameter defined by the update
            trigger.</t>
          </li>
        </ul>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Adaptive Subscription Data Model</name>
      <t>This document defines a YANG module named
      "ietf-adaptive-subscription" that augments the "update-trigger" choice
      defined in the "ietf-yang-push" module <xref target="RFC8641" format="default"/> with
      subscription configuration parameters that are specific to a
      subscriber's adaptive subscription.</t>
      <t>In addition to subscription state notifications defined in <xref target="RFC8639" format="default"/> and notifications for subscribed content defined in
      <xref target="RFC8641" format="default"/>, the "ietf-adaptive-subscription" module also
      defines the "adaptive-period-update" notification to report the update
      interval change.</t>
      <t>Additionally, it augments the "ietf-notification-capabilities" module
      defined in <xref target="RFC9196" format="default"/> so that the adaptive subscription
      capabilities can be discovered beforehand.</t>
      <section numbered="true" toc="default">
        <name>YANG Tree Diagram</name>
        <t>The following tree diagram <xref target="RFC8340" format="default"/> provides an
        overview of the data model for "ietf-adaptive-subscription"
        module.</t>

<sourcecode type="yangtree"><![CDATA[module: ietf-adaptive-subscription
  augment /sn:subscriptions/sn:subscription/yp:update-trigger:
    +--:(adaptive-periodic) {adaptive-subscription}?
       +--rw adaptive-periodic
          +--rw periodic* [name]
             +--rw name               string
             +--rw eval-expression    yang:xpath1.0
             +--rw eval-interval?     yp:centiseconds
             +--rw period             yp:centiseconds
             +--rw anchor-time?       yang:date-and-time
  augment /sn:establish-subscription/sn:input/yp:update-trigger:
    +--:(adaptive-periodic) {adaptive-subscription}?
       +-- adaptive-periodic
          +-- periodic* [name]
             +-- name               string
             +-- eval-expression    yang:xpath1.0
             +-- eval-interval?     yp:centiseconds
             +-- period             yp:centiseconds
             +-- anchor-time?       yang:date-and-time
  augment /sn:modify-subscription/sn:input/yp:update-trigger:
    +--:(adaptive-periodic) {adaptive-subscription}?
       +-- adaptive-periodic
          +-- periodic* [name]
             +-- name               string
             +-- eval-expression    yang:xpath1.0
             +-- eval-interval?     yp:centiseconds
             +-- period             yp:centiseconds
             +-- anchor-time?       yang:date-and-time
  augment /sn:subscription-started/yp:update-trigger:
    +--:(adaptive-periodic) {adaptive-subscription}?
       +-- adaptive-periodic
          +-- periodic* [name]
             +-- name               string
             +-- eval-expression    yang:xpath1.0
             +-- eval-interval?     yp:centiseconds
             +-- period             yp:centiseconds
             +-- anchor-time?       yang:date-and-time
  augment /sn:subscription-modified/yp:update-trigger:
    +--:(adaptive-periodic) {adaptive-subscription}?
       +-- adaptive-periodic
          +-- periodic* [name]
             +-- name               string
             +-- eval-expression    yang:xpath1.0
             +-- eval-interval?     yp:centiseconds
             +-- period             yp:centiseconds
             +-- anchor-time?       yang:date-and-time
  augment /sysc:system-capabilities/notc:subscription-capabilities:
    +--ro adaptive-notifications-supported?   notification-support
  augment /sysc:system-capabilities/sysc:datastore-capabilities
            /sysc:per-node-capabilities
            /notc:subscription-capabilities:
    +--ro adaptive-notifications-supported?   notification-support

  notifications:
    +---n adaptive-period-update {adaptive-subscription}?
       +--ro id?
       |       sn:subscription-id
       +--ro period                                  yp:centiseconds
       +--ro period-update-time?
       |       yang:date-and-time
       +--ro satisfied-criteria-data?                <anydata>
       +--ro datastore                               identityref
       +--ro (selection-filter)?
          +--:(by-reference)
          |  +--ro selection-filter-ref
          |          selection-filter-ref
          +--:(within-subscription)
             +--ro (filter-spec)?
                +--:(datastore-subtree-filter)
                |  +--ro datastore-subtree-filter?   <anydata>
                |          {sn:subtree}?
                +--:(datastore-xpath-filter)
                   +--ro datastore-xpath-filter?     yang:xpath1.0
                           {sn:xpath}?]]></sourcecode>
      </section>
      <section anchor="adaptive" numbered="true" toc="default">
        <name>The "ietf-adaptive-subscription" Module</name>
        <t>This YANG module imports modules from <xref target="RFC8639" format="default"/>, <xref target="RFC8641" format="default"/>,
        <xref target="RFC9196" format="default"/>, and <xref target="RFC9911" format="default"/>.</t>

	
        <sourcecode name="ietf-adaptive-subscription@2026-11-30.yang" type="yang" markers="true"><![CDATA[
module ietf-adaptive-subscription {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-adaptive-subscription";
  prefix adaps;

  import ietf-subscribed-notifications {
    prefix sn;
    reference
      "RFC 8639: Subscription to YANG Notifications";
  }
  import ietf-yang-push {
    prefix yp;
    reference
      "RFC 8641: Subscription to YANG Notifications for Datastore
       Updates";
  }
  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 9911: Common YANG Data Types";
  }
  import ietf-system-capabilities {
    prefix sysc;
    reference
      "RFC 9196: YANG Modules Describing Capabilities for
       Systems and Datastore Update Notifications";
  }
  import ietf-notification-capabilities {
    prefix notc;
    reference
      "RFC 9196: YANG Modules Describing Capabilities for
       Systems and Datastore Update Notifications";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
     WG List:  NETCONF <mailto:netconf@ietf.org>

     Author:   Qin Wu
               <mailto:bill.wu@huawei.com>
     Author:   Peng Liu
               <mailto:liupengyjy@chinamobile.com>
     Author:   Qiufang Ma
               <mailto:maqiufang1@huawei.com>
     Author:   Wei Wang
               <mailto:weiwang94@foxmail.com>
     Author:   Zhixiong Niu
               <mailto:Zhixiong.Niu@microsoft.com>";
  description
    "This module defines an experimental YANG module that
     extends YANG-Push to enable the subscriber's adaptive
     subscriptions to a publisher's event streams with various
     different time periods to report updates.

     Copyright (c) 2026 IETF Trust and the persons identified
     as authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     All revisions of IETF and IANA published modules can be
     found at the YANG Parameters registry group
     (https://www.iana.org/assignments/yang-parameters).

     This version of this YANG module is part of RFC 10086; see
     the RFC itself for full legal notices.";

  revision 2026-11-30 {
    description
      "Initial revision.";
    reference
      "RFC 10086: Adaptive Subscription to YANG Notifications";
  }

  feature adaptive-subscription {
    description
      "This feature indicates that adaptive subscriptions are
       supported.";
  }

  identity adaptive-unsupported {
    base sn:establish-subscription-error;
    description
      "Adaptive subscription is not supported for the targeted set
       of objects that are selectable by the filter.";
  }

  identity xpath-evaluation-unsupported {
    base sn:establish-subscription-error;
    base sn:modify-subscription-error;
    description
      "Unable to parse the XPath evaluation criteria defined in
       'eval-expression' because of a syntax error or some XPath
       1.0 syntax not supported against the specific data node.";
  }

  identity evaluation-interval-unsupported {
    base sn:establish-subscription-error;
    base sn:modify-subscription-error;
    description
      "The requested XPath evaluation interval represented by
       'eval-interval' is too short.  Hints suggesting alternative
       intervals may be returned as supplementary information.";
  }

  identity multi-xpath-criteria-conflict {
    base sn:establish-subscription-error;
    base sn:modify-subscription-error;
    description
      "Multiple XPath evaluation criteria represented by
       'eval-expression' are evaluated as a conflict.
       That is, more than one condition expression is
       evaluated to 'true'.";
  }

  grouping adaptive-subscription-modifiable {
    description
      "This grouping describes the datastore-specific adaptive
       subscription conditions that can be changed during the
       lifetime of the subscription.";
    container adaptive-periodic {
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The publisher supports
         switching to different time periods adaptively based
         on predefined condition expressions.";
      list periodic {
        key "name";
        description
          "A list of adaptive periods that define a push update
           interval and trigger conditions to switch to the update
           interval for sending an event record to the subscriber.";
        leaf name {
          type string;
          description
            "A name that uniquely identifies an adaptive period
             within the same subscription.";
        }
        leaf eval-expression {
          type yang:xpath1.0;
          mandatory true;
          description
            "A standard XPath evaluation expression that is applied
             against the targeted data node, which is used to
             trigger/control the update interval switching within
             the server.  The updates are only pushed at the
             corresponding time period when the XPath expression
             is evaluated to 'true'.

             The expression is evaluated in the following XPath
             context:
             -  The set of namespace declarations is the set of
                prefix and namespace pairs for all YANG modules
                implemented by the server, where the prefix is the
                YANG module name and the namespace is as defined by
                the 'namespace' statement in the YANG module.

             -  If the leaf is encoded in XML, all namespace
                declarations in scope on the 'eval-expression' leaf
                element are added to the set of namespace
                declarations.  If a prefix found in the XML is
                already present in the set of namespace
                declarations, the namespace in the XML is used.

             -  The set of variable bindings is empty.

             -  The function library is the core function library
                defined in XPath 1.0 and the functions defined in
                Section 10 of RFC 7950.

             -  The context node is the root node in the accessible
                tree, which is the operational state data in the
                server.";
          reference
            "XML Path Language (XPath) Version 1.0
             (https://www.w3.org/TR/1999/REC-xpath-19991116)
             RFC 7950: The YANG 1.1 Data Modeling Language,
                       Section 10";
        }
        leaf eval-interval {
          type yp:centiseconds;
          description
            "How often the XPath condition expression represented
             by 'eval-expression' is evaluated to decide whether
             to switch to another time period in units of 0.01
             seconds.  If this parameter is not provided, it is set
             with the minimum time interval that the server is able
             to detect whenever changes to the targeted data node
             occur.";
        }
        leaf period {
          type yp:centiseconds;
          mandatory true;
          description
            "Duration of time that should occur between periodic
             push updates in units of 0.01 seconds.";
        }
        leaf anchor-time {
          type yang:date-and-time;
          description
            "Designates a timestamp before or after which a series
             of periodic push updates is determined.  The next
             update will take place at a point in time that is a
             multiple of a period from the 'anchor-time'.
             For example, for an 'anchor-time' that is set for the
             top of a particular minute and a time period of a
             minute, updates will be sent at the top of every
             minute that this subscription is active.";
        }
      }
    }
  }

  augment "/sn:subscriptions/sn:subscription/yp:update-trigger" {
    description
      "This augmentation adds additional subscription parameters
       that apply specifically to adaptive subscription.";
    case adaptive-periodic {
      if-feature "adaptive-subscription";
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The periodicity of
         these notifications is determined by adaptive criteria.";
      uses adaptive-subscription-modifiable;
    }
  }

  augment "/sn:establish-subscription/sn:input/yp:update-trigger" {
    description
      "This augmentation adds additional establish-subscription
       parameters that apply specifically to datastore updates to
       RPC input.";
    case adaptive-periodic {
      if-feature "adaptive-subscription";
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The periodicity of
         these notifications is determined by adaptive criteria.";
      uses adaptive-subscription-modifiable;
    }
  }

  augment "/sn:modify-subscription/sn:input/yp:update-trigger" {
    description
      "This augmentation adds additional modify-subscription
       parameters that apply specifically to datastore updates to
       RPC input.";
    case adaptive-periodic {
      if-feature "adaptive-subscription";
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The periodicity of
         these notifications is determined by adaptive criteria.";
      uses adaptive-subscription-modifiable;
    }
  }

  augment "/sn:subscription-started/yp:update-trigger" {
    description
      "This augmentation adds additional adaptive subscription
       parameters to the notification that a subscription has
       started.";
    case adaptive-periodic {
      if-feature "adaptive-subscription";
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The periodicity of
         these notifications is determined by adaptive criteria.";
      uses adaptive-subscription-modifiable;
    }
  }

  augment "/sn:subscription-modified/yp:update-trigger" {
    description
      "This augmentation adds additional adaptive subscription
       parameters to the notification that a subscription has been
       modified.";
    case adaptive-periodic {
      if-feature "adaptive-subscription";
      description
        "The publisher is requested to periodically notify the
         receiver regarding the current values of the datastore
         as defined by the selection filter.  The periodicity of
         these notifications is determined by adaptive criteria.";
      uses adaptive-subscription-modifiable;
    }
  }

  notification adaptive-period-update {
    if-feature "adaptive-subscription";
    sn:subscription-state-notification;
    description
      "This notification is sent to indicate that an adaptive
       subscription time period has been switched based on
       its trigger condition.";
    leaf id {
      type sn:subscription-id;
      description
        "This references the subscription that drove the
         notification to be sent.";
    }
    leaf period {
      type yp:centiseconds;
      mandatory true;
      description
        "New duration of time that should occur between periodic
         push updates in units of 0.01 seconds.";
    }
    leaf period-update-time {
      type yang:date-and-time;
      description
        "The timestamp when the server switched to another time
         period because the evaluated 'eval-expression' result
         changed.";
    }
    anydata satisfied-criteria-data {
      description
        "The corresponding instance nodes and values specified in
         'eval-expression' that satisfied the condition and thus
         triggered the update interval switching within the server.";
    }
    uses yp:datastore-criteria {
      refine "selection-filter/within-subscription" {
        description
          "Specifies the selection filter and where it originated
           from.  If the 'selection-filter-ref' is populated, the
           filter in the subscription came from the 'filters'
           container.  Otherwise, it is populated in-line as part
           of the subscription itself.";
      }
    }
  }

  grouping adaptive-subscription-capabilities {
    description
      "Capabilities related to adaptive subscription and
       notification.";
    typedef notification-support {
      type bits {
        bit config-changes {
          description
            "The publisher is capable of sending
             notifications for 'config true' nodes for the
             relevant scope and subscription type.";
        }
        bit state-changes {
          description
            "The publisher is capable of sending
             notifications for 'config false' nodes for the
             relevant scope and subscription type.";
        }
      }
      description
        "Type for defining whether 'adaptive' notifications are
         supported for all data nodes, 'config false' data nodes,
         'config true' data nodes, or no data nodes.

         The bits config-changes or state-changes have no effect
         when they are set for a datastore or for a set of nodes
         that does not contain nodes with the indicated config
         value.  In those cases, the effect is the same as if no
         support were declared.  One example of this is indicating
         support for state-changes for a candidate datastore that
         has no effect.";
    }

    leaf adaptive-notifications-supported {
      type notification-support;
      description
        "Specifies whether the publisher is capable of sending
         'adaptive' notifications for the selected data nodes,
         including any subtrees that may exist below them.";
    }
  }

  augment "/sysc:system-capabilities"
        + "/notc:subscription-capabilities" {
    description
      "Add system-level capabilities of adaptive subscription.";
    uses adaptive-subscription-capabilities;
  }

  augment
    "/sysc:system-capabilities/sysc:datastore-capabilities/"
  + "sysc:per-node-capabilities/notc:subscription-capabilities" {
    description
      "Add node-level capabilities of adaptive subscription.";
    uses adaptive-subscription-capabilities;
  }
}
]]></sourcecode>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="xml" numbered="true" toc="default">
        <name>IETF XML Registry</name>
        <t>IANA has registered the following URI in the "ns"
        registry within the "IETF XML Registry" registry group <xref target="RFC3688" format="default"/>:</t>
        <dl spacing="compact">
          <dt>URI:</dt>
          <dd>urn:ietf:params:xml:ns:yang:ietf-adaptive-subscription</dd>
          <dt>Registrant Contact:</dt>
          <dd>The IESG</dd>
          <dt>XML:</dt>
          <dd>N/A; the requested URI is an XML namespace.</dd>
        </dl>
      </section>
      <section anchor="module" numbered="true" toc="default">
        <name>YANG Module Names Registry</name>
        <t>IANA has registered the following YANG module in the
        "YANG Module Names" registry <xref target="RFC6020" format="default"/>  within the "YANG
        Parameters" registry group.</t>
        <dl spacing="compact">
          <dt>Name:</dt>
          <dd>ietf-adaptive-subscription</dd>
          <dt>Maintained by IANA?</dt>
          <dd>N</dd>
          <dt>Namespace:</dt>
          <dd>urn:ietf:params:xml:ns:yang:ietf-adaptive-subscription</dd>
          <dt>Prefix:</dt>
          <dd>adaps</dd>
          <dt>Reference:</dt>
          <dd>RFC 10086</dd>
        </dl>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Operational Considerations</name>
      <section numbered="true" toc="default">
        <name>XPath Complexity Evaluation</name>
        <t>YANG-Push subscriptions <xref target="RFC8641" format="default"/> specify selection
        filters to identify targeted YANG datastore nodes and/or datastore
        subtrees for which updates are to be pushed. In addition, they specify
        update policies that contain conditions that trigger generation and
        pushing of new update records. To support a subscriber's adaptive
        subscription defined in this document, the trigger condition also uses
        similar selection filters to express a standard XPath evaluation
        criterion that is applied against the targeted data node(s).</t>
        <t>Care must be taken when using an arbitrary complex XPath evaluation
        criteria. While well supported by Section 3.4 of <xref target="XPATH1.0" format="default"/>, it could be error prone, exhaust computational
        resources, or not be fully implemented by XPath interpreters in real
        deployments. Some examples are given below for illustration:</t>
        <ul spacing="normal">
          <li>
            <t>Applying XPath evaluation criteria on any arbitrary "config
            true" and "config false" data nodes;</t>
          </li>
          <li>
            <t>Including more than one target data node selection and
            operation (e.g., addition, subtraction, division, and
            multiplication) within a single XPath evaluation criterion;</t>
          </li>
          <li>
            <t>Targeting any type of node value in the XPath evaluation
            criterion, e.g., string, int64, uint64, and decimal64 types;</t>
          </li>
          <li>
            <t>Comparing two node-sets within the XPath evaluation
            criterion;</t>
          </li>
          <li>
            <t>Comparing targeted data of different data types, e.g., one is
            an integer and the other is a string.</t>
          </li>
        </ul>
        <t>As described in <xref section="6.4" sectionFormat="of" target="RFC7950" format="default"/>, numbers in XPath 1.0 are IEEE 754 <xref target="IEEE754-2019" format="default"/> double-precision floating-point values; some
        values of int64, uint64, and decimal64 types cannot be exactly
        represented in XPath expressions.</t>
        <t>If targeted data to be compared are in different data types, a
        conversion function is needed to convert different data types into
        numbers.</t>
        <t>If both objects in XPath evaluation criteria to be compared are
        node-sets, more computation resources are required, which adds
        complexity.</t>
        <t>To reduce these complexities, the following implementation and use
        principles are <bcp14>RECOMMENDED</bcp14>:</t>
        <ul spacing="normal">
          <li>
            <t>XPath evaluation criteria are applied against a minimal set of
            data nodes in the data model. The minimal set of data nodes can be
            advertised using the "ietf-notification-capabilities" module defined
            in <xref target="RFC9196" format="default"/>;</t>
          </li>
          <li>
            <t>Both targets in the XPath evaluation criterion to be compared
            are in the same data type;</t>
          </li>
          <li>
            <t>When comparing a numerical leaf or leaf-list node (e.g.,
            signed/unsigned integer) against a threshold value, use a constant
            numeric value in the XPath evaluation criteria.</t>
          </li>
        </ul>
        <t>If a server receives an XPath evaluation criterion with some XPath
        syntax unsupported against the specific targeted data node, an RPC
        error with "xpath-evaluation-unsupported" <bcp14>MUST</bcp14> be returned. A
        mechanism for clients to discover supported XPath capabilities may be
        considered in the future as an operational enhancement, pending
        implementation experience gathered from this experiment.</t>
      </section>
      <section numbered="true" toc="default">
        <name>Threshold Selection for XPath Evaluation</name>
        <t>Determining the threshold used in an XPath expression criterion can
        be challenging for subscribers sometimes. Generally, the selection of
        a threshold should be based on the impact of the targeted node on the
        monitored service/application and experience from deployments. In
        extreme cases, setting an excessively high or low threshold may cause
        adaptive subscription to degenerate to periodic subscription.
        Sometimes the threshold needs to be adjusted during the lifecycle of
        an adaptive subscription, depending on factors like historical
        fluctuation range, how rapidly the targeted value of the node changes,
        distribution characteristics of the targeted node value, and even the
        generated volume of telemetry traffic.</t>
      </section>
      <section numbered="true" toc="default">
        <name>Deployment and Monitoring Considerations</name>
        <t>Subscribers are recommended to deploy adaptive subscriptions
        starting with conservative adaptation parameters (e.g., a minimum
        supported "eval-interval" value) to observe system behavior. An
        improperly configured adaptive subscription may lead to operational
        instability. Care must be taken when designing evaluation expressions.
        For example, a high volume of "adaptive-period-update" notifications
        within a short time window is a primary indicator of oscillation or
        unstable evaluation expressions. Other potential failure scenarios
        include invalid or unsupported XPath condition expressions, exhausted
        system resources, and unsupported time periods, all of which could
        result in RPC errors.</t>
        <t>To support operational visibility and troubleshooting, the
        following signals are recommended for monitoring:</t>
        <ul spacing="normal">
          <li>
            <t>The "adaptive-period-update" notification, indicating that an
            adaptive subscription time period has been updated.</t>
          </li>
          <li>
            <t>Subscription state change notifications, indicating events
            related to adaptive subscription management have occurred.</t>
          </li>
          <li>
            <t>RPC failures, indicating why a specific adaptive subscription
            could not be created or modified.</t>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      
      <t>This section is modeled after the template described in <xref target="RFC9907" section="3.7.1" sectionFormat="of" format="default"/>.</t>
      <t>The "ietf-adaptive-subscription" YANG module defines a data model
      that is designed to be accessed via YANG-based management protocols,
      such as the Network Configuration Protocol (NETCONF) <xref target="RFC6241" format="default"/> and RESTCONF <xref target="RFC8040" format="default"/>.  These YANG-based management protocols (1) have to
      use a secure transport layer (e.g., SSH <xref target="RFC4253" format="default"/>, TLS
      <xref target="RFC9846" format="default"/>, and QUIC <xref target="RFC9000" format="default"/>) and (2) have to use mutual authentication
      (e.g., for SSH, the SSH Authentication Protocol <xref target="RFC4252" format="default"/>).</t>
      <t>The Network Configuration Access Control Model (NACM) <xref target="RFC8341" format="default"/> provides the means to restrict access for particular
      NETCONF or RESTCONF users to a preconfigured subset of all available
      NETCONF or RESTCONF protocol operations and content.</t>
      <t>There are a number of data nodes defined in this YANG module that are
      writable/creatable/deletable (i.e., "config true", which is the
      default).  All writable data nodes are likely to be reasonably sensitive
      or vulnerable in some network environments.  Write operations (e.g.,
      &lt;edit-config&gt;) and delete operations to these data nodes without proper
      protection or authentication can have a negative effect on network
      operations.  The following subtrees and data nodes have particular
      sensitivities/vulnerabilities:</t>
      <dl newline="true" spacing="normal">
        <dt>"periodic":</dt>
        <dd>By modifying this list, an attacker might alter the
          updates that are being sent in order to confuse a receiver, withhold
          certain updates to be sent to the receiver, and/or overwhelm a
          receiver.  For example, an attacker might modify the period with
          which updates are reported and/or the XPath evaluation expression,
          resulting in certain updates not being published or a high volume of
          updates being published to exhaust receiver resources.</dd>
      </dl>
      <t>Some of the readable data nodes in this YANG module may be considered
      sensitive or vulnerable in some network environments.  It is thus
      important to control read access (e.g., via get, get-config, or
      notification) to these data nodes.  There are no particularly sensitive
      readable data nodes.</t>
      <t>This YANG module uses groupings from other YANG modules that define
      nodes that may be considered sensitive or vulnerable in network
      environments.  Refer to the Security Considerations of <xref target="RFC8641" format="default"/> for information as to which nodes may be considered
      sensitive or vulnerable in network environments.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5277.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9911.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8639.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8641.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9196.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
	
        <reference anchor="XPATH1.0" target="https://www.w3.org/TR/1999/REC-xpath-19991116/">
          <front>
            <title>XML Path Language (XPath) Version 1.0</title>
            <author initials="J." surname="Clark" fullname="James Clark" role="editor"/>
            <author initials="S." surname="DeRose" fullname="Steve DeRose" role="editor"/>
            <date day="16" month="November" year="1999"/>
          </front>
          <refcontent>W3C Recommendation</refcontent>
          <annotation>Latest version available at <eref target="https://www.w3.org/TR/xpath/" brackets="angle"/>.</annotation>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4252.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9907.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9846.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4253.xml"/>
	
        <reference anchor="IEEE754-2019" target="https://doi.org/10.1109/IEEESTD.2019.8766229">
          <front>
            <title>IEEE Standard for Floating-Point Arithmetic</title>
            <author>
              <organization>IEEE</organization>
            </author>
            <date month="July" year="2019"/>
          </front>
          <seriesInfo name="IEEE Std" value="754-2019"/>
          <seriesInfo name="DOI" value="10.1109/IEEESTD.2019.8766229"/>
        </reference>
	
        <reference anchor="MATTER" target="https://csa-iot.org/all-solutions/matter/">
          <front>
            <title>Matter Specification Version 1.6.1</title>
            <author>
              <organization>CSA</organization>
            </author>
            <date month="September" year="2026"/>
          </front>
        </reference>
      </references>
    </references>
    <section numbered="true" toc="default">
      <name>Use Cases</name>
      <t>The use cases presented in this section are for illustrative
      purposes.</t>
      <section numbered="true" toc="default">
        <name>Wireless Network Performance Monitoring</name>
        <t>Wireless signal strength is a critical factor in determining the
        quality and reliability of a wireless network connection. In practical
        scenarios, when the wireless signal strength drops below a specific
        threshold, the network may experience issues such as increased
        latency, packet loss, or even disconnections, which would require more
        frequent monitoring of network and service performance metrics to
        detect anomalies in a timely manner. Conversely, when the wireless
        signal strength exceeds a specific threshold, indicating a stable and
        strong connection, the data streaming rate can be reduced to a
        reasonable value to help conserve network bandwidth and computational
        resources.</t>
        <t>To optimize the process, adaptive subscription can be employed.
        When the wireless signal strength falls below a configured threshold,
        the subscribed data can be streamed at a higher rate to capture
        potentially important data and events that might indicate continuous
        service degeneration or anomalies; while when the wireless signal
        strength crosses a configured threshold, the subscribed data can be
        streamed at a lower rate to maintain efficient resource
        utilization.</t>
      </section>
      <section numbered="true" toc="default">
        <name>Reducing Impact on High-CPU Utilization</name>
        <t>Continuous monitoring of some metrics is essential for maintaining
        network and service health; however, this can place a significant
        burden on the device's CPU utilization, especially when the device is
        running resource-intensive tasks and is overloaded. When the CPU
        utilization on the device exceeds a certain high-level value, it is
        crucial to manage the network monitoring process in a way that
        minimizes its impact on overall system performance.</t>
        <t>In such cases, adaptive subscription can dynamically adjust the
        time period with which to report streaming updates and help balance
        monitoring needs with computational demands. When the CPU utilization
        on the device exceeds a certain high-level value, the subscriber can
        specify a longer time period for some less critical statistics to
        make room and save more resources. Conversely, when the CPU
        utilization falls below a specified threshold, indicating that the device
        has sufficient idle resources, the subscriber can revert to a shorter
        time period for streaming data without exhausting the CPU
        resources at the same time.</t>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Example YANG Module</name>
      <t>This section presents an example YANG module so that <xref target="usage" format="default"/> can give examples of how the YANG module defined in
      <xref target="adaptive" format="default"/> is used to perform adaptive subscription. The
      example YANG module used in this section represents  Wi-Fi Network
      Diagnostics data specified in <xref target="MATTER" format="default"/>, which can be used by
      a Node to assist a user or Administrative Node in diagnosing potential
      problems.</t>
      <t>The YANG tree diagram for the "example-wifi-network-diagnostic"
      module:</t>
      <sourcecode type="yangtree"><![CDATA[module: example-wifi-network-diagnostic
  +--ro server
  |  +--ro bssid?                       yang:mac-address
  |  +--ro security-type?               enumeration
  |  +--ro wifi-version?                enumeration
  |  +--ro channel-num?                 int8
  |  +--ro rssi?                        int8
  |  +--ro beacon-lost-count?           yang:zero-based-counter32
  |  +--ro beacon-rx-count?             yang:zero-based-counter32
  |  +--ro packet-multicast-rx-count?   yang:zero-based-counter32
  |  +--ro packet-multicast-tx-count?   yang:zero-based-counter32
  |  +--ro packet-unicast-rx-count?     yang:zero-based-counter32
  |  +--ro packet-unicast-tx-count?     yang:zero-based-counter32
  |  +--ro current-max-rate?            uint32
  |  +--ro overrun-count?               yang:zero-based-counter32
  +--ro events
     +--ro event* [name]
        +--ro name                   string
        +--ro disconnection?         enumeration
        +--ro association-failure?   enumeration
        +--ro connection-status?     enumeration]]></sourcecode>
      <section anchor="example-module" numbered="true" toc="default">
        <name>"example-wifi-network-diagnostic" YANG Module</name>

        <sourcecode type="yang"><![CDATA[module example-wifi-network-diagnostic {
  yang-version 1;
  namespace "https://example.com/yang/wifi-network-diagnostic";
  prefix ex-wnd;

  import ietf-yang-types {
    prefix yang;
  }

  container server {
    config false;
    description
      "Configuration of the Wi-Fi server logical entity.";
    leaf bssid {
      type yang:mac-address;
      description
        "The Media Access Control (MAC) address of a
         wireless access point.";
    }
    leaf security-type {
      type enumeration {
        enum unspecified {
          value 0;
        }
        enum none {
          value 1;
        }
        enum wep {
          value 2;
        }
        enum wpa {
          value 3;
        }
        enum wpa2 {
          value 4;
        }
        enum wpa3 {
          value 5;
        }
      }
      description
        "The type of Wi-Fi security used.  A value of 0
         indicates that the interface is not currently
         configured or operational.";
    }
    leaf wifi-version {
      type enumeration {
        enum 80211a {
          value 0;
        }
        enum 80211b {
          value 1;
        }
        enum 80211g {
          value 2;
        }
        enum 80211n {
          value 3;
        }
        enum 80211ac {
          value 4;
        }
        enum 80211ax {
          value 5;
        }
      }
      description
        "The highest 802.11 standard version usable
         by the Node.";
    }
    leaf channel-num {
      type int8;
      description
        "The channel that Wi-Fi communication is currently
         operating on.  A value of 0 indicates that the interface
         is not currently configured or operational.";
    }
    leaf rssi {
      type int8;
      description
        "The Received Signal Strength Indication (RSSI)
         of the Node's Wi-Fi radio in dBm.";
    }
    leaf beacon-lost-count {
      type yang:zero-based-counter32;
      description
        "The count of the number of missed beacons the
         Node has detected.";
    }
    leaf beacon-rx-count {
      type yang:zero-based-counter32;
      description
        "The count of the number of received beacons.  The
         total number of expected beacons that could have been
         received during the interval since association matches
         the sum of BeaconRxCount and BeaconLostCount.";
    }
    leaf packet-multicast-rx-count {
      type yang:zero-based-counter32;
      description
        "The number of multicast packets received by
         the Node.";
    }
    leaf packet-multicast-tx-count {
      type yang:zero-based-counter32;
      description
        "The number of multicast packets transmitted by
         the Node.";
    }
    leaf packet-unicast-rx-count {
      type yang:zero-based-counter32;
      description
        "The number of unicast packets received by
         the Node.";
    }
    leaf packet-unicast-tx-count {
      type yang:zero-based-counter32;
      description
        "The number of unicast packets transmitted by
         the Node.";
    }
    leaf current-max-rate {
      type uint32;
      description
        "The current maximum PHY rate of transfer of
         data in bytes per second.";
    }
    leaf overrun-count {
      type yang:zero-based-counter32;
      description
        "The number of packets dropped either at ingress or
         egress due to lack of buffer memory to retain all
         packets on the Ethernet network interface.  The
         OverrunCount attribute is reset to 0 upon a
         reboot of the Node.";
    }
  }
  container events {
    config false;
    description
      "Configuration of Wi-Fi Network Diagnostics events.";
    list event {
      key "name";
      description
        "The list of event sources configured on the
         server.";
      leaf name {
        type string;
        description
          "The unique name of an event source.";
      }
      leaf disconnection {
        type enumeration {
          enum de-authenticated {
            value 1;
          }
          enum dis-association {
            value 2;
          }
        }
        description
          "A Node's Wi-Fi connection has been disconnected as a
           result of deauthenticated or disassociation and
           indicates the reason.";
      }
      leaf association-failure {
        type enumeration {
          enum unknown {
            value 0;
          }
          enum association-failed {
            value 1;
          }
          enum authentication-failed {
            value 2;
          }
          enum ssid-not-found {
            value 3;
          }
        }
        description
          "A Node has attempted to connect, or reconnect, to
           a Wi-Fi access point but is unable to successfully
           associate or authenticate after exhausting all
           internal retries of its supplicant.";
      }
      leaf connection-status {
        type enumeration {
          enum connected {
            value 1;
          }
          enum notconnected {
            value 2;
          }
        }
        description
          "A Node's connection status to a Wi-Fi network has
           changed.  Connected, in this context, means that
           a Node acting as a Wi-Fi station is successfully
           associated to a Wi-Fi access point.";
      }
    }
  }
}]]></sourcecode>
      </section>
    </section>
    <section anchor="usage" numbered="true" toc="default">
      <name>Adaptive Subscription and Notification Example</name>
      <t>The examples within this document use the normative YANG module
      "ietf-adaptive-subscription" defined in <xref target="adaptive" format="default"/> and
      the non-normative example YANG module "example-wifi-network-diagnostic"
      defined in <xref target="example-module" format="default"/>.</t>
      <t>This section shows some typical adaptive subscription and
      notification message exchanges.</t>
      <section numbered="true" toc="default">

        <name>Configured Subscription Example</name>
        <t>The client configures adaptive subscription policy parameters on
        the server. The adaptive subscription configuration parameters require
        the server to support two update intervals (i.e., 5 seconds and 20
        seconds) and report updates every 20 seconds if the RSSI value is
        greater than or equal to -65 dBm.  If the RSSI value is less than -65
        dBm, switch to a 5-second period value to report updates. The server
        compares the RSSI value with -65 dBm every 2 seconds. <xref target="edit-config" format="default"/> specifies an example of configured subscription
        with the &lt;edit-config&gt; operation.</t>

	<t>Line folding per <xref target="RFC8792" format="default"/> has been implemented in the examples below.</t>
	
        <figure anchor="edit-config">
          <name>An Example of Configured Subscription</name>
          <sourcecode type="xml"><![CDATA[=============== NOTE: '\' line wrapping per RFC 8792 ================

<rpc xmlns="urn:ietf:params:xml:ns:netconf:\
base:1.0" message-id="101">
 <edit-config>
  <target>
   <running/>
  </target>
  <config>
   <subscriptions
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"
    xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
    <subscription>
     <id>1011</id>
     <yp:datastore
      xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">
      ds:operational
     </yp:datastore>
     <yp:datastore-xpath-filter
      xmlns:ex-wnd="https://example.com/yang/\
wifi-network-diagnostic">
      /ex-wnd:server
     </yp:datastore-xpath-filter>
     <adaps:adaptive-periodic
   xmlns:adaps="urn:ietf:params:xml:ns:yang:\
ietf-adaptive-subscription">
      <adaps:periodic>
       <adaps:name>adaptive-period-1</adaps:name>
       <adaps:eval-expression>
        /ex-wnd:server/ex-wnd:rssi&lt;-65
       </adaps:eval-expression>
       <adaps:eval-interval>200</adaps:eval-interval>
       <adaps:period>500</adaps:period>
       <adaps:anchor-time>2025-04-11T08:00:00Z</adaps:anchor-time>
      </adaps:periodic>
      <adaps:periodic>
       <adaps:name>adaptive-period-2</adaps:name>
       <adaps:eval-expression>
        /ex-wnd:server/ex-wnd:rssi&gt;=-65
       </adaps:eval-expression>
       <adaps:eval-interval>200</adaps:eval-interval>
       <adaps:period>2000</adaps:period>
       <adaps:anchor-time>2025-04-11T08:00:00Z</adaps:anchor-time>
      </adaps:periodic>
     </adaps:adaptive-periodic>
     <receivers>
      <receiver>
       <name>host.example.com</name>
      </receiver>
     </receivers>
    </subscription>
   </subscriptions>
  </config>
 </edit-config>
</rpc>]]></sourcecode>
        </figure>
      </section>
      <section numbered="true" toc="default">
        <name>Dynamic Subscription Example</name>
        <t>Alternatively, the subscriber may send an "establish-subscription"
        RPC with the parameters listed in <xref target="model" format="default"/> to request
        the creation of an adaptive subscription. The adaptive subscription
        configuration parameters require the server to report updates every 5
        seconds if the RSSI value is less than -65 dBm.  If the RSSI value is
        greater than or equal to -65 dBm, switch to a 20-second period value.
        The server compares the RSSI value with -65 dBm every 2 seconds. <xref target="establish-subscription" format="default"/> specifies an example of the
        "establish-subscription" RPC request.</t>
        <figure anchor="establish-subscription">
          <name>An Example of Dynamic Subscription</name>
          <sourcecode type="xml"><![CDATA[=============== NOTE: '\' line wrapping per RFC 8792 ================

<netconf:rpc message-id="101"
 xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
 <establish-subscription
  xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"
  xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
  <yp:datastore
   xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">
   ds:operational
  </yp:datastore>
  <yp:datastore-xpath-filter
   xmlns:ex-wnd="https://example.com/yang/wifi-network-diagnostic">
   /ex-wnd:server
  </yp:datastore-xpath-filter>
  <adaps:adaptive-periodic
   xmlns:adaps="urn:ietf:params:xml:ns:yang:\
ietf-adaptive-subscription">
   <adaps:periodic>
    <adaps:name>adaptive-period-1</adaps:name>
    <adaps:eval-expression>
     /ex-wnd:server/ex-wnd:rssi&lt;-65
    </adaps:eval-expression>
    <adaps:eval-interval>200</adaps:eval-interval>
    <adaps:period>500</adaps:period>
    <adaps:anchor-time>2025-04-11T08:00:00Z</adaps:anchor-time>
   </adaps:periodic>
   <adaps:periodic>
    <adaps:name>adaptive-period-2</adaps:name>
    <adaps:eval-expression>
     /ex-wnd:server/ex-wnd:rssi&gt;=-65
    </adaps:eval-expression>
    <adaps:eval-interval>200</adaps:eval-interval>
    <adaps:period>2000</adaps:period>
    <adaps:anchor-time>2025-04-11T08:00:00Z</adaps:anchor-time>
   </adaps:periodic>
  </adaps:adaptive-periodic>
 </establish-subscription>
</netconf:rpc>]]></sourcecode>
        </figure>
      </section>
      
      <section anchor="failure_example" numbered="true" toc="default">
        <name>Error Response Examples</name>
        <section numbered="true" toc="default">
          <name>"xpath-evaluation-unsupported" Error Response Example</name>
          <t>If the subscriber has authorization to establish the subscription
          with a server, but the server has not been able to fully satisfy the
          request from the subscriber, the server should send an RPC error
          response.</t>
          <t>For instance, if the XPath 1.0 syntax against the targeted data
          node defined in "eval-expression" is not supported by the server's
          implementation, the server returns a reply indicating a failure.
          <xref target="error-example" format="default"/> illustrates an example of such an RPC error
          response.</t>
          <figure anchor="error-example">
            <name>An Example of "xpath-evaluation-unsupported" RPC Error Response</name>
            <sourcecode type="xml"><![CDATA[=============== NOTE: '\' line wrapping per RFC 8792 ================

<?xml version="1.0" encoding="utf-8"?>
<rpc-reply message-id="101"
 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-adaptive-subscription:xpath-evaluation-unsupported
    </error-app-tag>
    <error-path xmlns:adaps="urn:ietf:params:xml:ns:yang:\
ietf-adaptive-subscription">
      /adaps:adaptive-periodic/adaps:periodic/adaps:eval-expression
    </error-path>
    <error-message xml:lang="en">
      Unsupported XPath expression:/ex-wnd:server/ex-wnd:rssi
    </error-message>
  </rpc-error>
</rpc-reply>]]></sourcecode>
          </figure>
          <t>Since adaptive subscription allows a server to be configured with
          multiple different time periods and corresponding XPath
          evaluation criteria to trigger an update interval switch in the server,
          it may be possible for the server to return multiple
          &lt;rpc-error&gt; elements with "xpath-evaluation-unsupported"
          failure specified by different error paths. The subscriber can use
          this information in future attempts to establish a subscription.</t>
        </section>
        <section numbered="true" toc="default">
          <name>"evaluation-interval-unsupported" Error Response Example</name>
          <t>If the requested XPath evaluation interval is too short for the
          server to support, the server returns an RPC error indicating the
          failure and may provide hints suggesting alternative intervals.</t>
          <t><xref target="error-example2" format="default"/> illustrates an example of an RPC
          error response where the server rejects a request for a 200-centisecond (2-second) evaluation interval and indicates 300-centisecond (3-second) as the minimum supported interval.</t>
          <figure anchor="error-example2">
            <name>An Example of "evaluation-interval-unsupported" RPC Error Response</name>
            <sourcecode type="xml"><![CDATA[=============== NOTE: '\' line wrapping per RFC 8792 ================

<?xml version="1.0" encoding="utf-8"?>
<rpc-reply message-id="101"
 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-adaptive-subscription:evaluation-interval-unsupported
    </error-app-tag>
    <error-path
   xmlns:adaps="urn:ietf:params:xml:ns:yang:\
ietf-adaptive-subscription">
      /adaps:adaptive-periodic/adaps:periodic/adaps:eval-interval
    </error-path>
    <error-message xml:lang="en">
      Minimum supported eval-interval is 300 cs; requested 200 cs
    </error-message>
  </rpc-error>
</rpc-reply>]]></sourcecode>
          </figure>
          <t>The supplementary information, including the minimum evaluation
          interval that the server can support for the targeted data node, is
          declared in the "error-message" element.</t>
        </section>
      </section>
      <section numbered="true" toc="default">
        <name>"adaptive-period-update" Notification Example</name>
        <t>Suppose that the RSSI value is initially below -65 dBm and the server pushes
        updates every 5 seconds starting at 2025-04-11T08:00:00Z and
        continuing through 2025-04-11T08:02:05Z. The server evaluates the RSSI
        value against -65 dBm every 2 seconds and, from 2025-04-11T08:02:06Z, it
        detects that the RSSI value exceeds -65 dBm continuously. As the
        "anchor-time" is set to 2025-04-11T08:00:00Z for "adaptive-period-2",
        which means updates can only be sent at the top of every 00, 20, 40
        second, the server sends the next update record at
        2025-04-11T08:02:20Z and adjusts the update interval to 20 seconds.
        Before this, the server generates and sends an
        "adaptive-period-update" notification to inform receivers of the new
        time period value. An example of an "adaptive-period-update"
        notification is shown in <xref target="state-change-notif" format="default"/>.</t>
        <figure anchor="state-change-notif">
          <name>An Example of "adaptive-period-update" Notification</name>
          <sourcecode type="xml"><![CDATA[<notification
 xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"
 xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
 <eventTime>2025-04-11T08:02:19.33Z</eventTime>
 <adaptive-period-update
  xmlns="urn:ietf:params:xml:ns:yang:ietf-adaptive-subscription">
  <id>1011</id>
  <period>2000</period>
  <period-update-time>2025-04-11T08:02:20Z</period-update-time>
  <satisfied-criteria-data>
   <path>/ex-wnd:server/ex-wnd:rssi</path>
   <value>-40</value>
  </satisfied-criteria-data>
  <yp:datastore
   xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">
       ds:operational
  </yp:datastore>
  <yp:datastore-xpath-filter
   xmlns:ex-wnd="https://example.com/yang/wifi-network-diagnostic">
       /ex-wnd:server
  </yp:datastore-xpath-filter>
 </adaptive-period-update>
</notification>]]></sourcecode>
        </figure>
      </section>
    </section>
    <section anchor="acknowledgments" numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>We would like to thank <contact fullname="Rob Wilton"/>, <contact fullname="Thomas Graf"/>, <contact fullname="Andy Bierman"/>, <contact fullname="Michael Richardson"/>,
      <contact fullname="Henk Birkholz"/>, <contact fullname="Chong Feng"/>, <contact fullname="Adrian Farrel"/>, <contact fullname="Joe Clarke"/>, and
      <contact fullname="Dhruv Dhody"/> for valuable review on this document. Special thanks to
      Thomas and Michael for organizing the discussion on several relevant
      documents and reaching a common understanding on the concept and ideas.  The
      authors would also like to thank Michael for providing Matter Wi-Fi
      statistics reference.</t>
      <t>Thanks to <contact fullname="Dhruv Dhody"/> for the OPSDIR review, <contact fullname="Joe Clarke"/> for the
      YANGDOCTORS review, <contact fullname="Yoav Nir"/> for the SECDIR review, and <contact fullname="Joseph Touch"/> for
      the TSVART review.</t>
      <t>Thanks to <contact fullname="Mahesh Jethanandani"/> for the careful AD review.</t>
      <t>Thanks to <contact fullname="Mohamed Boucadair"/>, <contact fullname="Andy Newton"/>, <contact fullname="Charles Eckel"/>, <contact fullname="Christopher Inacio"/>,
      <contact fullname="Deb Cooley"/>, <contact fullname="Éric Vyncke" asciiFullname="Eric Vyncke"/>, <contact fullname="Gorry Fairhurst"/>, <contact fullname="Gunter Van de Velde"/>,
      <contact fullname="Jim Guichard"/>, <contact fullname="Roman Danyliw"/>, and <contact fullname="Tommy Jensen"/> for the IESG
      review.</t>
    </section>
    <section anchor="contributors" numbered="false" toc="default">
      <name>Contributors</name>
      <contact fullname="Wei Song">
        <organization/>
        <address>
          <email>songwei80@huawei.com</email>
        </address>
      </contact>
      <contact fullname="Michael Wang">
        <organization/>
        <address>
          <email>wangzitao@huawei.com</email>
        </address>
      </contact>
    </section>
  </back>

</rfc>
