Email us : sales@yumaworks.com

YANG details

YANG

YANG is a powerful and versatile data modeling language that was designed from the requirements of network operators for an easy to use and robust mechanism for provisioning devices and services across networks. It was originally designed at the Internet Engineering Task Force (IETF) and has been so successful that it has been adopted as the standard for modeling design in many other standards bodies such as the Metro Ethernet Forum, OpenDaylight, OpenConfig, and others. The number of YANG modules being implemented for interfaces, devices, and service is exploding.

The YANG RFC 6020 has many very readable examples.

Key IETF YANG RFCs and YumaPro support:

Expand All Collapse All

RFC 6020 (YANG v1.0)

The YANG data modeling language is fully supported. View the RFC.
RFC 6021 (YANG Data Types v1)

The standard YANG data type extensions are fully supported. View the RFC.
RFC 6643 (Translation of SMIv2 to YANG)

Defines a translation of SMIv2 MIB modules into YANG modules, enabling read-only (config false) access to data objects defined in SMIv2 MIB modules via NETCONF. View the RFC.
RFC 6991 (YANG Data Types v2)

New YANG type definitions, and other updates to the standard are fully supported. View the RFC.
RFC 7895 (YANG Module Library)

YANG library that provides information about all the YANG modules used by a network management server (e.g., a Network Configuration Protocol (NETCONF) server), which can be easily cached by clients to minimize costly data retrieval, is fully supported. View the RFC.
RFC 7950 (YANG v1.1)

This maintenance release of the YANG language, which addresses some ambiguities and defects in YANG v1.0, is fully supported. View the RFC.
RFC 7951 (JSON encoding of YANG Data)

Encoding rules for representing configuration data, state data, parameters of Remote Procedure Call (RPC) operations or actions, and notifications defined using YANG as JavaScript Object Notation (JSON) text are fully supported. View the RFC.
RFC 8072 (YANG Patch)

Applying patches to configuration datastores using data defined with the YANG data modeling language, is fully supported. View the RFC.

Key YANG Module support:

ietf-inet-types

Standard YANG networking data types from RFC 6021. View the RFC.
ietf-netconf

Standard YANG data model for NETCONF protocol operations from RFC 6241. View the RFC.
ietf-netconf-acm

Standard NETCONF Access Control Model (NACM) from RFC 6536. View the RFC.
ietf-netconf-monitoring

Standard NETCONF monitoring data model and operation from RFC 6022 to retrieve YANG modules from the server. View the RFC.
ietf-netconf-notifications

Standard NETCONF Notification delivery with replay buffer and command interleave mode from RFC 5217. View the RFC.
ietf-netconf-partial-lock

Standard NETCONF and operations from RFC 5717 to support concurrent non-overlapping database edits. View the RFC.
ietf-netconf-with-defaults

Standard NETCONF :with-defaults capability extensions to the and operations.
ietf-yang-types

Standard YANG data types from RFC 6021. View the RFC.
nc-notifications

Netconf Central YANG module for notification monitoring data model from RFC 5277. View the RFC.
notifications

Netconf Central YANG module for operation from RFC 5277. View the RFC.
yuma-arp

Netconf Central YANG module for Linux ARP management.
yuma-interfaces

Netconf Central YANG module for Linux interface monitoring.
yuma-mysession

Netconf Central YANG module for setting and retrieving session-specific session parameters.
yuma-nacm

Netconf Central YANG module for NETCONF Access Control, used as the starting point for NACM in RFC 6536. View the RFC.
yuma-ncx

Netconf Central YANG language extensions.
yuma-proc

Netconf Central YANG module for Linux /proc system information.
yuma-system

Netconf Central YANG module for NETCONF system management and notifications, which was used as the starting point for RFC 6470. View the RFC.
yuma-time-filter

Netconf Central YANG module for time-stamp based filtered of configuration data.
yuma-types

Netconf Central YANG module for extended data types.
yumaworks-extensions

YumaWorks YANG language extensions.
yumaworks-types

YumaWorks YANG data type extensions.
yumaworks-system

YumaWorks extensions for CM maintenance such as the backup, restore, and delete-backup operations.

YANG Example of reusable groups

grouping target {
         leaf address {
             type inet:ip-address;
             description "Target IP address";
         }
         leaf port {
             type inet:port-number;
             description "Target port number";
         }
     }

     container peer {
         container destination {
             uses target;
         }
     }

NETCONF XML Example for the above

     <peer>
       <destination>
         <address>192.0.2.1</address>
         <port>830</port>
       </destination>
     </peer>

YANG Example of must and error-message

container interface {
         leaf ifType {
             type enumeration {
                 enum ethernet;
                 enum atm;
             }
         }
         leaf ifMTU {
             type uint32;
         }
         must "ifType != 'ethernet' or " +
              "(ifType = 'ethernet' and ifMTU = 1500)" {
             error-message "An ethernet MTU must be 1500";
         }
         must "ifType != 'atm' or " +
              "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
             error-message "An atm MTU must be  64 .. 17966";
         }
     }

YANG Example of operations

Given the following container definition:

     container system {
         description "Contains various system parameters";
         container services {
             description "Configure externally available services";
             container "ssh" {
                 presence "Enables SSH";
                 description "SSH service specific configuration";
                 // more leafs, containers and stuff here...
             }
         }
     }

A corresponding XML instance example:

     <system>
       <services>
         <ssh/>
       </services>
     </system>

Since the element is present, ssh is enabled.

To delete a container with an :

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
          xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
       <edit-config>
         <target>
           <running/>
         </target>
         <config>
           <system xmlns="http://example.com/schema/config">
             <services>
               <ssh nc:operation="delete"/>
             </services>
           </system>
         </config>
       </edit-config>
     </rpc>
  • YANG is the data modeling language for NETCONF
  • designed to be human readable and easy to understand
  • composed of hierarchical schema encoded in XML that can closely resemble an implementation’s native data structures
  • organizes the semantics and data representation
  • augments inserts nodes into an existing hierarchy so they can augment existing YANG modules, e.g. a standard module where the implementation provides additional vendor specific data/service
  • deviations over-ride nodes in an existing hierarchy so they can deviate from existing YANG modules, e.g. a standard module where the implementation cannot provide the data/service for a particular node
  • “if”, “when”, and “choice” constructs
  • contains a rich set of standard types and can create derived types and unions of types
  • grouping allows collections of nodes to be reused
  • “rpc” statement defines methods, input and output parameters
  • provides notifications
  • robust development is supported with versioning and with modularity. Modules can include sub-modules, which in turn can include yet more sub-modules

YumaWorks’ YumaPro SDK implements the YANG standard fully, including optional requirements.

Key features of YumaPro’s YANG implementation:

  • YumaPro is a 100% “native YANG” implementation – YANG modules are used directly by all the tools to control all aspects of NETCONF protocol usage
  • all YumaPro programs use the same centralized YANG language parser
  • keeps current with evolving standard’s features
  • YumaPro programs support concurrent usage of different revisions of the same module or sub-module
  • translation of existing investment in SNMP MIB data into YANG with freely available smidump tool

Login

Lost your password?