NETCONF

NETCONF

NETCONF overview

NETCONF is a protocol that provides mechanisms for installing, manipulating, and deleting the configuration of network devices. It uses Extensible Markup Language (XML)-based data encoding for configuration data and protocol messages. The NETCONF operations are realized as remote procedure calls (RPCs).

Refer to RFC 6241, Network Configuration Protocol (NETCONF), at https://tools.ietf.org/html/rfc6241 for more information.

On the DANOS vRouter, NETCONF is used within an SSH session through the SSH connection protocol. This mapping allows NETCONF to be run from a secure shell session by a user or an application. This mapping also makes sure that NETCONF complies with SSH IPv6.

On the DANOS vRouter, NETCONF is intended as a machine interface for management software and not intended as a user interface.

Refer to RFC 6242, Using the NETCONF Protocol over Secure Shell (SSH), at https://tools.ietf.org/html/rfc6242 for more information on using the NETCONF configuration protocol over SSH.

NETCONF capabilities supported on the DANOS vRouter

A NETCONF capability is a set of functions that supplements the base NETCONF specification. The capability is identified by a uniform resource identifier (URI). Capabilities augment the base operations of the device, describing both additional operations and the content that is allowed inside the operations. The client discovers the capabilities of the server and uses any additional operations, parameters, and content that are defined by those capabilities.

Following are the NETCONF capabilities that are supported on the DANOS vRouter:

  • capability:candidate 1.0

  • capability:startup 1.0

  • capability:rollback-on-error 1.0

  • capability:validate 1.1

Refer to RFC 6241, Network Configuration Protocol (NETCONF), at https://tools.ietf.org/html/rfc6241 for more information on these capabilities.

Initiating a NETCONF session

To allow an inbound NETCONF session request from a remote system to be accepted, use the commands that are shown in the following table.

1 2 3 vyatta@R1# set service netconf vyatta@R1# set service ssh port 830 vyatta@R1# commit

YANG model for NETCONF monitoring

The <get‐schema> operation is supported on the DANOS vRouter to query and retrieve schema information and NETCONF state information from a NETCONF server.

Refer to RFC 6022, YANG Module for NETCONF Monitoring, at https://tools.ietf.org/html/rfc6022 for more information on using <get-schema>.

Verifying Connections and Retrieving Operational Data Using NETCONF

ping

The ping command displays whether a destination responded and how long the destination took to receive a reply. If an error occurs in the delivery to the destination, the command displays an error message.

Sample XML request:

1 2 3 4 5 <ping xmlns="urn:vyatta.com:mgmt:vyatta‐op"> <host>127.0.0.1</host> <count>5</count> <ttl>3</ttl> </ping>
  • host: IP address you want to ping.

  • count: Number of packets with which you are pinging.

  • ttl: Time to live (ttl) in an IP packet in seconds that tells a network router whether the packet has been in the network too long and should be discarded. By default, the TTL value is 255.

Sample rpc-reply:

1 2 3 4 5 <tx-packet-count>5</tx-packet-count> <rx-packet-count>5</rx-packet-count> <min-delay>54</min-delay> <average-delay>62</average-delay> <max-delay>74</max-delay>

interface

The interface command displays information about an interface name. The command output displays all the IP addresses that are associated with the interface, administrator status, operational status, and description of the interface.

Sample XML request:

1 2 3 <interface xmlns="urn:vyatta.com:mgmt:vyatta-op"> <name>br0</name> </interface>
  • name: Name of interface.

Sample rpc-reply:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <address> <ip>15.15.15.15/24</ip> </address> <address> <ip>2020::/64</ip> </address> <address> <ip>2001::15/64</ip> </address> <address> <ip>3001::211:22ff:fe33:4455/64</ip> </address> <admin-status>up</admin-status> <oper-status>up</oper-status> <description>sample bridge</description>

route

The route command displays information about the path taken to a particular destination address.

Sample XML request:

1 2 3 <route xmlns="urn:vyatta.com:mgmt:vyatta-op"> <destination>192.168.14.0/24</destination> </route>
  • destination (optional): IP address or IP prefix

  • family: ipv4 (default) or ipv6

NOTE: When the destination is not present, the entire route table for the specified family
is returned as the output.

Sample rpc-reply:

1 2 3 4 5 6 7 8 <route> <destination>192.168.14.0</destination> <path> <entry>1</entry> <nexthop>31.31.31.32</nexthop> <device>dp0p256p1</device> </path> </route>

Retrieving statistics using NETCONF

Overview

You can retrieve DANOS vRouter statistics of all types by using NETCONF. Some of the statistics are also available from the CLI. The configuration model is a subtree of the overall YANG tree, which is included in the ISO distribution for the DANOS vRouter.

Use ssh to obtain NETCONF information in XML format from the vRouter as follows.

Configure set service ssh and set service netconf on the DANOS vRouter.

From a remote system, use SSH as follows to access and sign in the DANOS vRouter, when prompted.
ssh vyatta@<ip-address> -s netconf

Send a capabilities list enclosed within a <hello>...<hello/> element.

1 2 3 4 5 6 7 8 9 10 <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability> <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability> <capability>urn:ietf:params:netconf:capability:startup:1.0</capability> <capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability> </capabilities> </hello> ]]>]]>

Respond to the DANOS vRouter hello element with a hello message and capabilities list. End the list with ]]>]]> to inform SSH that the XML element is completed and should be sent.

The following sections provide XML examples for different categories of statistics and other information.

CPU information

The XML examples in this section provide CPU information.

The following example shows an RPC request for CPU information.

1 2 3 4 5 6 7 8 9 10 11 12 <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <system> <state> <processor xmlns="urn:vyatta.com:mgmt:vyatta-system:1"> </processor> </state> </system> </filter> </get> </rpc>]]>]]>

The following example shows the RPC reply.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <data> <system xmlns="urn:vyatta.com:mgmt:vyatta-system:1"> <state> <processor> <utilization> <cpu>0</cpu> <guest>0.00</guest> <idle>98.41</idle> <iowait>0.11</iowait> <irq>0.00</irq> <nice>0.00</nice> <niced-guest>0.00</niced-guest> <soft>0.00</soft> <steal>0.07</steal> <sys>1.39</sys> <user>0.01</user> </utilization> <utilization> <cpu>1</cpu> <guest>0.00</guest> <idle>97.27</idle> <iowait>0.06</iowait> <irq>0.00</irq> <nice>0.00</nice> <niced-guest>0.00</niced-guest> <soft>0.00</soft> <steal>0.35</steal> <sys>1.87</sys> <user>0.44</user> </utilization> <utilization> <cpu>all</cpu> <guest>0.00</guest> <idle>97.85</idle> <iowait>0.09</iowait> <irq>0.00</irq> <nice>0.00</nice> <niced-guest>0.00</niced-guest> <soft>0.00</soft> <steal>0.21</steal> <sys>1.63</sys> <user>0.23</user> </utilization> </processor> </state> </system> </data> </rpc-reply> ]]>]]>

Memory information

The XML examples in this section provide memory information.

The following example shows an RPC request for memory information.

1 2 3 4 5 6 7 8 9 10 11 12 <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <system> <state> <memory xmlns="urn:vyatta.com:mgmt:vyatta-system:1"> </memory> </state> </system> </filter> </get> </rpc>]]>]]>

Uptime information

The XML examples in this section provide memory information.

The following example shows an RPC request for uptime information.

1 2 3 4 5 6 7 8 9 10 11 12 <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <system> <state> <times xmlns="urn:vyatta.com:mgmt:vyatta-system:1"> </times> </state> </system> </filter> </get> </rpc>]]>]]>

Version information

The XML examples in this section provide memory information.

The following example shows an RPC request for version information.

1 2 3 4 5 6 7 8 9 10 11 12 13 <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <filter type="subtree"> <system> <state> <platform> <os-version xmlns="urn:vyatta.com:mgmt:vyatta-system:1"></os-version> </platform> </state> </system> </filter> </get> </rpc>]]>]]>