commit | d7b792eae19ed6d419ebfd082f863bac392aa56d | [log] [tgz] |
---|---|---|
author | Pavlin Radoslavov <pavlin@onlab.us> | Fri Aug 01 02:47:47 2014 -0700 |
committer | Gerrit Code Review <gerrit2@localhost> | Wed Aug 06 13:13:29 2014 -0700 |
tree | 246f57dfee7f541bac6941c2a18d9e57c0ee9c06 | |
parent | 6f29f3ecfaf5d0a68bb9a28f5733ef0d48d2c3c5 [diff] |
Work toward ONOS-1451: Separate Event Key space per instance Final step in the implementation: Implement the Topology Event filtering and processing logic inside class TopologyEventPreprocessor: - The topology events from each ONOS instance are kept separately within class OnosInstanceLastAddEvents - We keep only the last copy of the ADD events (not removed yet by REMOVE events). - If ADD MastershipEvent is received, all previously stored ADD Topology events for the corresponding Switch DPID are applied to the Topology - If there were previously reordered events, we attempt to add them again along with the other events. - Before adding the events to the Topology, the events are aggregated (squashed), and reordered in their natural order to build a Topology. E.g., the ADD events order is: MastershipEvent, SwitchEvent, PortEvent, LinkEvent, HostEvent. The REMOVE events are in the reverse order. Also, the REMOVE events are processed before the ADD events. - If an event cannot be added to the topology, it is added back to the collection of reordered events. Also, replaced some of the Collection<> with List<> in some of the event-related API to indicate that there is a semantic ordering of the events. NOTE: Some of the internals of TopologyEventPreprocessor should be optimized for speed. E.g., we should create an additional lookup map: Dpid -> Collection<TopologyEvent> and then method getPostponedEvents() doesn't need to traverse all topologyEvents entries. Change-Id: Ic0d9ebf242f015adb60817921b239bb65dd560e2
ONOS (Open Networking Operating System) is an experimental distributed SDN OS. Currently, it is under active development. ONOS was announced and demonstrated at ONS'13, '14.
Following URL has the instructions how to get started with ONOS, starting from downloading the development VM:
https://wiki.onlab.us/display/onosdocs/Getting+Started+with+ONOS
Cleanly build ONOS
$ cd ${ONOS_HOME}/ $ mvn clean compile
Required packages
$ sudo apt-get install maven python-flask python-cmd2 python-pyparsing
ZooKeeper
Download and install apache-zookeeper-3.4.6: http://zookeeper.apache.org/releases.html
By default ONOS expect ZooKeeper to be installed in ~/zookeeper-3.4.6
.
This can be changed by specifing the path using ZK_HOME
environment variable.
Data directory ZooKeeper uses by default is /var/lib/zookeeper
. You will need to give current user permission to write to this directory.
This directory can be changed using specifying ZK_LIB_DIR
environment variable and running ./onos.sh setup
to generate ${ONOS_HOME}/conf/zoo.cfg
.
See Configuration for details about ./onos.sh setup
.
RAMCloud
Run setup-ramcloud.sh to download and install RAMCloud to ~/ramcloud
.
Installation path can be changed by specifing RAMCLOUD_HOME
environment variable.
$ cd ${ONOS_HOME}/ $ ./setup-ramcloud.sh
./onos.sh setup
script is used to generate ONOS related configuration files. This script read configuration from "${ONOS_CONF_DIR}/onos_node.`hostname`.conf".
Copy the file "${ONOS_HOME}/conf/onos_node.conf" to match the hostname and configure the content appropriately.
e.g., To use RAMCloud as data store change host.backend
to ramcloud
Once you're done with required configuration run following to generate configuration files.
$ cd ${ONOS_HOME}/ $ ./onos.sh setup
To start ZooKeeper, RAMCloud (if enabled in configuration) and ONOS core.
$ cd ${ONOS_HOME}/ $ ./onos.sh start single-node
To stop all the above
$ cd ${ONOS_HOME}/ $ ./onos.sh stop
If you need to use the REST APIs, follow the instruction for "Start ONOS REST API server" in next section.
You can manually start/stop individual ONOS components as follows:
Start Zookeeper
$ cd ${ONOS_HOME}/ $ ./onos.sh zk start ## Confirm Zookeeper is running: $ ./onos.sh zk status
Start RAMCloud Coordinator (only on one of the node in cluster)
$ cd ${ONOS_HOME}/ $ ./onos.sh rc-coord start ## Confirm RAMCloud Coordinator is running: $ ./onos.sh rc-coord status
Start RAMCloud Server
$ cd ${ONOS_HOME}/ $ ./onos.sh rc-server start ## Confirm RAMCloud Server is running: $ ./onos.sh rc-server status
Start ONOS
$ cd ${ONOS_HOME}/ $ ./onos.sh core start ## Confirm ONOS is running: $ ./onos.sh core status
Start ONOS REST API server
$ cd ${ONOS_HOME}/ $ ./start-rest.sh start ## Confirm the REST API server is running: $ ./start-rest.sh status
Unit tests bundled with ONOS source code, can be executed by using the following:
$ cd ${ONOS_HOME}/ $ mvn test
Some of the unit tests, which take longer time to execute are excluded from the above goal. To force running all the unit tests, use the following commands:
$ cd ${ONOS_HOME}/ $ mvn test -P all-tests
To run only a subset of the unit tests, use the following commands:
$ cd ${ONOS_HOME}/ $ mvn test -Dtest=PortNumberTest
Comma and wildcards can be used to specify multiple test cases. See maven-surefire-plugin website for details.
ONOS utilizes several static analysis tools to detect programmatic and formatting errors. To run some of the analysis against the code, use the following commands:
$ cd ${ONOS_HOME} $ mvn clean verify -P error-prone
Maven need the Internet connection to download required dependencies and plugins, when they're used for the first time.
If you need to develop ONOS in an Internet unreachable environment you may want to run the following helper script before you go offline, so that required dependencies and plugins for frequently used maven target will be downloaded to your local environment.
$ ./prep-for-offline.sh
Apache 2.0