CORD : Setting Up Remote SADIS for VOLTHA + ONOS

 

SADIS is designed to provide a bridge between ONOS and the deployment infrastructure through which ONOS can query subscriber and device deployment specific information, such as a subscriber's s-tag/c-tag. For testing and demonstration purposes SADIS includes the capability to specify subscriber and device information in ONOS's network configuration file, but this is not practical in many cases as information cannot be added dynamically w/o pushing the entire network configuration to ONOS each time there is an update.

To overcome this limitation a web server can be used to represent the deployment infrastructure and server subscriber and device information to ONOS. This document describes how this can be quickly set up in using an NGINX Docker image and a Docker volume. The concept is to create files in a directory that represent the subscriber and device entries and then use NGINX to serve those files to ONOS. For this walk through a local volume will be used, which mean the data will persist on the Docker host's file system. This can for for small deployments or deployments where the location of the running container can be controlled. For a more robust deployment you should look at the distributed file system support available via Docker Volume plugins and adapt this guide to one of those.

Subscriber and Device Information

To start lets create and populate a directory with some subscriber and device information. This can be updated later as well as dynamically, but is good for illustrative purposes. 

mkdir /var/sadis_data
cd /var/sadis_data
cat > /var/sadis_data/uni-2
{
  "id": "uni-002",
  "cTag": 2,
  "sTag": 2,
  "nasPortId": "DEFAULT_NAS_PORT",
  "circuitId": "DEFAULT_CIRCUIT_ID"
}
^D

Docker Volume

A Docker volume represents a file system that can be shared into a Docker container much like mounting a remote file system. This is the best practice way of sharing file system data into a Docker container

docker volume create --name sadis_data

Copy Data Into a Volume

To get files into a Docker Volume you have to copy the data via a Docker container. This can easily be done using the following commands

docker create --name helper --volume sadis_data:/sadis_data busybox true
docker cp /var/sadis_data/. helper:/sadis_data/
docker rm helper

Start NGINX To Serve

The NGINX Docker Container can either be started via the command like or it can be started as part of a Docker Swarm Stack. It is important to note that by default NGINX serves data on port 80, please read the documentation on NGINX's Docker page to understand how this can be customized (https://hub.docker.com/_/nginx/). Below is a snippit of a docker-compose file that can be used to deploy NGINX, change the port on which is listens, and mount the volume in the proper location so that this container will provide remote data to ONOS.

version: "3.2"
services:
    sadis:
        image: "nginx"
        ports:
            - 8222:8222
        # Move the port from 80 to 8222, on which nginx listens
        command: /bin/bash -c "cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.orig && sed -e 's/80/8222/g' /etc/nginx/conf.d/default.conf.orig | envsubst > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
        deploy:
            replicas: 1
            placement:
                constraints:
                    - node.role == manager
        networks:
            - net
        volumes:
            - sadis_data:/usr/share/nginx/html:ro
volumes:
    sadis_data:
        external:
            name: sadis_data

NOTES: 

  • Line 8 - this command is used to replace the default port of 80 with 8222 in the configuration file of NGINX
  • Lines 11-13 - the placement constraints are used to force the container to be scheduled to the node on which the local volume is created. If you are using a distributed volume or have a copy of the volume on every node this would not be required.

ONOS Configuration

To configure ONOS to use the remote SADIS service the netcfg needs to be updated to include the URL over which ONOS will fetch information. Below is a sample SADIS configuration what will pull from the remote server as well as use a local cache with a TTL of 1 minute to time out cache entries. This is only a portion of the ONOS configuration and should be inserted into the deployments complete netcfg.

"org.opencord.sadis": {
  "sadis": {
    "integration": {
      "url": "http://sadis:8222/",
      "cache": {
        "enabled": true,
        "maxsize": 50,
        "ttl": "PT1m"
      }
    }
  }
}

NOTES:

  • Line 4 - sets the URL for the remote data server
  • Line 8 - sets the TTL for cached information. this value will effect how fast dynamic data changes may be available in ONOS w/o manual cache ejecttion via the REST API.

Dyanamic Data Updates

To update the data it is required to update the files in the volume. For simple data changes that means just copying the update file over the existing file. This works when adding new entries as well.

docker create --name helper --volume sadis_data:/sadis_data busybox true
docker cp /var/sadis_data/. helper:/sadis_data/
docker rm helper

 

When deleting and entry you must delete the file via a container

docker run -ti --rm --volume sadis_data:/sadis_data busybox rm /sadis_data/uni-2

 

One the files are updated in the volume they will take immediate effect in the NGINX (sadis) server and be available to ONOS.