|
||||||||||
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 IOFSwitch
name
- 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 IOFSwitch
name
- name of property
public void setAttribute(java.lang.String name, java.lang.Object value)
IOFSwitch
setAttribute
in interface IOFSwitch
name
- name of propertyvalue
- value for namepublic java.lang.Object removeAttribute(java.lang.String name)
IOFSwitch
removeAttribute
in interface IOFSwitch
name
- name of property
public boolean hasAttribute(java.lang.String name)
IOFSwitch
hasAttribute
in interface IOFSwitch
name
- name of property
public void setChannel(org.jboss.netty.channel.Channel channel)
IOFSwitch
setChannel
in interface IOFSwitch
protected 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 IOFSwitch
java.io.IOException
public void writeThrottled(java.util.List<OFMessage> msglist, FloodlightContext bc) throws java.io.IOException
IOFSwitch
writeThrottled
in interface IOFSwitch
java.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 IOFSwitch
protected void write(java.util.List<OFMessage> msglist)
msglist
-
java.io.IOException
public void disconnectOutputStream()
disconnectOutputStream
in interface IOFSwitch
public void setFeaturesReply(OFFeaturesReply featuresReply)
IOFSwitch
setFeaturesReply
in interface IOFSwitch
public void setPortDescriptions(java.util.List<OFPortDescription> portDescriptions)
IOFSwitch
setPortDescriptions
in interface IOFSwitch
public java.util.Collection<ImmutablePort> getEnabledPorts()
IOFSwitch
getEnabledPorts
in interface IOFSwitch
public java.util.Collection<java.lang.Integer> getEnabledPortNumbers()
IOFSwitch
getEnabledPortNumbers
in interface IOFSwitch
public ImmutablePort getPort(int portNumber)
IOFSwitch
getPort
in interface IOFSwitch
public ImmutablePort getPort(java.lang.String portName)
IOFSwitch
getPort
in interface IOFSwitch
public OrderedCollection<IOFSwitch.PortChangeEvent> processOFPortStatus(OFPortStatus ps)
IOFSwitch
processOFPortStatus
in interface IOFSwitch
ps
- the port status message
public java.util.Collection<ImmutablePort> getPorts()
IOFSwitch
getPorts
in interface IOFSwitch
public OrderedCollection<IOFSwitch.PortChangeEvent> comparePorts(java.util.Collection<ImmutablePort> ports)
IOFSwitch
comparePorts
in interface IOFSwitch
ports
- new ports to set
public OrderedCollection<IOFSwitch.PortChangeEvent> setPorts(java.util.Collection<ImmutablePort> ports)
IOFSwitch
setPorts
in interface IOFSwitch
ports
- new ports to set
public boolean portEnabled(int portNumber)
portEnabled
in interface IOFSwitch
public boolean portEnabled(java.lang.String portName)
portEnabled
in interface IOFSwitch
public long getId()
IOFSwitch
getId
in interface IOFSwitch
public java.lang.String getStringId()
IOFSwitch
getStringId
in interface IOFSwitch
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getAttributes()
IOFSwitch
getAttributes
in interface IOFSwitch
public java.util.Date getConnectedSince()
IOFSwitch
getConnectedSince
in interface IOFSwitch
public int getNextTransactionId()
IOFSwitch
getNextTransactionId
in interface IOFSwitch
public void sendStatsQuery(OFStatisticsRequest request, int xid, IOFMessageListener caller) throws java.io.IOException
IOFSwitch
sendStatsQuery
in interface IOFSwitch
request
- 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 IOFSwitch
request
- statistics request
java.io.IOException
public void deliverStatisticsReply(OFStatisticsReply reply)
IOFSwitch
deliverStatisticsReply
in interface IOFSwitch
reply
- the reply to deliverpublic void cancelStatisticsReply(int transactionId)
IOFSwitch
cancelStatisticsReply
in interface IOFSwitch
transactionId
- the transaction IDpublic void cancelAllStatisticsReplies()
IOFSwitch
cancelAllStatisticsReplies
in interface IOFSwitch
public 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 IOFSwitch
IDebugCounterService.CounterException
public boolean isConnected()
IOFSwitch
isConnected
in interface IOFSwitch
public boolean isActive()
IOFSwitch
isActive
in interface IOFSwitch
public void setConnected(boolean connected)
IOFSwitch
setConnected
in interface IOFSwitch
connected
- whether the switch is connectedpublic IFloodlightProviderService.Role getHARole()
IOFSwitch
getHARole
in interface IOFSwitch
public void setHARole(IFloodlightProviderService.Role role)
IOFSwitch
setHARole
in interface IOFSwitch
public void clearAllFlowMods()
IOFSwitch
clearAllFlowMods
in interface IOFSwitch
public boolean updateBroadcastCache(java.lang.Long entry, java.lang.Integer port)
IOFSwitch
updateBroadcastCache
in interface IOFSwitch
public java.util.Map<java.lang.Integer,java.lang.Long> getPortBroadcastHits()
IOFSwitch
getPortBroadcastHits
in interface IOFSwitch
public void flush()
IOFSwitch
flush
in interface IOFSwitch
public 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 IOFSwitch
java.io.IOException
public void deliverOFFeaturesReply(OFMessage reply)
IOFSwitch
deliverOFFeaturesReply
in interface IOFSwitch
reply
- the reply to deliverpublic void cancelFeaturesReply(int transactionId)
cancelFeaturesReply
in interface IOFSwitch
public int getBuffers()
IOFSwitch
getBuffers
in interface IOFSwitch
public int getActions()
getActions
in interface IOFSwitch
public int getCapabilities()
getCapabilities
in interface IOFSwitch
public byte getTables()
getTables
in interface IOFSwitch
public OFDescriptionStatistics getDescriptionStatistics()
getDescriptionStatistics
in interface IOFSwitch
public 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 IOFSwitch
public boolean inputThrottled(OFMessage ofm)
inputThrottled
in interface IOFSwitch
ofm
-
public void setTableFull(boolean isFull)
IOFSwitch
setTableFull
in interface IOFSwitch
public short getAccessFlowPriority()
IOFSwitch
getAccessFlowPriority
in interface IOFSwitch
public short getCoreFlowPriority()
IOFSwitch
getCoreFlowPriority
in interface IOFSwitch
public void setAccessFlowPriority(short accessFlowPriority)
IOFSwitch
setAccessFlowPriority
in interface IOFSwitch
public void setCoreFlowPriority(short coreFlowPriority)
IOFSwitch
setCoreFlowPriority
in interface IOFSwitch
public void startDriverHandshake()
IOFSwitch
startDriverHandshake
in interface IOFSwitch
public boolean isDriverHandshakeComplete()
IOFSwitch
isDriverHandshakeComplete
in interface IOFSwitch
public void processDriverHandshakeMessage(OFMessage m)
IOFSwitch
processDriverHandshakeMessage
in interface IOFSwitch
m
- The message that the driver should process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |