965 Commits

Author SHA1 Message Date
oleksandr.yashchuk@plvision.eu
3dbcaafa0c Initial gNOI implementation added. Introduced system Time and Reboot RPC
Change-Id: I8accdcc6c1ff247408ce54490ceff3972fdf850f
2019-03-26 21:35:33 +00:00
Carmelo Cascone
a3635abf1d Parse action profile max group size from P4Info annotations
This is a temporary workaround to the inability of p4c to
correctly interpret P4Runtime-defined @max_group_size annotations.

Change-Id: If2799786c135b2eb5b6a3b4c6d6022350d37237e
2019-03-22 05:00:35 +00:00
Ray Milkey
bd508ede5c cfgdef tool modifications to catch variable names that don't match properties
- catch errors in the cfgdef tool and abort compilation if a mismatch
  is seen
- Fix mismatches in the code discovered by the tool

Change-Id: Icd9a15eb9312bba6c2208b0b2a684062fcdc19c3
2019-03-21 19:07:31 +00:00
Carmelo Cascone
62d5c2e033 Allow enabling gRPC message logging for existing channels
Change-Id: Ic7586266e6a264ceeb9b55d7dae0db5e9a34c0c1
2019-03-08 06:15:07 +00:00
Carmelo Cascone
ab5d41e8ab Add support for enabling/disabling ports for gNMI devices
This change also includes:
- Refactoring of gNMI protocol+driver to take advantage of the recent
changes to the gRPC protocol subsystem (e.g. no more locking, start RPC
with timeouts, etc.).
- Fixed Stratum driver to work after GeneralDeviceProvider refactoring
- Updated bmv2.py to generate ChassisConfig for stratum_bmv2
- Fixed portstate command to use the same port name as in the store

Change-Id: I0dad3bc73e4b6d907b5cf6b7b9a2852943226be7
2019-03-07 07:45:32 +00:00
Carmelo Cascone
6146946e16 Fix inconsistent update type during concurrent P4Runtime writes
This is achieved by optimistically updating the P4Runtime mirror using
the write request (instead of waiting for a response) and by serializing
building write requests for the same device.

This change requires updating the P4Runtime protocol classes to expose
the content of the write request.

It also includes:
- force member weight to 1 when reading groups (some server
implementation still fails to be compliant to the spec)
- remove unused operation timeout handling in GDP (now all RPCz have a
timeout)

Change-Id: Ib4f99a6085c1283f46a2797e0c883d96954e02e9
2019-03-06 19:28:42 +00:00
Carmelo Cascone
3977ea4d9e Refactor channel and mastership handling in P4Runtime
This (big) change aims at solving the issue observed with mastership flapping
and device connection/disconnection with P4Runtime.

Channel handling is now based on the underlying gRPC channel state. Before,
channel events (open/close/error) were generated as a consequence of P4Runtime
StreamChannel events, making device availability dependent on mastership. Now
Stream Channel events only affect mastership (MASTER/STANDBY or NONE when the
SteamChannel RPC is not active).

Mastership handling has been refactored to generate P4Runtime election IDs that
are compatible with the mastership preference decided by the MastershipService.

GeneralDeviceProvider has been re-implemented to support in-order
device event processing and to reduce implementation complexity. Stats polling
has been moved to a separate component, and netcfg handling updated to only
depend on BasicDeviceConfig, augmented with a pipeconf field, and re-using the
managementAddress field to set the gRPC server endpoints (e.g.
grpc://myswitch.local:50051). Before it was depending on 3 different config
classes, making hard to detect changes.

Finally, this change affects some core interfaces:
- Adds a method to DeviceProvider and DeviceHandshaker to check for device
availability, making the meaning of availability device-specific. This is needed
in cases where the device manager needs to change the availability state of a
device (as in change #20842)
- Support device providers not capable of reconciling mastership role responses
with requests (like P4Runtime).
- Clarify the meaning of "connection" in the DeviceConnect behavior.
- Allows driver-based providers to check devices for reachability and
availability without probing the device via the network.

Change-Id: I7ff30d29f5d02ad938e3171536e54ae2916629a2
2019-03-06 19:28:42 +00:00
gyewan.an
3c99ee77c2 Changed the how to relay proxy message within cluster
*changed the commnunication way to 'unicast' from 'sendAndReceived'

Change-Id: I0207c074fd2ab7b8378d9b4ce0cf877fc9aeab29
2019-03-05 17:55:05 +00:00
gyewan.an
91d7e7e283 [ONOS-7566] Implementation of NetconfProxySession
Change-Id: I01cbe0b10ac36cb6db53127555b551f405acdeb1
2019-03-05 17:55:05 +00:00
Brian O'Connor
c69438361a Adding support for TLS connections for gRPC clients
This patch uses BoringSSL to negotiate TLS sessions under the hood.

Change-Id: I1495479ff33654f9cffe04d61f293c3e923b8aeb
2019-02-26 17:50:57 +00:00
Andrea Campanella
c535b67566 Fix for Netconf device re-connection.
Unproprer issuing of Device_UNREGISTERED event was causing incorrect device
removal during session re-establishment.
Unconsistent state in ports and links resulted.

Change-Id: Ie07d9077ff0b197a1cb8936b1f307807fae34aeb
2019-02-26 09:45:08 +00:00
Carmelo Cascone
a4dc3c12bc Update install-p4-tools.sh to use P4Runtime v1.0
Includes also various improvements to the p4vm scripts, such as:
- Choose to build VM with Ubuntu 16.04 or 18.04 (experimental)
- Allow users to specify version of protobuf and grpc to use
- Avoid building protobuf and grpc if already installed in the system
- Install Bazel 0.22

Also:
- Remove check for invalid group member weights (now PI always returns
members with weight 1)
- Re-compiled all P4 programs and fixed missing padding in controller
packet headers

Change-Id: I0e672fcebbaba63354c749f0c774af251f3cbc6c
2019-02-21 23:24:26 +00:00
Ray Milkey
11ce930557 Fix a few more app startup/shutdown problems
Change-Id: Ideb48a1e845ae345306fa10ec55499c471566ce7
2019-02-09 20:24:12 +00:00
Carmelo Cascone
7efca518f3 ONOS-7924 Fix unable to set role for OpenFlow switch
Change-Id: I612450b8f649c055b04a68afaad93ec645984bdc
2019-02-08 17:02:25 -08:00
Carmelo Cascone
bde9beba9c Re-package grpc and protobuf with the right group id and version
Change-Id: Ib1a17d917a061d3cce32eed3e72b18c596ccff69
2019-02-08 15:44:43 -08:00
Carmelo Cascone
3370c966f6 Fix gnmi package
Change-Id: Idac009b1de014ab8a9205cee3c6e56923bbcc3ec
2019-02-08 21:29:19 +00:00
Carmelo Cascone
ef478a6089 Bump grpc-java to 1.18.0
Requires bumping other dependencies in deps.json such as Netty (4.1.32)
and error_prone_annotations. Includes also fixes detected by updated
errorprone.

Change-Id: Ic2bd86931cc89bfb2cf1a4cb11a4586bc8cac608
2019-02-07 18:49:22 +00:00
Carmelo Cascone
b203b64818 Set all write responses as failed when P4Runtime server returns error
Change-Id: I1e3e1cd214b71b96c4abd10d8700a1fa11f73f0e
2019-02-07 18:45:48 +00:00
Ray Milkey
31b0048a78 Suppress exception stack traces on warning conditions to prevent STC faiures for non-fatal situations
Change-Id: I10d4945e92b3674f00725597d00fc13cc140c943
2019-02-07 18:15:23 +00:00
Carmelo Cascone
73f4530c38 Enhanced gRPC call logging
- Write calls to file, one file for each channel
- Log started, inbound msg, outbound msg, and closed events, for each RPC
- Distinguish between different RPCs by assigning an ID to each one

Also, removed redundant DeviceId attribute from GrpcChannelId, as all
channel IDs were already created using a client key that contains the
DeviceID. It seems a better approach to not restrict the definition of a
channel ID and have that defined simply as a string.

Change-Id: I9d88e528218a5689d6835c9b48022119976b6c5a
2019-02-05 13:56:20 -08:00
David K. Bainbridge
9b582b0b12 ONOS-7920 - mutex around access to prevent reentrant creation
Change-Id: I9492b2733686e0da4c05f304883f958f92598c79
2019-02-05 14:48:29 +00:00
Carmelo Cascone
4c289b731d New P4RuntimeClient implementation that supports batching and error reporting
The new client API supports batching and provides detailed response for
write requests (e.g. if entity already exists when inserting), which was
not possible with the old one.

This patch includes:
- New more efficient implementation of P4RuntimeClient (no more locking,
use native gRPC executor, use stub deadlines)
- Ported all codecs to new AbstractCodec-based implementation (needed to
implement codec cache in the future)
- Uses batching in P4RuntimeFlowRuleProgrammable and
P4RuntimeGroupActionProgrammable
- Minor changes to PI framework runtime classes

Change-Id: I3fac42057bb4e1389d761006a32600c786598683
2019-02-04 23:12:46 -08:00
Carmelo Cascone
e45902b280 Bumped P4Runtime to v1.0.0
Change-Id: Ie6419e45980a0394ce1e0439831f4b011a4d7487
2019-02-05 00:44:37 +00:00
David K. Bainbridge
77d8ca4d57 ONOS-7918 yes, release the reference to the reply
Change-Id: I7428cfb93c6cf0e64ee6f6504121fe706f4dd4f8
2019-02-04 09:28:06 +00:00
Andrea Campanella
a2a6c3cdeb Refactoring Netconf Device Provider to simplify device connection and avoid calling behaviours when the session is not yet established
Change-Id: I7d3b1efc6194629ba77918dfd759781f7ccf1b60
2019-01-31 10:52:43 +00:00
David K. Bainbridge
1070de9e0a ONOS-7916 address a NPE and add some more debugging logs
Change-Id: I1debef2d108177ea8d000496ff3de78349433cc5
2019-01-30 08:57:46 +00:00
gyewan.an
8d91841cac Simple refactoring AbstarctNetconfSession
Change-Id: I0fac98ec79d09d2dbb0e1d403fb025befe4a7835
2019-01-30 08:29:39 +00:00
Carmelo Cascone
0f8b7bea74 Fix build of protobuf-related components to support Bazel 0.22
- Bumped version of protobuf to 3.6.1.3 (includes fix for Bazel 0.22)
- Removed all protobuf and grpc dependencies from deps.json. Instead,
  depends solely on what's provided by the external grpc and protobuf
  workspaces.
- Use OSGi-wrapped protobuf and grpc JARs built with Bazel for runtime
- Add missing netty-related bundles to onos-thirdparty-base (required
by grpc)

Note, build with Bazel 0.22 is still broken because of
osgi_java_library.bzl, unless the following build arg is used:
build --incompatible_string_is_not_iterable=false

It seems the error is caused by dead code in osgi_java_library.bzl
that should be removed.

Change-Id: I749f1de25902bf9df5242444380f7224bc99b4b5
2019-01-29 16:11:08 -08:00
Carmelo Cascone
99c59dbb03 ONOS-7898 Action profile group/member refactoring
Also includes:
- New abstract P4Runtime codec implementation. Currently used for action
profile members/groups encoding/deconding, the plan is to handle all
other codecs via this.
- Improved read requests in P4RuntimeClientImpl
- Removed handling of max group size in P4Runtime driver. Instead, added
modified group translator to specify a max group size by using
information from the pipeline model.

Change-Id: I684bae0184d683bb448ba19863c561f9848479d2
2019-01-17 18:11:43 -08:00
Carmelo Cascone
cb4327a09e ONOS-7887 Rename action profile-related entities
Members can exist outside of a group. Previous naming was ambiguous
about this.

Action group -> action profile group
Action group member -> action profile member

Change-Id: I5097e92253353d355b864e689f9653df2d318230
2019-01-10 13:52:52 -08:00
David K. Bainbridge
56e9023a33 ONOS-7806 - add support for path differentiator for netconf config
Change-Id: Ie4bdf4eb0348f9591b958bf89284026ed1c39074
2019-01-07 14:21:22 -08:00
Andrea Campanella
59227c30a4 Removing fixed ssh timout on netconf session, if not otherwise specified it will default to INFINITE
Re-Adding down listener to thread upon session re-establishment. Enables re-opening every time.

Change-Id: I4c236cb5ff91a0a0fa6c5f70de79728415c2e63a
2019-01-07 18:47:47 +01:00
Andrea Campanella
bfd4ac8059 Fixing de-activation of restconf app
Change-Id: I8ebc554e7d7fbba4cb19c72f533e17907d31cae7
2019-01-04 13:29:58 +00:00
Ray Milkey
fb503a7416 Revert "Re-enabled TLS netty"
This reverts commit 1a37866929ca05acba71cdadad87dd563b6064dd.

Change-Id: I04cdfe02f70b608b1951c4dee38cb4e345f198d5
2018-12-19 23:32:48 +00:00
Thomas Vachuska
60434b3085 Fixed deprecation warning in test code.
Change-Id: I34deaedef576ebee826c81ce4a44de985cbe9ce6
2018-12-19 09:37:57 -08:00
Yi Tseng
a7f76c17e9 [ONOS-7873] Add retry mechanism to gNMI stream channel manager
Change-Id: Ifdd5b1c3fe9d3588913697aace9b77b27fb442f5
(cherry picked from commit 07d9b842f6b3bc8be3d33b2a666f1213231fd2c6)
2018-12-18 02:38:00 +00:00
Carmelo Cascone
a71b849708 Removes the gRPC channel if an exception occurs while instantiating the client
Includes also other minor changes to gRPC channel creation/connection
process, such as:
- More compact logs showing the gRPC client key
- GrpcChannelController.connectChannel() now returns the same
 StatusRuntime exception, no need to wrap it in an IOException
- Wait for channel shutdown after initial connection error

Change-Id: Ib7d2b728b8c82d9f9b2097cffcebd31cac891b27
2018-12-17 17:58:54 -08:00
Brian O'Connor
1a37866929 Re-enabled TLS netty
created netty specific feature separate from third-party-base
refactored boot features to ensure proper boot sequence for netty, sshd, and core-net
moved http codec to netty feature

Change-Id: Ie6e0ce14fba71603086b7cfe62e1c90a77fd18f2
Co-authored-by: Ray Milkey <ray@opennetworking.org>
2018-12-17 16:15:49 -08:00
Jian Li
654204c089 Support GENEVE tunnel type in OVSDB southbound
Change-Id: I9b93c14d93645ac40525c23bff368e0f81a8189d
2018-12-17 08:27:36 +00:00
Ray Milkey
fa066ed2b0 Revert "Adding support for TLS connections for gRPC clients"
This reverts commit 47a3aa697049bf53e8dd4cb76cf9ca262762a175.

Change-Id: I457594c3f423f276b9c49dbbaf068284a36ba9f1
2018-12-14 22:39:18 +00:00
Carmelo Cascone
6d57f32873 Fixed gRPC exception because of channel not terminated
Change-Id: I7a138938a1daa50ab65b6622a372c0275a351535
2018-12-13 23:20:35 -08:00
Brian O'Connor
47a3aa6970 Adding support for TLS connections for gRPC clients
This patch uses BoringSSL to negotiate TLS sessions under the hood.

Change-Id: I45b6871eb341bd67a230035a930f6a016d105e97
2018-12-14 03:41:04 +00:00
Carmelo Cascone
a46f554fb1 Fix runtime of P4-related stuff with new karaf
Change-Id: I139575d5b038224ca8ccce4ec71ec8a84b35dfeb
2018-12-12 23:41:01 -08:00
Carmelo Cascone
4277d4f553 Silently ignore devices without gNMI client
It is an indication that the device is not gNMI-enabled

Change-Id: Iede116cb839cb58c533dc709a50cc0f469f0997a
2018-12-12 22:19:38 -08:00
Yi Tseng
59d5f3efdf Add OpenConfig based port statistics discovery
Change-Id: I3e7d5683f8a51d06db18b644963044d204911346
2018-12-13 01:05:05 +00:00
Yi Tseng
e616d7553e Add gNMI device state subscriber
Change-Id: I20cb5e130f4e416bf8678aab2e5268faf24ad06b
2018-12-13 01:05:05 +00:00
Yi Tseng
d771648025 Cherry pick gNMI and Stratum related changes to this branch
Cherry picked commits:
20211 Update gNMI version and build script
20247 [ONOS-7829] Implement AbstractGrpcClient and AbstractGrpcClientControl
20233 [ONOS-7141][ONOS-7142] Add GnmiClient and GnmiController
20234 Refactor OpenConfig gNMI device description descovery
20260 [ONOS-7831] Implement GnmiHandshaker
20270 Add Stratum driver

Change-Id: I81ad8bce45251af5909cfcac0edbcfd11c8ebf1d
2018-12-13 01:05:05 +00:00
Carmelo Cascone
cb83181281 Reconcile the pipeline the old way if cookie is not available
Change-Id: If39490874cfb1738358ddf4fbbbee1a89010579e
2018-12-11 14:48:06 -08:00
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
Ray Milkey
fe6afd8c38 Sonar suggestions
Change-Id: I68d400185ffc885bf92b558a2565a49af149ef0c
2018-11-26 23:15:53 +00:00