Network Automation Series: Part 3 NETCONF and YANG
Since ARPANET hit the scene almost 50 years ago the methods of managing and monitoring a network has changed very little until recently. Most networks have been managed by:
As applications become more and more dependent upon the idiosyncrasies of the network, it is not just Network Engineers that are looking to configure and monitor networks. DevOps as an approach to development and operations has proven successful for many organizations, and these teams are quickly looking at how they can expand their reach into the network. This has driven the need to look at alternatives for managing and monitoring networks.
SNMP was originally conceived to back in 1988 as the mechanism for monitoring and configuring networks. As time passed with each iteration of SNMP it became apparent that SNMP works ‘reasonably well for device monitoring’. Over time it has become apparent that SNMP is not well suited for configuring networks.
What was needed was a paradigm shift in network management that addressed:
Working groups within the IETF were setup to define an approach for a standard programmatic interface for Interface configuration. The minutes from the IAB Network Management Workshop are documented in RFC 3535, from this the IETF developed NetConf and YANG.
NETCONF was originally proposed in RFC 4741 in 2006, and YANG in RFC 6020 in 2010. Both are new technologies that continue to evolve and gain acceptance from customers and vendors.
NETCONF is the standard for installing, manipulating and deleting configuration of network devices. NETCONF is the primary transport protocol used with YANG data models today. It is the NETwork CONFiguration protocol, and defines how a Manager and Agent will communicate in a standard fashion. The agent resides on the network device while the manager will be part of the Network Management System.
NETCONF is a transport protocol, but it doesn't provide access to configure or retrieve device information as part of the basic protocol. NETCONF leverages YANG (and non-YANG) data models to detail what "capabilities" a device provides. The list of these capabilities are exchanged during initial communication between a manager and agent as part of the "hello" phase.
NETCONF leverages SSH as the underlying method for communicating over the network. NETCONF authentication options are the same as any SSH communication. Usernames and passwords or certificates can be used just like when you use SSH for CLI communications.
Messages sent with NETCONF leverage Remote Procedure Calls or RPCs. RPCs are simply a standard framework for a client to request a server to take an action "remotely" and provide the results.
One of the key requirements identified when the IETF was considering a replacement for SNMP was an integrated method for configuration validation, error checking/handling, and rollback.
As part of addressing this need, NETCONF includes "Data Stores" to provide targets of individual operation events. Each container will hold a copy of the configuration data that can be pre-validated before committing to active configuration.
Another benefit of data stores, is that network management systems can verify configurations across all devices in a network are consistent in a data store, than commit an entire change network wide at once.
What is a data model? A data model is simply a well understood and agreed upon method to describe "something". As an example, consider this simple "data model" for a person.
Using the generic data model, we can describe an individual as a "Brown hair, blue eyed, five foot woman of about 120 pounds" and anyone understands what this means.
YANG is first a language for describing data models. The YANG language could be used to describe ANY data model, but it was designed to describe networking data models.
As a language, it is highly structured and typed, something that should be appreciated in a data modelling language.
A language isn't very useful if you don't use it for something, and the YANG language is used to write YANG Data Models. An individual data model, called a "YANG Module", will describe some aspect of networking.
The model can be displayed and represented in any number of formats depending on needs at the time. Some options include:
But who writes YANG Data Models? Firstly standards bodies will create YANG Data Models, then there will be models created by equipment and software vendors, and lastly users can create and derive their own YANG Data Models.
NETCONF and YANG
To retrieve (or send) YANG data, we leverage "NETCONF" (Transport Protocol) to communicate from a "Manager" (Client) on a workstation to an "Agent" (Server) running on a network element (switch or router) using "XML" (Data Format).
When using NETCONF as the transport protocol then YANG data is always serialised and represented as XML
Cisco provides a wealth of free resources so you can experiment with NETCONF and YANG interfaces, on a range of Cisco Platforms. Check out Cisco DevNet
If you wish to explore how Cisco can help with leveraging programmatic interfaces on our platforms please contact your Account Team. This concludes our third installment of the Network Automation Series. If you have any questions or require further information
Follow us on twitter - @ciscodevnet and @netopdevguy