From 494338e47e2d6cca3547283876906a48e2681f71 Mon Sep 17 00:00:00 2001 From: Sumanth Sathyanarayana Date: Mon, 24 Jun 2013 21:31:11 -0700 Subject: [PATCH 1/3] Added another variable called actualStats (HashMap) which gets the values from flowStats and will be passed as the statsReply to solve the problem of clearing of the map-flowStats and the flag is set as sent by the switch --- .../flowvisor/classifier/FVClassifier.java | 20 +++++++++++++------ .../statistics/FVFlowStatisticsReply.java | 13 ++++++++---- .../statistics/FVFlowStatisticsRequest.java | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/org/flowvisor/classifier/FVClassifier.java b/src/org/flowvisor/classifier/FVClassifier.java index 563af73..a3e8856 100644 --- a/src/org/flowvisor/classifier/FVClassifier.java +++ b/src/org/flowvisor/classifier/FVClassifier.java @@ -76,6 +76,7 @@ import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFPhysicalPort; import org.openflow.protocol.OFPort; +import org.openflow.protocol.OFStatisticsReply.OFStatisticsReplyFlags; import org.openflow.protocol.OFType; import org.openflow.protocol.OFError.OFHelloFailedCode; import org.openflow.protocol.action.OFAction; @@ -127,6 +128,8 @@ public class FVClassifier implements FVEventHandler, FVSendMsg, FlowMapChangedLi private boolean statsWindowOpen = true; private HashMap> flowStats = new HashMap>(); + private HashMap> actualStats = + new HashMap>(); private ConcurrentLinkedQueue toDeleteSlices = new ConcurrentLinkedQueue(); // OFPP_FLOOD @@ -984,8 +987,9 @@ public boolean isRateLimited(String sliceName) { private synchronized ArrayList getFlowStats(String sliceName) { ArrayList stats = new ArrayList(); - if (flowStats.get(sliceName) != null) - stats.addAll(flowStats.get(sliceName)); + if (actualStats.get(sliceName) != null) + stats.addAll(actualStats.get(sliceName)); + FVLog.log(LogLevel.DEBUG, null, actualStats.toString()); return stats; } @@ -1045,7 +1049,7 @@ private boolean matchContainsPort(FVFlowStatisticsReply reply, short outPort) { return false; } - public void sendFlowStatsResp(FVSlicer fvSlicer, FVStatisticsRequest original) { + public void sendFlowStatsResp(FVSlicer fvSlicer, FVStatisticsRequest original, short flag) { FVFlowStatisticsRequest orig = (FVFlowStatisticsRequest) original.getStatistics().get(0); @@ -1069,7 +1073,7 @@ public void sendFlowStatsResp(FVSlicer fvSlicer, FVStatisticsRequest original) { } statsReply.setStatistics(stats); - + statsReply.setFlags(flag); statsReply.setXid(original.getXid()); statsReply.setVersion(original.getVersion()); @@ -1084,8 +1088,7 @@ public void sendFlowStatsResp(FVSlicer fvSlicer, FVStatisticsRequest original) { public synchronized void classifyFlowStats(FVStatisticsReply fvStatisticsReply) { - - flowStats.clear(); + actualStats.clear(); List stats = fvStatisticsReply.getStatistics(); for (OFStatistics s : stats) { FVFlowStatisticsReply stat = (FVFlowStatisticsReply) s; @@ -1098,6 +1101,11 @@ public synchronized void classifyFlowStats(FVStatisticsReply fvStatisticsReply) stat.setCookie(pair.getCookie()); addToFlowStats(stat, pair.getSliceName()); } + actualStats.putAll(flowStats); + FVLog.log(LogLevel.DEBUG, this, " actualStats: ",actualStats.toString(), "flowStats: ", flowStats.toString()); + if ((fvStatisticsReply.getFlags() != OFStatisticsReplyFlags.REPLY_MORE.getTypeValue()) ){ + flowStats.clear(); + } for (String slice : toDeleteSlices) { cleanUpFlowMods(slice); } diff --git a/src/org/flowvisor/message/statistics/FVFlowStatisticsReply.java b/src/org/flowvisor/message/statistics/FVFlowStatisticsReply.java index 941c9c9..03ab2cb 100644 --- a/src/org/flowvisor/message/statistics/FVFlowStatisticsReply.java +++ b/src/org/flowvisor/message/statistics/FVFlowStatisticsReply.java @@ -8,6 +8,7 @@ import org.flowvisor.message.FVStatisticsReply; import org.flowvisor.message.FVStatisticsRequest; import org.flowvisor.slicer.FVSlicer; +import org.openflow.protocol.OFStatisticsReply.OFStatisticsReplyFlags; import org.openflow.protocol.statistics.OFFlowStatisticsReply; import org.openflow.protocol.statistics.OFStatisticsType; @@ -33,10 +34,14 @@ public void classifyFromSwitch(FVStatisticsReply msg, FVClassifier fvClassifier) return; } FVStatisticsRequest original = (FVStatisticsRequest) pair.getOFMessage(); - if (original.getStatisticType() == OFStatisticsType.FLOW) - fvClassifier.sendFlowStatsResp(pair.getSlicer(), original); - else if (original.getStatisticType() == OFStatisticsType.AGGREGATE) - fvClassifier.sendAggStatsResp(pair.getSlicer(), original); + + if(msg.getFlags() != OFStatisticsReplyFlags.REPLY_MORE.getTypeValue()){ + if (original.getStatisticType() == OFStatisticsType.FLOW) + fvClassifier.sendFlowStatsResp(pair.getSlicer(), original, msg.getFlags()); + //fvClassifier.sendFlowStatsResp(pair.getSlicer(), original); + else if (original.getStatisticType() == OFStatisticsType.AGGREGATE) + fvClassifier.sendAggStatsResp(pair.getSlicer(), original); + } } diff --git a/src/org/flowvisor/message/statistics/FVFlowStatisticsRequest.java b/src/org/flowvisor/message/statistics/FVFlowStatisticsRequest.java index 7d9f433..2c767e5 100644 --- a/src/org/flowvisor/message/statistics/FVFlowStatisticsRequest.java +++ b/src/org/flowvisor/message/statistics/FVFlowStatisticsRequest.java @@ -26,7 +26,7 @@ public void sliceFromController(FVStatisticsRequest msg, FVClassifier fvClassifi FVSlicer fvSlicer) { FVMessageUtil.translateXidMsg(msg,fvClassifier, fvSlicer); if (!fvClassifier.pollFlowTableStats(msg)) - fvClassifier.sendFlowStatsResp(fvSlicer, msg); + fvClassifier.sendFlowStatsResp(fvSlicer, msg, (short)0); } From 2f016affda3a754b8ed3f8f225597baab01acb0b Mon Sep 17 00:00:00 2001 From: Sumanth Sathyanarayana Date: Tue, 25 Jun 2013 10:19:23 -0700 Subject: [PATCH 2/3] Updated the release notes and version number --- RELEASE-NOTES | 19 ++++++++++++++----- src/org/flowvisor/FlowVisor.java | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d244926..c6c8347 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,11 +1,20 @@ +FlowVisor 1.0.9 : June 25 2013 + * FLOWVISOR-244 : Flow stats reply sent by FlowVisor doesn't set the "more replies" flag + +FlowVisor 1.0.8 : May 29 2013 + * FLOWVISOR-238 : fvctl-xml and fvctl-json + +FlowVisor 1.0.7 : May 14 2013 + * FLOWVISOR-234 : Slices in updated config are set to disabled. + FlowVisor 1.0.6 : May 10 2013 - * FLOWVISOR-230 : fvctl list-slice-info gives confusing error message if you specify a non-existent slice - * FLOWVISOR-231 : fvctl and network specs - * FLOWVISOR-232 : Error adding flowspace rules with MAC addresses + * FLOWVISOR-230 : fvctl list-slice-info gives confusing error message if you specify a non-existent slice + * FLOWVISOR-231 : fvctl and network specs + * FLOWVISOR-232 : Error adding flowspace rules with MAC addresses FlowVisor 1.0.5 : May 2 2013 - * FLOWVISOR-216 : Undo changes to default port configurations - * Potential fix for FV crashes; awaiting confirmation + * FLOWVISOR-216 : Undo changes to default port configurations + * Potential fix for FV crashes; awaiting confirmation FlowVisor 1.0.4 : May 1 2013 * FLOWVISOR-226 : fvconfig load hangs diff --git a/src/org/flowvisor/FlowVisor.java b/src/org/flowvisor/FlowVisor.java index 5351a21..c4def61 100644 --- a/src/org/flowvisor/FlowVisor.java +++ b/src/org/flowvisor/FlowVisor.java @@ -40,7 +40,7 @@ public class FlowVisor { public final static int FLOWVISOR_VENDOR_EXTENSION = 0x80000001; // VERSION - public final static String FLOWVISOR_VERSION = "flowvisor-1.0.8"; + public final static String FLOWVISOR_VERSION = "flowvisor-1.0.9"; public final static int FLOWVISOR_DB_VERSION = 2; From a57182ba483affbcc124954482307f5592a72629 Mon Sep 17 00:00:00 2001 From: Sumanth Sathyanarayana Date: Thu, 27 Jun 2013 14:11:51 -0700 Subject: [PATCH 3/3] Changed the FV Version num --- RELEASE-NOTES | 2 +- src/org/flowvisor/FlowVisor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 32466a1..00a0b0c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,4 +1,4 @@ -FlowVisor 1.1.3-DEV: May 15 2013 +FlowVisor 1.2-MAINT: June 3 2013 * FLOWVISOR-59 : Flowvisor should be able to ask the flow table from the switch * FLOWVISOR-62 : Allow slice perms to be specfied with "rwd" in addition to by number * FLOWVISOR-191: fvctl add-flowspace should check whether a slice exist before returning diff --git a/src/org/flowvisor/FlowVisor.java b/src/org/flowvisor/FlowVisor.java index a686b61..87b7535 100644 --- a/src/org/flowvisor/FlowVisor.java +++ b/src/org/flowvisor/FlowVisor.java @@ -40,7 +40,7 @@ public class FlowVisor { public final static int FLOWVISOR_VENDOR_EXTENSION = 0x80000001; // VERSION - public final static String FLOWVISOR_VERSION = "flowvisor-1.2.0"; + public final static String FLOWVISOR_VERSION = "flowvisor-1.2.1"; public final static int FLOWVISOR_DB_VERSION = 2;