wiki:OpenFlow/Controllers/Floodlight

Version 3 (modified by tupty@bbn.com, 11 years ago) (diff)

--

Floodlight

Floodlight is a OpenFlow controller platform. It is primarily written in Java, although it has some REST APIs, and the source contains some tools written in other languages that can interface with those APIs.

For Operators

Configuration

http://www.openflowhub.org/display/floodlightcontroller/Configuration+HOWTO explains how to load specific modules. Modules are documented at http://www.openflowhub.org/pages/viewpage.action?pageId=3638160. The default configuration uses the Forwarding module to forward traffic, so if you do not want your controller forwarding data plane traffic, you will need to disable the forwarding module first.

Monitoring

Monitoring what is going on within an OpenFlow network can be done with a few basic curl commands and a basic understanding of how to read JSON. The full set of commands are documented at http://www.openflowhub.org/display/floodlightcontroller/Floodlight+REST+API, but a few select useful ones are documented below.

Variables

Variable Description Example Value
<host_url> hostname of the host running the controller localhost
<rest_api_port> Port to which the REST server is bound 8080
<controller_url> http://<host_url>:<rest_api_port> http://localhost:8080

Querying for Flow Stats

This will tell you what flows are in the switch currently, which table that flow is in, and statistics on the flow (i.e. how many packets have matched that flow, how long that flow has been in the table for, etc.).

curl <controller_url>/wm/core/switch/all/flows/json | python -m json.tool

Querying for Topology Information

This will tell you how the OpenFlow switches are interconnected. This will only work for switches that are physically directly connected or logically directly connected (i.e. via a tunnel). If a non-OpenFlow switch is between two OpenFlow switches, then this query cannot tell you how these two OpenFlow switches connect. To query this information, the net.floodlightcontroller.topology.TopologyManager module must be loaded.

curl <controller_url>/wm/topology/links/json | python -m json.tool

To see how OpenFlow switches interconnect through non-OpenFlow switches, the following query can be used:

curl <controller_url>/wm/topology/external-links/json | python -m json.tool

Note that this second query relies on the controller being able to handle traffic for a specific ethertype.

Detecting where devices enter the OpenFlow network

Querying for Switch Features

This will let you see the supported ofp_actions and ofp_capabilities of each switch that is being queried. You can also see information on the ports, including their name (according to the switch), their port number (according to OpenFlow), and some of their features. Decoding these values will require looking at the spec, because many of them are presented as bitmasks.

curl <controller_url>/wm/core/switch/all/features/json | python -m json.tool

Testing specific OpenFlow features

For Developers

Developers can refer to http://www.openflowhub.org/display/floodlightcontroller/For+Developers for information on how to develop controllers in Floodlight.