OpenFlow is a foundational protocol in software-defined networking (SDN) that separates the control plane from the data plane. It enables centralized control over forwarding elements (switches, routers) by a remote controller, supporting dynamic flow-table management at wire speed.
1. What Is OpenFlow?
SDN Context
Software-Defined Networking (SDN) centralizes decision-making (control) in a controller, leaving packet forwarding (data plane) to network devices. OpenFlow provides the “southbound” interface to manage the switches' forwarding tables.
Core Idea
- Flow Entries: Defined by match/action rules (e.g., match IP/TCP headers, then forward, drop, or modify).
- Controller-Switch Connection: Over TLS/TCP (default port 6653).
- Proactive vs Reactive Control: Controller can pre-install flows, or reactively learn and install.
2. OpenFlow Standardization (RFCs & Specifications)
SDN Overview (RFC 7426)
RFC 7426 provides SDN architecture context, defining layers and identifying OpenFlow as the “southbound” interface between controller and forwarding elements.
OpenFlow in SDN (RFC 7149)
RFC 7149 notes that OpenFlow is one of several options for southbound control—others include NETCONF, PCEP, etc.—but emphasizes it's a key component for separating forwarding and control.
OpenFlow Switch Specifications
The Open Networking Foundation (ONF) publishes protocol specs; latest official release is OpenFlow v1.5.1 (circa Sept 2015), with v1.6 reserved for members.
Key features across versions include:
- Connection Handshake: Hello/Feature_request replied by controller/switch.
- Flow Table Ops: Commands = ADD, MODIFY, DELETE (strict and non-strict).
- Auxiliary Connections: Recommended for Packet‑In; special rules apply (e.g., Hello, Error, Feature exchange only).
3. Message Types and Key Fields
Message types (per OpenFlow spec):
- HELLO: Version negotiation.
- FEATURES_REQ/REP.
- PACKET_IN / PACKET_OUT.
- FLOW_MOD (with commands: ADD/MODIFY/MODIFY_STRICT/DELETE/DELETE_STRICT).
- FLOW_REMOVED, ERROR, ECHO (Req/Reply), BARRIER, experimental EXPERIMENTER.
Flow Entry Fields
Each flow entry includes:
- Match Fields: Ethernet src/dst, VLAN, IP src/dst, transport ports, protocol, TCP flags, MPLS, etc. v1.5.1 supports ~41 fields.
- Priority: Integer; high value wins on multiple matches.
- Counters: Packet/byte counts (cleared or cumulative).
- Idle/Hard Timeouts: Remove after inactivity or fixed time.
- Cookie: 64-bit opaque identifier.
- Flags: e.g.,
CHECK_OVERLAP
,SEND_FLOW_REM
,RESET_COUNTS
. - Instructions/Actions: Forward to port(s), drop, modify header, group, meter, and more.
- Table ID: For multi-table pipelines (v1.1+).
- Buffer ID: To avoid copying packet-in payload.
Group Tables (v1.1+)
- group_id: Unique identifier.
- group_type: (ALL, SELECT, INDIRECT, FAST_FAILOVER).
- Buckets: Each bucket has actions and parameters.
- Counters: Per group.
Meter Tables (v1.3+)
- meter_id.
- Meter bands (rate-limit or drop).
- Counters: traffic metrics per meter.
4. OpenFlow State-Machine
Conceptual controller–switch handshake:

State machine:
- INIT → after HELLO exchanges → FEATURES
- Once FEATURES exchanged, transitions to CONFIG and then RUN
- RUN handles packet events, flow installation, heartbeat (ECHO), barrier sync, and tear down on disconnect.
5. Python Libraries for OpenFlow
Python is popular for custom controllers and testing. Major libraries include, some seem to be actively maintained (like OSKen) while others seems to have been andonded:
5.1 python-openflow
(PyPI/Kytos)
python-openflow, is a low-level OpenFlow message parsing and creation (v1.0–v1.5). It doesn’t perform socket I/O directly, you embed it into your own controller framework or Kytos SDN controller. Unfortunately this project is now abandonded.
5.2 twink
Twink is a lightweight pure-Python OpenFlow message parser/builder for v1.0–v1.4. Supports synchronous and asynchronous servers, OVS tools, ideal for protocol-level testing.
5.3 Ryu and OSKen
Ryu is a full-featured Python SDN framework with OpenFlow support, event-driven apps, REST APIs - this project seems to have been abandonded. OSKen is an actively maintained fork by OpenStack with identical APIs.
5.4 POX
POX is a simple Python controller supporting OpenFlow 1.0, with easy-to-use API and educational tools, this project seems to have been abandodned.
5.5 Other Options
- OpenFaucet: Pure-Python implementation of v1.0 via Twisted. Seems to have been abandoned.
- Scapy: For parsing OpenFlow packet-ins using generic packet manipulation. This tool is actively maintained.
6. Fuzzing OpenFlow Devices with Penzzer
Penzzer offers a unique advantage in fuzzing OpenFlow-capable devices due to its stateful, protocol-aware fuzzing engine that understands the nuances of OpenFlow protocol interactions.
How Penzzer Fuzzes OpenFlow
- State Synchronization: Penzzer initiates and maintains valid HELLO and FEATURES exchanges, preserving correct protocol state.
- Flow Mutation: It generates a wide variety of FLOW_MOD messages, including malformed headers, rare or deprecated field combinations, and invalid flags.
- Invalid Message Sequences: It attempts out-of-order sequences (e.g., flow deletes before adds) to test resilience.
- Auxiliary Channel Exploits: Uses malformed or unexpected messages over auxiliary connections to detect channel misuse or misrouting.
- Field Edge-Case Testing: Values such as max integers, null cookies, empty match/action fields are used to probe parsing logic.
- Error and Echo Storms: Sends repeated ECHO, ERROR, or BARRIER messages to test error handling and loop protections.
Each test is observed for protocol violations, system crashes, and latency deviations. Logs are correlated with expected behaviors from OpenFlow spec, and discrepancies are reported with full context.
7. Benefits and Use Cases
- Interoperability Testing: Ensure switches from different vendors comply with OpenFlow standards.
- Robustness Checks: Validate behavior under extreme or malformed input.
- Security Evaluations: Identify vulnerabilities like buffer overflows, unexpected flow injection, or denial-of-service scenarios.
- QA and Regression: Continually test updates and patches against known edge cases.
- Protocol Compliance: Penzzer highlights discrepancies from OpenFlow specification automatically.
- Automation Integration: Easily integrates into CI/CD pipelines for ongoing verification.
Using Penzzer in these scenarios improves device security, implementation correctness, and reduces time-to-certification for OpenFlow compliance.
Want to hear more about Penzzer?
Leave your details and we'll reach out shortly.