Using Data Models

Use Data Models

Figure 1. Workflow for using Data models

The above illustration gives a quick snap shot of how YANG can be used with Netconf in configuring a network device using a client application.

The tasks that help the user to implement Data model configuration are listed here.

  1. Load the software image ; the YANG models are a part of the software image. Alternatively, the YANG models can also be downloaded from:
    https://github.com/YangModels/yang/tree/master/vendor/cisco/xr
    Users can also query using NETCONF to get the list of models.
    <?xml version="1.0" encoding="utf-8"?>
    <rpc message-id="100" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <get>
            <filter type="subtree">
                <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
                    <schemas/>
                </netconf-state>
            </filter>          
        </get>
    </rpc>
  2. Communication between the router and the application happens by Netconf over SSH. Enable Netconf on the router on a suitable port.

  3. From the client application, connect to the router using Netconf over SSH. Run Netconf operations to make configuration changes or get operational data.

    Figure 2. Lane Diagram to show the router and client application operations

Enabling Netconf

This task enables Netconf over SSH.

Before you begin

  • Install the required packages (k9sec and mgbl)

  • Generate relevant crypto keys

Procedure


Step 1

netconf-yang agent ssh

Enables the Netconf agent process.

Step 2

ssh server netconf

Enables Netconf.

Step 3

ssh server v2

Enables SSH on the device and enables Netconf on port 22 if the Netconf agent process is enabled.


What to do next

The netconf-yang agent session command enables the user to set session parameters.
netconf-yang agent session {limit value |  absolute-timeout value |  idle-timeout value}
where,
  • limit value - sets the maximum count for concurrent netconf-yang sessions. Range is 1 to 1024. The default value is 50.

  • absolute-timeout value - sets the absolute session lifetime. Range is 1 to 1440 (in minutes).

  • idle-timeout value - sets the idle session lifetime. Range is 1 to 1440 (in minutes).

Enabling gRPC

Use the following procedure to enable gRPC over HTTPS/2. gRPC supports both, the IPv4 and IPv6 address families (default is IPv4).

Procedure


Step 1

Install the GO client. For more details on installing the GO client, see https://golang.org/doc/install.

Step 2

Configure the gRPC port, using the grpc port command.


RP/0/RP0/CPU0:ios(config)#grpc
RP/0/RP0/CPU0:ios(config)#port 57400
RP/0/RP0/CPU0:ios(config)#tls
RP/0/RP0/CPU0:ios(config)#commit

Port can range from 57344 to 57999. If a port is unavailable, an error is displayed.