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 | |
The four principles of SDN (K&R)
- Flow-based forwarding: forwarding can use many header fields (layer 2, 3 and 4), not just the destination IP address.
- Separation of data plane and control plane.
- Network control functions run outside the switches, on the controller.
- 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 | |
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 | |
- 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.
Example: a link fails
- A switch sees a link go down and sends a
port statusmessage to the controller. - The controller updates its link-state view.
- The routing application computes new paths (with Dijkstra, for example).
- 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
- Jim Kurose: SDN control plane (chapter 4/5 video lectures): https://gaia.cs.umass.edu/kurose_ross/lectures.php
- Nick McKeown: talks on SDN and P4 (e.g. "Programmable Networks"), on YouTube: https://www.youtube.com/results?search_query=Nick+McKeown+SDN+P4
- Open Networking Foundation: talks on SDN, ONOS and P4 (YouTube search): https://www.youtube.com/results?search_query=Open+Networking+Foundation+SDN
- David Bombal: SDN, network automation and Python for network engineers: https://www.youtube.com/@davidbombal
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
- Mininet: emulate an SDN network on your laptop: http://mininet.org/
- Ryu (Python SDN controller, good for learning) and ONOS: https://ryu-sdn.org/, https://opennetworking.org/onos/
- Containerlab: container-based network labs: https://containerlab.dev/
- Cilium (eBPF-based Kubernetes networking and security): https://cilium.io/
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-into 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
- Harden the controller: run it as a distributed cluster, apply patches, minimise the services and restrict who has access to it.
- Encrypt and authenticate all controller–switch communication (TLS with mutual certificate authentication).
- Secure the northbound API: strong authentication (OAuth2 / mTLS), role-based access control, input validation and audit logging.
- Rate-limit
packet-inmessages and use proactive (pre-installed) flow rules for normal traffic. - 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).
- 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.
- Monitor flow-rule changes: alert on unexpected rules, such as a new mirror port or a new route to the Internet.
Extra references
- ENISA, Threat Landscape and Good Practice Guide for Software Defined Networks/5G: https://www.enisa.europa.eu/
- ONF, Security Foundation Requirements for SDN Controllers: https://opennetworking.org/
- Scott-Hayward, O'Callaghan & Sezer, SDN Security: A Survey (IEEE SDN4FNS, 2013)
- CIS Benchmarks for AWS, Azure and Google Cloud (cloud network security baselines): https://www.cisecurity.org/cis-benchmarks
- NIST SP 800-207: Zero Trust Architecture: https://csrc.nist.gov/pubs/sp/800/207/final