net.floodlightcontroller.forwarding
Class Forwarding

java.lang.Object
  extended by net.floodlightcontroller.routing.ForwardingBase
      extended by net.floodlightcontroller.forwarding.Forwarding
All Implemented Interfaces:
IListener<OFType>, IOFMessageListener, IFloodlightModule

public class Forwarding
extends ForwardingBase
implements IFloodlightModule


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.floodlightcontroller.core.IListener
IListener.Command
 
Field Summary
protected static org.slf4j.Logger log
           
 
Fields inherited from class net.floodlightcontroller.routing.ForwardingBase
appCookie, broadcastCache, broadcastCacheFeature, clusterIdComparator, counterStore, deviceManager, floodlightProvider, FLOWMOD_DEFAULT_HARD_TIMEOUT, FLOWMOD_DEFAULT_HARD_TIMEOUT_CONSTANT, FLOWMOD_DEFAULT_IDLE_TIMEOUT, FLOWMOD_DEFAULT_IDLE_TIMEOUT_CONSTANT, FORWARDING_APP_ID, messageDamper, OFMESSAGE_DAMPER_CAPACITY, OFMESSAGE_DAMPER_TIMEOUT, prime1, prime2, routingEngine, topology
 
Constructor Summary
Forwarding()
           
 
Method Summary
protected  void doDropFlow(IOFSwitch sw, OFPacketIn pi, IRoutingDecision decision, FloodlightContext cntx)
           
protected  void doFlood(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
          Creates a OFPacketOut with the OFPacketIn data that is flooded on all ports unless the port is blocked, in which case the packet will be dropped.
protected  void doForwardFlow(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx, boolean requestFlowRemovedNotifn)
           
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
          Get a list of Modules that this module depends on.
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
          Return the list of interfaces that this module implements.
 java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
          Instantiate (as needed) and return objects that implement each of the services exported by this module.
 void init(FloodlightModuleContext context)
          This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.
 IListener.Command processPacketInMessage(IOFSwitch sw, OFPacketIn pi, IRoutingDecision decision, FloodlightContext cntx)
          All subclasses must define this function if they want any specific forwarding action
 void startUp(FloodlightModuleContext context)
          This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads.
 
Methods inherited from class net.floodlightcontroller.routing.ForwardingBase
blockHost, getName, init, isCallbackOrderingPostreq, isCallbackOrderingPrereq, isInBroadcastCache, isInSwitchBroadcastCache, packetOutMultiPort, packetOutMultiPort, packetOutMultiPort, pushPacket, pushRoute, receive, startUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.slf4j.Logger log
Constructor Detail

Forwarding

public Forwarding()
Method Detail

processPacketInMessage

public IListener.Command processPacketInMessage(IOFSwitch sw,
                                                OFPacketIn pi,
                                                IRoutingDecision decision,
                                                FloodlightContext cntx)
Description copied from class: ForwardingBase
All subclasses must define this function if they want any specific forwarding action

Specified by:
processPacketInMessage in class ForwardingBase
Parameters:
sw - Switch that the packet came in from
pi - The packet that came in
decision - Any decision made by a policy engine

doDropFlow

protected void doDropFlow(IOFSwitch sw,
                          OFPacketIn pi,
                          IRoutingDecision decision,
                          FloodlightContext cntx)

doForwardFlow

protected void doForwardFlow(IOFSwitch sw,
                             OFPacketIn pi,
                             FloodlightContext cntx,
                             boolean requestFlowRemovedNotifn)

doFlood

protected void doFlood(IOFSwitch sw,
                       OFPacketIn pi,
                       FloodlightContext cntx)
Creates a OFPacketOut with the OFPacketIn data that is flooded on all ports unless the port is blocked, in which case the packet will be dropped.

Parameters:
sw - The switch that receives the OFPacketIn
pi - The OFPacketIn that came to the switch
cntx - The FloodlightContext associated with this OFPacketIn

getModuleServices

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
Description copied from interface: IFloodlightModule
Return the list of interfaces that this module implements. All interfaces must inherit IFloodlightService

Specified by:
getModuleServices in interface IFloodlightModule
Returns:

getServiceImpls

public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
Description copied from interface: IFloodlightModule
Instantiate (as needed) and return objects that implement each of the services exported by this module. The map returned maps the implemented service to the object. The object could be the same object or different objects for different exported services.

Specified by:
getServiceImpls in interface IFloodlightModule
Returns:
The map from service interface class to service implementation

getModuleDependencies

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
Description copied from interface: IFloodlightModule
Get a list of Modules that this module depends on. The module system will ensure that each these dependencies is resolved before the subsequent calls to init().

Specified by:
getModuleDependencies in interface IFloodlightModule
Returns:
The Collection of IFloodlightServices that this module depends on.

init

public void init(FloodlightModuleContext context)
          throws FloodlightModuleException
Description copied from interface: IFloodlightModule
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.

Specified by:
init in interface IFloodlightModule
Throws:
FloodlightModuleException

startUp

public void startUp(FloodlightModuleContext context)
Description copied from interface: IFloodlightModule
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads.

Specified by:
startUp in interface IFloodlightModule