Skip to content

Developing for CCIPS Controller

Juan Carlos Villén Molina edited this page Sep 5, 2024 · 24 revisions

This page provides an overview of how to contribute to the development of the CCIPS controller. Whether you want to fix bugs, add new features, or optimize the existing codebase, this guide will help you get started.

Prerequisites

  • Maven.
  • Git.
  • Docker.

Understanding Netconf in ONOS ONOS Logo

link

Netconf (Network Configuration Protocol) is a critical part of the CCIPS controller that allows the ONOS controller to communicate and manage Netconf-capable devices. The following sections summarize the key classes and interfaces used for handling Netconf devices in ONOS, giving developers a clear understanding of how devices are tracked, connected, and managed.

Key Classes and Interfaces

  • NetconfController.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: represents a NETCONF capable device connected to the ONOS core with his own NetconfSession.
  • NetconfSession.java: Interface representing the transport connection to a Netconf device. It provides a single access point for performing operations such as get-config and edit-config.
  • NetconfDeviceListener.java: Listens for device connection and disconnection events, notifying ONOS when a device becomes available or is removed.
  • NetconfDeviceOutputEventListener.java: Receives notifications and replies from the device, including errors, allowing ONOS to react to real-time device events.

s

The following code highlights the workflow in ONOS for interacting with a Netconf device. The key concept here is understanding how to access a NetconfSession and use it to perform various Netconf operations.

@Reference(cardinality = ReferenceCardinality.MANDATORY)
protected NetconfController deviceController;

String uri_device = "netconf:172.0.0.3:830";
DeviceId new_device = DeviceId.deviceId(uri_device);
NetconfSession newDeviceSession = deviceController.getNetconfDevice(new_device).getSession();
newDeviceSession.editConfig(DatastoreId.datastore("running"), mode, CONFIGURATION_XML);

The code begins by injecting the NetconfController, which is then used to access the NetconfDevice through its URI, and once the device instance is retrieved, its session can be accessed to perform operations like editConfig to modify the device's configuration.

CCIPS APP

To compile and install the CCIPS app, navigate to the project directory and run:

mvn clean install

The installation of the CCIPS app and the activation of the necessary Netconf modules are automatically handled by the onos_critique.sh and setup_controller.sh scripts, which are included in the new Dockerfile created for ONOS. If you wish to directly use this Dockerfile with the included scripts, the only change required would be to replace the .oar file with the newly created one after modifying the code, as explained in this other section of the wiki: Initial Setup Steps.

However, if you prefer to run the basic ONOS 2.7.0 Docker image or execute it locally without Docker, follow these steps:

  1. Launch the official ONOS 2.7.0 image or start ONOS locally following the official guide.
  2. Execute the script:
./onos_critique.sh
  1. Activate the required Netconf bundles:
/onos/tools/package/runtime/bin/onos-app localhost activate org.onosproject.netconf
/onos/tools/package/runtime/bin/onos-app localhost activate org.onosproject.drivers.netconf
  1. Install and activate the CCIPS app:
/onos/tools/package/runtime/bin/onos-app localhost install! target/ccips-app-1.0-SNAPSHOT.oar

Note

It is important to activate the app before loading the netconf-cfg.json file into ONOS.