Managing networks with OpenFlow
Flow Control
The OpenFlow protocol and its surrounding technologies are bringing the promise of SDN to real networks – and it might not be long before you see them on your real network.
Several leading Internet companies founded the Open Networking Foundation (ONF) [1] to promote the adoption of software-defined networking through open standard development. According to the ONF, their "signature accomplishment" is fostering and maintaining the OpenFlow standard [2], which defines a protocol for communicating with software-defined network (SDN)-ready network devices (Figure 1). A striking number of proprietary and free SDN projects now implement the OpenFlow standard.
OpenFlow has gained some momentum since it first appeared in 2008. Between the test suite 0.8.1 from June 2008 and version 1.0 of the specification from December 2009, the developers released seven updates. Since then, eight further iterations have appeared; the current version is numbered 1.4.
In this article, I describe how OpenFlow implements the principles of SDN and take a brief tour of OpenFlow configuration and management using the Mininet simulation tool. See the article on Mininet elsewhere in this issue for more on installing and using Mininet.
OpenFlow at Work
As you learned in the previous article in this issue, the basic idea of software-defined networking is to centralize control of network devices such as routers and switches in a way that allows the network to behave more intelligently. Processing power on the network device is therefore kept to a minimum: the hardware just forwards packets and does not need to execute complex logic to make individual forwarding decisions. The controller maintains an overview of the network, passing simple instructions to the networking devices in the form of a flow table, which the device will use as a roadmap for forwarding packets (see the "OpenFlow Controllers" box).
OpenFlow Controllers
A variety of controllers are available for OpenFlow networks. These controllers implement the OpenFlow protocol and take care of communication with the switches. Additionally, most controllers provide an API for a popular programming language (Figure 4). The API lets developers write applications that manage and control the network of OpenFlow devices.
Some popular OpenFlow controllers include:
- Nox – The Nox controller [3] was released under the GPLv3 and has been in development since 2008. Nox follows a modular approach, with a C++ and a Python API.
- Floodlight – The Floodlight Controller [4] is based on the cross-platform Java programming language. Floodlight also comes with some apps and pursues a module and app-based approach. The standard version comes with a module that offers an additional REST interface for actively setting static flows. Floodlight is available under the open source Apache license.
- Frenetic – Frenetic [5] is a project by Princeton University released under the LGPLv3. The network programming language runs as an application on the Nox controller, uses a separate run-time environment, and speaks Ocaml or Python. Frenetic adds a further abstraction layer for app development, which makes it possible to reduce the amount of source code and write application-oriented code that can be encapsulated and reused in functions.
This separation of data and control reduces the unit cost significantly, because the software-side implementation of the various protocols for operating a device in a Layer 2 domain (bridged/switched network) is expensive. Also, the admin does not have to pre-configure the devices individually. Since all the intelligence is in the controller, you don't need to leave your desk; instead, you can manage the network from a central point.
OpenFlow uses a flow-based routing concept. By considering the network as a whole, the controller can set up end-to-end connections across multiple switches for certain types of packets. OpenFlow maps the packet type to the transport protocol.
As soon as the controller detects the signature, it instructs the participating switches in the network to set their forwarding entries accordingly. The admin thus no longer needs to train the local switches but can use the controller to develop granular rules for the entire adaptive network.
The OpenFlow forwarding logic basically consists of a flow table, which in turn contains various flow entries (Figure 2). Included with the entries is a header, which collects an identification pattern in several fields; this identifier information will play a role in packet detection (matching patterns). The flow entries define actions applicable to the pattern or packet type.
The specifications are sometimes very extensive, because they provide detailed explanations of the flow entry structures, the structure of the flow tables, the possible actions, and the counter fields. If you're interested in the details, you'll find the OpenFlow specifications at the website for the Open Networking Foundation.
When a packet in an OpenFlow network arrives at one of the ports reserved for OpenFlow, the switch examines the header field (Figure 3). The switch compares the bits with the entries in its flow table, which may use wildcards as entries. In case of a match, the switch performs the actions defined in the flow entries and updates the counter.
The action can be, for example, forwarding the packet to a port, modifying its header field, or forwarding it to another flow table. If the switch fails to find the entry in the header field in a flow table, it encapsulates the packet and sends it to the controller, which then decides how to proceed. The controller either forwards the packet directly or instructs the switches to add the flow entry to their flow tables so that they can handle packets with this pattern in the future.
The controller has two types of flow entries: proactive and reactive. Proactive means the controller instructs the switch to set a flow record for a given flow table without the switch first asking for permission. Reactive tells the switch to encapsulate an unknown packet and send it to the controller; in response, the controller generates a matching flow record for the unknown packet.
Once a switch has set a flow entry, it waves through the packets that belong to the flow. This approach reduces the response time because it saves the detour via the controller.
Hardware
OpenFlow has evolved into production use as an SDN concept; the dedicated switches that support OpenFlow are described by their vendors as OpenFlow enabled. These are hybrid switches that, in addition to their legacy switch functionality and the associated protocols, such as the Link Local Discovery Protocol (LLDP), offer an OpenFlow configuration. To use them, network managers need, depending on the vendor and model, to complete various configurations of the OpenFlow instance on the switch. This usually means switching the appropriate ports or VLANs to OpenFlow mode so that an external controller can manage the switch.
Examples with Mininet
I'll describe three practical examples that illustrate how to use OpenFlow. To cook up these simulations, I'll use Mininet [6], a tool designed for testing and simulating network configurations. (See the article on Mininet elsewhere in this issue.)
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.