Free tech learning for everyone, from basics to pro

SDNEmerging Technologies and SecurityIntermediate

OpenFlow and flow tables explained

In short: OpenFlow is a southbound protocol that lets a controller install match-and-action rules in a switch. Each rule matches header fields, has a priority and tells the switch what to do. Packets pass through one or more flow tables, and anything unmatched follows a table-miss rule.

What OpenFlow does

In software-defined networking (SDN) the control plane, which decides where traffic goes, moves out of each switch into a central controller. The switch keeps the data plane and simply follows instructions. OpenFlow was the first widely known open protocol for this conversation between controller and switch. It is a southbound protocol, meaning it runs from the controller down to devices. It was originally developed in research and is maintained by the Open Networking Foundation (ONF). Version 1.3 is the one most implementations support.

The switch opens a TCP connection to the controller, normally protected with TLS. The registered port is 6653. Over this channel the controller adds, changes and removes flow entries, asks for statistics and receives packets the switch does not know how to handle.

Flow entries and tables

Parts of a flow entryMatch fieldsports, MACs, IPsPrioritywhich rule winsCounterspackets, bytesInstructionsforward, drop, modifyTimeoutsidle and hard
Figure 1. Each OpenFlow flow entry combines what to match, how important it is, what to do and how long to keep it.
  • Match fields can include the ingress port, source and destination MAC, VLAN ID, EtherType, IP addresses, IP protocol and TCP or UDP ports. Fields not listed are wildcards.
  • Priority decides which entry wins when several match. The highest priority applies.
  • Instructions apply actions such as output to a port, drop, push or pop a VLAN tag, or set a field, and can send the packet to a later table.
  • Counters track packets and bytes, useful for monitoring.
  • Timeouts remove an entry after it is idle for a time, or after a fixed time regardless.
Packet handling in an OpenFlow switchPacket inarrives onportTable 0highest matchMore tablesgoto-tableActionsoutput, setfieldTable missdrop or tocontroller
Figure 2. Packets pass through a pipeline of flow tables; a packet with no match follows the table-miss entry.

Modern OpenFlow supports a pipeline of tables, for example one for access control, one for VLAN handling and one for forwarding. A table-miss entry, with priority 0 and no match fields, decides what happens to unmatched packets: drop them, or send them to the controller as a packet-in message. Group tables allow actions such as flooding to several ports or fast failover, and meter tables allow rate limiting.

Reactive versus proactive

ModeHow it worksTrade-off
ReactiveFirst packet of a new flow goes to the controller, which installs a ruleFlexible, but adds delay and controller load; vulnerable to flooding
ProactiveController installs rules in advance based on the topology and policyFast and predictable; needs more table space and planning

Most production designs are mainly proactive, with reactive handling only for exceptions.

Try it in a lab with Open vSwitch

Open vSwitch (OVS) is an open-source virtual switch that supports OpenFlow. On a lab Linux virtual machine you can create a bridge and add rules by hand, with no controller:

sudo ovs-vsctl add-br br0
sudo ovs-vsctl set bridge br0 protocols=OpenFlow13
sudo ovs-ofctl -O OpenFlow13 add-flow br0 "priority=100,ip,nw_dst=192.168.10.20,actions=output:2"
sudo ovs-ofctl -O OpenFlow13 add-flow br0 "priority=0,actions=drop"
sudo ovs-ofctl -O OpenFlow13 dump-flows br0
sudo ovs-vsctl set-controller br0 tcp:192.168.10.5:6653

The last line points the bridge at a controller in your lab. Watch the counters in dump-flows change as you send test traffic.

Tip: secure the controller channel. Without TLS and authentication, anyone who can reach it could install rules that redirect or drop traffic. See SDN security.

In exams, remember that OpenFlow is one southbound option among several. Many commercial SDN products use NETCONF, BGP or vendor APIs instead.

Practice

Two flow entries match a packet, one with priority 200 and one with priority 50. Which applies?
The entry with priority 200, because the highest priority match wins.
What does a table-miss entry do?
It is a lowest-priority catch-all that decides what happens to unmatched packets, typically drop or send to the controller.
Why do production networks prefer proactive flow installation?
Rules are already present, so packets are forwarded at full speed without waiting for the controller, and the controller is less exposed to floods of new flows.

Key takeaways

  • OpenFlow is a southbound protocol between an SDN controller and switches.
  • Flow entries combine match fields, priority, instructions, counters and timeouts.
  • Packets pass through a pipeline of tables; unmatched packets follow the table-miss entry.
  • Proactive rule installation is faster and more predictable than reactive.
  • Protect the controller channel with TLS and access control.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.