YANG
Yet Another Next Generation is a data modeling language for the definition of data sent over network management protocols such as the NETCONF and RESTCONF. Developed and maintained by the NETMOD working group in the Internet Engineering Task Force, YANG was initially published as in October 2010, with a significant update to version 1.1 in August 2016.
YANG enables comprehensive network automation by providing a standardized way to model the configuration and state data of network elements. The language can be used to define the format of event notifications emitted by network devices and allows data modelers to define the signature of RPCs that can be invoked on network elements via the NETCONF protocol. Being protocol-independent, YANG models can be converted into various encoding formats, including XML, JSON, and CBOR, depending on the network configuration protocol's support.
YANG is a modular language and represents data structures in a hierarchical tree format. It includes numerous built-in data types, with the capability for users to derive additional application-specific types. More complex reusable data structures can be represented as "groupings," which promote model reusability and consistency. YANG data models can use XPath expressions to define constraints on the elements of a YANG data model, enabling validation of configuration data before it is committed to devices.
YANG has become the de facto standard for modeling network device configurations across the telecommunications industry and is widely supported by major network equipment manufacturers. It plays a crucial role in software-defined networking and network function virtualization environments by providing a consistent interface for programmatic network management.
History
Many network management protocols have associated data modeling languages. The first widely deployed Internet standard for network management was the Simple Network Management Protocol. The data modeling language associated with SNMP was called the Structure of Management Information. The SMI language itself was based on the 1988 version of the Abstract Syntax Notation One. The current version of the SMI language, SMIv2 defined in, has developed into an extended subset of ASN.1.In the late 1990s, a project was started to create a replacement for SMIv2, which was called SMIng. One motivation was to decouple SMIng from the management protocol SNMP and to give SMIng a syntactic structure that is both easy to parse for computer programs and easy to learn for people familiar with programming languages that use a C-like notation. While the SMIng project did not succeed in the IETF, the SMIng specifications were published as experimental documents in May 2004.
Soon after the development of the NETCONF protocol in the IETF, it became clear that a data modeling language was needed to define data models manipulated by the NETCONF protocol. A design team created a proposal that became the basis of the YANG language. The syntactic structure and the base type system was essentially borrowed from SMIng. However, based on the lessons learned from the SMIng project, no attempts were made to make the YANG protocol neutral. Instead, YANG ties into concepts of the NETCONF protocol, such as the assumption that data model instances can be serialized into XML. Standardization of YANG started with the formation of the NETMOD working group in April 2008. The YANG 1.0 specification was published as in October 2010. Recently, the NETMOD working group has been working on YANG 1.1, which has been published in August 2016 in.
Example
The following YANG moduleexample-sports shows a data model for team sports. The module declares a namespace and a prefix and imports the type library module ietf-yang-types before defining the type season. It then defines a container sports that includes a list of persons and a list of teams. A team has a list of players that reference persons via the leafref type and its path restriction.module example-sports
JSON encoding
The code block below shows the JSON representation of an instantiation of theexample-sports data model.XML encoding
The code block below shows the XML representation of an instantiation of theexample-sports data model.Documentation
Language specifications and architectural documents
The following Request for Comments define the YANG language and some basic extensions:- : YANG - A Data Modeling Language for the Network Configuration Protocol
- : Mapping YANG to Document Schema Definition Languages and Validating NETCONF Content
- : The YANG 1.1 Data Modeling Language
- : JSON Encoding of Data Modeled with YANG
- : Defining and Using Metadata with YANG
- : Network Management Datastore Architecture
- : YANG Library
- : YANG Schema Mount
- : YANG Data Structure Extensions
- : Encoding of Data Modeled with YANG in the Concise Binary Object Representation
- : YANG Schema Item iDentifier
Guidelines and supporting documentation
- : Guidelines for Authors and Reviewers of Documents Containing YANG Data Models
- : YANG Module Classification
- : YANG Tree Diagrams
- : A Framework for Automating Service and Network Management with YANG
- : A File Format for YANG Instance Data
- : An Update to YANG Module Names Registration
IETF usage
Standards-track protocol specifications
The following requests for comments define standards-track protocols that are defined using YANG modules:- : Network Configuration Protocol
- : With-defaults Capability for NETCONF
- : Network Configuration Protocol Base Notifications
- : RESTCONF Protocol
- : NETCONF Call Home and RESTCONF Call Home
- : YANG Patch Media Type
- : Network Configuration Access Control Model
- : NETCONF Extensions to Support the Network Management Datastore Architecture
- : RESTCONF Extensions to Support the Network Management Datastore Architecture
- : Secure Zero Touch Provisioning
- : Subscription to YANG Notifications
- : Dynamic Subscription to YANG Events and Datastores over NETCONF
- : Subscription to YANG Notifications for Datastore Updates
- : Dynamic Subscription to YANG Events and Datastores over RESTCONF
Standards-track data models
- : YANG Module for NETCONF Monitoring
- : Translation of Structure of Management Information Version 2 MIB Modules to YANG Modules
- : Configuration Data Model for the IP Flow Information Export and Packet Sampling Protocols
- : IANA Interface Type YANG Module
- : A YANG Data Model for System Management
- : A YANG Data Model for SNMP Configuration
- : YANG Data Model for Key Chains
- : A YANG Data Model for LMAP Measurement Agents
- : Common YANG Data Types for the Routing Area
- : YANG Data Model for L3VPN Service Delivery
- : A YANG Data Model for Interface Management
- : A YANG Data Model for IP Management
- : A YANG Data Model for Network Topologies
- : A YANG Data Model for Layer 3 Topologies
- : A YANG Data Model for the Virtual Router Redundancy Protocol
- : A YANG Data Model for Hardware Management
- : A YANG Data Model for Routing Management
- : A Voucher Artifact for Bootstrapping Protocols
- : A YANG Data Model for the Routing Information Base
- : A YANG Data Model for Layer 2 Virtual Private Network Service Delivery
- : A YANG Module for Network Address Translation and Network Prefix Translation
- : A YANG Data Model for Dual-Stack Lite
- : YANG Data Model for Network Access Control Lists
- : Manufacturer Usage Description Specification
- : YANG Data Model for Network Instances
- : YANG Model for Logical Network Elements
- : Generic YANG Data Model for Connection-Oriented Operations, Administration, and Maintenance Protocols
- : Generic YANG Data Model for the Management of Operations, Administration, and Maintenance Protocols That Use Connectionless Communications
- : A YANG Data Model for Retrieval Methods for the Management of Operations, Administration, and Maintenance Protocols That Use Connectionless Communication
- : A YANG Data Model for Fabric Topology in Data-Center Networks
- : A YANG Data Model for Microwave Radio Link
- : YANG Data Model for the Precision Time Protocol
- : A YANG Data Model for Alarm Management
- : A YANG Data Model for the Internet Group Management Protocol and Multicast Listener Discovery
- : A YANG Data Model for Tunnel Interface Types
- : YANG Modules for IPv4-in-IPv6 Address plus Port Softwires
- : A YANG Data Model for the Routing Information Protocol
- : Common YANG Data Types for Traffic Engineering
- : YANG Data Model for Traffic Engineering Topologies
- : A YANG Data Model for Factory Default Settings
- : A YANG Data Model for the Multicast Source Discovery Protocol
- : A YANG Data Model for Layer 2 Network Topologies
- : A YANG Data Model for MPLS Base
- : YANG Module Tags
- : YANG Data Model for Segment Routing
- : A YANG Data Model for IPsec Flow Protection Based on Software-Defined Networking
- : A YANG Data Model for Routing Policy
- : YANG Data Model for MPLS LDP
- : A YANG Data Model for Layer 0 Types
- : A YANG Data Model for Wavelength Switched Optical Networks
- : A YANG Data Model for Terminal Access Controller Access-Control System Plus
- : YANG Types for DNS Classes and Resource Record Types
- : A YANG Data Model for Internet Group Management Protocol and Multicast Listener Discovery Snooping
- : A YANG Grouping for Geographic Locations
- : A Common YANG Data Model for Layer 2 and Layer 3 VPNs
- : YANG Modules Describing Capabilities for Systems and Datastore Update Notifications
- : A YANG Data Model for DHCPv6 Configuration
- : A YANG Data Model for NTP
- : A YANG Network Data Model for Layer 2 VPNs
- : YANG Data Model for Bidirectional Forwarding Detection
- : YANG Data Model for Protocol Independent Multicast
- : YANG Data Model for the OSPF Protocol
- : YANG Data Model for the IS-IS Protocol
- : A YANG Module for IS-IS Reverse Metric
- : A YANG Data Model for IP Traffic Flow Security
- : A YANG Data Model for Static Context Header Compression
- : A YANG Data Model for Network and VPN Service Performance Monitoring
- : A YANG Data Model for Internet Group Management Protocol and Multicast Listener Discovery Proxy Devices
- : A YANG Data Model for RIB Extensions
- : A YANG Network Data Model for Service Attachment Points
- : A YANG Data Model for Service Assurance
- : A YANG Data Model for Reporting Software Bills of Materials and Vulnerability Information
- : YANG Data Model for OSPFv3 Extended Link State Advertisements
- : A YANG Data Model for In Situ Operations, Administration, and Maintenance
- : Deterministic Networking YANG Data Model
- : YANG Data Types and Groupings for Cryptography
- : A YANG Data Model for a Truststore
- : A YANG Data Model for a Keystore
- : YANG Groupings for TCP Clients and TCP Servers
- : YANG Groupings for SSH Clients and SSH Servers
- : YANG Groupings for TLS Clients and TLS Servers
- : Conveying a Certificate Signing Request in a Secure Zero-Touch Provisioning
- : A YANG Data Model for Babel
- : YANG Data Model for TCP
- : A YANG Data Model for Microwave Topology
- : A YANG Data Model for Challenge-Response-Based Remote Attestation Procedures Using Trusted Platform Modules
- : YANG Data Model for Maximum Segment Identifier Depth Types and MPLS MSD
- : YANG Data Model for Routing in Fat Trees
- : A YANG Data Model for Virtual Network Operations
- : A YANG Data Model for Syslog Management
- : A YANG Data Model for the Path Computation Element Communication Protocol
- : A Common YANG Data Model for Attachment Circuits
- : YANG Data Models for Bearers and Attachment Circuits as a Service
- : A Network YANG Data Model for Attachment Circuits
- : A YANG Data Model for Augmenting VPN Service and Network Models with Attachment Circuits
- : A YANG Data Model for IS-IS Segment Routing over the MPLS Data Plane
- : A YANG Data Model for OSPF Segment Routing over the MPLS Data Plane
- : Extensions to the YANG Data Model for Access Control Lists
- : Common YANG Data Types