NETMOD Working Group R. Ranade
Internet-Draft Huawei
Intended status: Standards Track Feb 01, 2019
Expires: August 5, 2019

Extensions to Yang Push


This document defines extensions to the yang push subscription mechanism, which can provide more granularity in tracking configuration changes in datastores.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on August 5, 2019.

Copyright Notice

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents ( in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

Table of Contents

1. Introduction

The subscription mechanism defined in yang-push draft [I-D.ietf-netconf-yang-push] supports a subscription mechanism where datastore and its datanodes can be provided as targets. However there are a few scenarios where a subscription to datanodes may not be sufficient.

1.1. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

The following terms are defined in [RFC8342] and are not redefined here:

2. Yang Push Subscription Extensions

There are two new filter nodes added to the Yang push subscription mechanism. They are listed below.

2.1. Config Filter

This is a filter for nodes with the given value for their 'config' property. When this leaf is set to 'true', only 'config true' nodes are selected and, when set to 'false', only 'config false' nodes are selected. If this leaf is not present, this filter is not applied.

2.2. Origin Metadata Attribute

This document defines the "with-origin" parameter, which if present, requests that the server includes "origin" metadata annotations as defined in [RFC8342] in notifications which are part of this subscription. This parameter is only valid for the operational state datastore and any datastores with identities derived from the "operational" identity. Otherwise, if an invalid datastore is specified then a suitable error is returned.

Data in the operational state datastore can come from multiple sources. The server should return the most accurate value for the "origin" metadata annotation as possible, indicating the source of the operational value, as specified in Section 5.3.4 of RFC8342

When encoding the origin metadata annotation for a hierarchy of returned nodes, the annotation may be omitted for a child node when the value matches that of the parent node, as described in the "ietf-origin" YANG module [RFC8342].

The "with-origin" parameter is optional to support. It is identified with the feature "origin".

3. Examples of usage

In this example, the following fictional module is used:

module example-interface {
  yang-version 1.1;
  namespace urn:example:interface;
  prefix int;

  import ietf-inet-types {
    prefix inet;
  container interface {
    leaf name{
      type string;
    leaf speed{
      type string;
      config false;

A subscription on the "config true" nodes of the operational state datastore. This subscription also requests to get the origin of the datanodes as part of Yang-push notifications. This is considering that the NETCONF protocol was used for this subscription.

<rpc xmlns="urn:ietf:params:xml:ns:netconf:1.0">  
  <establish-subscription \
        xmlns="urn:ietf:params:xml:ns:netconf:1.0" \
        xmlns:yp="urn:ietf:params:xml:ns:netconf:1.0" \

The operator has configured an interface ("eth1"), the system has recognised an interface ("eth0") which was plugged in recently. The below NETCONF notification is an example for a yang-push notification when the device applies the "eth0" configuration.

<notification \
        xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" \
        xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" >
            <interface xmlns="urn:example:interface" \

4. YANG Module

    <CODE BEGINS> file "ietf-yang-push-ext@2019-02-01.yang"
    module ietf-yang-push-ext {
      yang-version 1.1;
      namespace "urn:ietf:params:xml:ns:yang:ietf-yang-push-ext";
      prefix ypext;
      import ietf-subscribed-notifications {
        prefix sn;

      import ietf-yang-push {
        prefix yp;
      import ietf-datastores {
        prefix ds;
        reference "RFC 8342: Network Management Datastore Architecture.";
      import ietf-origin {
        prefix or;
        reference "RFC 8342: Network Management Datastore Architecture.";
        "IETF NETMOD (Network Modeling) Working Group";
        "WG Web:   <>
         WG List:  <>
         WG Chair: Kent Watsen

         Editor:   Rohit Ranade

        "This module defines extensions to subscription mechanism 
        to yang-push on operational state datastore.

        Copyright (c) 2019 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 Simplified BSD License set
        forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents

        The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
        'OPTIONAL' in the module text are to be interpreted as described
        in RFC 2119 (

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

      revision 2019-02-01 {
          "Initial revision.";
        reference "RFCXXXX";
      feature origin {
          "Indicates that the server supports the 'origin' annotation.";
          "RFC 8342: Network Management Datastore Architecture";
      grouping subscription-filter-extension{
          "This grouping describes the extensions to subscription
        leaf config-filter {
          type boolean;
            "Filter for nodes with the given value for their 'config'
             property.  When this leaf is set to 'true', only 'config
             true' nodes are selected and, when set to 'false', only
             'config false' nodes are selected.  If this leaf is not
             present, this filter is not applied.";

        leaf with-origin {
          when 'derived-from-or-self(../yp:datastore, "ds:operational")';
          if-feature origin;
          type empty;
            "If this parameter is present, the server will return
             the 'origin' annotation for the nodes that has one.";

      augment "/sn:establish-subscription/sn:input/sn:target/ +
                  yp:datastore" {
          "This augmentation adds the filter extensions for the 
           subscription to RPC input.";
        uses subscription-filter-extension;

5. IANA Considerations

This document registers one URI in the IETF XML Registry [RFC3688]. The following registration has been made:

This document registers one YANG module in the YANG Module Names Registry [RFC6020]. The following registration has been made:

6. Security Considerations


7. Normative References

[I-D.ietf-netconf-yang-push] Clemm, A., Voit, E., Prieto, A., Tripathy, A., Nilsen-Nygaard, E., Bierman, A. and B. Lengyel, "Subscription to YANG Datastores", Internet-Draft draft-ietf-netconf-yang-push-21, January 2019.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.
[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K. and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018.

Author's Address

Rohit R Ranade Huawei Divyashree Techno Park, Whitefield Bangalore, Karnataka 560066 India EMail: