Skip to content
Snippets Groups Projects
Commit 516e88bb authored by Ryan Izard's avatar Ryan Izard
Browse files

Fix potential divide by zero. Increased latency parameters to threshold=0.50,...

Fix potential divide by zero. Increased latency parameters to threshold=0.50, history=10. Maybe it's just because my control plane is over a VPN and over the public internet, but the link latencies are fluctuating a bit. TODO evaluate whether or not we should completely clear the average/history each time we accept a new latency value. This would lessen the number of latency updates.
parent af750c25
No related branches found
No related tags found
No related merge requests found
...@@ -214,8 +214,8 @@ IFloodlightModule, IInfoProvider { ...@@ -214,8 +214,8 @@ IFloodlightModule, IInfoProvider {
/* /*
* Latency tracking * Latency tracking
*/ */
protected static int LATENCY_HISTORY_SIZE = 5; protected static int LATENCY_HISTORY_SIZE = 10;
protected static double LATENCY_UPDATE_THRESHOLD = 0.30; protected static double LATENCY_UPDATE_THRESHOLD = 0.50;
/** /**
* Flag to indicate if automatic port fast is enabled or not. Default is set * Flag to indicate if automatic port fast is enabled or not. Default is set
......
...@@ -104,7 +104,7 @@ public class LinkInfo { ...@@ -104,7 +104,7 @@ public class LinkInfo {
if (newLatency != null) { if (newLatency != null) {
/* check threshold */ /* check threshold */
if ((((double) Math.abs(newLatency.getValue() - currentLatency.getValue())) if ((((double) Math.abs(newLatency.getValue() - currentLatency.getValue()))
/ currentLatency.getValue() / (currentLatency.getValue() == 0 ? 1 : currentLatency.getValue())
) )
>= latencyUpdateThreshold) { >= latencyUpdateThreshold) {
/* perform update */ /* perform update */
......
...@@ -24,7 +24,7 @@ net.floodlightcontroller.forwarding.Forwarding.match=vlan, mac, ip, transport ...@@ -24,7 +24,7 @@ net.floodlightcontroller.forwarding.Forwarding.match=vlan, mac, ip, transport
net.floodlightcontroller.core.internal.FloodlightProvider.openflowPort=6653 net.floodlightcontroller.core.internal.FloodlightProvider.openflowPort=6653
net.floodlightcontroller.core.internal.FloodlightProvider.role=ACTIVE net.floodlightcontroller.core.internal.FloodlightProvider.role=ACTIVE
net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.latency-history-size=10 net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.latency-history-size=10
net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.latency-update-threshold=0.3 net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.latency-update-threshold=0.5
net.floodlightcontroller.core.internal.OFSwitchManager.defaultMaxTablesToReceiveTableMissFlow=2 net.floodlightcontroller.core.internal.OFSwitchManager.defaultMaxTablesToReceiveTableMissFlow=2
net.floodlightcontroller.core.internal.OFSwitchManager.maxTablesToReceiveTableMissFlowPerDpid={"00:00:00:00:00:00:00:01":"1","2":"1"} net.floodlightcontroller.core.internal.OFSwitchManager.maxTablesToReceiveTableMissFlowPerDpid={"00:00:00:00:00:00:00:01":"1","2":"1"}
net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnInitialHandshakeAsMaster=YES net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnInitialHandshakeAsMaster=YES
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment