Giant patch of changes to support OpenFlow 1.3
The following people have contributed to this patch:
- Ali Al-Shabibi <alshabibi.ali@gmail.com>
- Ayaka Koshibe <ayaka@onlab.us>
- Brian O'Connor <bocon@onlab.us>
- Jonathan Hart <jono@onlab.us>
- Matteo Gerola <mgerola@create-net.org>
- Michele Santuari <michele.santuari@create-net.org>
- Pavlin Radoslavov <pavlin@onlab.us>
- Saurav Das <sauravdas@alumni.stanford.edu>
- Toshio Koide <t-koide@onlab.us>
- Yuta HIGUCHI <y-higuchi@onlab.us>
The patch includes the following changes:
- New Floodlight I/O loop / state machine
- New switch/port handling
- New role management (incl. Role.EQUAL)
- Added Floodlight debug framework
- Updates to Controller.java
- Move to Loxigen's OpenflowJ library
- Added OF1.3 support
- Added support for different switches (via DriverManager)
- Updated ONOS modules to use new APIs
- Added and updated unit tests
Change-Id: Ic70a8d50f7136946193d2ba2e4dc0b4bfac5f599
diff --git a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowSynchronizer.java b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowSynchronizer.java
index af3cc70..7b2bfd0 100644
--- a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowSynchronizer.java
+++ b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowSynchronizer.java
@@ -1,6 +1,5 @@
package net.onrc.onos.core.flowprogrammer;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -8,12 +7,10 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import net.floodlightcontroller.core.IOFSwitch;
-import net.onrc.onos.core.flowprogrammer.IFlowPusherService.MsgPriority;
import net.onrc.onos.core.util.FlowEntryId;
import org.openflow.protocol.OFFlowMod;
@@ -99,10 +96,6 @@
Set<FlowEntryWrapper> graphEntries = getFlowEntriesFromGraph();
long step1 = System.nanoTime();
Set<FlowEntryWrapper> switchEntries = getFlowEntriesFromSwitch();
- if (switchEntries == null) {
- log.debug("getFlowEntriesFromSwitch() failed");
- return null;
- }
long step2 = System.nanoTime();
SyncResult result = compare(graphEntries, switchEntries);
long step3 = System.nanoTime();
@@ -184,12 +177,12 @@
Set<FlowEntryWrapper> entries = new HashSet<FlowEntryWrapper>();
// TODO: fix when FlowSynchronizer is refactored
- /*
+ /*
for(IFlowEntry entry : swObj.getFlowEntries()) {
FlowEntryWrapper fe = new FlowEntryWrapper(entry);
entries.add(fe);
}
- */
+ */
return entries;
}
@@ -218,8 +211,9 @@
lengthU += req.getLengthU();
req.setLengthU(lengthU);
- List<OFStatistics> entries = null;
- try {
+ //List<OFStatistics> entries = null;
+ // XXX S when we fix stats, we fix this
+ /*try {
Future<List<OFStatistics>> dfuture = sw.getStatistics(req);
entries = dfuture.get();
} catch (IOException e) {
@@ -231,14 +225,16 @@
} catch (ExecutionException e) {
log.error("Error getting statistics", e);
return null;
- }
+ }*/
Set<FlowEntryWrapper> results = new HashSet<FlowEntryWrapper>();
+ /*
for (OFStatistics result : entries) {
OFFlowStatisticsReply entry = (OFFlowStatisticsReply) result;
FlowEntryWrapper fe = new FlowEntryWrapper(entry);
results.add(fe);
}
+ */
return results;
}
@@ -248,7 +244,7 @@
* FlowEntryWrapper represents abstract FlowEntry which is embodied
* by FlowEntryId (from GraphDB) or OFFlowStatisticsReply (from switch).
*/
- class FlowEntryWrapper {
+ static class FlowEntryWrapper {
FlowEntryId flowEntryId;
// TODO: fix when FlowSynchronizer is refactored
// IFlowEntry iFlowEntry;
@@ -256,12 +252,12 @@
// TODO: fix when FlowSynchronizer is refactored
- /*
+ /*
public FlowEntryWrapper(IFlowEntry entry) {
flowEntryId = new FlowEntryId(entry.getFlowEntryId());
iFlowEntry = entry;
}
- */
+ */
public FlowEntryWrapper(OFFlowStatisticsReply entry) {
flowEntryId = new FlowEntryId(entry.getCookie());
@@ -285,7 +281,7 @@
double startDB = System.nanoTime();
// Get the Flow Entry state from the Network Graph
// TODO: fix when FlowSynchronizer is refactored
- /*
+ /*
if (iFlowEntry == null) {
try {
// TODO: fix when FlowSynchronizer is refactored
@@ -296,13 +292,13 @@
return;
}
}
- */
+ */
dbTime = System.nanoTime() - startDB;
//
// TODO: The old FlowDatabaseOperation class is gone, so the code
//
- /*
+ /*
double startExtract = System.nanoTime();
FlowEntry flowEntry =
FlowDatabaseOperation.extractFlowEntry(iFlowEntry);
@@ -316,7 +312,7 @@
double startPush = System.nanoTime();
pusher.pushFlowEntry(sw, flowEntry, MsgPriority.HIGH);
pushTime = System.nanoTime() - startPush;
- */
+ */
}
/**
@@ -340,7 +336,8 @@
fm.setPriority(statisticsReply.getPriority());
fm.setOutPort(OFPort.OFPP_NONE);
- pusher.add(sw, fm, MsgPriority.HIGH);
+ // XXX BOC commented out pending FlowSync refactor
+ //pusher.add(sw, fm, MsgPriority.HIGH);
}
/**