54 Commits

Author SHA1 Message Date
Carmelo Cascone
3c216fa4f4 Fixed bmv2.py assigning gRPC/Thrift port already in use
Also handle Mininet exceptions by shutting down all BMv2 instances

Change-Id: I5a8d1a06441daa57c5dd3b0861f1b7484828174a
2018-06-22 14:52:15 +02:00
Carmelo Cascone
df32beae1e Fixed AttributeError when logging bmv2 crash in bmv2.py
Change-Id: Ia899a0e5090d3f27694b65f2a75f06500a0b6fec
2018-06-19 21:03:34 +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
55965c6aae Allow arbitrary ONOS device ID in bmv2.py
Needed for SR functional tests

Change-Id: Ieec7d6ef72628b55787b0275d725c829230790da
2018-05-21 17:17:56 +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
eaa8b1dcf9 Simplified Mininet command line args when using bmv2.py
All lower case, easier to remember

Change-Id: I5093769263f8c282381e0f8f8bcd040268045809
2018-04-11 21:30:02 +00:00
jaegonkim
a1988f3fdf [ONOS-7600] Supporting debug mode in onos.py
Change-Id: I388114bfd2419181cca6e137a9cc9b84c62c90de
2018-04-10 18:37:35 +00:00
jaegonkim
4e360499cc [ONOS-7489] onos.py - killing onos, and restarting onos for onos cluster failover test.
Change-Id: I111ccc72ac5d7ae826973e613b2073e96099f3f9
2018-03-13 17:37:54 +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
Andrea Campanella
bf9e5ce3f5 [ONOS-7137] Interfaces Discovery through gNMI
Also, bumped version of gNMI proto as supported by PI

Change-Id: If2903b2dc483f545893daae77f993cc7dadee468
2018-01-24 16:54:21 +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
Keesjan Karsten
8539f088f2 Mininet gRPC switch startup reachability check
Just a small change to make sure the gRPC port of simple_switch_grpc
is actually opened after startup, before ONOS gets the netcfg to try
to connect to the switch. Otherwise ONOS will receive a TCP RST from
the still closed port and the connection fails, rendering the switch
devices unavailable. Also included a timeout for port opening.

Change-Id: I1338a4ba24a14be57717f636e684c91c4cb12a7c
2018-01-04 16:08:15 +00:00
Carmelo Cascone
6ec8f8ff93 Minor refactoring of BMv2 mininet scripts
With options to delay pushing the netcfg for each device and generating
the full netcfg JSON for bmv2-demo.

Change-Id: I046a93a8c639f4bb4cf76cbd61b826473760bfb1
2017-11-23 00:49:04 +00:00
Carmelo Cascone
c3baa4cad9 Fixed onos.py
It now works also when no OpenFlow subsytem is loaded

Change-Id: If51f1ab654dad7c02a3f8744b53f4029abf1bd9f
2017-11-21 19:05:43 +00:00
Lyndon Fawcett
fbad2e75f8 ONOS-7040 added java options for configuring maximum and initial memory pool for JVM.
Change-Id: I87246759ffcd063497e2b522686f2028fe2c150a
2017-11-10 20:05:14 +00:00
Carmelo Cascone
6e85404b1c Minor changes to PI-ECMP demo
- Support devices with different pipeconfs (as in the HW testbed)
- Run UDP servers in Mininet hosts
- Wait before pushing config to ONOS

Change-Id: Ic400e0ac0949375a27aa9721b32dc57d5065fb1c
2017-09-11 22:02:57 +02:00
Carmelo Cascone
46d360bb63 Added option to run Bmv2 with valgrind in bmv2.py
Helpful to debug Bmv2 memory leaks.

Change-Id: I404914201c00203ab3050c439fd7af8a608774d2
2017-08-29 21:07:23 +02:00
Carmelo Cascone
3443325287 Allow bmv2-demo mininet topology with arbitrary size
+ made imbalanced striping optional
+ improved generated netcfg
+ various improvements to bmv2.py

Change-Id: Ic297a9d4571bc1987a9cf8fe7bec7c648fb86686
2017-08-29 15:28:50 +00:00
Yi Tseng
7875cb78bb [ONOS-6854] refactor bmv2-demo.py
Change-Id: I9b7460b15f6664363f2ff0b16110e2b3bc4dedeb
2017-08-22 19:32:12 +00:00
Carmelo Cascone
2cad9efec5 Various fixes to get a P4Runtime demo that works
Change-Id: Icab512fceeb6ec0faf1b402c1e325e055cdb2caf
2017-08-03 16:17:58 +02:00
Carmelo Cascone
aaf6d9821e Build BMv2 with debugger in onos-setup-p4-dev
Tested on Ubuntu 14.04, not 16.04.

Also, bumped version of PI and BMv2.

Change-Id: I00319f12f077608a66c7e07fd59a7f1ca835c391
2017-07-31 09:08:03 +00:00
Carmelo Cascone
fb76b04736 Fixed P4 tools build script for Ubuntu 14
+ bumped version of p4runtime and BMv2
+ minor update to bmv2.py

Change-Id: I7784b075b2e6015bb3eef1286011968303b66129
2017-07-18 13:41:32 +00:00
Carmelo Cascone
59f57decd1 ONOS-6561 BMv2 handshaker via P4Runtime
+ support fort device-specific default pipeconf
+ improvements to P4runtime and gRPC protocol stuff

Change-Id: I8986fce3959df564454ea3d31859860f61eabcae
2017-07-13 17:24:25 +00:00
Carmelo Cascone
569d4ad93f Bumped version of P4Runtime and P4 tools for dev VM
+fixed protobuf version according to p4c documentation.

Change-Id: I16471b70b9b2ebc0e0a30c733f1e6ce47d40e30b
2017-07-10 16:24:53 -04:00
Carmelo Cascone
9e6621ffb0 Fix for log handling in bmv2.py
Change-Id: Idf96ace58c4b1cb67c52e2c122ad644b945f4f99
2017-06-27 20:14:13 +00:00
Carmelo Cascone
a11279b3c2 Updated JSON config in bmv2.py for general device provider
+ fixed unhandled exception

Change-Id: I06057872e743a85a430980ed2b6a67942b61e58f
2017-06-22 11:10:33 +00:00
Brian O'Connor
71167f9e76 Updating bmv2.py to remove dependency on onos-netcfg
Change-Id: I4b98efe2d025a03925a6505ef387aac105af9aa0
2017-06-19 21:02:32 +02:00
Carmelo Cascone
b752427548 ONOS-6457 Improved bmv2.py mininet script
- Starts BMv2 with empty.p4 as when running with --no-p4 the switch
  crashes
- Automatically send a netcfg JSON to ONOS for each device
- Makefile to build all P4 programs (needed for empty.p4)

Change-Id: Ib872641751c543aac6c752610b1ce88a1a00d0d2
2017-06-06 12:48:02 +00:00
Carmelo Cascone
75e9799694 ONOS-6457 Updated bmv2.py to work with simple_switch_grpc target
Change-Id: I696daca118f631c73b747eaea8ce936cd4b1097a
2017-06-05 15:30:02 +00:00
Carmelo Cascone
c52a4b1b46 Run an ONOS cluster inside Mininet (via onos.py) with any demo script.
E.g. $ sudo -E python attmpls.py --cluster-size 3

Also, added option (--netcfg) to auto set netcfg at Mininet startup, and
added command to bring onos instances up/down to Mininet CLI.

Change-Id: Id02917fd5181af496b7d954da0ef3d5f2cbb970d
2016-11-30 21:19:47 +00:00
Jon Hall
2548559590 Add HA.py
A set of mininet based HA tests based on onos.py
Currently includes the following tests:
    - a control network partitioning test
    - A dynamic cluster scaling test

Change-Id: I9a8e1019dcc51666fee1d933afd66ff390592525
2016-09-12 17:56:20 +00:00
Bob Lantz
2ca9a35df9 Added README
Change-Id: I9bb92f93a88e113928a35196ac83954b9e069e5c
2016-09-07 23:07:11 +00:00
Bob Lantz
894eab5711 Add examples/ dir, README, and multicluster.py
multicluster.py creates two ONOS "clusters" (1 node by
default, though larger are possible), each of which
is responsible for a separate segment of the data network.

Change-Id: I233c9884b565bd6a28fa1a05e990e86207c88347
2016-08-30 17:34:32 +00:00
Bob Lantz
503a402e89 Multiple ONOSCluster support for ONOSCLI
Previously we were only passing the first ONOSCluster
into MininetFacade, but lo and behold it supports as
many networks as you like! So we pass them all in the
case where we have multiple ONOSClusters.

Change-Id: If848886b958aa47d3e4834c44adc98fffd90453c
2016-08-29 18:08:37 -07:00
Bob Lantz
8e576256fb Enable --custom files to import ONOSCLI
Since --custom files are execed, subsequently importing them
actually creates duplicate classes. This wouldn't be a problem
except that we depend on isinstance(). As a workaround, we allow
the class name to match if isinstance() fails, assuming it will
be a class that is compatible with ONOSCluster or ONOSNode.

Example: env PYTHONPATH=. mn --custom onos.py,mytest.py

where mytest.py imports onos

Change-Id: Ib4cda82fbdd612420de1e113ab768e2f137d5213
2016-08-29 17:56:11 -07:00
Bob Lantz
5763516eb6 Add portOffset for multiple ONOSCluster port forwarding
With multiple ONOS clusters, we want to make sure that the
forwarded port numbers don't collide. We add a portOffset
which is automatically incremented appropriately as more
ONOSClusters are created. It can also be specified explicitly.

Change-Id: I62977c3d4141668d9f541067db1a20ec0035489b
2016-08-30 00:55:39 +00:00
Jon Hall
a43d0334aa Add check for node status to onos.py startup
Change-Id: I8e6b103ef46a5bc5877507a7adef3eb6117adf64
2016-08-16 22:32:34 +00:00
Jon Hall
9b238aef36 Pass alertActions cli option to ONOSNode class in onos.py
Change-Id: I534cc0e22ac11018e6c5ec6f73a2f7259392b9e0
2016-08-16 22:30:35 +00:00
Bob Lantz
a2ccaa5672 unpackONOS: check for failure when extracting tar archive
Change-Id: Iad44ac863449afdbf21d8766479af569f9ba9b6e
2016-06-30 20:58:13 +00:00
Bob Lantz
930138e306 Enable global port forwarding in root namespace
This should fix the problem seen in VirtualBox where you
may have some random interface which is host-only which needs
to have port forwarding set up on it.

Change-Id: Iacdbb129d52529783bdab1c3d768131f6eaf0364
2016-06-30 01:16:53 +00:00
Carmelo Cascone
977ae3f42d Varius updates to BMv2 mininet scripts
Most notably:
- Added support for onos.py's ONOSCluster controller (it works with
	"mn --custom onos.py,bmv2.py --switch onosbmv2 ...")
- Randomly select an open port for the Thrift RPC server

Change-Id: Ifa974741dc4a3693777f01866b1f6203d0e7e75e
2016-06-29 20:53:05 +00:00
Carmelo Cascone
785fada2fb Added Bmv2 demo scripts (mininet and netcfg)
Change-Id: I7471a9ebe55f74dbe8c63faef9a8685c48621862
2016-06-28 23:01:35 +00:00
Bob Lantz
55562ea677 Unpack/install all nodes before startup
Madan suggested that this might help vs. the pipelined
startup we were doing before, so let's try it.

We will unpack/install all nodes before we start up,
so that we can start the whole cluster at about the same
instant.

Note that this is probably closer to what we'd see in hardware.

The disadvantage is that we don't get a "clean" environment
with each invocation of start().

Change-Id: I0a45984f50e1ef25a7d8a836e46978fdbdff0bd0
2016-06-17 18:21:08 -07:00
Bob Lantz
c3de5152b3 Correctly print message if arping isn't installed
Change-Id: Ia8e6a305bebb51556974b72c83d86b472b6918e5
2016-06-17 17:14:46 -07:00
Bob Lantz
92d8e0510f Use ip route to determine default intf for port forwarding
We were using eth0 by default before, but this doesn't work if
your default interface isn't eth0.

Fixes port forwarding on Ubuntu 16.04.

Change-Id: I55baed7fd8952a9f6cab364e20e31a0632ddda6d
2016-06-17 23:34:51 +00:00
Bob Lantz
9ba19dce8f Use netstat for waitListening; client -h h1 "apps -a"
And fix do_log()

Change-Id: I04402fda9c409fa4cb41ae20cf1c551369b7669d
2016-06-17 14:13:44 -07:00
Bob Lantz
c96e25824a add arp cmd; always return lists from checkLog
The arp CLI command sends gratuitous ARPs from all hosts - this
makes it easier for ONOS to discover hosts.

Previously checkLog returned None, None if the log file didn't
exist; now we return an empty list, to avoid breaking when we
take the len() of errors or warnings (which was happening before)
and to avoid having to check for None, None, which didn't seem to
add a lot of value to justify its complexity.

Change-Id: I84847fcf70525c82ac037d8a84cf40d21ab2a106
2016-06-13 21:40:25 -07:00
Bob Lantz
6438242617 Add status/error checks during ONOS startup
We check for:
- process exits
- log ERRORs
- log WARNings
- low memory

Also added a "status" CLI command to check for exits
and errors.

Change-Id: I6e65fe49619e338f1827fc616ca52a82de7ba470
2016-06-13 22:43:32 +00:00
Bob Lantz
569bbec710 Unset empty vars; pass IPs to onos-gen-partitions
We really don't need the OCx variables, but for now at
least we are unsetting the ones that are incorrect and
calling onos-gen-partitions with the explicit IP
addresses.

Change-Id: I8bd3d69bee4857e00070288b586255455c9c8adf
2016-06-06 15:28:12 +00:00
Bob Lantz
4b51d5c32e Various minor fixes and improvements
- enable parameters for onos cli commands (e.g. onos:apps -a)
- don't depend on onos1's name
- reduce dependencies on unnecessary variables
- enable running if karaf isn't installed elsewhere
- make NAT an option

Change-Id: I3e8abd51aa8d3f5c7afab1c6b86e50707de20ef6
2016-05-31 22:26:58 +00:00