This repository contains the "getting started" tutorial. At the bottom of this page, there are more links to other more advanced tutorials that leverage Stratum.
This tutorial will teach you how to start a Mininet network of Stratum software switches (backed by bmv2).
The basic tutorial will show you how to use the P4Runtime shell and Stratum's gNMI client to connect to a Stratum switch as well as how to connect the switch to the ONOS controller.
The Trellis tutorial will show you how to start a 2x2 leaf-spine fabric topology, start ONOS with the required Trellis applicaitons, and push the configuration to get everything connected.
This tutorial uses Docker. If it is not installed, follow these instructions to install it.
There is a Docker container with Mininet and the Stratum BMv2 switch preinstalled: opennetworking/mn-stratum
We can use the following command to start the container:
docker run --privileged --rm -it -p 50001:50001 opennetworking/mn-stratum
This will start a single switch and connect two Mininet hosts to switch ports 1 and 2.
Note on the Docker flags:
--privileged
is required to create network namespaces and virtual interfaces--rm
will remove the container upon exit-it
will allocate a TTY and run the container in interactive mode-p 50001:50001
will publish the Stratum switch's gRPC port to the host. By default, Mininet will allocate gRPC ports to the switches sequentially starting at 50001.
You can also pass standard Mininet arguments. For example to start a 3 switch linear topology, append: --topo linear,3
To see a full list of Mininet arguments by appending -h
to the Docker command.
You can find the basic tutorial in the basic
directory.
You can find the Trellis tutorial in the trellis
directory.
To learn more about Stratum's northbound interfaces (P4Runtime, gNMI and gNOI), you can find the NG-SDN tutorial in the ngsdn-tutorial
repo.
If you'd like to try Stratum out on hardware, you can find the code in the stratum-onos-demo
repo to reproduce the ONF Connect 2019 Interoperability Demo.
To learn P4, you can find a basic tutorial in the p4lang/tutorials
repo.
For a more advanced tutorial that use ONOS and Stratum in an SRv6 fabric, you can try the onos-p4-tutorial
.