OpenDaylight supports the NETCONF protocol as a northbound server as well as a southbound plugin. It also includes a set of test tools for simulating NETCONF devices and clients.


The following article explains how to communicate with netconfd-pro server from ODL over the NETCONF protocol.


The netconfd-pro 21.10-4 release and ODL karaf-0.8.4-Oxygen were used for the example.


Netconfd-pro and ODL Integration


The netconfd-pro server does not required any changes and settings to work with ODL or any other tool if the tool is following RFC correctly. The netconfd-pro fully compliant with NETCONF RFC and all standards that specify connection procedure. 


ODL connects to netconfd-pro through the NETCONF interface using the OpenDaylight southbound NETCONF Plugin. The ODL NETCONF Southbound Plugin supports both NETCONF 1.0 and 1.1 over SSH.


ODL requires the following configuration in order to communicate with a NETCONF device:

  • Device name: Any name that can identify the device that ODL connects to
  • IP address: IP address of the NETCONF server
  • Port: This is the NETCONF server’s port number
  • Username: Used for authentication
  • Password: The user password


Enter the Karaf shell in order to install features.

The following ODL features must be installed to support netconfd-pro connection with ODL:

  • odl-netconf-connector-all
  • odl-netconf-topology
  • odl-netconf-clustered-topology


The following ODL features must be installed to support yangcli-pro connection with ODL:

  • odl-netconf-console


The following ODL features must be installed to support RESTCONF connection with ODL:

  • odl-restconf


opendaylight-user@root>feature:install odl-netconf-connector-all
opendaylight-user@root>feature:install odl-netconf-clustered-topology
opendaylight-user@root>feature:install odl-netconf-topology
opendaylight-user@root>feature:install odl-netconf-console
opendaylight-user@root>feature:install odl-restconf

opendaylight-user@root>feature:list | grep netconf
odl-netconf-connector                                           │ 1.8.2            │          │ Started     │ odl-netconf-1.8.2                                               │ OpenDaylight :: Netconf Connector :: Netconf Conn



Configuring the Connector


For the sake of simplicity, we chose to use the Karaf shell our example. (Refer to: https://docs.opendaylight.org/projects/netconf/en/latest/user-guide.htm for more details on how to configure connector with help of RESTCONF northbound interface)


Before configuring the connector, we need to start ODL by running: $ODL_INSTALL_DIR/bin/karaf


The connector allows ODL to connect to a NETCONF device using the credentials, address, and port specified in the connector’s configuration file.


In Karaf shell terminal run the following command to verify that there is no any NETCONF devices already connected:


opendaylight-user@root>show-device -i 127.0.0.1 -p 830                                                                                                                                             
NETCONF ID | NETCONF IP | NETCONF Port | Status | Available Capabilities
------------------------------------------------------------------------


Now connect the netconfd-pro server to the ODL with help of the following command (the netconfd-pro server must be started already):


opendaylight-user@root>connect-device -p 830 -P your_password -U user -i 127.0.0.1 -id example-device
Netconf connector added succesfully


By executing above command ODL will try to connect to NETCONF device located at local-host at port 830 with provided user and password credentials.


There might be an issue on the first connect attempt since ODL does not send get-schema request for the modules that it founds in Hello message capabilities right away. Instead it sends GET request on /netconf-state and only after that ODL tries to resolve the capabilities.
In this case restart the netconfd-pro server to re-connect or wait until ODL tries another attempt to connect to the netconfd-pro server.
Or preload all the modules you want to use to $ODL_INSTALL_DIR/bin/karaf/cache/schemas


If nothing helps from the above try to use the following parameter (only on 21.10 version of the netconfd-pro server):
--remove-schema-aug-leafs



Then it will issue a get-schema to get all of the schema modules supported by the NETCONF device. This is how it will be able to mount the data tree and provide a northbound interface to the user.


In order to check if the connection was established successfully refer to the netconfd-pro server log. The log supposed to have records of connection and should not contain any errors that would indicate that connection failed.


Or run the following command from ODL, make sure that the status is "Connected":


opendaylight-user@root>show-device -i 127.0.0.1 -p 830
NETCONF ID                       | NETCONF IP | NETCONF Port | Status    | Available Capabilities                                                                                                   
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
example-device     | 127.0.0.1  | 830          | Connected | urn:ietf:params:netconf:base:1.0                                                                                         
                                 |            |              |           | urn:ietf:params:netconf:capability:yang-library:1.0?revision=2016-06-21&module-set-id=4314                               
                                 |            |              |           | urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=report-all&also-supported=trim,explicit,report-all-tagged
                                 |            |              |           | urn:ietf:params:netconf:base:1.1                                                                                         
                                 |            |              |           | urn:ietf:params:netconf:capability:xpath:1.0                                                                             
                                 |            |              |           | urn:ietf:params:netconf:capability:partial-lock:1.0                                                                      
                                 |            |              |           | urn:ietf:params:netconf:capability:interleave:1.0                                                                        
                                 |            |              |           | urn:ietf:params:netconf:capability:rollback-on-error:1.0                                                                 
                                 |            |              |           | urn:ietf:params:netconf:capability:notification:1.0                                                                      
                                 |            |              |           | urn:yumaworks:params:xml:ns:netconf:config-id?id=1486062                                                                 
                                 |            |              |           | urn:ietf:params:netconf:capability:writable-running:1.0                                                                  
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-restconf?revision=2017-01-26)ietf-restconf                                             
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-getbulk?revision=2021-08-07)yumaworks-getbulk                                         
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-app-common?revision=2021-08-24)yumaworks-app-common                                   
                                 |            |              |           | (http://create-only-leaf)create-only-leaf                                                                                
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-event-stream?revision=2021-05-15)yumaworks-event-stream                               
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:yumaworks-restconf?revision=2017-07-03)yumaworks-restconf                                   
                                 |            |              |           | (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)ietf-netconf                                                
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-ids?revision=2014-07-12)yumaworks-ids                                                 
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-types?revision=2021-05-15)yumaworks-types                                             
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-netconf-acm?revision=2018-02-14)ietf-netconf-acm                                       
                                 |            |              |           | (http://netconfcentral.org/ns/yuma-app-common?revision=2017-07-25)yuma-app-common                                        
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-extensions?revision=2021-12-14)yumaworks-extensions                                   
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-yang-patch?revision=2017-02-22)ietf-yang-patch                                         
                                 |            |              |           | (urn:ietf:params:xml:ns:netmod:notification?revision=2008-07-14)nc-notifications                                         
                                 |            |              |           | (http://netconfcentral.org/ns/yuma-types?revision=2019-11-29)yuma-types                                                  
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?revision=2011-06-01)ietf-netconf-with-defaults                   
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-term-msg?revision=2019-05-05)yumaworks-term-msg                                       
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)ietf-netconf-monitoring                         
                                 |            |              |           | (urn:ietf:params:xml:ns:netconf:partial-lock:1.0?revision=2009-10-19)ietf-netconf-partial-lock                           
                                 |            |              |           | (urn:ietf:params:xml:ns:netconf:notification:1.0?revision=2013-03-15)notifications                                       
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring?revision=2017-01-26)ietf-restconf-monitoring                       
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-inet-types?revision=2013-07-15)ietf-inet-types                                         
                                 |            |              |           | (urn:ietf:params:xml:ns:yang:ietf-yang-library?revision=2016-06-21)ietf-yang-library                                     
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-event-filter?revision=2014-02-09)yumaworks-event-filter                               
                                 |            |              |           | (http://yumaworks.com/ns/yumaworks-system?revision=2022-01-27)yumaworks-system                                           
                                 |            |              |           | (http://netconfcentral.org/ns/yuma-system?revision=2013-07-15)yuma-system                                                

Or alternatively you may send yangcli-pro GET request on /network-topology node to identify that the netconfd-pro server was connected and what capability were loaded:


user@yw-user:~$ yangcli-pro server=localhost user=admin password=admin ncport=2830
user@localhost> sget /network-topology
... 

nc:rpc-reply {
  data {
    nt:network-topology {
      topology  topology-netconf {
        topology-id topology-netconf
        node  example-device {
          node-id example-device
          nettop:available-capabilities {
            available-capability {
              capability urn:ietf:params:netconf:base:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:yang-library:1.0?revision=2016-06-21&module-set-id=4314
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=report-all&also-supported=trim,explicit,report-all-tagged
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:base:1.1
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:xpath:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:partial-lock:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:interleave:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:rollback-on-error:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:notification:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability urn:yumaworks:params:xml:ns:netconf:config-id?id=1486062
              capability-origin device-advertised
            }
            available-capability {
              capability urn:ietf:params:netconf:capability:writable-running:1.0
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-restconf?revision=2017-01-26)ietf-restconf
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-getbulk?revision=2021-08-07)yumaworks-getbulk
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-app-common?revision=2021-08-24)yumaworks-app-common
              capability-origin device-advertised
            }
            available-capability {
              capability (http://create-only-leaf)create-only-leaf
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-event-stream?revision=2021-05-15)yumaworks-event-stream
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:yumaworks-restconf?revision=2017-07-03)yumaworks-restconf
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)ietf-netconf
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-ids?revision=2014-07-12)yumaworks-ids
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-types?revision=2021-05-15)yumaworks-types
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-netconf-acm?revision=2018-02-14)ietf-netconf-acm
              capability-origin device-advertised
            }
            available-capability {
              capability (http://netconfcentral.org/ns/yuma-app-common?revision=2017-07-25)yuma-app-common
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-extensions?revision=2021-12-14)yumaworks-extensions
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-yang-patch?revision=2017-02-22)ietf-yang-patch
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:netmod:notification?revision=2008-07-14)nc-notifications
              capability-origin device-advertised
            }
            available-capability {
              capability (http://netconfcentral.org/ns/yuma-types?revision=2019-11-29)yuma-types
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?revision=2011-06-01)ietf-netconf-with-defaults
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-term-msg?revision=2019-05-05)yumaworks-term-msg
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)ietf-netconf-monitoring
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:netconf:partial-lock:1.0?revision=2009-10-19)ietf-netconf-partial-lock
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:netconf:notification:1.0?revision=2013-03-15)notifications
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring?revision=2017-01-26)ietf-restconf-monitoring
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-inet-types?revision=2013-07-15)ietf-inet-types
              capability-origin device-advertised
            }
            available-capability {
              capability (urn:ietf:params:xml:ns:yang:ietf-yang-library?revision=2016-06-21)ietf-yang-library
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-event-filter?revision=2014-02-09)yumaworks-event-filter
              capability-origin device-advertised
            }
            available-capability {
              capability (http://yumaworks.com/ns/yumaworks-system?revision=2022-01-27)yumaworks-system
              capability-origin device-advertised
            }
            available-capability {
              capability (http://netconfcentral.org/ns/yuma-system?revision=2013-07-15)yuma-system
              capability-origin device-advertised
            }
          }
          nettop:clustered-connection-status {
            netconf-master-node akka.tcp://opendaylight-cluster-data@127.0.0.1:2550
          }
          nettop:connection-status connected
          nettop:host 127.0.0.1
          nettop:port 830
          nettop:unavailable-capabilities {
          }
        }
      }
    }
  }
}

..



Netconfd-pro configurations


The netconfd-pro server does not required any changes and settings to work with ODL or any other tool if the tool is following the RFC correctly.

The netconfd-pro fully compliant with NETCONF RFC and all standards that specify connection procedure.


Once ODL is able to connect to the device by establishing a NETCONF session. ODL can start configuring the device.