Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this tutorial, you will learn how to run an emulated Mininet network of BMv2 devices (i.e., the P4 reference software switch) and how to use ONOS to control such network. Some exercises also require writing code for ONOS and P4.

Table of Contents

Tutorial VM

We have prepared a VM with all you need to complete the exercises. To VM can be downloaded here (approx. 4GB).

...

Code Block
languagebash
cd ~/onos
git pull origin
buck build onos


Building ONOS with the recommended system configuration takes approx. 10 minutes.

Exercises

Exercise 1

The goal of exercise 1 is to introduce P4 and P4Runtime support in ONOS.  This integration allows existing applications in ONOS to communicate to and program P4 devices on the network and operate in a pipeline agnostic manner.  This exercise illustrates how existing applications such as reactive forwarding, proxy-arp, and link discovery via LLDP can still be done on devices supporting P4 and P4Runtime.

  1. Start ONOS with a small subset of the applications by executing the following command:

    Code Block
    languagebash
    ONOS_APPS=fwd,proxyarp,hostprovider,lldpprovider onos-buck run onos-local —- clean debug
  2. Activate the BMv2 driver and pipeconfvia the ONOS CLI
    1. Use the following command to access the ONOS CLI:

      Code Block
      languagebash
      onos localhost
    2. Enter the following command to activate the BMv2 driver:

      Code Block
      languagebash
      onos localhost
    3. Enter the following command to active the pipeconf:

      Code Block
      languagebash
      app activate org.onosproject.p4tutorial.pipeconf
    4. To verify that you have activated all the required apps, run the following command:

      Code Block
      languagebash
      apps -s -a
    5. Make sure you see the following list of applications displayed:

      * 5 org.onosproject.generaldeviceprovider 1.12.0.SNAPSHOT General Device Provider
      * 11 org.onosproject.drivers 1.12.0.SNAPSHOT Default Drivers
      * 56 org.onosproject.proxyarp 1.12.0.SNAPSHOT Proxy ARP/NDP
      * 62 org.onosproject.lldpprovider 1.12.0.SNAPSHOT LLDP Link Provider
      * 74 org.onosproject.protocols.grpc 1.12.0.SNAPSHOT gRPC Protocol Subsystem
      * 75 org.onosproject.protocols.p4runtime 1.12.0.SNAPSHOT P4Runtime Protocol Subsystem
      * 76 org.onosproject.p4runtime 1.12.0.SNAPSHOT P4Runtime Provider
      * 77 org.onosproject.drivers.p4runtime 1.12.0.SNAPSHOT P4Runtime Drivers
      * 82 org.onosproject.hostprovider 1.12.0.SNAPSHOT Host Location Provider
      * 108 org.onosproject.fwd 1.12.0.SNAPSHOT Reactive Forwarding
      * 110 org.onosproject.drivers.bmv2 1.12.0.SNAPSHOT BMv2 Drivers
      * 114 org.onosproject.p4tutorial.pipeconf 1.12.0.SNAPSHOT P4 Tutorial Pipeconf