YANG data models
- defines a standard, hierarchical structure for the configuration and operational data of network devices,
- enables robust network communication by specifying data relationships, constraints, actions, and notifications, and
- supports integration with network management protocols such as NETCONF and gRPC for automated configuration and monitoring.
- YANG module: A file or group of files that together define a single data model. Each module is uniquely identified by a namespace URL.
- NETCONF/gRPC: Protocols that use YANG data models for configuration and operational data exchange.
YANG data models must be obtained from the router. These models define a valid structure for the data exchanged between the router and the client, and are consumed by NETCONF and gRPC-enabled applications (gRPC supported only on 64-bit platforms). YANG models are categorized as follows:
- Cisco-specific models: Proprietary YANG models unique to Cisco devices. For details and representation, see Native models.
- Common models (Open Config/OC): Industry-standard YANG models, typically from organizations such as IETF and IEEE. OC models have separate YANG modules for configuration data, operational data, and actions. See OC models for examples.
All YANG data models are stamped with semantic version 1.0.0 as the baseline from release 7.0.1 and later. For more details on YANG, refer to RFC 6020 and RFC 6087.
Data model requirements
YANG data models handle these types of requirements on routers (RFC 6244):
- Configuration data: A set of writable data required to transform a system from its initial state. For example, configuring entries in the IP routing table, or setting interface MTU or speed.
- Operational state data: Data obtained by the system at runtime, reflecting its operational status, which is typically transient and influenced by internal or external events (for example, OSPF routing entries).
- Actions: Supported via NETCONF actions to enable robust network-wide configuration transactions, ensuring atomic changes across devices.
For more information, see RFC 6244.
YANG model structure
YANG data models use a tree-based, hierarchical structure with nodes, making the models easy to understand and navigate. Each feature typically has a synthesized YANG model built from schemas. A model in tree format includes:
- Top level nodes and their subtrees
- Subtrees that augment nodes in other YANG models
- Custom RPCs
YANG node types
YANG defines these four node types for data modeling:
- Leaf node: Contains a single value of a specific type.
- Leaf-list node: Contains a sequence of leaf nodes.
- List node: Contains a sequence of leaf-list entries, each uniquely identified by one or more key leaves.
- Container node: Contains a grouping of related nodes (which may be any of the four types).
Each node is named and either defines a value or contains child nodes according to its type.
Components of a YANG module
A YANG module defines a single data model but can reference other modules or sub-modules. These standard statements are used:
- Import: Imports external modules.
- Include: Includes one or more sub-modules.
- Augment: Adds new definitions to another module at specified locations.
- When: Sets conditions under which new nodes are valid.
- Prefix: References definitions in an imported module.
![]() Note |
The gRPC YANG path or JSON data is based on the YANG module name, not the namespace. |
Additional reference information
- All data models from release 7.0.1 and later are stamped with semantic version 1.0.0.
- For further reading on YANG, see RFC 6020 and RFC 6087.
- For industry-standard open YANG models, see the OpenConfig public repository.

Feedback