Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

YANG is a data modeling language used to model configuration & state data. Modeling languages such as SMI (SNMP), UML, XML Schema, and others already existed. However, none of these languages were specifically targeted to the needs of configuration management. They lacked critical capabilities like being easily read and understood by human implementers, and fell short in providing mechanisms to validate models of configuration data for semantics and syntax.

  YANG tools are the basic building block to achieve the final goal of abstracting the language based Syntax/Semantics processing by APPs. 

The YANG modeled interfaces need to be implemented by corresponding application component. There are 2 parts in implementing the interface:

 

    1. Syntax/semantics processing of the request/response being exchanged. 
    2. Business logic to compute the request. 

...

We intend to provide a framework in which the applications only need to implement the business logic and seamlessly support any interface language like REST, NETCONF etc. 

           Image Removed Image Added

In ONOS, YANG is being used as a general purpose modeling language.

...

    1. Model

    2. YangCompiler

    3. YangSerializer

    4. YangRunTime

Model

Base Models will be used by different YANG components. It includes following:

DataNode

...

Provides a basis for holding information in a tree whose structure corresponds to a set of YANG models (base & augmentations).

...

  • Inner node represents container and list.
  • Leaf node represents leaf and leaf-list.
ResourceId

...

 

Resource identifier, Its list of node key to drive path till the resource, where key is contains the local node name and the corresponding module namespace. 

  • Is immutable.
  • Provides a mechanism for mutation (Builder pattern, etc.)
  • Used to operate on a given resource.
ModelObject

...

Provides a common basis for all POJOs which are generated from a YANG model.

  • It is mutable.
  • The binding between ModelObject POJO and DataNode is performed by the YANG Runtime.

    Each model or application will have a unique identifier, which can be configured using buck or maven as shown below :

    Code Block
    languagebash
    titleTo config mode-ld using maven
    <configuration>
        <modelId>xml</modelId>
    </configuration>
    Code Block
    languagebash
    titleTo config model-Id using buck
    yang_model(
        app_name = 'example.application',
        model_id = 'example_id'
    )


    In-case model-id is not configured then artifact-Id will be configured as model-Id for that particular application. 

YANG Compiler

             

...

It encodes the internal in-memory representation of a configuration model to an external representation consumable from the resulting input stream.
Resource identifier in composite data will get encoded to resource identifier stream and data node will be encoded to resource data stream.

                            Image Removed

...

                          Image Added

Facilities to convert Input stream to DataNode and vice versa.

...

4) YANG GUI enhancement for live compilation.

5) Sub-module support.