|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.floodlightcontroller.core.OFSwitchBase
public abstract class OFSwitchBase
This is the internal representation of an openflow switch.
| Nested Class Summary | |
|---|---|
protected class |
OFSwitchBase.PortManager
Manages the ports of this switch. |
| Nested classes/interfaces inherited from interface net.floodlightcontroller.core.IOFSwitch |
|---|
IOFSwitch.OFPortType, IOFSwitch.PortChangeEvent, IOFSwitch.PortChangeType |
| Field Summary | |
|---|---|
protected short |
accessFlowPriority
|
protected int |
actions
|
protected java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> |
attributes
|
protected int |
buffers
|
protected int |
capabilities
|
protected org.jboss.netty.channel.Channel |
channel
|
protected java.util.Date |
connectedSince
|
protected short |
coreFlowPriority
|
protected long |
datapathId
|
protected IDebugCounterService |
debugCounters
|
protected OFDescriptionStatistics |
description
|
protected IFloodlightProviderService |
floodlightProvider
|
protected static java.lang.ThreadLocal<java.util.Map<IOFSwitch,java.util.List<OFMessage>>> |
local_msg_buffer
|
protected static org.slf4j.Logger |
log
|
static int |
OFSWITCH_APP_ID
|
protected boolean |
packetInThrottleEnabled
|
protected java.lang.String |
stringId
|
protected byte |
tables
|
protected IThreadPoolService |
threadPool
|
| Fields inherited from interface net.floodlightcontroller.core.IOFSwitch |
|---|
PROP_REQUIRES_L3_MATCH, PROP_SUPPORTS_NETMASK_TBL, PROP_SUPPORTS_OFPP_FLOOD, PROP_SUPPORTS_OFPP_TABLE, SWITCH_DESCRIPTION_FUTURE, SWITCH_IS_CORE_SWITCH, SWITCH_SUPPORTS_NX_ROLE |
| Constructor Summary | |
|---|---|
OFSwitchBase()
|
|
| Method Summary | |
|---|---|
boolean |
attributeEquals(java.lang.String name,
java.lang.Object other)
Check if the given attribute is present and if so whether it is equal to "other" |
void |
cancelAllStatisticsReplies()
Cancel all statistics replies |
void |
cancelFeaturesReply(int transactionId)
|
void |
cancelStatisticsReply(int transactionId)
Cancel the statistics reply with the given transaction ID |
void |
clearAllFlowMods()
Clear all flowmods on this switch |
OrderedCollection<IOFSwitch.PortChangeEvent> |
comparePorts(java.util.Collection<ImmutablePort> ports)
Compute the changes that would be required to replace the old ports of this switch with the new ports |
void |
deliverOFFeaturesReply(OFMessage reply)
Deliver the featuresReply future reply |
void |
deliverStatisticsReply(OFStatisticsReply reply)
Deliver the statistics future reply |
void |
disconnectOutputStream()
|
protected void |
enableWriteThrottle(boolean enable)
|
static void |
flush_all()
|
void |
flush()
Flush all flows queued for this switch in the current thread. |
short |
getAccessFlowPriority()
Get the suggested priority to use when installing access flows in this switch. |
int |
getActions()
|
java.lang.Object |
getAttribute(java.lang.String name)
Set properties for switch specific behavior |
java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> |
getAttributes()
Retrieves attributes of this switch |
int |
getBuffers()
Returns switch features from features Reply |
int |
getCapabilities()
|
java.util.Date |
getConnectedSince()
Retrieves the date the switch connected to this controller |
short |
getCoreFlowPriority()
Get the suggested priority to use when installing core flows in this switch. |
OFDescriptionStatistics |
getDescriptionStatistics()
|
java.util.Collection<java.lang.Integer> |
getEnabledPortNumbers()
Get list of the port numbers of all enabled ports. |
java.util.Collection<ImmutablePort> |
getEnabledPorts()
Get list of all enabled ports. |
IFloodlightProviderService.Role |
getHARole()
Get the current role of the controller for the switch |
long |
getId()
Get the datapathId of the switch |
java.net.SocketAddress |
getInetAddress()
Get the IP Address for the switch |
int |
getNextTransactionId()
Returns the next available transaction id |
ImmutablePort |
getPort(int portNumber)
Retrieve the port object by the port number. |
ImmutablePort |
getPort(java.lang.String portName)
Retrieve the port object by the port name. |
java.util.Map<java.lang.Integer,java.lang.Long> |
getPortBroadcastHits()
Get the portBroadcastCacheHits |
java.util.Collection<ImmutablePort> |
getPorts()
Get list of all ports. |
java.lang.String |
getStringId()
Get a string version of the ID for this switch |
byte |
getTables()
|
boolean |
hasAttribute(java.lang.String name)
Checks if a specific switch property exists for this switch |
boolean |
inputThrottled(OFMessage ofm)
Determine if this message should be dropped. |
boolean |
isActive()
Check if the switch is active. |
boolean |
isConnected()
Check if the switch is connected to this controller. |
boolean |
isDriverHandshakeComplete()
Check if the sub-handshake for this switch driver has been completed. |
boolean |
isOverloaded()
Return if switch has exceeded the high threshold of packet in rate. |
boolean |
isWriteThrottleEnabled()
Return whether write throttling is enabled on the switch |
boolean |
portEnabled(int portNumber)
|
boolean |
portEnabled(java.lang.String portName)
|
void |
processDriverHandshakeMessage(OFMessage m)
Pass the given OFMessage to the driver as part of this driver's sub-handshake. |
OrderedCollection<IOFSwitch.PortChangeEvent> |
processOFPortStatus(OFPortStatus ps)
Add or modify a switch port. |
java.util.concurrent.Future<java.util.List<OFStatistics>> |
queryStatistics(OFStatisticsRequest request)
Returns a Future object that can be used to retrieve the asynchronous OFStatisticsReply when it is available. |
java.util.concurrent.Future<OFFeaturesReply> |
querySwitchFeaturesReply()
Returns a Future object that can be used to retrieve the asynchronous OFStatisticsReply when it is available. |
java.lang.Object |
removeAttribute(java.lang.String name)
Set properties for switch specific behavior |
void |
sendStatsQuery(OFStatisticsRequest request,
int xid,
IOFMessageListener caller)
Send a flow statistics request to the switch. |
void |
setAccessFlowPriority(short accessFlowPriority)
Set the suggested priority to use when installing access flows in this switch. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set properties for switch specific behavior |
void |
setChannel(org.jboss.netty.channel.Channel channel)
Set the netty Channel this switch instance is associated with Called immediately after instantiation |
void |
setConnected(boolean connected)
Set whether the switch is connected |
void |
setCoreFlowPriority(short coreFlowPriority)
Set the suggested priority to use when installing core flows in this switch. |
void |
setDebugCounterService(IDebugCounterService debugCounters)
Set debug counter service for per-switch counters Called immediately after instantiation |
void |
setFeaturesReply(OFFeaturesReply featuresReply)
Set the OFFeaturesReply message returned by the switch during initial handshake. |
void |
setFloodlightProvider(Controller controller)
Set IFloodlightProviderService for this switch instance Called immediately after instantiation |
void |
setFloodlightProvider(IFloodlightProviderService floodlightProvider)
|
void |
setHARole(IFloodlightProviderService.Role role)
Set switch's HA role to role. |
protected void |
setInputThrottleThresholds(int pktInHigh,
int pktInLow,
int pktInPerMac,
int pktInPerPort)
For switch drivers to set thresholds, all rates in per second |
void |
setPortDescriptions(java.util.List<OFPortDescription> portDescriptions)
Set the OFFeaturesReply message returned by the switch during initial handshake. |
OrderedCollection<IOFSwitch.PortChangeEvent> |
setPorts(java.util.Collection<ImmutablePort> ports)
Replace the ports of this switch with the given ports. |
void |
setTableFull(boolean isFull)
Set the flow table full flag in the switch |
void |
setThreadPoolService(IThreadPoolService tp)
Set IThreadPoolService for this switch instance Called immediately after instantiation |
void |
startDriverHandshake()
Start this switch driver's sub handshake. |
java.lang.String |
toString()
|
boolean |
updateBroadcastCache(java.lang.Long entry,
java.lang.Integer port)
Update broadcast cache |
protected void |
write(java.util.List<OFMessage> msglist)
Not callable by writers, but allow IOFSwitch implementation to override |
void |
write(java.util.List<OFMessage> msglist,
FloodlightContext bc)
Writes the list of messages to the output stream, bypassing rate limiting. |
void |
write(OFMessage m,
FloodlightContext bc)
Writes to the OFMessage to the output stream, bypassing rate limiting. |
void |
writeThrottled(java.util.List<OFMessage> msglist,
FloodlightContext bc)
Writes the list of messages to the output stream, subject to rate limiting. |
void |
writeThrottled(OFMessage m,
FloodlightContext bc)
Write OFMessage to the output stream, subject to switch rate limiting. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.floodlightcontroller.core.IOFSwitch |
|---|
getPortType, isFastPort, setSwitchProperties |
| Field Detail |
|---|
protected static final org.slf4j.Logger log
protected java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> attributes
protected IFloodlightProviderService floodlightProvider
protected IThreadPoolService threadPool
protected IDebugCounterService debugCounters
protected volatile java.util.Date connectedSince
protected int capabilities
protected int buffers
protected int actions
protected byte tables
protected long datapathId
protected java.lang.String stringId
protected short accessFlowPriority
protected short coreFlowPriority
protected org.jboss.netty.channel.Channel channel
protected boolean packetInThrottleEnabled
protected OFDescriptionStatistics description
protected static final java.lang.ThreadLocal<java.util.Map<IOFSwitch,java.util.List<OFMessage>>> local_msg_buffer
public static final int OFSWITCH_APP_ID
| Constructor Detail |
|---|
public OFSwitchBase()
| Method Detail |
|---|
public boolean attributeEquals(java.lang.String name,
java.lang.Object other)
IOFSwitch
attributeEquals in interface IOFSwitchname - the name of the attribute to checkother - the object to compare the attribute against.
public java.lang.Object getAttribute(java.lang.String name)
IOFSwitch
getAttribute in interface IOFSwitchname - name of property
public void setAttribute(java.lang.String name,
java.lang.Object value)
IOFSwitch
setAttribute in interface IOFSwitchname - name of propertyvalue - value for namepublic java.lang.Object removeAttribute(java.lang.String name)
IOFSwitch
removeAttribute in interface IOFSwitchname - name of property
public boolean hasAttribute(java.lang.String name)
IOFSwitch
hasAttribute in interface IOFSwitchname - name of property
public void setChannel(org.jboss.netty.channel.Channel channel)
IOFSwitch
setChannel in interface IOFSwitchprotected void enableWriteThrottle(boolean enable)
public boolean isWriteThrottleEnabled()
IOFSwitch
isWriteThrottleEnabled in interface IOFSwitch
public void writeThrottled(OFMessage m,
FloodlightContext bc)
throws java.io.IOException
IOFSwitch
writeThrottled in interface IOFSwitchjava.io.IOException
public void writeThrottled(java.util.List<OFMessage> msglist,
FloodlightContext bc)
throws java.io.IOException
IOFSwitch
writeThrottled in interface IOFSwitchjava.io.IOException
public void write(OFMessage m,
FloodlightContext bc)
IOFSwitch
write in interface IOFSwitch
public void write(java.util.List<OFMessage> msglist,
FloodlightContext bc)
IOFSwitch
write in interface IOFSwitchprotected void write(java.util.List<OFMessage> msglist)
msglist -
java.io.IOExceptionpublic void disconnectOutputStream()
disconnectOutputStream in interface IOFSwitchpublic void setFeaturesReply(OFFeaturesReply featuresReply)
IOFSwitch
setFeaturesReply in interface IOFSwitchpublic void setPortDescriptions(java.util.List<OFPortDescription> portDescriptions)
IOFSwitch
setPortDescriptions in interface IOFSwitchpublic java.util.Collection<ImmutablePort> getEnabledPorts()
IOFSwitch
getEnabledPorts in interface IOFSwitchpublic java.util.Collection<java.lang.Integer> getEnabledPortNumbers()
IOFSwitch
getEnabledPortNumbers in interface IOFSwitchpublic ImmutablePort getPort(int portNumber)
IOFSwitch
getPort in interface IOFSwitchpublic ImmutablePort getPort(java.lang.String portName)
IOFSwitch
getPort in interface IOFSwitchpublic OrderedCollection<IOFSwitch.PortChangeEvent> processOFPortStatus(OFPortStatus ps)
IOFSwitch
processOFPortStatus in interface IOFSwitchps - the port status message
public java.util.Collection<ImmutablePort> getPorts()
IOFSwitch
getPorts in interface IOFSwitchpublic OrderedCollection<IOFSwitch.PortChangeEvent> comparePorts(java.util.Collection<ImmutablePort> ports)
IOFSwitch
comparePorts in interface IOFSwitchports - new ports to set
public OrderedCollection<IOFSwitch.PortChangeEvent> setPorts(java.util.Collection<ImmutablePort> ports)
IOFSwitch
setPorts in interface IOFSwitchports - new ports to set
public boolean portEnabled(int portNumber)
portEnabled in interface IOFSwitchpublic boolean portEnabled(java.lang.String portName)
portEnabled in interface IOFSwitchpublic long getId()
IOFSwitch
getId in interface IOFSwitchpublic java.lang.String getStringId()
IOFSwitch
getStringId in interface IOFSwitchpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getAttributes()
IOFSwitch
getAttributes in interface IOFSwitchpublic java.util.Date getConnectedSince()
IOFSwitch
getConnectedSince in interface IOFSwitchpublic int getNextTransactionId()
IOFSwitch
getNextTransactionId in interface IOFSwitch
public void sendStatsQuery(OFStatisticsRequest request,
int xid,
IOFMessageListener caller)
throws java.io.IOException
IOFSwitch
sendStatsQuery in interface IOFSwitchrequest - flow statistics request messagexid - transaction id, must be obtained by using the getXid() API.caller - the caller of the API. receive() callback of this
caller would be called when the reply from the switch is received.
java.io.IOException
public java.util.concurrent.Future<java.util.List<OFStatistics>> queryStatistics(OFStatisticsRequest request)
throws java.io.IOException
IOFSwitch
queryStatistics in interface IOFSwitchrequest - statistics request
java.io.IOExceptionpublic void deliverStatisticsReply(OFStatisticsReply reply)
IOFSwitch
deliverStatisticsReply in interface IOFSwitchreply - the reply to deliverpublic void cancelStatisticsReply(int transactionId)
IOFSwitch
cancelStatisticsReply in interface IOFSwitchtransactionId - the transaction IDpublic void cancelAllStatisticsReplies()
IOFSwitch
cancelAllStatisticsReplies in interface IOFSwitchpublic void setFloodlightProvider(IFloodlightProviderService floodlightProvider)
floodlightProvider - the floodlightProvider to setpublic void setThreadPoolService(IThreadPoolService tp)
IOFSwitch
setThreadPoolService in interface IOFSwitch
public void setDebugCounterService(IDebugCounterService debugCounters)
throws IDebugCounterService.CounterException
IOFSwitch
setDebugCounterService in interface IOFSwitchIDebugCounterService.CounterExceptionpublic boolean isConnected()
IOFSwitch
isConnected in interface IOFSwitchpublic boolean isActive()
IOFSwitch
isActive in interface IOFSwitchpublic void setConnected(boolean connected)
IOFSwitch
setConnected in interface IOFSwitchconnected - whether the switch is connectedpublic IFloodlightProviderService.Role getHARole()
IOFSwitch
getHARole in interface IOFSwitchpublic void setHARole(IFloodlightProviderService.Role role)
IOFSwitch
setHARole in interface IOFSwitchpublic void clearAllFlowMods()
IOFSwitch
clearAllFlowMods in interface IOFSwitch
public boolean updateBroadcastCache(java.lang.Long entry,
java.lang.Integer port)
IOFSwitch
updateBroadcastCache in interface IOFSwitchpublic java.util.Map<java.lang.Integer,java.lang.Long> getPortBroadcastHits()
IOFSwitch
getPortBroadcastHits in interface IOFSwitchpublic void flush()
IOFSwitch
flush in interface IOFSwitchpublic static void flush_all()
public java.net.SocketAddress getInetAddress()
getInetAddress in interface IOFSwitch
public java.util.concurrent.Future<OFFeaturesReply> querySwitchFeaturesReply()
throws java.io.IOException
IOFSwitch
querySwitchFeaturesReply in interface IOFSwitchjava.io.IOExceptionpublic void deliverOFFeaturesReply(OFMessage reply)
IOFSwitch
deliverOFFeaturesReply in interface IOFSwitchreply - the reply to deliverpublic void cancelFeaturesReply(int transactionId)
cancelFeaturesReply in interface IOFSwitchpublic int getBuffers()
IOFSwitch
getBuffers in interface IOFSwitchpublic int getActions()
getActions in interface IOFSwitchpublic int getCapabilities()
getCapabilities in interface IOFSwitchpublic byte getTables()
getTables in interface IOFSwitchpublic OFDescriptionStatistics getDescriptionStatistics()
getDescriptionStatistics in interface IOFSwitchpublic void setFloodlightProvider(Controller controller)
IOFSwitch
setFloodlightProvider in interface IOFSwitch
protected void setInputThrottleThresholds(int pktInHigh,
int pktInLow,
int pktInPerMac,
int pktInPerPort)
pktInHigh - - above this start throttlingpktInLow - - below this stop throttlingpktInPerMac - - block host if unique pktIn rate reaches thispktInPerPort - - block port if unique pktIn rate reaches thispublic boolean isOverloaded()
isOverloaded in interface IOFSwitchpublic boolean inputThrottled(OFMessage ofm)
inputThrottled in interface IOFSwitchofm -
public void setTableFull(boolean isFull)
IOFSwitch
setTableFull in interface IOFSwitchpublic short getAccessFlowPriority()
IOFSwitch
getAccessFlowPriority in interface IOFSwitchpublic short getCoreFlowPriority()
IOFSwitch
getCoreFlowPriority in interface IOFSwitchpublic void setAccessFlowPriority(short accessFlowPriority)
IOFSwitch
setAccessFlowPriority in interface IOFSwitchpublic void setCoreFlowPriority(short coreFlowPriority)
IOFSwitch
setCoreFlowPriority in interface IOFSwitchpublic void startDriverHandshake()
IOFSwitch
startDriverHandshake in interface IOFSwitchpublic boolean isDriverHandshakeComplete()
IOFSwitch
isDriverHandshakeComplete in interface IOFSwitchpublic void processDriverHandshakeMessage(OFMessage m)
IOFSwitch
processDriverHandshakeMessage in interface IOFSwitchm - The message that the driver should process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||