ArticleslgStudy

science

YANG

YANG is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand YANG rather than just read about it. In short: Yet Another Next Generation (YANG, /jæŋ/) 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 (IETF), YANG was initially published as RFC 6020 in October 2010, with a significant update to version 1.1 in August 2016 (RFC 7950).

Key takeaways

  • YANG belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect YANG to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of YANG from memory before moving on to harder problems.

Reference excerpt

Yet Another Next Generation (YANG, /jæŋ/) 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 (IETF), YANG was initially published as RFC 6020 in October 2010, with a significant update to version 1.1 in August 2016 (RFC 7950). 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 (SDN) and network function virtualization (NFV) 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 (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. 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.

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.

JSON encoding The code block below shows the JSON representation of an instantiation of the example-sports data model.

XML encoding The code block below shows the XML representation of an instantiation of the example-sports data model.

Documentation

Language specifications and architectural documents The following Request for Comments (RFCs) define the YANG language and some basic extensions:

RFC 6020: YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF) RFC 6110: Mapping YANG to Document Schema Definition Languages and Validating NETCONF Content RFC 7950: The YANG 1.1 Data Modeling Language [does not replace RFC 6020] RFC 7951: JSON Encoding of Data Modeled with YANG RFC 7952: Defining and Using Metadata with YANG RFC 8342: Network Management Datastore Architecture (NMDA) RFC 8525: YANG Library [obsoletes RFC 7895] RFC 8528: YANG Schema Mount RFC 8791: YANG Data Structure Extensions RFC 9254: Encoding of Data Modeled with YANG in the Concise Binary Object Representation (CBOR) RFC 9595: YANG Schema Item iDentifier (YANG SID)

Guidelines and supporting documentation The following requests for comments provide guidelines and supporting documentation:

RFC 9907: Guidelines for Authors and Reviewers of Documents Containing YANG Data Models [obsoletes RFC 8407] RFC 8199: YANG Module Classification RFC 8340: YANG Tree Diagrams RFC 8969: A Framework for Automating Service and Network Management with YANG RFC 9195: A File Format for YANG Instance Data RFC 9890: An Update to YANG Module Names Registration

IETF usage

Standards-track protocol specifications The following requests for comments define standards-track protocols that are (partially) defined using YANG modules:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with YANG

Start with the simplest possible case. Write down what YANG claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to YANG before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about YANG ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of YANG

In research
YANG appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses YANG in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
YANG is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data modeling, Data modeling languages, so understanding it makes those chapters shorter.
In everyday life
Look for YANG outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “YANG” →

How to study YANG in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what YANG means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain YANG out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is YANG in simple terms?

Yet Another Next Generation (YANG, /jæŋ/) 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 (IETF), YANG was initially published…

Why does YANG matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study YANG?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on YANG.

Tags

  • Data modeling
  • Data modeling languages

Keep exploring