How to Write Flows for an OF-DPA Switch
Table of Contents
Introduction
OF-DPA, or OpenFlow Data Plane Abstraction, is a Broadcom specification that allows one to interface with a Broadcom chipset in an OpenFlow-ish way. OF-DPA abstracts much of the switch's pipeline into logical OpenFlow flow and group tables, where a user-provided application running on the switch itself can control flow and group operations using the OF-DPA APIs exposed by Broadcom.
Open Network Linux (ONL) is a great place to get started if you are interested in experimenting with OF-DPA on a supported switch. ONL has an Indigo-based OpenFlow agent that can run onboard ONL and interface with an OpenFlow controller to control the switch's OF-DPA-exposed forwarding pipeline.
Floodlight is equipped to work with OF-DPA switches, including those running the Indigo agent mentioned above. However, since the Indigo agent does not abstract away the OF-DPA pipeline, the controller is responsible for "understanding" the very non-OVS-like pipeline of an OF-DPA switch when installing flow and group rules. OF-DPA switches have very specific requirements for each table in the pipeline and how the tables interact with each other as a whole. It is highly recommended that anyone interested in OF-DPA become very familiar with the intricate OF-DPA pipeline prior to attempting to program it with Floodlight. This will help you to better understand the system as a whole and debug your code.
OFDPAUtils
Floodlight comes equipped with a utility class called OFDPAUtils for helping to perform common OF-DPA flow and group modification operations. This class is your friend when installing flow and group rules into an OF-DPA switch. Please read through this well-commented class for more information about what features are provided. If a feature is not provided that you need, please feel free to add it yourself. If it's a good general-purpose feature, we'd be happy to take a pull request with your contribution.
Forwarding
The Forwarding module utilizes OFDPAUtils to detect an OF-DPA switch and install simple forwarding rules (as forwarding is designed to for any switch). OFDPAUtils helps abstract the complex OF-DPA pipeline from Forwarding. The Forwarding module only needs to provide some simple match and output action information in order to have flows installed in each required table of the OF-DPA switch to achieve the desired packet forwarding operation.
Forwarding makes use of OFDPAUtils here to flush existing flows and groups upon initial connection, here to initialize the switch pipeline, and here to install flows/groups. Note that these exact line numbers might change as Forwarding evolves in the future, so you might have to search around the classes for "OFDPAUtils" to find the exact places it's used.