NETCONF is an XML-based network configuration Protocol, which is described in detail in document RFC6241.
Yang is a data modeling language that is modeled for netconf. Document RFC2060 details The yang1.0 version, RFC7950 describes the yang1.1 version.
XML is a tree-like data format.
Here we first need to say the problem of network configuration, such as I want to configure a router a static route, the general method is to connect to the input command to configure. Netconf's role is to complete the network Automation configuration, each time you will need to tell netconf configuration data, he will complete the configuration. However, the problem is that the configuration model for network devices is not the same. If you can give a fixed model and use the model to parse the configuration data and transform it into a data structure that meets the requirements, you can complete the automation configuration. The role of Yang language is to set this fixed model as Yang model. Netconf's information interaction is implemented using XML, so Yang model is a model describing the structure of XML.
The netconf automatic configuration system uses the CLIENT/SERVER structure. The client sends a request to Server,server to accept the message and parse it and extract the RPC information, using the Yang model to verify the legality of the request. If authentication is passed, the server executes the RPC, completes the network configuration, and returns the message to the client.
There are a few things to be aware of in this process that will help you learn to use Yang. The 1th is that the client and server are bidirectional XML format communication (the most important information is RPC). The 2nd is the lossless bidirectional conversion of Yang and Yin (Yin is a file in XML format that can describe Yang in detail). 3rd, the full name of RPC is remote Procedure call, which plays an important role in Yang's RPC (finally knowing what Yang's RPC is for, and RPC contains information using <RPC></RPC> Delivery, the primary information that the server returns to the client is used <RPC-reply></RPC-reply> passed.
Netconf, Yang, and XML relationships