Categories
CCNP Enterprise Core (350-401) Cisco Software Defined Networking

YANG Data Models

Yet Another Generation (YANG) modelling language, defined in RFC 6020 uses data models.

Data models are used to describe whatever can be configured on a device, whatever can be monitored device, and all the administrative actions that can be executed on a device, including all the notifications that a device can generate.

All of these variables are represented within a YANG model.

Data models are powerful as they can create a uniform way to describe data, which is beneficial across vendors platforms.

Data models allow network operators to configured, monitor, and interact with network devices holistically across an enterprise environment

YANG models use a tree structure. In that structure the models are similar in format to XML and are constructed in modules.

The modules are hierarchical in nature and contain all the different data and types that make up the YANG data model. YANG models make a clear distinction between configuration data and state information.

The tree structure represents how to reach a specific element of the model, and elements can be configurable or not configurable.

Every element has a defined type. An interface can be changed to be on or off. An interfaces operational state can be not be modified at all.

container food {
 
 choice dinner {

  case kfc {
   leaf zinger {
    type empty;
   }
   left fillet {
    type empty;
   }

  case mcdonalds {
   leaf mcflurry {
    enum smarties;
    enum galaxy;
    enum kitkat;
   }
 } 
}

There is food, of the two choices for dinner, one is KFC and the other is McDonalds.

If at KFC, the two choices are Zinger or Fillter.

If at McDonalds, the choice is McFlurry. There is a choice between Smarties, Galaxy or KitKat.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.