Yet Another Next Generation (YANG, /jæŋ/, which rhymes with "hang")[1][2][3] is a data modeling language for the definition of data sent over network management protocols such as the NETCONF[4] and RESTCONF.[5] The YANG data modeling language is maintained by the NETMOD [6] working group in the Internet Engineering Task Force (IETF) and initially was published as RFC 6020 in October 2010, with an update in August 2016 (RFC 7950). The data modeling language can be used to model both configuration data as well as state data of network elements. Furthermore, YANG can be used to define the format of event notifications emitted by network elements and it allows data modelers to define the signature of remote procedure calls that can be invoked on network elements via the NETCONF protocol. The language, being protocol independent, can then be converted into any encoding format, e.g. XML or JSON, that the network configuration protocol supports.
YANG is a modular language representing data structures in an XML tree format. The data modeling language comes with a number of built-in data types. Additional application specific data types can be derived from the built-in data types. More complex reusable data structures can be represented as groupings. YANG data models can use XPATH expressions to define constraints on the elements of a YANG data model.
Contents
1History
2Example
2.1JSON encoding
2.2XML encoding
3Documentation
3.1Language specifications and architectural documents
3.2Guidelines and supporting documentation
4IETF usage
4.1Standards-track protocol specifications
4.2Standards-track data models
4.3Experimental specifications
5Implementations
6References
7External links
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 (SNMP). The data modeling language associated with SNMP was called the Structure of Management Information (SMI). The SMI language itself was based on the 1988 version of the Abstract Syntax Notation One (ASN.1). The current version of the SMI language, SMIv2 defined in RFC 2578, 2579 and 2580, 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 (RFC 3780, 3781).
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.[7] 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 RFC 6020 in October 2010. Recently, the NETMOD working group has been working on YANG 1.1, which has been published in August 2016 in RFC 7950.[2]
Example
The following YANG module example-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 {
namespace "http://example.com/example-sports";
prefix sports;
import ietf-yang-types { prefix yang; }
typedef season {
type string;
description
"The name of a sports season, including the type and the year, e.g,
'Champions League 2014/2015'.";
}
container sports {
config true;
list person {
key "name";
leaf name { type string; }
leaf birthday { type yang:date-and-time; mandatory true; }
}
list team {
key "name";
leaf name { type string; }
list player {
key "name season";
unique number;
leaf name { type leafref { path "/sports/person/name"; } }
leaf season { type season; }
leaf number { type uint16; mandatory true; }
leaf scores { type uint16; default 0; }
}
}
}
}
JSON encoding
The code block below shows the JSON representation of an instantiation of the example-sports data model.
RFC 8531: Generic YANG Data Model for Connection-Oriented Operations, Administration, and Maintenance (OAM) Protocols
RFC 8532: Generic YANG Data Model for the Management of Operations, Administration, and Maintenance (OAM) Protocols That Use Connectionless Communications
RFC 8533: A YANG Data Model for Retrieval Methods for the Management of Operations, Administration, and Maintenance (OAM) Protocols That Use Connectionless Communication
RFC 8542: A YANG Data Model for Fabric Topology in Data-Center Networks
RFC 8561: A YANG Data Model for Microwave Radio Link
RFC 8575: YANG Data Model for the Precision Time Protocol (PTP)
RFC 8632: A YANG Data Model for Alarm Management
RFC 8652: A YANG Data Model for the Internet Group Management Protocol (IGMP) and Multicast Listener Discovery (MLD)
RFC 8675: A YANG Data Model for Tunnel Interface Types
RFC 8676: YANG Modules for IPv4-in-IPv6 Address plus Port (A+P) Softwires
RFC 8695: A YANG Data Model for the Routing Information Protocol (RIP)
RFC 8776: Common YANG Data Types for Traffic Engineering
RFC 8795: YANG Data Model for Traffic Engineering (TE) Topologies
RFC 8808: A YANG Data Model for Factory Default Settings
RFC 8916: A YANG Data Model for the Multicast Source Discovery Protocol (MSDP)
RFC 8944: A YANG Data Model for Layer 2 Network Topologies
RFC 8960: A YANG Data Model for MPLS Base
RFC 8819: YANG Module Tags
RFC 9020: YANG Data Model for Segment Routing
RFC 9061: A YANG Data Model for IPsec Flow Protection Based on Software-Defined Networking (SDN)
RFC 9067: A YANG Data Model for Routing Policy
RFC 9070: YANG Data Model for MPLS LDP
RFC 9093: A YANG Data Model for Layer 0 Types
RFC 9094: A YANG Data Model for Wavelength Switched Optical Networks (WSONs)
RFC 9105: A YANG Data Model for Terminal Access Controller Access-Control System Plus (TACACS+)
RFC 9108: YANG Types for DNS Classes and Resource Record Types
RFC 9166: A YANG Data Model for Internet Group Management Protocol (IGMP) and Multicast Listener Discovery (MLD) Snooping
RFC 9179: A YANG Grouping for Geographic Locations
RFC 9181: A Common YANG Data Model for Layer 2 and Layer 3 VPNs
RFC 9196: YANG Modules Describing Capabilities for Systems and Datastore Update Notifications
RFC 9243: A YANG Data Model for DHCPv6 Configuration
RFC 9249: A YANG Data Model for NTP
RFC 9291: A YANG Network Data Model for Layer 2 VPNs
RFC 9314: YANG Data Model for Bidirectional Forwarding Detection (BFD)
RFC 9128: YANG Data Model for Protocol Independent Multicast (PIM)
RFC 9129: YANG Data Model for the OSPF Protocol
RFC 9130: YANG Data Model for the IS-IS Protocol
RFC 9194: A YANG Module for IS-IS Reverse Metric
RFC 9348: A YANG Data Model for IP Traffic Flow Security
RFC 9363: A YANG Data Model for Static Context Header Compression (SCHC)
RFC 9375: A YANG Data Model for Network and VPN Service Performance Monitoring
RFC 9398: A YANG Data Model for Internet Group Management Protocol (IGMP) and Multicast Listener Discovery (MLD) Proxy Devices
RFC 9403: A YANG Data Model for RIB Extensions
RFC 9408: A YANG Network Data Model for Service Attachment Points (SAPs)
RFC 9418: A YANG Data Model for Service Assurance
RFC 9472: A YANG Data Model for Reporting Software Bills of Materials (SBOMs) and Vulnerability Information
Experimental specifications
The following requests for comments are experimental specifications that use or extend YANG:
RFC 6095: Extending YANG with Language Abstractions
RFC 7758: Time Capability in NETCONF
Implementations
Open source implementations (sorted by name):
clixon is a YANG-based toolchain including interactive CLI, NETCONF and RESTCONF interfaces written in C.
goyang is a YANG parser and compiler written in Go to produce Go language objects
jnc is a pyang-based YANG-to-Java-API compiler
libyang is a YANG parser and toolkit written in C and providing API in C
pyang is an extensible YANG validator and converter written in Python
pyangbind is a pyang-based Python binding generator
Sysrepo is a YANG-based configuration and operational datastore for Unix/Linux applications.
yangbuilder is a builder for YANG, implemented in Apache Groovy (generate yang data models with Apache Groovy, maintain similar models with one source code base)
yang-ide is an Eclipse plugin for editing and visualizing YANG models
yang-js is a YANG parser and evaluator written in CoffeeScript/JavaScript for Node.js and the web browser
yang-express is a yang-js based Express.js web framework generator
yang-swagger is a yang-js based Swagger/OpenAPI specification generator
yangson is a Python 3 library for working with JSON encoded configuration and state data modeled using the YANG data modeling language.
YANG Tools is an OpenDaylight Project toolset written in Java
Yang-Explorer - is a pyang-based Yang Browser and RPC Builder Application
ydk-gen is a YANG-to-API compiler generating APIs in multiple languages (e.g. Python, C++)
yuma123 is netconf/YANG toolchain written in C providing: libyuma - API for development of applications supporting runtime compilation of YANG modules, netconfd - modular server, yangcli - interactive command line tool
Closed source implementations (sorted by name):
confd is a commercial management agent toolkit including a YANG compiler
MasterYANG is a YANG model designer, visualizer, and editor for Windows
Visual YANG Designer is a YANG definition file creator/editor/modeler/builder/designer and YANG compiler implemented in Java
yumapro is a commercial management agent toolkit including a YANG compiler
References
↑Template:Cite tech report
↑ 2.02.1Template:Cite tech report
↑RFC 8328 : Policy-Based Management Framework for the Simplified Use of Policy Abstractions (SUPA)
↑Template:Cite tech report
↑Template:Cite tech report
↑"Network Modeling Working Group". https://tools.ietf.org/wg/netmod/.
↑Schönwälder, Jürgen; Björklund, Martin; Shafer, Phil (2010). "Network Configuration Management using NETCONF and YANG". IEEE Communications Magazine48 (9): 166–173. doi:10.1109/MCOM.2010.5560601.
External links
YANG Model Catalog - Online catalog with a REST API
YANG central - YANG information and tutorials
YANG Discussion Forum - ConfD User Community Forum for discussing YANG related questions.
For a list of YANG-based clients and servers see the NETCONF page.
ISBN:978-0135180396 - "Network Programmability with YANG: The Structure of Network Automation with YANG, NETCONF, RESTCONF, and gNMI"
0.00
(0 votes)
Original source: https://en.wikipedia.org/wiki/YANG. Read more