Skip to content
BoKSA

05: Software Defined Networking (SDN)

05: Software Defined Networking (SDN)

Course: Networking - Security Advanced · Updated: October 2026 Literature: K&R chapter 4 (Network Layer: Data Plane): generalized forwarding and SDN; K&R chapter 5: the SDN control plane Related lecture: Presentation: Network management, SDN & multimedia

Learning objectives

After studying this article you can:

  • explain the difference between the traditional per-router control plane and a logically centralised control plane
  • explain generalised forwarding using the match + action abstraction
  • describe OpenFlow: flow tables, match fields, actions and counters
  • describe the SDN architecture: data-plane switches, the SDN controller, and the northbound and southbound APIs
  • name current SDN technologies: P4, intent-based networking, cloud networking and SD-WAN

1. Why SDN?

Traditionally every router is a monolithic box. It contains:

  • the hardware for forwarding (the data plane)
  • a proprietary operating system
  • implementations of routing protocols (OSPF, BGP) that run on each router (the control plane)

This leads to:

  • hard management: hundreds of devices, each configured separately (often by hand, through a CLI)
  • slow innovation: a new feature means waiting for the vendor
  • "middleboxes" for every function: firewalls, NAT, load balancers, each with its own box and configuration

Around 2005–2008, Stanford and Berkeley introduced Software Defined Networking: separate the control plane from the data plane, and put the control logic in software on a (logically) central controller.

1
2
3
4
5
6
7
8
9
  Traditional                         SDN
  +---------+  +---------+            +---------------------------+
  | control |  | control |            |  SDN controller (software)|
  |  data   |  |  data   |            +-------------+-------------+
  +---------+  +---------+                          | southbound API (OpenFlow, P4Runtime, gNMI)
   each router computes its own       +--------+ +--------+ +--------+
   forwarding table                   |  data  | |  data  | |  data  |
                                      +--------+ +--------+ +--------+
                                         simple switches only forward

The four principles of SDN (K&R)

  1. Flow-based forwarding: forwarding can use many header fields (layer 2, 3 and 4), not just the destination IP address.
  2. Separation of data plane and control plane.
  3. Network control functions run outside the switches, on the controller.
  4. A programmable network: applications control the network through APIs.

2. Generalised forwarding: match + action

A traditional router uses destination-based forwarding: match the longest prefix of the destination IP, then action: forward out of link X.

SDN generalises this. Each switch has a flow table with entries made up of:

Part Content
Match Values for header fields: ingress port, MAC src/dst, EtherType, VLAN ID, IP src/dst, IP protocol, TCP/UDP src/dst port, ... (wildcards allowed)
Action Forward to port(s), drop, modify fields (e.g. NAT), send to the controller, push or pop a VLAN/MPLS tag
Priority Settles conflicts when several rules match
Counters Number of packets and bytes that matched the rule

One abstraction for many devices

Device Match Action
Router Longest destination IP prefix Forward out of a link
Switch Destination MAC address Forward or flood
Firewall IP addresses and TCP/UDP port numbers Permit or deny
NAT IP address and port Rewrite address and port

Example OpenFlow rules

1
2
3
4
5
6
7
8
# Block all traffic to TCP port 22 (SSH)
match: ip_proto=6, tcp_dst=22                     action: drop

# Send packets from host 10.1.0.0/16 out of port 3
match: ip_src=10.1.0.0/16                          action: output:3

# Layer 2 forwarding
match: eth_dst=22:A7:23:11:E1:02                   action: output:3

3. OpenFlow

OpenFlow (the Open Networking Foundation, ONF) was the first standard southbound protocol between the controller and the switches. It runs over TCP (port 6653), usually protected with TLS.

Message direction Examples
Controller → switch features (ask the switch what it can do), configure, modify-state (add, remove or change flow entries), packet-out (send a packet from a specific port)
Switch → controller packet-in (a packet with no matching rule, sent to the controller), flow-removed, port status

4. The SDN architecture

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 +---------------------------------------------------------------+
 |  Network control applications                                 |
 |  routing | access control | load balancing | monitoring       |
 +-----------------------------+---------------------------------+
                               | northbound API (REST, intent)
 +-----------------------------v---------------------------------+
 |  SDN controller ("network operating system")                  |
 |  - network-wide state: topology, links, hosts, flow statistics |
 |  - distributed for reliability and scalability                 |
 +-----------------------------+---------------------------------+
                               | southbound API (OpenFlow, P4Runtime, NETCONF, gNMI)
 +-----------------------------v---------------------------------+
 |  Data-plane switches: fast, simple, commodity hardware        |
 +---------------------------------------------------------------+
  • Data-plane switches: forward based on the installed flow tables
  • SDN controller: keeps a global view of the network and is logically centralised but physically distributed for fault tolerance. Examples: ONOS, OpenDaylight, Ryu (education).
  • Control applications: the "brains". They implement routing, firewall, load balancing and so on, using the controller's view of the network.
  1. A switch sees a link go down and sends a port status message to the controller.
  2. The controller updates its link-state view.
  3. The routing application computes new paths (with Dijkstra, for example).
  4. The controller installs the new flow tables in the affected switches.

5. SDN after 2018: where is it now?

The original hype ("OpenFlow everywhere") has settled down. The ideas of SDN have won, even where OpenFlow itself is less used:

Development Description
Hyperscaler networks Google (B4, Jupiter, Orion), Microsoft and Meta run their data-centre and WAN networks with centralised SDN control.
P4 Programming Protocol-independent Packet Processors. A language that defines what the data plane parses and how it processes packets, not just which rules it holds. P4Runtime is the southbound API. P4 is now hosted by the Linux Foundation.
Cloud networking Virtual Private Clouds (AWS VPC, Azure VNet), security groups and virtual routers are SDN in practice. They are all configured through an API.
SD-WAN Central management of branch-office connections over the Internet, 5G and MPLS. Very common in businesses.
Network virtualisation and overlays VMware NSX, Cisco ACI and Kubernetes networking (CNI plug-ins such as Cilium, which uses eBPF).
Intent-Based Networking The administrator says what is needed ("finance may not talk to HR"), and the system works out how.
5G core The mobile core network is software-defined (SBA, network slicing).
Network automation / NetDevOps Networks are managed "as code" with Ansible, Terraform, Nornir and Git, often with YANG models (see article 06).

6. Summary

  • SDN separates control from forwarding and centralises control in software.
  • Generalised forwarding (match + action) unifies routers, switches, firewalls and NAT.
  • OpenFlow was the first southbound API. P4 makes the data plane itself programmable.
  • In 2026, SDN principles are everywhere: in cloud networks, SD-WAN, data centres and 5G.

References

Videos

Articles and books

  • Larry Peterson et al., Software-Defined Networks: A Systems Approach (free online book): https://sdn.systemsapproach.org/
  • Kreutz et al., Software-Defined Networking: A Comprehensive Survey, Proceedings of the IEEE (2015)
  • McKeown et al., OpenFlow: Enabling Innovation in Campus Networks, ACM SIGCOMM CCR (2008): the original OpenFlow paper
  • P4 Language Consortium: https://p4.org/
  • Open Networking Foundation (ONOS, OpenFlow specifications): https://opennetworking.org/
  • Google, Jupiter evolving: transforming Google's datacenter network via optical circuit switches and SDN (SIGCOMM 2022)

Tools


Cyber Security

Why it matters

SDN changes the attack surface of a network:

  • The controller is a high-value target. Whoever compromises the controller controls all forwarding in the network. They can redirect, copy (mirror) or drop any traffic.
  • The southbound channel (OpenFlow, P4Runtime) must be protected. If it runs without TLS, an attacker can inject flow rules.
  • The northbound API (REST) is a web API, with all the usual web vulnerabilities: weak authentication, injection, broken access control.
  • Denial of Service: an attacker can send many packets that match no rule. Each one causes a packet-in to the controller and overloads it. Flow tables in switches are limited too (flow-table exhaustion).
  • Cloud = SDN: misconfigured cloud security groups and VPC routes (e.g. a database open to 0.0.0.0/0) are among the most common causes of data leaks.

SDN also offers security advantages:

  • a central, consistent policy: no forgotten firewall rule on one device
  • fine-grained micro-segmentation: isolate every workload (a basis for Zero Trust, see article 14)
  • rapid response: quarantine an infected host network-wide with one API call, or redirect suspicious traffic to an IDS
  • network-wide visibility: flow counters are a built-in source of telemetry

How to make it safe

  1. Harden the controller: run it as a distributed cluster, apply patches, minimise the services and restrict who has access to it.
  2. Encrypt and authenticate all controller–switch communication (TLS with mutual certificate authentication).
  3. Secure the northbound API: strong authentication (OAuth2 / mTLS), role-based access control, input validation and audit logging.
  4. Rate-limit packet-in messages and use proactive (pre-installed) flow rules for normal traffic.
  5. Use "network as code" with review: store network and cloud configuration in Git, use pull-request reviews, and scan it automatically with policy-as-code tools (e.g. Checkov, tfsec, Open Policy Agent).
  6. Apply least privilege in the cloud: default-deny security groups, no public IPs on internal systems, and regular audits with tools such as Prowler or ScoutSuite.
  7. Monitor flow-rule changes: alert on unexpected rules, such as a new mirror port or a new route to the Internet.

Extra references