31 Commits

Author SHA1 Message Date
Carmelo Cascone
b5324e7168 Improve fabric.p4 to reduce pipeline resources and refactor pipeconf impl
This patch affects both the P4 pipeline implementation and the
Java pipeconf.

P4 PIPELINE
- Less tables and smarter use of metadata to reduce inter-tables
dependencies and favor parallel execution of tables.
- Removed unused actions / renamed existing ones to make forwarding
behavior clearer (e.g. ingress_port_vlan table)
- Remove co-existence of simple and hansed table. Hashed should be the
default one, but implementations that do not support action profiles
might compile fabric.p4 to use the simple one.
- Use @name annotations for match fields to make control plane
independent of table implementation.
- Use @hidden to avoid showing actions and table on the p4info that
cannot be controlled at runtime.
- First attempt to support double VLAN cross-connect (xconnect table).
- New design has been tested with "fabric-refactoring" branch of
fabric-p4test:
github.com/opennetworkinglab/fabric-p4test/tree/fabric-refactoring

JAVA PIPECONF
This patch brings a major refactoring that reflects the experience
gathered in the past months of working on fabric.p4 and reasoning on its
pipeconf implementation. Indeed, the FlowObjective API is
under-specified and sometimes ambiguous which makes the process of
creating and maintaining a pipeliner implementation tedious. This
refactoring brings a simplified implementation by removing unused/
unnecessary functionalities and by recognizing commonality when possible
(e.g. by means of abstract and utility classes). It also makes design
patterns more explicit and consistent. Overall, the goal is to reduce
technical debt and to make it easier to support new features as we
evolve fabric.p4

Changes include:
- Changes in pipeliner/interpreter to reflect new pipeline design.
- By default translate objective treatment to PiAction. This favors
debuggability of flow rules in ONOS.
- Support new NextObjective’s NextTreatment class.
- Remove lots of unused/unnecessary code (e.g. async callback handling
for pending objective install status in pipeliner as current
implementation was always returning success)
- Gather commonality in abstract classes and simplify implementation
for objective translator (filtering, forwarding, next)
- New implementation of ForwardingFunctionTypes (FFT) that looks at
criterion instance values along with their types (to avoid relying on
case-specific if-else conditions to recognize variants of an FFT)
- Adaptive translation of NextObjective based on presence of simple or
hashed table.
- Support DENY FilteringObjective

Also:
- Fix onos-p4-gen-constants to avoid generating conflicting
PiMatchFieldId variable names.
- Install Graphviz tools in p4vm to generate p4c graphs
- Generate p4c graphs by default when compiling fabric.p4
- Use more compact Hex string when printing PI values

Change-Id: Ife79e44054dc5bc48833f95d0551a7370150eac5
2018-12-11 14:48:06 -08:00
Jonghwan Hyun
bfb3a21a51 Update install-p4-tools.sh to support Ubuntu 18.04
Change-Id: I11b79bb87090aff0fc0ebaf945500391e47412fb
2018-11-20 21:13:05 +00:00
Carmelo Cascone
65aa829cd1 Various improvements to P4 tutorial
- Added steps to exercise 2 to use wireshark to capture MyTunnel packets
- Various formatting fix/improvements
- Fixed markdown link to use relative paths
- Fixed bm-cli command not to use sudo (not needed)

Change-Id: I514da99a6cfadd048294c610ba201503c0339e89
(cherry picked from commit 19ea89f8540eef0e41fdf7b4fd9a2a1950f2ade9)
2018-11-09 18:52:40 +00:00
Carmelo Cascone
a252df1d9a Updated Ubuntu 16 desktop vagrant box for tutorial P4 VM
Change-Id: I4c3028a715d2a91cceaad44685285148f47d556b
(cherry picked from commit 4b9974fabf5393d53b99b70f88b577e4f3076c5e)
2018-11-01 01:05:48 +00:00
Carmelo Cascone
03ae0acdd8 Bump version of P4Runtime to 1.0.0rc3 and P4 tools
Change-Id: I3082b4bd772d692830bd5af8e326a0fd5fb2f167
2018-10-18 22:30:46 +00:00
Carmelo Cascone
76e6386d41 Bump version of BMv2 and disable nanomsg
To match what used in Stratum

Change-Id: Ic4b87bcad6c3da36030fa01ee4135f60c05fcd78
(cherry picked from commit 1a16f00d8ddfb47c6423e5bc70f5d362230debb7)
2018-09-05 05:17:19 +00:00
Carmelo Cascone
ea2c110e4e Updated tutorial p4vm scripts to build upon Ubuntu Desktop
And not Lubuntu which had u=issues with VirtualBox guest additions

Change-Id: I47218b78ea3d6ae2574fa55166cc48c1de3989e7
2018-08-23 00:21:41 +00:00
Charles Chan
84431b9aae Add Trellis dependency into p4vm
Change-Id: Ieddb3ffa9da620ea78e4538aae02869804e2d0d1
2018-08-17 15:27:00 -07:00
Carmelo Cascone
a1812adb19 ONOS-7770 Install Bazel in p4vm
Change-Id: I3e1540bd4d080655047e3fb6accac9bec21de484
2018-08-15 20:15:04 +00:00
Charles Chan
87dc82e42e Fix missing depencencies for fabric.p4 tutorial
Change-Id: Ie8758c1e8ceee78fcb41984b06b6e216c82177d8
2018-08-06 17:07:08 +00:00
Carmelo Cascone
95e5afdf38 Various improvements to p4vm scripts
- Allow running up to a given step of install-p4-tools.sh
(e.g. helpful to install only PI)
- Install fabric-p4test deps (ONOS-7656)
- Fix python protobuf libraries not installed

Change-Id: I443edb08f455703ae682e485a89d793a584c30ff
2018-07-21 14:14:16 +00:00
Carmelo Cascone
58136816ab ONOS-7739 Support for P4Runtime multicast programming
Design doc: https://docs.google.com/document/d/13rkQlwr49M-uxQQEuxCMP7BFEPY2gtQ850Hn3gUfesU/edit#heading=h.lzdayib259sq

Change-Id: Ief00bec89fe5a9784b0ee13fdaafa3ae58ab654f
2018-07-20 18:16:17 +00:00
Carmelo Cascone
f645e8406c Bump P4 tools to latest version
With support for P4Runtime multicast API

Change-Id: I6982c32187204b656a927d0f3d7f3a4b1b877e75
2018-07-16 20:31:32 +00:00
Carmelo Cascone
f742a1186f Fixed p4vm not building with debug flags disabled
Change-Id: I5089319b91c6b62166f4e506762f2552dd20744c
2018-07-11 11:28:57 +00:00
Carmelo Cascone
f02872d834 Allow to build P4 tools without debug flags to improve BMv2 performance
If the env variable DEBUG_FLAGS is set to false, build tools without
debug features to improve throughput of BMv2 and reduce CPU/memory
footprint.

Debug features include BMv2 logging, debugger, nanomsg, etc.

With DEBUG_FLAGS=true, when running 20 BMv2 instances, it requires 4 CPU
cores 100%. With DEBUG_FLAGS=false, when running 50 BMv2 instances,
overall CPU usage is only 1%.

Change-Id: Ifdd8ea976940b440797beb0e2300a749a55907dd
2018-06-29 14:36:05 +00:00
Esin Karaman
971fb7fd1f ONOS-7251 - Initial implementation of fabric.p4 L2 broadcast feature.
Thrift client cherry-picked from the commit dd5792ac9ee38a702c3128a34224852b5c284687

Change-Id: I989f2b2074485a892195889a7c976b518510da88
2018-06-28 13:34:47 +00:00
Eder Ollora
319b9bfe3e Fixed URL for p4.vim in tutorial script
Change-Id: Ia7a174edfd63ba677fce81fc91b4463cfc62d813
2018-06-19 15:06:39 +00:00
Carmelo Cascone
6af4e17c53 Bumped supported revisions of P4 tools
Includes:
- Use new P4Runtime "v1" package names
- Removed VALID match
- New table entry priority spec (1 is min priority, not 0)
- Fixed p4c-bm2-ss to include arch flag
- Re-compiled P4 programs with more recent p4c (with updated p4info)

Change-Id: I05908f40eda0f0c755009268fd261fb8bcc9be35
2018-06-15 19:04:30 +00:00
Andrea Campanella
4f9085e2d7 Adding an STC scenario for fabric.p4
Change-Id: I3457ab67c2c97eab73623500ba3f6a75b9ed33a3
2018-06-04 10:24:55 +00:00
Carmelo Cascone
c282133c31 Remove depenency on internal BMv2 device ID when starting bmv2.py
Needed to support TestON-based Segment Routing tests. All instances
started with internal ID = 0 (one PI/P4Runtime server procees is
executed for each simple_switch_grpc instance, i.e, there's no need to
use different internal IDs to distinguish between switch instances).
Log/conf files and bm-* commands are now based on switch name.

Change-Id: I34d3079d6dff5933ceb4d95f04863426af24eb81
2018-05-15 05:19:30 +00:00
Carmelo Cascone
ef71549529 Fix incorrect SSH port when generating P4 VM
Change-Id: I649433e2fcaa3c935bd6ebe61240e1645ace8d77
2018-05-14 19:48:46 -07:00
Carmelo Cascone
57defd3782 Generate leaner P4 VM
Dev: 1.5 GB instead of 3.5 GB
Tutorial: 2.3 GB instead of 5.5 GB

Change-Id: Ib63d47578a2c9e16a97827bfba463f90cfe1187d
2018-05-11 16:01:16 -07:00
Carmelo Cascone
c5569c2c19 Extend ONOS+P4 VM scripts to build tutorial VM
With Lubuntu desktop and P4-enabled code editors

Change-Id: I0c287c1d039da5f227d43994340b20a01ffc2617
2018-04-18 09:48:30 +00:00
Carmelo Cascone
81929aa0cf Bumped supported commit of P4Runtime and BMv2
Includes fixes for:
- ONOS-7593: Support for indirect resource Index type
- ONOS-7595: Removed ID from direct resources
- P4Runtime requires unset bits to be 0 in ternary field matches
- Incorrect parsing of flow rule byte counters
- Full entity names in P4Info with top-level control block (fixed only
	for basic.p4, other programs need to be re-compiled and PI IDs in
	respective pipeconf changed)

Change-Id: Ia19aa949c02e363a550e692915c6d6516a2d13d7
2018-04-11 19:04:45 +00:00
Carmelo Cascone
05354678a9 Fixed missing square brackets in install-p4-tools.sh
Change-Id: I46e118bba275e704ddc0c73514796e2ca2495b52
2018-04-10 20:57:53 +00:00
Carmelo Cascone
4f985cd8c5 Disabled gNMI support in p4vm until it becomes more stable
Change-Id: If2085d5824a2b9d06b249bf8d82d92fd384de5af
2018-02-11 20:12:49 -08:00
Kevin Chuang
53a9d5b37d Fix build error on Ubuntu 14.04
- Build protobuf-c (libprotobuf-c-dev is not available on Ubuntu 14.04
apt repository)
- Build libboost-iostreams1.58 (The highest version of libboost-iostreams on Ubuntu 14.04
apt repository is 1.55, which will cause error when building p4c)

Change-Id: I00648e3c4890ebee0052c643e9f4b4ea10d345a9
2018-02-01 01:00:54 +00:00
Carmelo Cascone
76b3ee6bb5 Install P4Runtime Python test scripts in dev VM
Change-Id: I096bf1ef6b91bb2507745250c5fec0a7d18a6680
2018-01-31 02:16:09 +00:00
Carmelo Cascone
f11513d1bc Various improvements to P4 dev env
- Better handling of BMv2 crashes in bmv2.py (with watchdog and logging)
- bm-* commands for easy access to BMv2 log, CLI, etc

Change-Id: I1c79acda641171566d8e1162442c7f377bb273fe
2018-01-18 00:59:26 +00:00
Carmelo Cascone
b7e618d43d Updated script to build P4 VM
Among other things, build now is not based on the upstream version of
onos-setup-p4-dev, but on the local one.

Change-Id: I270a324152a9349d6a9989aa8b5a38b45e1856d9
2018-01-14 18:21:06 +00:00
Carmelo Cascone
d66150733a ONOS-7330 Added ONOS-P4 VM build script
Builds and OVA from scratch with the most updated tools in one command.
The build process is based on Vagrant.

Change-Id: I633d99092946f99e877f0c97631a4f99c5b1f37e
2017-12-20 21:56:02 +00:00