Internet Engineering Task Force M. Veillette, Ed.
Internet-Draft Trilliant Networks Inc.
Intended status: Standards Track January 24, 2018
Expires: July 28, 2018

Constrained YANG Module Library


This document describes a YANG library that provides information about all the YANG modules used by a constrained network management server (e.g., a CoAP Management Interface (CoMI) server). Simple caching mechanisms are provided to allow clients to minimize retrieval of this information.

Status of This Memo

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

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

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 July 28, 2018.

Copyright Notice

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

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents ( 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

WARNING: Both this contribution and the CoMI protocol [I-D.ietf-core-comi] need to be reviewed to verify their compatibility with the “Network Management Datastore Architecture” (NMDA). See [I-D.dsdt-nmda-guidelines], [I-D.ietf-netconf-rfc7895bis], [I-D.ietf-netmod-revised-datastores] and [I-D.ietf-netconf-nmda-restconf] for more details.

The YANG library specified in this document is available to clients of a given server to discover the YANG modules supported by this constrained network management server. A CoMI server provides a link to this library in the /mod.uri resource. The following YANG module information is provided to client applications to fully utilize the YANG data modeling language:

1.1. Major differences between ietf-constrained-yang-library and ietf-yang-library

YANG module ‘ietf-constrained-yang-library’ targets the same functionality and shares the same approach as YANG module ietf-yang-library. The following changes with respect to ietf-yang-library are specified to make ietf-constrained-yang-library compatible with SID [I-D.ietf-core-yang-cbor] used by CoMI [I-D.ietf-core-comi] and to improve its applicability to constrained devices and networks.

o To minimize their size, each revision date is encoded in binary.

2. Terminology and Notation

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119].

The following terms are defined in [RFC7950]:

The following terms are defined in [I-D.ietf-core-yang-cbor]:

The following terms are defined in [I-D.ietf-core-comi]:

The following terms are used within this document:

3. Overview

The “ietf-constrained-yang-library” module provides information about the YANG library used by a given server. This module is defined using YANG version 1 as defined by [RFC7950], but it supports the description of YANG modules written in any revision of YANG.

3.1. Tree diagram

The tree diagram of YANG module ietf-constrained-yang-library is provided below. This graphical representation of a YANG module is defined in [I-D.ietf-netmod-yang-tree-diagrams].

module: ietf-constrained-yang-library
   +--ro modules-state
      +--ro hash      binary
      +--ro module* [sid revision]
         +--ro sid                 comi:sid
         +--ro revision            revision
         +--ro feature*            comi:sid
         +--ro deviation* [sid revision]
         |  +--ro sid         comi:sid
         |  +--ro revision    revision
         +--ro conformance-type    enumeration
         +--ro submodule* [sid revision]
            +--ro sid         comi:sid
            +--ro revision    revision

   +---n yang-library-change
      +--ro hash    -> /modules-state/hash

3.2. Description

3.2.1. modules-state

This mandatory container specifies the module set identifier and the list of modules supported by the server.

3.2.2. modules-state/hash

This mandatory leaf contains the hash of the library content. The value of this leaf MUST change whenever the set of modules and submodules in the library changes. This leaf allows a client to fetch the module list once, cache it, and only re-fetch it if the value of this leaf has been changed.

If the value of this leaf changes, the server also generates a ‘yang-library-change’ notification.

3.2.3. modules-state/module

This mandatory list contains one entry for each YANG module supported by the server. There MUST be an entry in this list for each revision of each YANG module that is used by the server. It is possible for multiple revisions of the same module to be imported, in addition to an entry for the revision that is implemented by the server.

4. YANG Module “ietf-constrained-yang-library”

RFC Ed.: update the date below with the date of RFC publication and remove this note.

<CODE BEGINS> file "ietf-constrained-yang-library@2018-01-20.yang"
module ietf-constrained-yang-library {
  prefix "lib";

  import ietf-comi {
    prefix comi;
    "IETF CORE (Constrained RESTful Environments) Working Group";

    "WG Web:   <>
     WG List:  <>

     WG Chair: Carsten Bormann 

     WG Chair: Jaime Jimenez 

     Editor:   Michel Veillette

    "This module contains the list of YANG modules and submodules
    implemented by a server.

     Copyright (c) 2016 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

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

  // RFC Ed.: replace XXXX with actual RFC number and remove
  // this note.

  // RFC Ed.: update the date below with the date of the RFC
  // publication and remove this note.

  revision 2018-01-20 {
      "Initial revision.";
      "RFC XXXX: Constrained YANG Module Library.";

   * Typedefs

  typedef revision {
    type binary {
      length "4";
      "Revision date encoded as a binary string as follow:
      - First byte = Century
      - Second byte = Year (0 to 99)
      - Third byte = Month (1 = January to 12 = December)
      - Forth byte = Day (1 to 31)";

   * Groupings

  grouping identification-info {
      "YANG modules and submodules identification information.";

    leaf sid {
      type comi:sid;
      mandatory true;
        "SID assigned to this module or submodule.";
    leaf revision {
      type revision;
        "Revision date assigned to this module or submodule.
        A zero-length binary string is used if no revision
        statement is present in the YANG module or submodule.";
  identity module-set {
        "Base identity from which shared module-set identifiers
        are derived.";
   * Operational state data nodes

  container modules-state {
    config false;
      "Contains information about the different data models
      implemented by the server.";
    leaf hash {
      type binary {
        length "8..32";
      mandatory true;
        "A server-generated hash of the contents of the library.
        The server MUST change the value of this leaf each time
        the content of the library has changed. The hash function
        and size are not specified, but shall be collision

    list module {
      key "sid revision";
        "Each entry represents one revision of one module
         currently supported by the server.";

      uses identification-info;
      leaf-list feature {
        type comi:sid;
          "List of YANG features from this module that are
          supported by the server, regardless whether
          they are defined in the module or in any
          included submodules.";
      list deviation {
        key "sid revision";
          "List of YANG deviation modules used by this server
          to modify the conformance of the module associated
          with this entry.  Note that the same module can be
          used for deviations for multiple modules, so the same
          entry MAY appear within multiple 'module' entries.

          Deviation modules MUST also be present in the 'module'
          list, with the same sid and revision values and the
          'conformance-type' set to 'implement'.";
        uses identification-info;
      leaf conformance-type {
        type enumeration {
          enum implement {
            value 0;
              "Indicates that the server implements one or more
              protocol-accessible objects defined in the YANG
              module identified in this entry.  This includes
              deviation statements defined in the module.

              For YANG version 1.1 modules, there is at most one
              module entry with conformance type 'implement' for
              a particular module, since YANG 1.1 requires that
              at most one revision of a module is implemented.

              For YANG version 1 modules, there SHOULD NOT be more
              than one module entry for a particular module.";
          enum import {
            value 1;
              "Indicates that the server imports reusable
              definitions from the specified revision of the
              module, but does not implement any protocol
              accessible objects from this revision.

              Multiple module entries for the same module MAY
              exist. This can occur if multiple modules import
              the same module, but specify different revision-dates
              in the import statements.";
        mandatory true;
          "Indicates the type of conformance the server is claiming
          for the YANG module identified by this entry.";
      list submodule {
        key "sid revision";
          "Each entry represents one submodule within the
           parent module.";
        uses identification-info;

   * Notifications

  notification yang-library-change {
      "Generated when the set of modules and submodules supported
      by the server has changed.";
    leaf hash {
      type leafref {
        path "/lib:modules-state/lib:hash";
      mandatory true;
        "New hash value.";

5. IANA Considerations

5.1. YANG Module Registry

This document registers one YANG module in the YANG Module Names registry [RFC7950].

name: ietf-constrained-yang-library

namespace: urn:ietf:params:xml:ns:yang:ietf-constrained-yang-library

prefix: lib

reference: RFC XXXX

// RFC Ed.: replace XXXX with RFC number and remove this note

6. Security Considerations

This YANG module is designed to be accessed via the CoMI protocol [I-D.ietf-core-comi]. 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 to these data nodes.

Specifically, the ‘module’ list may help an attacker to identify the server capabilities and server implementations with known bugs. Server vulnerabilities may be specific to particular modules, module revisions, module features, or even module deviations. This information is included in each module entry. For example, if a particular operation on a particular data node is known to cause a server to crash or significantly degrade device performance, then the module list information will help an attacker identify server implementations with such a defect, in order to launch a denial of service attack on the device.

7. Acknowledgments

The YANG module defined by this memo have been derived from an already existing YANG module, ietf-yang-library [RFC7895], we will like to thanks to the authors of this YANG module. A special thank also to Andy Bierman for his initial recommendations for the creation of this YANG module.

8. References

8.1. Normative References

[I-D.ietf-core-comi] Veillette, M., Stok, P., Pelov, A. and A. Bierman, "CoAP Management Interface", Internet-Draft draft-ietf-core-comi-02, December 2017.
[I-D.ietf-core-yang-cbor] Veillette, M., Pelov, A., Somaraju, A., Turner, R. and A. Minaburo, "CBOR Encoding of Data Modeled with YANG", Internet-Draft draft-ietf-core-yang-cbor-05, August 2017.
[I-D.ietf-netmod-yang-tree-diagrams] Bjorklund, M. and L. Berger, "YANG Tree Diagrams", Internet-Draft draft-ietf-netmod-yang-tree-diagrams-05, January 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC7950] Bjorklund, M., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, August 2016.

8.2. Informative References

[I-D.dsdt-nmda-guidelines] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K. and R. Wilton, "Guidelines for YANG Module Authors (NMDA)", Internet-Draft draft-dsdt-nmda-guidelines-01, May 2017.
[I-D.ietf-netconf-nmda-restconf] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K. and R. Wilton, "RESTCONF Extensions to Support the Network Management Datastore Architecture", Internet-Draft draft-ietf-netconf-nmda-restconf-02, January 2018.
[I-D.ietf-netconf-rfc7895bis] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K. and R. Wilton, "YANG Library", Internet-Draft draft-ietf-netconf-rfc7895bis-03, January 2018.
[I-D.ietf-netmod-revised-datastores] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K. and R. Wilton, "Network Management Datastore Architecture", Internet-Draft draft-ietf-netmod-revised-datastores-10, January 2018.
[RFC7895] Bierman, A., Bjorklund, M. and K. Watsen, "YANG Module Library", RFC 7895, DOI 10.17487/RFC7895, June 2016.

Author's Address

Michel Veillette (editor) Trilliant Networks Inc. 610 Rue du Luxembourg Granby, Quebec J2J 2V2 Canada Phone: +14503750556 EMail: