|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.routing.ForwardingBase
public abstract class ForwardingBase
Abstract base class for implementing a forwarding module. Forwarding is responsible for programming flows to a switch in response to a policy decision.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.floodlightcontroller.core.IListener |
---|
IListener.Command |
Field Summary | |
---|---|
static long |
appCookie
|
TimedCache<java.lang.Long> |
broadcastCache
|
protected boolean |
broadcastCacheFeature
|
java.util.Comparator<SwitchPort> |
clusterIdComparator
|
protected ICounterStoreService |
counterStore
|
protected IDeviceService |
deviceManager
|
protected IFloodlightProviderService |
floodlightProvider
|
static short |
FLOWMOD_DEFAULT_HARD_TIMEOUT
|
static short |
FLOWMOD_DEFAULT_HARD_TIMEOUT_CONSTANT
|
static short |
FLOWMOD_DEFAULT_IDLE_TIMEOUT
|
static short |
FLOWMOD_DEFAULT_IDLE_TIMEOUT_CONSTANT
|
static int |
FORWARDING_APP_ID
|
protected static org.slf4j.Logger |
log
|
protected OFMessageDamper |
messageDamper
|
protected static int |
OFMESSAGE_DAMPER_CAPACITY
|
protected static int |
OFMESSAGE_DAMPER_TIMEOUT
|
int |
prime1
|
static int |
prime2
|
protected IRoutingService |
routingEngine
|
protected ITopologyService |
topology
|
Constructor Summary | |
---|---|
ForwardingBase()
|
Method Summary | |
---|---|
static boolean |
blockHost(IFloodlightProviderService floodlightProvider,
SwitchPort sw_tup,
long host_mac,
short hardTimeout,
long cookie)
|
java.lang.String |
getName()
Returns the application name "forwarding". |
protected void |
init()
init data structures |
boolean |
isCallbackOrderingPostreq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering post-requisite for this module. |
boolean |
isCallbackOrderingPrereq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering prerequisite for this module. |
protected boolean |
isInBroadcastCache(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx)
|
protected boolean |
isInSwitchBroadcastCache(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx)
|
void |
packetOutMultiPort(byte[] packetData,
IOFSwitch sw,
int inPort,
java.util.Set<java.lang.Integer> outPorts,
FloodlightContext cntx)
Write packetout message to sw with output actions to one or more output ports with inPort/outPorts passed in. |
void |
packetOutMultiPort(IPacket packet,
IOFSwitch sw,
int inPort,
java.util.Set<java.lang.Integer> outPorts,
FloodlightContext cntx)
|
void |
packetOutMultiPort(OFPacketIn pi,
IOFSwitch sw,
int inPort,
java.util.Set<java.lang.Integer> outPorts,
FloodlightContext cntx)
|
abstract IListener.Command |
processPacketInMessage(IOFSwitch sw,
OFPacketIn pi,
IRoutingDecision decision,
FloodlightContext cntx)
All subclasses must define this function if they want any specific forwarding action |
protected void |
pushPacket(IOFSwitch sw,
OFPacketIn pi,
boolean useBufferId,
int outport,
FloodlightContext cntx)
Pushes a packet-out to a switch. |
boolean |
pushRoute(Route route,
OFMatch match,
java.util.EnumSet<OFOXMFieldType> nonWildcards,
OFPacketIn pi,
long pinSwitch,
long cookie,
FloodlightContext cntx,
boolean reqeustFlowRemovedNotifn,
boolean doFlush,
byte flowModCommand)
Push routes from back to front |
IListener.Command |
receive(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx)
This is the method Floodlight uses to call listeners with OpenFlow messages |
protected void |
startUp()
Adds a listener for devicemanager and registers for PacketIns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
protected static int OFMESSAGE_DAMPER_CAPACITY
protected static int OFMESSAGE_DAMPER_TIMEOUT
public static short FLOWMOD_DEFAULT_IDLE_TIMEOUT
public static short FLOWMOD_DEFAULT_HARD_TIMEOUT
public static final short FLOWMOD_DEFAULT_IDLE_TIMEOUT_CONSTANT
public static final short FLOWMOD_DEFAULT_HARD_TIMEOUT_CONSTANT
protected IFloodlightProviderService floodlightProvider
protected IDeviceService deviceManager
protected IRoutingService routingEngine
protected ITopologyService topology
protected ICounterStoreService counterStore
protected OFMessageDamper messageDamper
protected boolean broadcastCacheFeature
public final int prime1
public static final int prime2
public TimedCache<java.lang.Long> broadcastCache
public static final int FORWARDING_APP_ID
public static final long appCookie
public java.util.Comparator<SwitchPort> clusterIdComparator
Constructor Detail |
---|
public ForwardingBase()
Method Detail |
---|
protected void init()
protected void startUp()
public java.lang.String getName()
getName
in interface IListener<OFType>
public abstract IListener.Command processPacketInMessage(IOFSwitch sw, OFPacketIn pi, IRoutingDecision decision, FloodlightContext cntx)
sw
- Switch that the packet came in frompi
- The packet that came indecision
- Any decision made by a policy enginepublic IListener.Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
IOFMessageListener
receive
in interface IOFMessageListener
sw
- the OpenFlow switch that sent this messagemsg
- the messagecntx
- a Floodlight message context object you can use to pass
information between listeners
public boolean pushRoute(Route route, OFMatch match, java.util.EnumSet<OFOXMFieldType> nonWildcards, OFPacketIn pi, long pinSwitch, long cookie, FloodlightContext cntx, boolean reqeustFlowRemovedNotifn, boolean doFlush, byte flowModCommand)
route
- Route to pushmatch
- OpenFlow fields to match onsrcSwPort
- Source switch port for the first hopdstSwPort
- Destination switch port for final hopcookie
- The cookie to set in each flow_modcntx
- The floodlight contextreqeustFlowRemovedNotifn
- if set to true then the switch would
send a flow mod removal notification when the flow mod expiresdoFlush
- if set to true then the flow mod would be immediately
written to the switchflowModCommand
- flow mod. command to use, e.g. OFFlowMod.OFPFC_ADD,
OFFlowMod.OFPFC_MODIFY etc.
protected void pushPacket(IOFSwitch sw, OFPacketIn pi, boolean useBufferId, int outport, FloodlightContext cntx)
packet
- packet data to send.sw
- switch from which packet-out is sentbufferId
- bufferIdinPort
- input portoutPort
- output portcntx
- context of the packetflush
- force to flush the packet.public void packetOutMultiPort(byte[] packetData, IOFSwitch sw, int inPort, java.util.Set<java.lang.Integer> outPorts, FloodlightContext cntx)
packetData
- sw
- inPort
- ports
- cntx
- public void packetOutMultiPort(OFPacketIn pi, IOFSwitch sw, int inPort, java.util.Set<java.lang.Integer> outPorts, FloodlightContext cntx)
Accepts a PacketIn instead of raw packet data. Note that the inPort
and switch can be different than the packet in switch/port
public void packetOutMultiPort(IPacket packet, IOFSwitch sw, int inPort, java.util.Set<java.lang.Integer> outPorts, FloodlightContext cntx)
Accepts an IPacket instead of raw packet data. Note that the inPort
and switch can be different than the packet in switch/port
protected boolean isInBroadcastCache(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
protected boolean isInSwitchBroadcastCache(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
public static boolean blockHost(IFloodlightProviderService floodlightProvider, SwitchPort sw_tup, long host_mac, short hardTimeout, long cookie)
public boolean isCallbackOrderingPrereq(OFType type, java.lang.String name)
IListener
isCallbackOrderingPrereq
in interface IListener<OFType>
type
- the object type to which this appliesname
- the name of the module
public boolean isCallbackOrderingPostreq(OFType type, java.lang.String name)
IListener
isCallbackOrderingPostreq
in interface IListener<OFType>
type
- the object type to which this appliesname
- the name of the module
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |