Page Content

Tutorials

What is YANG Yet Another Next Generation, and Core Purpose

Yet Another Next Generation

YANG is an acronym for Yet Another Next Generation. Network device configuration and operational data structures are defined using YANG, a data modelling language.

In the telecom sector, YANG has become the de facto standard for modelling network device settings. It is regarded as the foundation of network automation that is driven by models.

As the schema or blueprint that outlines the accessible data and how it should be arranged and presented, YANG is essentially the dictionary that defines the language.

Yet Another Next Generation
Yet Another Next Generation

You can also read What are the Advantages and Disadvantages of XML

The Core Purpose and Role of YANG

By offering a standardized method for modelling network components, YANG primarily facilitates extensive network automation.

  • Defines Structure and Constraints: For both configuration and state data on a network device, YANG specifies the exact structure and limitations. It guarantees network data structure, consistency, and validation.
  • Supports Programmatic Interaction: YANG enables programmatic interaction between apps and devices. It makes it possible for developers, engineers, and suppliers to communicate configuration and status data in a structured and predictable manner.
  • Modeling Components: YANG models specify the hierarchy, structure, and guidelines for configuring devices. For example, they specify the parameters (such as name, IP address, and status) and appearance of a “interface” object.
  • Beyond Configuration: YANG models specify more than simply state and configuration information. Additionally, they specify the signature of Remote Procedure Calls (RPCs) that can be made on network elements and the structure of event notifications.
  • Standardization and Vendor Neutrality: Any vendor device that supports the same YANG model can utilize the same automation tools due to the model’s standardization. This encourages consistency, interoperability, and model reusability in multi-vendor settings.

YANG in the Automation Stack

YANG is protocol-independent but is foundational to modern, structured network management protocols. It defines the rules (“the what”), while protocols handle the transaction (“the how”).

FeatureYANGJSON / XML
RoleData modeling languageData serialization / format
FunctionDefines structure and rules for dataRepresents the actual data (configuration/operational)
ProtocolsUsed with NETCONF and RESTCONFJSON is widely used in RESTCONF and APIs; XML is common/mandatory in NETCONF

The connection is vital: when a Cisco router is queried via RESTCONF, the response is in JSON, but that JSON structure is defined and validated using a YANG model behind the scenes.

You can also read What is MP BGP Multiprotocol BGP? Components and Benefits

Structure and Building Blocks

YANG uses a hierarchical tree format to represent data structures. The top-level definition, akin to a blueprint name, is a YANG module.

The following are important nodes that define the structure:

  • Leaf Nodes: The smallest data node, known as a leaf node, has a single value of a certain kind, such as an integer or string.
  • Container Nodes: A logical subtree, such as a folder, is created by grouping similar nodes using a non-data node. A container has no value of its own and just has child nodes.
  • List Nodes: Describes a series of list entries, each of which is distinguished from the others by the values of its key leaves.
  • Leaf-list Nodes: A series of primitive values is stored in leaf-list nodes.
  • Grouping: Encourages model reusability by defining reusable sets of node definitions.
  • Module/Submodules: The module may be separated into smaller modules and includes definition, revision, and module-header declarations.
  • Augment: Vendors can add proprietary parameters to standard models by using Augment, which enables a module to add more nodes to data models.

Data Typing and Constraints

To guarantee consistency and integrity, YANG uses robust data typing. Numerous built-in types are supported, such as strings, booleans, unions, enumerations, integers (int8, uint64), and more.

Additionally, YANG provides advanced capabilities for constraint enforcement:

  • Derived Types (typedef): Users can define derived types from base types, allowing for naming and reusing a type multiple times, often with restrictions like ranges.
  • mandatory true: Ensures a leaf must be present in the configuration.
  • Integrity Constraints (must): These statements use XPath expressions that must evaluate to true, allowing for complex validation constraints.
  • Conditional Statements (when): Used to make a parent statement conditional; if the associated XPath expression becomes false, the parent node is automatically deleted.
  • unique: Ensures that the combination of specified non-key leafs must be unique within a list.
  • leafref: Used to model relationships between objects by referencing a key or unique attribute in a list, ensuring that configurations do not end up with dangling pointers.
Yet Another Next Generation

You can also read What is Metro Ethernet Network? how does metro ethernet work

Historical Context and Standardization

The IETF’s NETMOD working group created and maintains YANG. Its underlying type system and syntactic structure were taken from the older, failed SMIng project.

  • YANG 1.0 was published as RFC 6020 in October 2010.
  • A significant update, YANG 1.1, was published as RFC 7950 in August 2016.

The goal of YANG was to replace outdated techniques like SNMP with a more reliable and organized manner for the “next generation” of network management.

A teacher (the network automation platform) must adhere to YANG’s strict curriculum. The precise courses to be taught, the stringent requirements, and the anticipated style of the final exams are all outlined in the curriculum (YANG). To guarantee that each student (network device) receives uniform, verified, and organized teaching, the lessons that are supplied (JSON or XML data) must strictly follow this pre-established syllabus.

You can also read What is Message Switching & advantages of message switching

Agarapu Geetha
Agarapu Geetha
My name is Agarapu Geetha, a B.Com graduate with a strong passion for technology and innovation. I work as a content writer at Govindhtech, where I dedicate myself to exploring and publishing the latest updates in the world of tech.
Index