Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


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 here on GitHub if you don't have the source code checked out or 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.


  • start ONOS
  • activate the netconf app :

    Code Block
    onos> app activate org.onosproject.netconf
  • if you wrote your own driver for your device activate that specific driver (i.e.) :

    Code Block
    onos> app activate
  • give ONOS the information to connect to the device and which driver to use for you device in a json file. You need to specify username, password, ip and port. If you wrote a specific driver that has also to be changed form the standard "netconf" one.

    Code Block
      "devices": {
        "netconf:<ip>:<port>": {
          "netconf": {
            "ip": <ip>,
            "port": <port>,
            "username": <username>,
            "password": <password>
          "basic": {
            "driver": <driver-name>

    A working example is here on GitHub or in $ONOS_ROOT/tools/test/configs/netconf-cfg.json if you have the source code. Change the IP both in the DeviceId at the top and in the devices array. The port number by default on NETCONF is 830, so unless you made any changes to that leave it as is. The device can be accessed also via SSH Key. Just specify the sshkey:<key> in the json file as a key,value pair.
    You can also add other information, more than the driver, to the basic device configuration information: "type": "<device-type>", "manufacturer": "<device-manufacturer>","hwVersion": "<hw-version>","swVersion": "<sw-version>".
    If you don't specify any driver-name in the basic configuration ONOS will assign the default one. Being the default one very much related to OpenFlow devices. It's suggested to always specify the driver-name  with yours or the "netconf" one.


  • upload the configuration you just wrote to the instance of ONOS you are running, in our case localhost:

    Code Block
    <your_machine>~$ curl -X POST -H "content-type:application/json" http://localhost:8181/onos/v1/network/configuration -d @<path_to_your_json_configuration_file> --user onos:rocks


    Code Block
    <your_machine>~$ onos-netcfg localhost <path_to_your_json_configuration_file>
  • Check if the device is present in ONOS:

    Code Block
    onos> devices

    should return, among other devices also something like:

    Code Block
    onos> id=netconf:, available=true, role=MASTER, type=SWITCH, mfr=unknown, hw=unknown, sw=unknown, serial=unknown, ipaddress=, driver=ovs-netconf, name=netconf:

    If the device is not present then it could have been and error and you have to check the logs.

    • for localhost logs

      Code Block
      <your_machine>~$ tl

      or for remote logs

      Code Block
      <your_machine>~$ ol <IP Address with ONOS instance>
    • verify that the logs don't contain NETCONF related exceptions and this warning does not appear:

      Code Block
      WARN  | event-dispatch-0 | ListenerRegistry <.....> org.onosproject.netconf.NetconfException: Can't connect to NETCONF device on

      In case the log is present it means that the device was not able to reply on the given IP and Port. Verify Ip and Port in the Json file you posted and retry. If any other exception is present, such as no device name, please read the log and react to it accordingly.

  • Once the device is present in ONOS you can interact with it.