Tunnel Subsystem


Tunnel is a type of system resources in ONOS. Tunnel subsystem is built to support tunnel setup for applications. This subsystem is constructed in a processing approach based on the model of producer and consumer (P-C). The P-C model distinguishes two types of applications, tunnel producers and tunnel consumers. A tunnel producer is an application capable of creating, updating and deleting tunnels. Tunnel subsystem is responsible of storing and managing tunnels in ONOS store. A tunnel consumer is an application that can borrow tunnels from ONOS store and return tunnels to ONOS store. A consumer can communicate with producer via ONOS for creating tunnels.

               The Model of Tunnel Producer and Consumer


The following figure depicts the tunnel subsystem architecture.



  1. Tunnels are firstly created by tunnel producers and then tunnel consumers can borrow tunnels from the tunnel store.
  2. When a tunnel a consumer is requesting is not available, the TunnelManager invoke the method of TunnelProvider to inform a producer what the consumer is requesting with tunnel attributes. After a producer creates a tunnel, the tunnel is stored in ONOS TunnelStore. Eventually TunnelStore will notify the consumer that the tunnel is available and the consumer can start to borrow again.




Programming APIs for ONOS applications

The tunnels are managed by ONOS as a type of system resources. Customer applications, as tunnel consumers, can require tunnels from ONOS via northbound API calls. The tunnels are created by producer applications via southbound APIs and stored inside ONOS. The current northbound APIs support future applications (normally admin) capable of removing and updating specific tunnels.

Firstly, applications should register the tunnel events for the notifications of new tunnel creation. An application starts to require a tunnel from ONOS by calling borrowTunnel. If two or more applications are requiring same tunnel, ONOS will serve the applications based on a FIFO order, until the tunnel’s bandwidth is not meeting any more requirements, and then the not served requests will be rejected. Before acquiring a tunnel or for admin purpose, applications can query the tunnel resource’s availability by tunnel’s ID, type, source/dest points, etc. similarly, an application can require a tunnel with different parameters. If a required tunnel is not available in resource pool, ONOS will produce this type of the tunnel by calling southbound APIs to request producer application to create it. After application finishes its use with tunnels, it should return them to ONOS resource pool by calling northbound API returnTunnel.

The followings list current APIs available in ONOS.

Southbound APIs

 Northbound APIs

Tunnel management CLI commands

Administrators can interact with the inventory of tunnel resource using the following console commands: