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:
--privilegedis required to create network namespaces and virtual interfaces--rmwill remove the container upon exit-itwill allocate a TTY and run the container in interactive mode-p 50001:50001will 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.
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.