974 Commits

Author SHA1 Message Date
Carmelo Cascone
c0b23a459f Allow building third-party apps based on gRPC
By publishing the repackaged grpc and protobuf artifacts

Change-Id: Ib3af7dba4f64948132aa70be31922de61d6f6ab2
2019-04-25 15:38:00 -07:00
Carmelo Cascone
75a9a8958e Trigger pipeconf deploy right after registration
Without waiting for the next pipeconf watchdog periodic probe.
To support this, this patch extends the PiPipeconfService to advertise
pipeconf registration events.

Change-Id: Ib44f1813bd37083c666a5e7980de320ce469c2d2
2019-04-23 19:39:56 +00:00
Carmelo Cascone
adb89058b4 Do not require device data blob when checking pipeconf on device
This prevents loading potentially large amount of data in memory when
doing pipeconf reconciliation, as well as unregistering a pipeconf while
devices are using it (since we no longer need to access the
target-specific extensions to generate the device data blob)

Change-Id: Ib54123ce49a931ff88d93c991244d4086e5d7de0
2019-04-18 05:52:26 +00:00
Carmelo Cascone
9db4d5c644 Add support for P4Runtime clone sessions via Group API
Clone sessions can now be created by defining groups with new type CLONE

The PI framework has been refactored to abstract commonality between
multicast groups and clone sessions as both are managed as part of the
P4Runtime packet replication engine (PRE).

Change-Id: I2f23c629b7de1931d5cab96ec76aef26130ce418
2019-04-17 21:55:13 +00:00
Carmelo Cascone
4b616316d9 Further improvements to connection handling for gRPC-based devices
Force reset of gRPC connection backoff when probing for reachability.
This allows provider to attempt reconnection when needed, instead of
depending on the channel backoff timer.

Improved checkup task in GDP to better handle mastership
flapping observed when reconnecting devices.

Change-Id: I473fb14160b2eb744a483de431b91f9f6bcdab95
2019-04-17 21:54:42 +00:00
Carmelo Cascone
d51a555886 Minor fixes for P4Runtime devices
- Push ports before device is marked online
- Do not notify role NONE on device disconnection (otherwise the
DeviceManager won't mark the device as offline if there's not a master)
- Detect changes in the pipeconf extensions when reloading a pipeconf

Change-Id: I1779987da1269ec98c71b2ccda7bb579be5bf3f0
2019-04-15 20:34:12 +00:00
Carmelo Cascone
c2be50a804 Allow sharing the same gRPC channel between clients
This change introduces a refactoring of the gRPC protocol subsystem that
allows the creation of a gRPC chanel independently of the client, while
allowing multiple clients to share the same channel (e.g. as in Stratum
where we use 3 clients).

Moreover, we refactor the P4RuntimeClient API to support multiple
P4Runtime-internal device ID using the same client. While before the
client was associated to one of such ID.

Finally, we provide an abstract implementation for gRPC-based driver
behaviors, reducing code duplication in P4Runtime, gNMI and gNOI drivers.

Change-Id: I1a46352bbbef1e0d24042f169ae8ba580202944f
2019-04-11 23:14:41 +00:00
Carmelo Cascone
b8a2505d80 More robust deferring for P4Runtime MasterArbitrationUpdate messages
The P4RuntimeClient implements a deferring mechanism to avoid becoming
master when it shouldn't, i.e. when the requested election ID is bigger
than the master one on the device, but it was not asked to be master.
We rely on a distributed primitive to make sure all nodes are aware of
the latest master election ID on the device. In case we lose primitive
update events, this patch adds a maximum timeout after which the
MasterArbitrationUpdate message is always sent.

Change-Id: I98669dac3fc79173b9e98f41e11a4d08901c6cb1
2019-04-08 23:01:01 +00:00
Carmelo Cascone
c32976e7d5 Various fixes in preparation of Stratum demo at ONS 2019
- Do not read counters with table entries for Barefoot drivers
- If driver behavior setup fails, log which operation we are aborting
- Remove unnecessary setup steps in Stratum-related drivers
- Always get clients by their key in gRPC-based drivers
- Log when P4Runtime group operation fails because of missing group in
store
- Fix polling of table entry counters for P4Runtime driver

Change-Id: Ic9bf19b76d8cb5a191aec24852af4410fea8b998
2019-04-08 23:00:54 +00:00
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