Info | ||
---|---|---|
| ||
The content of this page is for users who already have some experience with ONOS and Trellis and wish to learn how to use those with P4 devices. If you are getting started with ONOS and Trellis we suggest you start with the following slides and exercises: Trellis+P4 Tutorial (Presented at ONF Connect, Dec 2018): http://bit.ly/trellis-p4-slides. |
Environment:
...
Prerequisites (ONOS, Docker)
Before starting, make sure to have ONOS on your physical machine. To download, build and run the ONOS-P4 Tutorial VM:
...
ONOS, follow this guide: Developer Quick Start
Make also sure that Docker is installed and you can run Docker containers in your machine (Install Docker).
P4-Mininet Docker container
We provide a convenient Docker container with Mininet and BMv2 already installed (P4mn on Docker Hub).
To pull the container, type the following command in a terminal window on your machine:
Code Block | ||||
---|---|---|---|---|
| ||||
$ docker pull opennetworking/p4mn |
Get Trellis "routing" repository
...
Name: Name for segment routing device;
ipv4(6)NodeSid: Global unique id for IP loopback, it is used as MPLS label in forwarding;
ipv4(6)Loopback: Router loopback IP address, it should not be part of same same subnet defined on dataplane interface;
routerMac: Globally unique Mac address. It will be used to reply ARP requests for router IP or interface IP;
isEdgeRouter: true if this device is edge/leaf, otherwise false;
adjacencySids: Reserved, put empty array for now.
Topology:
Host view:
In the demo mininet Mininet topology, we set the gateway of the hosts to the IP of the interface of the leaf switch. For example, the gateway of Host 1 will be 10.0.2.254.
Steps:
In this tutorial, we need to create 3 terminal window windows for:
ONOS karaf process (from now on it will be called T1)
ONOS shell (T2)
Docker P4+Mininet emulator
And we run everything inside the virtual machine
(T3)
So, first of all, open 3 terminal windows on your machine.
On T1 run ONOS with the following commands:Start ONOS with following command
Code Block | ||
---|---|---|
| ||
$ cd ~/onos $ ONOS_APPS=drivers,openflow,netcfghostprovider,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider,drivers.bmv2,pipelines.fabric $ bazel run onos-local -- clean |
Use another terminal, In T2 connect to the ONOS shell running the following command:
Code Block | ||
---|---|---|
| ||
$ onos localhost |
and check that the following apps apps are correctly active. You should see apps are active:
Code Block | ||
---|---|---|
| ||
$ onos localhost onos> apps -a -s * 9 org.onosproject.drivers 1.13.0.SNAPSHOT Default Drivers * 35 org.onosproject.generaldeviceprovider 1.13.0.SNAPSHOT General Device Provider * 36 org.onosproject.protocols.grpc 1.13.0.SNAPSHOT gRPC Protocol Subsystem * 37 org.onosproject.protocols.p4runtime 1.13.0.SNAPSHOT P4Runtime Protocol Subsystem * 38 org.onosproject.p4runtime 1.13.0.SNAPSHOT P4Runtime Provider * 39 org.onosproject.drivers.p4runtime 1.13.0.SNAPSHOT P4Runtime Drivers * 42 org.onosproject.proxyarp 1.13.0.SNAPSHOT Proxy ARP/NDP * 44 org.onosproject.hostprovider 1.13.0.SNAPSHOT Host Location Provider * 45 org.onosproject.lldpprovider 1.13.0.SNAPSHOT LLDP Link Provider * 73 org.onosproject.pipelines.basic 1.13.0.SNAPSHOT Basic Pipelines * 84 org.onosproject.route-service 1.13.0.SNAPSHOT Route Service Server * 95 org.onosproject.protocols.gnmi 1.13.0.SNAPSHOT gNMI Protocol Subsystem * 96 org.onosproject.drivers.gnmi 1.13.0.SNAPSHOT gNMI Drivers * 108 org.onosproject.pipelines.fabric 1.13.0.SNAPSHOT Fabric Pipeline * 120 org.onosproject.segmentrouting 1.13.0.SNAPSHOT Segment Routing * 121 org.onosproject.drivers.bmv2 1.13.0.SNAPSHOT BMv2 Drivers |
...