Switch Flow Table Configuration

Clear Flow Table Behavior

When a switch connects to the controller for the first time, the default behavior of Floodlight is to clear all tables. The same is true for each transition to the MASTER role. This is oftentimes a desirable behavior when developing and debugging code and is the primary motivation for such a "feature" as the default. In essence, it allows you to reset your data plane by simply restarting the controller. If you would like to change this behavior, you can modify src/main/resources/floodlightdefault.properties to suit your needs.

net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnInitialHandshakeAsMaster=YES
net.floodlightcontroller.core.internal.OFSwitchManager.clearTablesOnEachTransitionToMaster=YES

The first parameter, clearTablesOnInitialHandshakeAsMaster, as it sounds, determines whether the switch flow tables should be cleared after the initial handshake and transition to MASTER. Anything other than YES, YEP, TRUE, JA, or STIMMT will be interpreted as a NO.

The second parameter, clearTablesOnEachTransitionToMaster, is similar to the first, except it determines whether or not flow tables will be cleared on each transition to MASTER from any other role. This might be desirable if you want the new MASTER controller to start from scratch. Anything other than YES, YEP, TRUE, JA, or STIMMT will be interpreted as a NO.

Table-Miss Flow Behavior (OpenFlow 1.3 and up only)

In OpenFlow 1.3, in order to for packets to be sent to the controller on a table-miss, a default table-miss flow must be inserted manually by the controller. This is in contrast to the behavior of OpenFlow 1.2 and earlier, which embed this behavior within each table. The motivation behind the change is to allow for user-defined table-miss actions. Instead of outputting to the controller, the table-miss flow can be programmed with any set of instructions or actions supported by OpenFlow 1.3. (Note that Floodlight by default will simply forward to the controller though.)

net.floodlightcontroller.core.internal.OFSwitchManager.defaultMaxTableToReceiveTableMissFlow=4
net.floodlightcontroller.core.internal.OFSwitchManager.maxTableToReceiveTableMissFlowPerDpid={"00:00:00:00:00:00:00:01":"4","2":"4"}

The first parameter above, defaultMaxTableToReceiveTableMissFlow, sets a global maximum table ID to receive a table-miss flow each time the switch flow tables are cleared (see Clear Flow Table Behavior above). This applies to all switches that connect to the controller. The default is set at 4 to accommodate hardware switches that have a few software flow tables.

Like the first parameter, maxTableToReceiveTableMissFlowPerDpid configures the maximum table ID to receive a table-miss flow each time the switch flow tables are cleared (see Clear Flow Table Behavior above). However, this parameter allows the specification of a JSON formatted string giving a DPID-specific setting. Any DPID configuration here will override the default configuration.

Both of these parameters are somewhat naive and don't take into consideration gaps in table numbering or specifying specific tables to receive the table-miss flow. More advanced table-miss configuration should be done by writing a custom module to install the flows according to your own algorithm.