Table of Contents

Contributors

NameOrganizationRoleEmail
Andrea CampanellaOn.LabDeveloperandrea@onlab.us
Helen WuON.LabDevelophelen@onlab.us

Overview

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

Interfaces and Classes

Through implementing the NetconfDeviceOutputEventListener.java and adding the listener to the session anybody who needs to obtain device notifications can listen on device generated messages that are picked up by the listeners implementations that is in the set of to be notified listeners in the StreamHandler implementation, right now NetconfStreamThread.java.

Supported NETCONF Operations

For more background on NETCONF operations, refer to this reference source about NETCONF protocol operations.

Device Discovery

Currently, ONOS is made aware of NETCONF devices through the use of a Network Configuration Service JSON file, which represents the configuration of and provides information about devices. An example of such a file is provided in the ONOS source code in ${ONOS_ROOT}/tools/test/configs/netconf-cfg.json. This JSON file informs ONOS of the existence of such devices when it is pushed, but the confirmation of their reachability and availability occurs in the device provider, NetconfDeviceProvider. For more information about the device subsystem, refer to the Device Subsystem wiki page. When the NETCONF devices from the JSON files are pushed to ONOS, the devices are created with the default availability set to false, indicating inability to use the device. Shortly after (approximately 3 seconds after devices configuration is pushed to ONOS), and at intervals of 30 seconds afterwards, the reachability of all devices in the configuration is checked, and according to the information collected, the devices are either marked online (available=true), marked offline (available=false), or the availability state is left unchanged.

Connect your own device to ONOS

If you have your own device that talks NETCONF protocol follow this section. Otherwise, if you want to try ONOS NETCONF implementation out with a test VM proceed to the Example section.

Once you have your device Running on some IP address and some port, in order to make ONOS see it you should follow these steps. 

Example: Get and Set Controllers.

An example of NETCONF infrastructure usage is getting and setting 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 in the Behaviour operations on the devices, you need the NetconfController, which you can obtain through 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 can get the NetconfSession object to communicate with the device and do operations on the physical devices, like getting the configuration in the get controllers methods or setting a pre-built new one for the setControllers. XmlConfigParser.java offers a method to extract the desired information from an devices's XML response 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 actual 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 DeviceControllersCommand.java and DeviceSetControllersCommand.java that provide, in two CLI commands

onos> device-controllers
onos> device-setcontrollers

Example: Testing infrastructure

To test locally (not on real switches) the NETCONF implementation you need the Mininet machine with of-config installed (link to mininet machine).

VMDescriptionComments
onos-ofconfig-mininet.ovaMininet machine with of-config installedUsername / Password: mininet / mininet

of-config is wrapper for an openvswitch instance, that uses NETCONF protocol and translates it to OVSDB in order to use that database implementation. 

Infrastructure Setup:

Fault Management

If you start a subscription to a device with createSubscription, ONOS will receive <notification> XML messages from the NETCONF device. NetconfAlarmProvider and NetconfAlarmTranslator translate these notification messages into alarms, as they are defined in Alarm.java, and notifies the core about the new alarms. For more information about fault management, refer to NETCONF Fault Management.

Future Work

There is much room for improvement and testing, this is only a basic skeleton of the infrastructure. The improvement should be focused on extracting the XML that is now encoded in the NetconfSessionImpl's methods and testing each operation. In the future the XML can be generated through YANG models so it can be specific for every type of device we want to connect.