Programmatic Configuration Using Data Models

Data models are a programmatic way of configuring and collecting operational data of a network device. They replace the process of manual configuration, which is proprietary, and highly text-based.

Data Models—Scope, Need, and Benefits

Scope

Data models can be used to automate configuration tasks across heterogeneous devices in a network.

Data models handle the following types of requirements on routers (RFC 6244):
  • Configuration data: A set of writable data that is required to transform a system from an initial default state into its current state. For example, configuring entries of the IP routing tables, configuring the interface MTU to use a specific value, configuring an ethernet interface to run at a given speed, and so on.

  • Operational state data: A set of data that is obtained by the system at runtime and influences the behavior of the system in a manner similar to configuration data. However, in contrast to configuration data, operational state data is transient. The data is modified by interactions with internal components or other systems using specialized protocols. For example, entries obtained from routing protocols such as OSPF, attributes of the network interfaces, and so on.

  • Actions: A set of NETCONF actions that support robust network-wide configuration transactions. When a change is attempted that affects multiple devices, the NETCONF actions simplify the management of failure scenarios, resulting in the ability to have transactions that will dependably succeed or fail atomically.

Data models provide a well-defined hierarchy of the configurational and operational data of a router, and NETCONF actions. The data models are programmed to provide a common framework of configurations to be deployed across networks. This common framework helps to program and manage a network with ease.

For more information about Data Models, see RFC 6244.

Need

Typically, a network operation center is a heterogeneous mix of various devices at multiple layers of the network. Such network centers require bulk automated configurations to be accomplished seamlessly.

CLIs are widely used for configuring and extracting the operational details of a router. But the general mechanism of CLI scraping is not flexible and optimal. Small changes in the configuration require rewriting scripts multiple times. Bulk configuration changes through CLIs are cumbersome and error-prone. These limitations restrict automation and scale.

To overcome these limitations, Cisco IOS XR supports a programmatic way of writing configurations to any network device using data models.

Data models help to manipulate configuration data, retrieve operational data, and perform actions. The data models replace the process of manual configuration and are written in an industry-defined language. Although configurations using CLIs are easier and human-readable, automating the configuration using data models results in scalability. To get these data models, see Obtain Data Models

The data models provides access to the capabilities of the devices in a network using Network Configuration Protocol (NETCONF) or gRPC (google-defined Remote Procedure Calls) protocols. The operations on the router are carried out by the protocols using YANG models to automate and programme operations in a network. To enable the protocol, see Enable Protocol

The process of automating configurations in a network is accomplished using the core components - router, client application, YANG model and communication protocols. For more information about the core components, see Components to Use Data Models.

Benefits

Configuring routers using data models overcomes drawbacks posed by traditional router management because the data models:
  • Provide a common model for configuration and operational state data, and perform NETCONF actions.

  • Use protocols to communicate with the routers to get, manipulate and delete configurations in a network.

  • Automate configuration and operation of multiple routers across the network.

Process for using Data Models

The process for using data models involves:
  • Obtain the data models.

  • Establish a connection between the router and the client using communication protocols such as NETCONF or gRPC.

  • Manage the configuration of the router from the client using data models.


Note

Configure AAA authorization to restrict users from uncontrolled access. If AAA authorization is not configured, the command and data rules associated to the groups that are assigned to the user are bypassed. An IOS-XR user can have full read-write access to the IOS-XR configuration through Network Configuration Protocol (NETCONF), google-defined Remote Procedure Calls (gRPC) or any YANG-based agents. In order to avoid granting uncontrolled access, enable AAA authorization using aaa authorization exec command before setting up any configuration. For more information about configuring AAA authorization, see the System Security Configuration Guide for Cisco NCS 5500 Series Routers.


Figure 1 shows the tasks involved in using data models.

Figure 1. Process for Using Data Models