Sets of YANG models

With the YANG language, we can model the data for an application in a YANG module. For example, we can model the data for the BGP protocol in a YANG module.

A YANG module comes with its own revision history and has rules for backward compatibility.

However, it is also interesting to have a way to model sets of YANG models. This can be useful in determining which set of models are supported in an implementation. This is where the YANG library becomes very useful. This allows a way of tracking which set of YANG modules are supported on a particular server.

YANG and it’s tools

One of the interesting aspects of YANG is the kind of tooling it enables. Because of it’s structured tree-like nature, it naturally renders itself to have corresponding API (corresponding to each model). These API can either be generic path-based (similar to XPath) or specific to each data model (as it is in YDK).

This API can then be used in various tools which may be used to configure and monitor devices which support the corresponding models. Also applications which deal with processing the modeled data can make use of such API.

Processing modeled data

One of the reasons why modeled data is a powerful advancement is that it makes processing of such data easier. It allows for programmability and automation. When much of the networking data is CLI-based, the operational and configuration data from network devices is mostly hand-crafted. As a result, there has to be a lot of screen-scraping and manual testing to process such data. With the advent of modeled data, which could be modeled using a language like YANG, it can be easily processed by automated programs.

Modeled data vs unstructured data

When it comes to storing, retrieving and analyzing large chunks of data, it is greatly helpful if the said data conforms to some model instead of being unstructured free form data. This is where data modeling languages like YANG come in.

The beauty of YANG is that it lets the consumers know the specific details of the data, including constraints like range, allowed regex patterns among many others.

It also can model semantic constraints, meaning that it can tell you if a value is allowed in a certain context​.