< Home

Introduction to NETCONF YANG API

Overview

Network Configuration Protocol (NETCONF) is a communication mechanism used between the NMS and network devices. The network administrator can use NETCONF to add, modify, and delete configurations of network devices, and obtain configurations and status of network devices. All network devices provide standard Application Programming Interface (API), through which the NMS manages these devices using NETCONF.

For details about NETCONF, see NETCONF Configuration in the S2720, S5700, and S6700 V200R019C10 Configuration Guide - Network Management and Monitoring Configuration Guide.

The NETCONF packets are in XML format and the NETCONF protocol has a powerful filtering capability. Each data field has a fixed element name and position. Therefore, the devices of the same vendor can use the same access mode and result display mode. The devices of different vendors can achieve the same effect by XML mapping. This feature facilitates third-party software development and NMS software customization in the multi-vendor, multi-device environment. With the help of such NMS software, NETCONF simplifies device configuration and improves device configuration efficiency.

YANG is a data modeling language for NETCONF. Clients use YANG to compile remote procedure calls (RPCs) into packets in the XML format to communicate with servers. Packets in the XML format comply with YANG model restrictions.

RPC Operations

The NETCONF protocol uses the RPC-based communication mechanism and provides transport-independent NETCONF request and response mechanism using the elements such as <rpc> and <rpc-reply> to implement device configuration and management.

  • <rpc>

    The <rpc> element is used to enclose a NETCONF request sent from the client to the server.

    The <rpc> element has a mandatory attribute "message-id", which is a string chosen by the sender of the RPC that will commonly encode a monotonically increasing integer. The receiver of the RPC does not decode or interpret this string but simply saves it to be used as a "message-id" attribute in any resulting <rpc-reply> message.

  • <rpc-reply>

    The <rpc-reply> element is used to enclose NETCONF response. The server returns a <rpc-reply> message in response to every <rpc> message.

    The <rpc-reply> element also has a mandatory attribute "message-id", which is the same as that in the RPC request.

  • <rpc-error>

    The <rpc-error> element is sent in <rpc-reply> messages if an error or alarm occurs during the processing of an <rpc> request.

  • <ok>

    The <ok> element is sent in <rpc-reply> messages if no error or alarm occurs during the processing of an <rpc> request.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >