The question/task: Explain OpenFlow SDN separation of control and data planes. How does the controller modify switch flow tables? Explain the match-action paradigm.
My reasoning: OpenFlow SDN: Control/Data Plane Separation
- Centralized Intelligence: Single point of control with complete network visibility
- Step 2: Flow-Mod Messages
The controller sends
OFPT_FLOW_MOD messages to modify flow tables:
Controller Switch
│ │
│─── OFPT_FLOW_MOD ────────▶│
│ (Add/Modify/Delete) │
│ │
│◀── OFPT_BARRIER_REPLY ────│
│ (Acknowledgment) │
Types of Flow Modifications:
| Command | OpenFlow Constant | Description |
Add | OFPFC_ADD | Add new flow entry; replace if match exists |
| Modify | OFPFC_MODIFY | Modify existing matching entry |
| Modify-Strict | OFPFC_MODIFY_STRICT | Modify only exact match |
| Delete | OFPFC_DELETE | Delete matching entries |
| Delete-Strict | OFPFC_DELETE_STRICT | Delete only exact match |
Example Flow-Mod Message Structure:
OFPT_FLOW_MOD:
Command: OFPFC_ADD
Match Fields:
- in_port: 1
- eth_type: 0x0800 (IPv4)
- ipv4_src: 10.0.0.1
- ipv4_dst: 10.0.0.2
Priority: 100
Actions:
- output: 2
Idle Timeout: 60 seconds
Hard Timeout: 300 seconds
- Match-Action Paradigm
The Paradigm Explained
The match-action paradigm is the fundamental packet processing model in OpenFlow:
Incoming Packet
│
▼
┌─────────────────────┐
│ Match Fields │
│ Against Flow │──▶ No Match ──▶ To Controller (Table-Miss)
│ Table Entries │ or Drop
└─────────┬───────────┘
│ Match Found
▼
┌─────────────────────┐
│ Execute Actions │
│ Associated with │
│ Matched Entry │
└─────────┬───────────┘
│
▼
Outgoing Packet
Match Fields
OpenFlow supports matching on multiple packet header fields across protocol layers:
| Layer | Match Fields |
Physical | Switch ingress port, metadata |
| Link Layer | Ethernet source/destination MAC, VLAN ID, VLAN priority, Ethernet type |
| Network Layer | IPv4/IPv6 source/destination, IP protocol, DSCP, ECN |
| Transport Layer | TCP/UDP source/destination ports |
| Optional | MPLS labels, ARP fields, ICMP type/code |
Wildcarding
Fields can be:
- Exact match: Must match precisely
- Wildcarded: Match any value (using masks for IP addresses)
Example:
Match: ipv4_src = 192.168.1.0/24 (subnet mask)
tcp_dst = 80 (exact)
eth_type = 0x0800 (exact)
Actions
When a packet matches a flow entry, the switch executes associated actions:
| Action Category | Examples |
Forwarding | Output to port, flood, output to controller (OFPP_CONTROLLER) |
| Dropping | No action specified = drop |
| Modification | Rewrite MAC addresses, IP addresses, VLAN tags |
| Metadata | Set metadata, push/pop VLAN/MPLS tags |
| Group Tables | Forward to group (for multicast, failover) |
| Pipeline | Go to next flow table (for multi-table pipelines) |
Processing Flow Example
Scenario: HTTP traffic from subnet to web server
Flow Entry:
┌─────────────────────────────────────────────────────────────┐
│ Match: │
│ • eth_type = 0x0800 (IPv4) │
│ • ipv4_src = 10.0.1.0/24 │
│ • ipv4_dst = 10.0.2.100 │
│ • tcp_dst = 80 │
│ │
│ Actions: │
│ 1. Output to port 5 │
│ │
│ Priority: 100 │
│ Counters: 15,420 packets, 1.2 MB │
└─────────────────────────────────────────────────────────────┘
Table-Miss Handling
When no flow entry matches:
- Continue: Proceed to next flow table (if pipeline exists)
Verification Summary
| Concept | Key Point |
Separation | Control plane (controller) is logically centralized; data plane (switches) is distributed but dumb |
| Flow-Mod | Controller uses OFPT_FLOW_MOD messages to add/modify/delete flow entries via secure channel |
| Match-Action | Packets matched against flow table entries; matched entries' actions are executed |
| Flexibility | Match fields span Layers 1-4; actions include forwarding, dropping, modification, and pipeline processing |
OpenFlow SDN: Control/Data Plane Separation
1. Separation of Control and Data Planes
Traditional Networking Architecture
In traditional networks, each network device (router, switch) contains both:
- Control Plane: Makes decisions about where traffic is sent (routing protocols, STP, etc.)
- Data Plane: Actually forwards the traffic based on control plane decisions
This creates a distributed, complex system where each device operates independently.
SDN/OpenFlow Architecture
OpenFlow fundamentally separates these planes:
| Component | Location | Function |
|---|
| Control Plane | Centralized Controller | Makes all forwarding decisions, maintains network-wide view |
| Data Plane | OpenFlow Switches | Forwards packets based on flow tables, no autonomous decision-making |
┌─────────────────────────────────────────┐
│ SDN Controller │
│ (Control Plane - Logically Centralized) │
│ • Network Operating System │
│ • Network Applications │
└─────────────────┬───────────────────────┘
│ OpenFlow Protocol
│ (Secure Channel)
┌─────────────┼─────────────┐
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│Switch 1│ │Switch 2│ │Switch 3│
│(Data │ │(Data │ │(Data │
│ Plane) │ │ Plane) │ │ Plane) │
└────────┘ └────────┘ └────────┘
Key Benefits
- Centralized Intelligence: Single point of control with complete network visibility
- Programmability: Network behavior controlled via software APIs
- Vendor Independence: Standardized interface (OpenFlow) between planes
- Simplified Devices: Switches become simple forwarding devices
2. How the Controller Modifies Switch Flow Tables
Flow Table Structure
Each OpenFlow switch maintains one or more flow tables containing flow entries:
┌────────────────────────────────────────────────────────────────┐
│ Flow Entry │
├──────────────┬─────────────┬──────────┬──────────┬─────────────┤
│ Match Fields │ Priority │ Counters │ Actions │ Timeouts │
│ (Ingress, │ (for │ (bytes, │ (output, │ (idle, │
│ Ethernet, │ ambiguous │ packets) │ drop, │ hard) │
│ IP, TCP...) │ matches) │ │ modify) │ │
└──────────────┴─────────────┴──────────┴──────────┴─────────────┘
Controller Modification Process
Step 1: Controller-Switch Communication
The controller and switch communicate via a secure channel (typically TLS-encrypted TCP connection on port 6653).
Step 2: Flow-Mod Messages
The controller sends OFPT_FLOW_MOD messages to modify flow tables:
Controller Switch
│ │
│─── OFPT_FLOW_MOD ────────▶│
│ (Add/Modify/Delete) │
│ │
│◀── OFPT_BARRIER_REPLY ────│
│ (Acknowledgment) │
Types of Flow Modifications:
| Command | OpenFlow Constant | Description |
|---|
| Add | OFPFC_ADD | Add new flow entry; replace if match exists |
| Modify | OFPFC_MODIFY | Modify existing matching entry |
| Modify-Strict | OFPFC_MODIFY_STRICT | Modify only exact match |
| Delete | OFPFC_DELETE | Delete matching entries |
| Delete-Strict | OFPFC_DELETE_STRICT | Delete only exact match |
Example Flow-Mod Message Structure:
OFPT_FLOW_MOD:
Command: OFPFC_ADD
Match Fields:
- in_port: 1
- eth_type: 0x0800 (IPv4)
- ipv4_src: 10.0.0.1
- ipv4_dst: 10.0.0.2
Priority: 100
Actions:
- output: 2
Idle Timeout: 60 seconds
Hard Timeout: 300 seconds
3. Match-Action Paradigm
The Paradigm Explained
The match-action paradigm is the fundamental packet processing model in OpenFlow:
Incoming Packet
│
▼
┌─────────────────────┐
│ Match Fields │
│ Against Flow │──▶ No Match ──▶ To Controller (Table-Miss)
│ Table Entries │ or Drop
└─────────┬───────────┘
│ Match Found
▼
┌─────────────────────┐
│ Execute Actions │
│ Associated with │
│ Matched Entry │
└─────────┬───────────┘
│
▼
Outgoing Packet
Match Fields
OpenFlow supports matching on multiple packet header fields across protocol layers:
| Layer | Match Fields |
|---|
| Physical | Switch ingress port, metadata |
| Link Layer | Ethernet source/destination MAC, VLAN ID, VLAN priority, Ethernet type |
| Network Layer | IPv4/IPv6 source/destination, IP protocol, DSCP, ECN |
| Transport Layer | TCP/UDP source/destination ports |
| Optional | MPLS labels, ARP fields, ICMP type/code |
Wildcarding
Fields can be:
- Exact match: Must match precisely
- Wildcarded: Match any value (using masks for IP addresses)
Example:
Match: ipv4_src = 192.168.1.0/24 (subnet mask)
tcp_dst = 80 (exact)
eth_type = 0x0800 (exact)
Actions
When a packet matches a flow entry, the switch executes associated actions:
| Action Category | Examples |
|---|
| Forwarding | Output to port, flood, output to controller (OFPP_CONTROLLER) |
| Dropping | No action specified = drop |
| Modification | Rewrite MAC addresses, IP addresses, VLAN tags |
| Metadata | Set metadata, push/pop VLAN/MPLS tags |
| Group Tables | Forward to group (for multicast, failover) |
| Pipeline | Go to next flow table (for multi-table pipelines) |
Processing Flow Example
Scenario: HTTP traffic from subnet to web server
Flow Entry:
┌─────────────────────────────────────────────────────────────┐
│ Match: │
│ • eth_type = 0x0800 (IPv4) │
│ • ipv4_src = 10.0.1.0/24 │
│ • ipv4_dst = 10.0.2.100 │
│ • tcp_dst = 80 │
│ │
│ Actions: │
│ 1. Set VLAN ID = 100 │
│ 2. Decrement TTL │
│ 3. Output to port 5 │
│ │
│ Priority: 100 │
│ Counters: 15,420 packets, 1.2 MB │
└─────────────────────────────────────────────────────────────┘
Table-Miss Handling
When no flow entry matches:
- Send to Controller: Packet-in message for controller to decide
- Drop: Silently discard the packet
- Continue: Proceed to next flow table (if pipeline exists)
Verification Summary
| Concept | Key Point |
|---|
| Separation | Control plane (controller) is logically centralized; data plane (switches) is distributed but dumb |
| Flow-Mod | Controller uses OFPT_FLOW_MOD messages to add/modify/delete flow entries via secure channel |
| Match-Action | Packets matched against flow table entries; matched entries' actions are executed |
| Flexibility | Match fields span Layers 1-4; actions include forwarding, dropping, modification, and pipeline processing |