understand YANG and its goals

2020-02-13 01:52发布

I've read https://en.wikipedia.org/wiki/YANG but still having problems to understand the practical use of YANG, and the benefits it provides. As I understand, it now is used not only by NETCONF, as was originally designed. YANG is not a language in a common sense, as C or python for instance, i.e. whatever we write in YANG is not compiled or translated; as I understand is is used as a reference model for a higher level library or application. Then the question is how does the high level code understand YANG?

1条回答
仙女界的扛把子
2楼-- · 2020-02-13 02:32

YANG is a specialized schema language, akin to XSD Schema or RelaxNG but (was) specific to NETCONF. Its goal is to model all content that is exchanged during protocol sessions between peers, as described in RFC6020:

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.

The model defined by YANG may be consumed in the usual way - code generation for example, like what JAXB does for XSD Schema and Java. There are tools and server implementations out there that simply consume the YANG module set (a YANG model) and are ready to be used as dummy implementations. There are also tools that use the model to enable users to query a device, without actually implementing anything specific about the device. You could say that a set of YANG modules exposes the interface provided by a device. What you do with this interface is entirely up to you.

I suggest reading the high level overview provided in the specification:

Also check the wiki page of the ietf-netmod-yang tag.

Edit: You may also benefit from reading the An Architecture for Network Management Using NETCONF and YANG document. It further explains the architecture which YANG a is part of, including how different roles such as application developers should approach it (in the context of network management).

查看更多
登录 后发表回答