Open Kilda Java Documentation
org.openkilda.floodlight.switchmanager.SwitchManager Class Reference
Inheritance diagram for org.openkilda.floodlight.switchmanager.SwitchManager:
org.openkilda.floodlight.switchmanager.ISwitchManager

Public Member Functions

Collection< Class<? extends IFloodlightService > > getModuleServices ()
 
Map< Class<? extends IFloodlightService >, IFloodlightService > getServiceImpls ()
 
Collection< Class<? extends IFloodlightService > > getModuleDependencies ()
 
void init (FloodlightModuleContext context) throws FloodlightModuleException
 
void startUp (FloodlightModuleContext context) throws FloodlightModuleException
 
Command receive (IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
 
String getName ()
 
boolean isCallbackOrderingPrereq (OFType type, String name)
 
boolean isCallbackOrderingPostreq (OFType type, String name)
 
ConnectModeRequest.Mode connectMode (final ConnectModeRequest.Mode mode)
 
void installDefaultRules (final DatapathId dpid) throws SwitchOperationException
 
long installIngressFlow (final DatapathId dpid, final String flowId, final Long cookie, final int inputPort, final int outputPort, final int inputVlanId, final int transitVlanId, final OutputVlanType outputVlanType, final long meterId) throws SwitchOperationException
 
long installEgressFlow (final DatapathId dpid, String flowId, final Long cookie, final int inputPort, final int outputPort, final int transitVlanId, final int outputVlanId, final OutputVlanType outputVlanType) throws SwitchOperationException
 
long installTransitFlow (final DatapathId dpid, final String flowId, final Long cookie, final int inputPort, final int outputPort, final int transitVlanId) throws SwitchOperationException
 
long installOneSwitchFlow (final DatapathId dpid, final String flowId, final Long cookie, final int inputPort, final int outputPort, final int inputVlanId, final int outputVlanId, final OutputVlanType outputVlanType, final long meterId) throws SwitchOperationException
 
List< OFFlowStatsEntry > dumpFlowTable (final DatapathId dpid)
 
OFMeterConfigStatsReply dumpMeters (final DatapathId dpid) throws SwitchOperationException
 
long installMeter (final DatapathId dpid, final long bandwidth, final long burstSize, final long meterId) throws SwitchOperationException
 
Map< DatapathId, IOFSwitch > getAllSwitchMap ()
 
long deleteMeter (final DatapathId dpid, final long meterId) throws SwitchOperationException
 
List< Long > deleteAllNonDefaultRules (final DatapathId dpid) throws SwitchOperationException
 
List< Long > deleteRulesByCriteria (final DatapathId dpid, DeleteRulesCriteria... criteria) throws SwitchOperationException
 
List< Long > deleteDefaultRules (final DatapathId dpid) throws SwitchOperationException
 
void installVerificationRule (final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException
 
void installDropFlowCustom (final DatapathId dpid, String dstMac, String dstMask, final long cookie, final int priority) throws SwitchOperationException
 
void installDropFlow (final DatapathId dpid) throws SwitchOperationException
 
void startSafeMode (final DatapathId dpid)
 
void stopSafeMode (final DatapathId dpid)
 
void safeModeTick ()
 
void sendSwitchActivate (final IOFSwitch sw) throws SwitchOperationException
 
void sendPortUpEvents (final IOFSwitch sw) throws SwitchOperationException
 
void configurePort (DatapathId dpId, int portNumber, Boolean portAdminDown) throws SwitchOperationException
 

Static Public Attributes

static final long FLOW_COOKIE_MASK = 0x7FFFFFFFFFFFFFFFL
 
static final int VERIFICATION_RULE_PRIORITY = FlowModUtils.PRIORITY_MAX - 1000
 
static final int DEFAULT_RULE_PRIORITY = FlowModUtils.PRIORITY_HIGH
 

Additional Inherited Members

- Public Attributes inherited from org.openkilda.floodlight.switchmanager.ISwitchManager
String OVS_MANUFACTURER = "Nicira, Inc."
 
long DROP_RULE_COOKIE = 0x8000000000000001L
 
long VERIFICATION_BROADCAST_RULE_COOKIE = 0x8000000000000002L
 
long VERIFICATION_UNICAST_RULE_COOKIE = 0x8000000000000003L
 

Detailed Description

Created by jonv on 29/3/17.

Definition at line 120 of file SwitchManager.java.

Member Function Documentation

◆ configurePort()

void org.openkilda.floodlight.switchmanager.SwitchManager.configurePort ( DatapathId  dpId,
int  portNumber,
Boolean  portAdminDown 
) throws SwitchOperationException

Configure switch port.
Configurations

  • UP/DOWN port
  • Change port speed
Parameters
dpIddatapath ID of the switch.
portNumberthe port to configure.
portAdminDownthe port status to be applied.
Exceptions
SwitchOperationExceptionSwitch not found or Port not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 1484 of file SwitchManager.java.

◆ connectMode()

ConnectModeRequest.Mode org.openkilda.floodlight.switchmanager.SwitchManager.connectMode ( final ConnectModeRequest.Mode  mode)

Set connection mode.

Parameters
modethe mode to use, if not null
Returns
the connection mode after the set operation (if not null)

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 290 of file SwitchManager.java.

◆ deleteAllNonDefaultRules()

List<Long> org.openkilda.floodlight.switchmanager.SwitchManager.deleteAllNonDefaultRules ( final DatapathId  dpid) throws SwitchOperationException

Deletes all non-default rules from the switch.

Parameters
dpiddatapath ID of the switch
Returns
the list of cookies for removed rules
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 594 of file SwitchManager.java.

◆ deleteDefaultRules()

List<Long> org.openkilda.floodlight.switchmanager.SwitchManager.deleteDefaultRules ( final DatapathId  dpid) throws SwitchOperationException

Deletes the default rules (drop + verification) from the switch.

Parameters
dpiddatapath ID of the switch
Returns
the list of cookies for removed rules
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 680 of file SwitchManager.java.

◆ deleteMeter()

long org.openkilda.floodlight.switchmanager.SwitchManager.deleteMeter ( final DatapathId  dpid,
final long  meterId 
) throws SwitchOperationException

Deletes the meter from the switch OF_13.

Parameters
dpiddatapath ID of the switch
meterIdmeter identifier
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 571 of file SwitchManager.java.

◆ deleteRulesByCriteria()

List<Long> org.openkilda.floodlight.switchmanager.SwitchManager.deleteRulesByCriteria ( final DatapathId  dpid,
DeleteRulesCriteria...  criteria 
) throws SwitchOperationException

Delete rules that match the criteria.

Parameters
dpiddatapath ID of the switch
criteriathe list of delete criteria
Returns
the list of removed cookies
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 649 of file SwitchManager.java.

◆ dumpFlowTable()

List<OFFlowStatsEntry> org.openkilda.floodlight.switchmanager.SwitchManager.dumpFlowTable ( final DatapathId  dpid)

Returns list of installed flows.

Parameters
dpidswitch id
Returns
OF flow stats entries

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 467 of file SwitchManager.java.

◆ dumpMeters()

OFMeterConfigStatsReply org.openkilda.floodlight.switchmanager.SwitchManager.dumpMeters ( final DatapathId  dpid) throws SwitchOperationException

Returns list of installed meters.

Parameters
dpidswitch id
Returns
OF meter config stats entries
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 500 of file SwitchManager.java.

◆ getAllSwitchMap()

Map<DatapathId, IOFSwitch> org.openkilda.floodlight.switchmanager.SwitchManager.getAllSwitchMap ( )

◆ getModuleDependencies()

Collection<Class<? extends IFloodlightService> > org.openkilda.floodlight.switchmanager.SwitchManager.getModuleDependencies ( )

Definition at line 196 of file SwitchManager.java.

◆ getModuleServices()

Collection<Class<? extends IFloodlightService> > org.openkilda.floodlight.switchmanager.SwitchManager.getModuleServices ( )

Definition at line 176 of file SwitchManager.java.

◆ getName()

String org.openkilda.floodlight.switchmanager.SwitchManager.getName ( )

Definition at line 262 of file SwitchManager.java.

◆ getServiceImpls()

Map<Class<? extends IFloodlightService>, IFloodlightService> org.openkilda.floodlight.switchmanager.SwitchManager.getServiceImpls ( )

Definition at line 186 of file SwitchManager.java.

◆ init()

void org.openkilda.floodlight.switchmanager.SwitchManager.init ( FloodlightModuleContext  context) throws FloodlightModuleException

Definition at line 208 of file SwitchManager.java.

◆ installDefaultRules()

void org.openkilda.floodlight.switchmanager.SwitchManager.installDefaultRules ( final DatapathId  dpid) throws SwitchOperationException

Adds default rules to install verification rules and final drop rule. Essentially, it calls installDropFlow and installVerificationRule twice (ie isBroadcast)

Parameters
dpiddatapathId of switch
Exceptions
SwitchOperationExceptionin case of errors

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 301 of file SwitchManager.java.

◆ installDropFlow()

void org.openkilda.floodlight.switchmanager.SwitchManager.installDropFlow ( final DatapathId  dpid) throws SwitchOperationException

Installs the default drop rule.

Parameters
dpiddatapathId of switch
Exceptions
SwitchOperationExceptionin case of errors

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 747 of file SwitchManager.java.

◆ installDropFlowCustom()

void org.openkilda.floodlight.switchmanager.SwitchManager.installDropFlowCustom ( final DatapathId  dpid,
String  dstMac,
String  dstMask,
final long  cookie,
final int  priority 
) throws SwitchOperationException

Installs custom drop rule .. ie cookie, priority, match

Parameters
dpiddatapathId of switch
dstMacDestination Mac address to match on
dstMaskDestination Mask to match on
cookieCookie to use for this rule
priorityPriority of the rule
Exceptions
SwitchOperationExceptionswitch operation exception

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 731 of file SwitchManager.java.

◆ installEgressFlow()

long org.openkilda.floodlight.switchmanager.SwitchManager.installEgressFlow ( final DatapathId  dpid,
String  flowId,
final Long  cookie,
final int  inputPort,
final int  outputPort,
final int  transitVlanId,
final int  outputVlanId,
final OutputVlanType  outputVlanType 
) throws SwitchOperationException

Installs flow on egress swtich.

Parameters
dpiddatapathId of the switch
flowIdflow id
inputPortport to expect the packet on
outputPortport to forward the packet out
transitVlanIdvlan to match on the ingressPort
outputVlanIdset vlan on packet before forwarding via outputPort; 0 means not to set
outputVlanTypetype of action to apply to the outputVlanId if greater than 0
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 356 of file SwitchManager.java.

◆ installIngressFlow()

long org.openkilda.floodlight.switchmanager.SwitchManager.installIngressFlow ( final DatapathId  dpid,
final String  flowId,
final Long  cookie,
final int  inputPort,
final int  outputPort,
final int  inputVlanId,
final int  transitVlanId,
final OutputVlanType  outputVlanType,
final long  meterId 
) throws SwitchOperationException

Installs an flow on ingress switch.

Parameters
dpiddatapathId of the switch
flowIdflow id
inputPortport to expect the packet on
outputPortport to forward the packet out
inputVlanIdinput vlan to match on, 0 means not to match on vlan
transitVlanIdvlan to add before outputing on outputPort
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 311 of file SwitchManager.java.

◆ installMeter()

long org.openkilda.floodlight.switchmanager.SwitchManager.installMeter ( final DatapathId  dpid,
final long  bandwidth,
final long  burstSize,
final long  meterId 
) throws SwitchOperationException

Installs a meter on ingress switch OF_13. TODO: describe params meaning in accordance with OF

Parameters
dpiddatapath ID of the switch
bandwidththe bandwidth limit value
burstSizethe size of the burst
meterIdthe meter ID
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 531 of file SwitchManager.java.

◆ installOneSwitchFlow()

long org.openkilda.floodlight.switchmanager.SwitchManager.installOneSwitchFlow ( final DatapathId  dpid,
final String  flowId,
final Long  cookie,
final int  inputPort,
final int  outputPort,
final int  inputVlanId,
final int  outputVlanId,
final OutputVlanType  outputVlanType,
final long  meterId 
) throws SwitchOperationException

Installs flow through one switch.

Parameters
dpiddatapathId of the switch
flowIdflow id
inputPortport to expect packet on
outputPortport to forward packet out
inputVlanIdvlan to match on inputPort
outputVlanIdset vlan on packet before forwarding via outputPort; 0 means not to set
outputVlanTypetype of action to apply to the outputVlanId if greater than 0
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 416 of file SwitchManager.java.

◆ installTransitFlow()

long org.openkilda.floodlight.switchmanager.SwitchManager.installTransitFlow ( final DatapathId  dpid,
final String  flowId,
final Long  cookie,
final int  inputPort,
final int  outputPort,
final int  transitVlanId 
) throws SwitchOperationException

Installs flow on a transit switch.

Parameters
dpiddatapathId of the switch
flowIdflow id
inputPortport to expect packet on
outputPortport to forward packet out
transitVlanIdvlan to match on inputPort
Returns
transaction id
Exceptions
SwitchOperationExceptionSwitch not found

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 388 of file SwitchManager.java.

◆ installVerificationRule()

void org.openkilda.floodlight.switchmanager.SwitchManager.installVerificationRule ( final DatapathId  dpid,
final boolean  isBroadcast 
) throws SwitchOperationException

Installs the default verification rule, if it is allowed. One case where it isn't - if the switch is an OpenFlow 1.2 switch and isBroadcast = false. In that scenario, nothing happens.

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 689 of file SwitchManager.java.

◆ isCallbackOrderingPostreq()

boolean org.openkilda.floodlight.switchmanager.SwitchManager.isCallbackOrderingPostreq ( OFType  type,
String  name 
)

Definition at line 281 of file SwitchManager.java.

◆ isCallbackOrderingPrereq()

boolean org.openkilda.floodlight.switchmanager.SwitchManager.isCallbackOrderingPrereq ( OFType  type,
String  name 
)

Definition at line 272 of file SwitchManager.java.

◆ receive()

Command org.openkilda.floodlight.switchmanager.SwitchManager.receive ( IOFSwitch  sw,
OFMessage  msg,
FloodlightContext  cntx 
)

Definition at line 244 of file SwitchManager.java.

◆ safeModeTick()

void org.openkilda.floodlight.switchmanager.SwitchManager.safeModeTick ( )

◆ sendPortUpEvents()

void org.openkilda.floodlight.switchmanager.SwitchManager.sendPortUpEvents ( final IOFSwitch  sw) throws SwitchOperationException

◆ sendSwitchActivate()

void org.openkilda.floodlight.switchmanager.SwitchManager.sendSwitchActivate ( final IOFSwitch  sw) throws SwitchOperationException

◆ startSafeMode()

void org.openkilda.floodlight.switchmanager.SwitchManager.startSafeMode ( final DatapathId  dpid)

Safely install default rules - ie monitor traffic.

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 1326 of file SwitchManager.java.

◆ startUp()

void org.openkilda.floodlight.switchmanager.SwitchManager.startUp ( FloodlightModuleContext  context) throws FloodlightModuleException

Definition at line 233 of file SwitchManager.java.

◆ stopSafeMode()

void org.openkilda.floodlight.switchmanager.SwitchManager.stopSafeMode ( final DatapathId  dpid)

Stop the safe install .. switch is deactivated or removed.

Implements org.openkilda.floodlight.switchmanager.ISwitchManager.

Definition at line 1339 of file SwitchManager.java.

Member Data Documentation

◆ DEFAULT_RULE_PRIORITY

final int org.openkilda.floodlight.switchmanager.SwitchManager.DEFAULT_RULE_PRIORITY = FlowModUtils.PRIORITY_HIGH
static

Definition at line 132 of file SwitchManager.java.

◆ FLOW_COOKIE_MASK

final long org.openkilda.floodlight.switchmanager.SwitchManager.FLOW_COOKIE_MASK = 0x7FFFFFFFFFFFFFFFL
static

Make sure we clear the top bit .. that is for NON_SYSTEM_MASK. This mask is applied to Cookie IDs when creating a flow.

Definition at line 127 of file SwitchManager.java.

◆ VERIFICATION_RULE_PRIORITY

final int org.openkilda.floodlight.switchmanager.SwitchManager.VERIFICATION_RULE_PRIORITY = FlowModUtils.PRIORITY_MAX - 1000
static

Definition at line 131 of file SwitchManager.java.


The documentation for this class was generated from the following file: