Internet-Draft NETCONF default attribute YANG April 2024
Andersson Expires 4 October 2024 [Page]
NETCONF Working Group
6243 (if approved)
Intended Status:
Standards Track
P. Andersson
Cisco Systems

YANG Model for the NETCONF default attribute


This document defines a YANG module with the "default" attribute using the namespace and prefix defined in [RFC6243]. This enables usage of the "default" attribute in e.g. YANG JSON encoding.

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 4 October 2024.

Table of Contents

1. Introduction

YANG metadata [RFC7952] defines that attributes should be namespace-qualified, which for YANG JSON [RFC7951] means module-name:attribute. This becomes a problem since the "default" attribute defined in [RFC6243] doesn't define it in a YANG module, but instead defines the "default" attribute in XML Schema. The result is that it is impossible to emit the "default" attribute using YANG JSON encoding, since there is no corresponding YANG module name to use. For NETCONF this is not a problem since the prefix "wd" is defined with the corresponding namespace "urn:ietf:params:xml:ns:netconf:default:1.0".

2. The "ietf-defaults" Module

The "ietf-defaults" module defines the "default" attribute.

2.1. YANG Module

This YANG module has normative references to [RFC6243], [RFC7951], and [RFC7952].

<CODE BEGINS> file "ietf-defaults@2024-04-03.yang"

module ietf-defaults {
  yang-version 1.1;
  prefix wd;

  import ietf-yang-metadata {
    prefix md;
      "RFC 7952: Defining and Using Metadata with YANG";

    "IETF NETCONF (Network Configuration) Working Group";

    "WG Web:
     WG List:  NETCONF WG list <>

     Authors:  Per Andersson <>";

    "This module defines the 'default' attribute in YANG
     previously only defined in XML Schema in RFC 6243 Section 6.

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

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

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  revision 2024-04-03 {
      "Initial revision.";
      "RFC XXXX: YANG Model for the NETCONF default attribute";

  md:annotation default {
    type boolean;
      "This annotation is only relevant if the server supports the
       'report-all-tagged' defaults retrieval mode. For details see
       RFC 6243.";
      "RFC 6243: With-defaults Capability for NETCONF";


3. IANA Considerations

3.1. The "IETF XML" Registry

This document registers one URI in the "ns" subregistry of the IETF XML Registry [RFC3688] maintained at Following the format in [RFC3688], the following registration is requested:

URI: urn:ietf:params:xml:ns:netconf:default:1.0
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
Reference: RFC 6243, RFC XXXX

3.2. The "YANG Module Names" Registry

This document registers one YANG module in the YANG Module Names registry [RFC6020] maintained at Following the format defined in [RFC6020], the below registration is requested:

name: ietf-defaults
namespace: urn:ietf:params:xml:ns:netconf:default:1.0
prefix: wd
Reference: RFC XXXX

4. Security Considerations

4.1. Regarding the "ietf-defaults" YANG Module

This document defines an extension to existing NETCONF and RESTCONF protocol operations. It does not introdue any new or increased security risks into the management system.

5. References

5.1. Normative References

Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <>.
Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, , <>.
Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, , <>.
Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, , <>.
Bierman, A. and B. Lengyel, "With-defaults Capability for NETCONF", RFC 6243, DOI 10.17487/RFC6243, , <>.
Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, , <>.
Lhotka, L., "JSON Encoding of Data Modeled with YANG", RFC 7951, DOI 10.17487/RFC7951, , <>.
Lhotka, L., "Defining and Using Metadata with YANG", RFC 7952, DOI 10.17487/RFC7952, , <>.
Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, , <>.
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <>.
Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10.17487/RFC8341, , <>.
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, , <>.

5.2. Informative References

Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, , <>.

Appendix A. YANG JSON Example

The following example shows the example from Section A.3.2. <with-defaults> = 'report-all-tagged' in [RFC6243] encoded as YANG JSON encoded data. The request is adapted for RESTCONF [RFC8040].

GET /restconf/data/example:interfaces?with-defaults=report-all-tagged
Accept: application/yang-data+json

HTTP/1.1 200 OK
Date: Wed, 03 Apr 2024 01:18:51 GMT
Server: example-server
Content-Type: application/yang-data+json

    "example:interfaces": [
            "name": "eth0",
            "mtu": 8192,
            "status": "up",
            "@status": {
                 "ietf-defaults:default": true"
            "name": "eth1",
            "mtu": 1500,
            "@mtu": {
                "ietf-defaults:default": true"
            "status": "up",
            "@status": {
                "ietf-defaults:default": true"
            "name": "eth2",
             "mtu": 9000,
             "status": "not feeling so good"
            "name": "eth3",
            "mtu": 1500,
            "@mtu": {
                "ietf-defaults:default": true"
            "status": "waking up"

YANG JSON encoded data with "default" attribute.

Author's Address

Per Andersson
Cisco Systems