VNF

Or: finally working on our thesis

All our thesis is focus on this, so we hope to do a good job, at least here. What you're gonna find here is a brief explanation of how we built our system to process packets through VNF and get that packets back.

Harbor: create and destroy VNF in Kubernetes

We're aware that in this kind of environment automation is fundamental, and generally you'd expect that VNF get deployed, scaled and destroyed automatically on-demand, rather than manually accessing your cluster and loading them manually. To accomplish this, we've create a little backend, Harbor, that is capable of creating, destroying, and storing VNF definition.

Harbor, written in Java using the Spark framework, at the time of writing has the following API configuration.

At the end of the day, Harbor ended substituting the Openbaton role: indeed it already covers what Openbaton does, so we see an opportunity to drop the latter and to stick with a component created from us that perfectly fits our needs.

API definition

Launch a VNF

GET /vnf/launch/:id

It gives the possibility to launch an already uploaded VNF.

Path Parameters

NameTypeDescription

id

string

The VNF id

{ "result": "ok" }

Stop a VNF

GET /vnf/stop/:id

Stop an already running VNF. Note that this destroys all the resources created

Path Parameters

NameTypeDescription

id

string

The VNF id

{ "result": "ok" }

Get YAML definition of a VNF

GET /vnf/get/:id

This API calls return the YAML of a given VNF id.

Path Parameters

NameTypeDescription

id

string

The VNF id

{ "result" : "ok" }

Add a VNF to the catalog

POST /vnf/create/:id

Uploads a new VNF to the catalog. Note that the VNF must have an unique id, otherwise the upload will fail. You need to send as the body request a valid Kubernetes YAML.

Path Parameters

NameTypeDescription

id

string

The VNF unique id

{ "result" : "ok" }

Update a VNF

POST /vnf/update/:id

Update an existing VNF with a new one. Note that this doesn't modify the resources running in the cluster.

Path Parameters

NameTypeDescription

id

string

The VNF id

{ "result" : "ok" }

Delete a VNF from the catalog

DELETE /vnf/delete/:id

This method deletes an existing VNF from the catalog. Note that the resources in this case are not stopped!

Path Parameters

NameTypeDescription

id

string

The VNF id

{ "result" : "ok" }

The API json definition can be found here:

[
  {
    "name": "/vnf",
    "path": [
      {
        "name": "/launch/:id",
        "type": "get",
        "function": "routes.vnf.VnfLauncherRoute"
      },
      {
        "name": "/stop/:id",
        "type": "get",
        "function": "routes.vnf.VnfStopperRoute"
      },
      {
        "name": "/create/:id",
        "type": "post",
        "function": "routes.vnf.CreateVnfRoute"
      },
      {
        "name": "/delete/:id",
        "type": "delete",
        "function": "routes.vnf.DeleteVnfRoute"
      },
      {
        "name": "/update/:id",
        "type": "post",
        "function": "routes.vnf.UpdateVnfRoute"
      },
      {
        "name": "/get/:id",
        "type": "get",
        "function": "routes.vnf.GetVnfRoute"
      }
    ]
  }
]

Additional notes about implementation

We tried initially to use Kubernetes Java client API, without success, since they're not documented and cryptic. Thus we fell back to a simple, yet horrible, solution, using kubectl to deploy YAML on the cluster and paring CLI output.

Last updated