ONOS and P4: TUTORIAL - grupogita/ONOSP4-tutorial GitHub Wiki

Introduction

Required software and dependencies

Previous to start the tutorial, you will need to have some Linux distribution installed, either as a native installation of through a virtual machine. It is recommended to have at least 4GB of RAM and 20GB of free disk space.

Once you have ready the base operating system, the following dependencies must be installed. This can be done by following the software installation procedure of the corresponding Linux distribution:

  • docker
  • docker-compose
  • make
  • python3
  • git
  • curl
  • Postman (optional)
  • Some code editor (optional)

On the use of a code editor

In order to develop the programming exercises, you will write or modify code in different languages such as: P4, Java and Python. Although it is not mandatory to use a code editor, it is possible to install one. Some options are sublime text, atom or visual studio. In case you do not prefer to install one, built-in text editors (e.g. vim or nano) can be used.

Cloning the code repository

Subsequently, you must clone the following repository:

git clone https://github.com/grupogita/ONOSP4-tutorial.git

Once the ONOSP4-tutorial repository has been cloned, you can update its contents as follows in order to get fixes or new functionalities that GITA might provide:

cd ONOSP4-tutorial
git pull origin main

It is recommended to check frequently for these fixes or new functionalities and new programming exercises.

Make commands

The code available in the git repository contains a Makefile file that automatizes several frequent taks which are performed by invoking make commands during the development process. You can find below a list of these commands, with a brief description of their usage.

Command Description
make app-build Builds the pipeline application to be deployed in ONOS
make app-reload Installs and starts the ONOS app
make deps Installs all required Docker dependencies
make mn-cli Enables access to the Mininet CLI
make mn-log Enables to check the status of the topology loaded in Mininet (CLI output, log messages)
make netcfg Pushes netcfg.json file to ONOS. It provides to the ONOS controller the information of the Software Switch
make onos-cli Enables access to the ONOS CLI
make onos-log Enables access to the ONOS logfile to check the output of different operations (CLI output, log messages)
make p4-build Builds the P4 program for the software switch
make restart Restarts the previous topology and the ONOS application
make start Starts Mininet topology and ONOS application
make stop Stops Mininet topology and ONOS application
make clean Deletes the files generated by the used P4 program

For further information about the internals and tasks executed for these commands, you can take a look on the Makefile

Starting with the exercises

Before starting with the proposed exercises, and as a final setup step of the development environment, the make deps command must be executed. This command pulls and installs the necessary docker container dependencies (e.g. the images for the specific containers implementing the elements of the architecture. That is, mininet with P4-programmable Software Switch and ONOS).

Information about the containers involved in this tutorial can be found in Docker dependencies.

NOTE: The command make deps does not pull the PTF tests for ONOS fabric.p4 container. However this container is already in the repository.