Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

Overview

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

 

Interfaces and Classes

  • NetconfController.java, implemented by NetconfControllerImpl.java: tracks all the NETCONF devices, serves as a one stop for connecting and obtaining a device and (un)register listeners on device events.

  • NetconfDevice.java implemented by NetconfDeviceImpl.java: represents a NETCONF capable device connected to the ONOS core with his own NetconfSession and his informations saved in an instance of NetconfDeviceInfo
  • NetconfSession.java: interface that every type of connection to a NETCONF device must implement, represents the single access point for any operation on the device. An example is NetconfSessionImpl: uses an SSH2 Connection and Session to exchange information and perform operations like get/set-config with the physical NETCONF device.
  • NetconfDeviceProvider.java: manages any NETCONF device role and all the interactions with the ONOS core.
  • NetconfDeviceListener.java implemented by InnerNetconfDeviceListener.java in NetconfDeviceProvider: informs the provider in the ONOS core that a NETCONF device is connected/disconnected.
  • NetconfDeviceInfo.java: contains ip,port,protocol,username,password and DeviceId of a NETCONF device; it's used to exchange information about a device without having to pass the device instance itself.
  • XMLConfigParser.java: parser for reading and producing XML files to and from the NETCONF device. For now has only configuration reader and edit controllers configuration producer.

 

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.

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.

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.

 

  • No labels