Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

YANG

YANG is a Data Modeling Language

Data Modeled

  • Config
  • State
  • RPCs (to make changes)
  • Notifications (to get events)

YANG was intended for NETCONF.

  1. Functional Overview

YANG is a language used to model data for the NETCONF protocol. A YANG module defines a hierarchy of data that can be used for NETCONF- based operations, including configuration, state data, Remote Procedure Calls (RPCs), and notifications. This allows a complete description of all data sent between a NETCONF client and server.

Source RFC 6020 Section 4.1.

Terms

YANG — Yet Another Next Generation

Structured

  • Data that is formated for automation to use
  • Data that follows a schema

Schema

  • Rules around how data is allowed to be structured

Why

Device CLI output provides unstructured data

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/9, changed state to down

YANG provides structured data which follows a schema

<config xmlns="http://tail-f.com/ns/config/1.0">
  <router xmlns="http://com/example/routermodel">
    <name>switch</name>
    <address>192.168.0.10</address>
    <operational-status>down</operational-status>
    <interface>
      <type>GigabitEthernet</type>
      <enabled>true</enabled>
      <interface-id>0/9</interface-id>
    </interface>
  </router>
</config>

Features

  • Tree structured
  • Defined structured
  • Modular
  • Encoding Variety
    • XML, JSON
  • Meant for automated tooling

Node Types

Container

  • Groups nodes

Leaf

  • A data

Leaf-List

  • Multiple units of one data

List

Models

Different organizations make different models.

At present multiple models are needed to get all features.

This is a BGP example.

ietf-98-openconfig-models

Courtesy of IETF 98, Rob Shakir & Anees Shaikh

Cisco

  • AKA, Vendor Model
  • AKA, Native Model
  • AKA, IOS-XE Model
  • Best Supported

OpenConfig

  • Industry supported
  • Primary focus: operational usability
  • Secondary focus: ease to implement

IETF

IEEE

  • Very New

ONF

  • Associated with the Linux Foundation

IANA

References

Cisco Blog - Native, IETF, OpenConfig… Why so many YANG models? - Hank Preston

Cisco Live - … Understand … YANG with NETCONF and RESTCONF … - Bryan Byrne & Hank Preston - BRKDEV-1368

Cisco Live - Exploring YANG Data Modeling - Aayushi Mahajan - DEVNET-1882

GitHub - OpenConfig YANG models

IETF 98 - Observations on Modeling Configuration and State in YANG

RFC 6020 - YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)

Last Modified • Saturday, June 27, 2026. 11:45 pm UTC+00:00 • Commit: 4314778