Skip to content
Snippets Groups Projects
Commit e0566f44 authored by abat's avatar abat
Browse files

Merge into master from pull request #280:

parents 6da43355 a644080a
No related branches found
No related tags found
No related merge requests found
...@@ -296,13 +296,24 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule { ...@@ -296,13 +296,24 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule {
this.routingEngine = context.getServiceImpl(IRoutingService.class); this.routingEngine = context.getServiceImpl(IRoutingService.class);
this.topology = context.getServiceImpl(ITopologyService.class); this.topology = context.getServiceImpl(ITopologyService.class);
this.counterStore = context.getServiceImpl(ICounterStoreService.class); this.counterStore = context.getServiceImpl(ICounterStoreService.class);
// read our config options
Map<String, String> configOptions = context.getConfigParams(this);
String idleTimeout = configOptions.get("idletimeout");
if (idleTimeout != null) {
FLOWMOD_DEFAULT_IDLE_TIMEOUT = Short.parseShort(idleTimeout);
}
String hardTimeout = configOptions.get("hardtimeout");
if (hardTimeout != null) {
FLOWMOD_DEFAULT_HARD_TIMEOUT = Short.parseShort(hardTimeout);
}
log.debug("FlowMod idle timeout set to {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);
log.debug("FlowMod hard timeout set to {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);
} }
@Override @Override
public void startUp(FloodlightModuleContext context) { public void startUp(FloodlightModuleContext context) {
if (log.isDebugEnabled()) {
log.debug("Starting " + this.getClass().getCanonicalName());
}
super.startUp(); super.startUp();
} }
} }
...@@ -54,14 +54,15 @@ import org.openflow.protocol.action.OFActionOutput; ...@@ -54,14 +54,15 @@ import org.openflow.protocol.action.OFActionOutput;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public abstract class ForwardingBase implements public abstract class ForwardingBase
IOFMessageListener, implements IOFMessageListener, IDeviceListener {
IDeviceListener {
protected static Logger log = protected static Logger log =
LoggerFactory.getLogger(ForwardingBase.class); LoggerFactory.getLogger(ForwardingBase.class);
public static final short FLOWMOD_DEFAULT_HARD_TIMEOUT = 5; // in seconds public static short FLOWMOD_DEFAULT_IDLE_TIMEOUT = 5; // in seconds
public static short FLOWMOD_DEFAULT_HARD_TIMEOUT = 0; // infinite
protected IFloodlightProviderService floodlightProvider; protected IFloodlightProviderService floodlightProvider;
protected IDeviceService deviceManager; protected IDeviceService deviceManager;
protected IRoutingService routingEngine; protected IRoutingService routingEngine;
...@@ -96,7 +97,7 @@ public abstract class ForwardingBase implements ...@@ -96,7 +97,7 @@ public abstract class ForwardingBase implements
/** /**
* Adds a listener for devicemanager and registers for PacketIns. * Adds a listener for devicemanager and registers for PacketIns.
*/ */
public void startUp() { protected void startUp() {
deviceManager.addListener(this); deviceManager.addListener(this);
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this); floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
} }
...@@ -186,7 +187,8 @@ public abstract class ForwardingBase implements ...@@ -186,7 +187,8 @@ public abstract class ForwardingBase implements
List<OFAction> actions = new ArrayList<OFAction>(); List<OFAction> actions = new ArrayList<OFAction>();
actions.add(action); actions.add(action);
fm.setIdleTimeout((short)5) fm.setIdleTimeout(FLOWMOD_DEFAULT_IDLE_TIMEOUT)
.setHardTimeout(FLOWMOD_DEFAULT_HARD_TIMEOUT)
.setBufferId(OFPacketOut.BUFFER_ID_NONE) .setBufferId(OFPacketOut.BUFFER_ID_NONE)
.setCookie(cookie) .setCookie(cookie)
.setCommand(flowModCommand) .setCommand(flowModCommand)
...@@ -562,7 +564,8 @@ public abstract class ForwardingBase implements ...@@ -562,7 +564,8 @@ public abstract class ForwardingBase implements
& ~OFMatch.OFPFW_IN_PORT); & ~OFMatch.OFPFW_IN_PORT);
fm.setCookie(cookie) fm.setCookie(cookie)
.setHardTimeout((short) hardTimeout) .setHardTimeout((short) hardTimeout)
.setIdleTimeout((short) 5) .setIdleTimeout(FLOWMOD_DEFAULT_IDLE_TIMEOUT)
.setHardTimeout(FLOWMOD_DEFAULT_HARD_TIMEOUT)
.setBufferId(OFPacketOut.BUFFER_ID_NONE) .setBufferId(OFPacketOut.BUFFER_ID_NONE)
.setMatch(match) .setMatch(match)
.setActions(actions) .setActions(actions)
......
...@@ -40,6 +40,7 @@ import net.floodlightcontroller.packet.Ethernet; ...@@ -40,6 +40,7 @@ import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.packet.IPacket; import net.floodlightcontroller.packet.IPacket;
import net.floodlightcontroller.packet.IPv4; import net.floodlightcontroller.packet.IPv4;
import net.floodlightcontroller.restserver.IRestApiService; import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.routing.ForwardingBase;
import net.floodlightcontroller.util.MACAddress; import net.floodlightcontroller.util.MACAddress;
/** /**
...@@ -59,7 +60,6 @@ public class VirtualNetworkFilter ...@@ -59,7 +60,6 @@ public class VirtualNetworkFilter
implements IFloodlightModule, IVirtualNetworkService, IOFMessageListener, IDeviceListener { implements IFloodlightModule, IVirtualNetworkService, IOFMessageListener, IDeviceListener {
protected static Logger log = LoggerFactory.getLogger(VirtualNetworkFilter.class); protected static Logger log = LoggerFactory.getLogger(VirtualNetworkFilter.class);
private final short FLOW_MOD_DEFAULT_IDLE_TIMEOUT = 5; // in seconds
private final short APP_ID = 20; private final short APP_ID = 20;
// Our dependencies // Our dependencies
...@@ -425,8 +425,8 @@ public class VirtualNetworkFilter ...@@ -425,8 +425,8 @@ public class VirtualNetworkFilter
List<OFAction> actions = new ArrayList<OFAction>(); // no actions = drop List<OFAction> actions = new ArrayList<OFAction>(); // no actions = drop
long cookie = AppCookie.makeCookie(APP_ID, 0); long cookie = AppCookie.makeCookie(APP_ID, 0);
fm.setCookie(cookie) fm.setCookie(cookie)
.setIdleTimeout(FLOW_MOD_DEFAULT_IDLE_TIMEOUT) .setIdleTimeout(ForwardingBase.FLOWMOD_DEFAULT_IDLE_TIMEOUT)
.setHardTimeout((short) 0) .setHardTimeout(ForwardingBase.FLOWMOD_DEFAULT_HARD_TIMEOUT)
.setBufferId(OFPacketOut.BUFFER_ID_NONE) .setBufferId(OFPacketOut.BUFFER_ID_NONE)
.setMatch(match) .setMatch(match)
.setActions(actions) .setActions(actions)
......
...@@ -10,4 +10,6 @@ net.floodlightcontroller.perfmon.PktInProcessingTime,\ ...@@ -10,4 +10,6 @@ net.floodlightcontroller.perfmon.PktInProcessingTime,\
net.floodlightcontroller.ui.web.StaticWebRoutable net.floodlightcontroller.ui.web.StaticWebRoutable
net.floodlightcontroller.restserver.RestApiServer.port = 8080 net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633 net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
net.floodlightcontroller.jython.JythonDebugInterface.port = 6655 net.floodlightcontroller.jython.JythonDebugInterface.port = 6655
\ No newline at end of file net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
\ No newline at end of file
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