YANG model
YANG model
YANG is a data modeling language used to describe configuration and operational data, remote procedure
calls and notifications for network devices. The salient features of YANG are:
• Human-readable format, easy to learn and represent
• Supports definition of operations
• Reusable types and groupings
• Data modularity through modules and submodules
• Supports the definition of operations (RPCs)
• Well-defined versioning rules
• Extensibility through augmentation
For more details of YANG, refer RFC 6020 and 6087.
NETCONF and gRPC (Google Remote Procedute Call) provide a mechanism to exchange configuration and
operational data between a client application and a router and the YANG models define a valid structure for
the data (that is being exchanged).
Protocol
NETCONF
gRPC
Each feature has a defined YANG model. Cisco-specific YANG models are referred to as synthesized models.
Some of the standard bodies, such as IETF , IEEE and Open Config, are working on providing an industry-wide
standard YANG models that are referred to as common models.
Components of a YANG Model
A module defines a single data model. However, a module can reference definitions in other modules and
submodules by using the import statement to import external modules or the include statement to include
one or more submodules. A module can provide augmentations to another module by using the augment
statement to define the placement of the new nodes in the data model hierarchy and the when statement to
define the conditions under which the new nodes are valid. Prefix is used when referencing definitions in the
imported module.
YANG models are available for configuring a feature and to get operational state (similar to show commands)
This is the configuration YANG model for AAA (denoted by - cfg)
(snippet)
module Cisco-IOS-XR-aaa-locald-cfg {
/*** NAMESPACE / PREFIX DEFINITION ***/
namespace "http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-cfg";
Data Models Configuration Guide for Cisco NCS 1001
2
Transport
SSH
HTTP/2
Data models
Encoding/ Decoding
XML
XML, JSON