Overview

This section provides an overview on the NETCONF protocol implementation in ONOS.

 

Interfaces and Classes

Example: Get and Set Controllers.

A usage case of the NETCONF infrastructure is the get and set controllers on a device. These operations are defined in an ONOS Behaviour, in our case the NetconfControllerConfig.java, that implements ControllerConfig general behaviour. To do the operations on the device you need, in the Behaviour, the NetconfController, which you can obtainthorugh the DriverHandler. The NetconfController instance now gives you access to all the device or a single device. Once you have the device you are interested in based upon the deviceId you provide you can get the NetconfSession object to comunicate with the device and do operations on the physical device, getting the configuration in case of the get controllers or setting a pre-built new one for the setControllers. XmlConfigParser.java offers a method to extract the wanted information from an XML configuration received from the device and another method to produce the correct XML to set one or more controller on a specific device.

You can take a look at the acutal implementation of the get and set controllers operation in the NetconfControllerConfig.java class. For an example of other operations that can be implemented the OVSDB infrastructure provides a good starting point.

To call the getControllers and setControllers methods you need to obtain the ControllerConfig Behaviour nad then call on this instance the methods. The set and get commands are implemented, as an example, in DeviceControllersNetconfCommand.java e DeviceSetControllersNetconfCommand.java that provide, in two CLI commands device-controllers-netconf class and device-setcontrollers-netconf.

Infrastructure

To test locally (not on real switches) the NETCONF implementation you need the Mininet machine with of-config installed. of-config is wrapper for an openvswitch instance, that uses NETCONF protocol and translates it to OVSDB protocol in order to use that database implementation.