Versions Compared

Key

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

...

  • RestSBController.java, implemented by RestSBControllerImpl.java: tracks all the NETCONF devices, serves as a one stop for connecting and obtaining a device and (un)register listeners on device events. It also exposes interface methods to do REST CRUD operations on a device indetified by a DeviceId.

  • RestSBDevice.java implemented by DefaultRestSBDevice.java: represents a REST capable device known to the ONOS core with all the information needed such as Ip,port,name,password,protocol, deviceId.
  • RestDeviceProvider.java: manages any REST device role and all the interactions with the ONOS core, such as provisioning the ports and the initial device setup. Has his own internalConfigListener from which it gets notified when a configuration is pushed to ONOS via restAPI. The device is added to ONOS if replies on the ip and port that the configuration provides.
  • XMLConfigParser.java: parser for reading and producing XML files to and from the REST device. For now has only configuration ports for a specific Ciena device.

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.

Connect your own device to ONOS

...

Notify ONOS of your REST device 

This section specifies how to notify the ONOS core of a device that support REST operations for configuration.

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. 

  • start ONOS
  • activate the netconf REST southbound app :

    Code Block
    onos> app activate org.onosproject.netconfrest
  • give ONOS the information to connect to regarding 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 "netconfrest" one.

    Code Block
    {
      "devices":{
        "netconf:<username>@<ip>:<port>":{
          "basic":{
            "driver":"ovs-netconf"
          }
        }
      },
      "apps":{
        "org.onosproject.netconf":{
          "devices":[{
            "name":<username>,
            "password":<password>,
            "ip":<ip>,
            "port":<port>
          }]
        }
      }
    }

    A working example is in $ONOS_ROOT/tools/test/configs/netconf-cfg.json. 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.
    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>".

     

  • 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

    or 

    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:mininet@10.1.9.24:1830, available=true, role=MASTER, type=SWITCH, mfr=unknown, hw=unknown, sw=unknown, serial=unknown, ipaddress=10.1.9.24, driver=ovs-netconf, name=netconf:mininet@10.1.9.24:1830

    If the device is not present the 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
    • verify that the logs don't contain NETCONF related exceptions and this warning does not appear:

      Code Block
      | INFO | event-dispatch-0 | NetconfDeviceProvider | 186 - org.onosproject.onos-netconf-provider-device - 1.4.0.SNAPSHOT | Can't connect to NETCONF device on <ip>:<port>

      In case the log is preset 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.

...