CMPT 471/771: Computer Networks��Software-Defined Networking and Network Virtualization
Instructor: Mohamed Hefeeda
1
School of Computing Science �Simon Fraser University
Outline
2
3
Hyperscale DCs
(Google, Meta, Azure)
Motivation: Where is SDN Deployed?
Carrier WANs
(AT&T, Bell Canada)
Enterprise Networks
(RBC, SFU)
🡺 SDN is an important topic
4
Control Plane
Control Plane
SFU IF 1
Alice IF 3
DST OUT_IF
Forwarding Table
SFU IF 2
Alice IF 4
DST OUT_IF
Forwarding Table
Routing algorithm
Routing algorithm
Control Plane
SFU IF 2
Alice IF 4
DST OUT_IF
Forwarding Table
Routing algorithm
Routers exchange messages with each other to calculate tables
Recap: Control Plane: Distributed
5
Agent
Agent
Flow Table
Flow Table
Agent
Flow Table
Routers exchange messages with a remote/centralized controller
Control Plane
Control Plane: Centralized
SDN: Basic Concepts
6
SDN: Basic Concepts
7
Mainframe 🡺 PC
8
Vertically integrated
Closed, proprietary 🡺
Slow innovation
Small industry
Horizontal
Open interfaces 🡺
Rapid innovation
Huge industry
Traditional Router 🡺 SDN Switch
9
Vertically integrated
Closed, proprietary 🡺
Slow innovation
Small industry
Horizontal
Open interfaces 🡺
Rapid innovation
Huge industry
SDN: Architecture Overview
10
a.k.a SDN Controller
SDN Switches
e.g., OSPF, load balancer, ...
Open Interfaces
(a.k.a Bare-metal, merchant-silicon switches)
SDN: Data Plane (Switches)
11
SDN: Data Plane (Switches)
12
Intel Tofino P4 Switch
OpenFlow Switch
SDN Switches
13
Generalized Forwarding
14
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Link layer
Network layer
Transport layer
Payload …
Generalized Forwarding: Flow Rule
15
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Match
Action
Stats
Can be …
Packet + byte counters
Link layer
Network layer
Transport layer
Match pkt against fields
Perform action(s)
Keep stats
Generalized Forwarding: Examples
16
Destination-based forwarding:
(as a special case of generalized forwarding)
*
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Action
*
*
*
*
*
51.6.0.8
*
*
*
Forward(6)
Forward datagrams destined to 51.6.0.8 to output port 6
How would you implement this ‘*’ or don’t care thing?
Using binary masks, e.g., mask 0000 0000 0000 1111 means that we do not care about the left 12 bits 🡺 We only want to match against the four rightmost bits
Generalized Forwarding: Examples
17
Firewall
*
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Action
*
*
*
*
*
*
*
*
22
Drop
Block datagrams destined to TCP port 22
*
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Action
*
*
*
*
128.19.1.1
*
*
*
*
Drop
Block datagrams originated from host 128.19.1.1
OpenFlow Match-Action Abstraction
18
Flow Table: Contains Multiple Entries
19
Switch
Port
MAC
src
MAC
dst
Eth
type
VLAN
ID
IP
Src
IP
Dst
IP
Prot
TCP
sport
TCP
dport
Match
Action
Stats
Packet + byte counters
Link layer
Network layer
Transport layer
Match
Action
Stats
Match
Action
Stats
Matching is typically performed using TCAM
Flow Tables: TCAM and Priority
20
TCAM
1
0
X
X
1
1
0
X
X
X
X
X
Entry 2
Entry 3
Entry 4
Search for
1
0
1
0
Entry 1
1
1
X
X
0
0
1
0
Highest Priority
SDN: Control Plane
21
Control Plane
Data Plane
Notice: the figure shows e2e example where the controller manages all components, including virtual switches (vS) on end hosts 🡺 great flexibility
SDN Controller (Network OS)
22
Network-wide distributed, robust state management
Communication to/from controlled devices
Link-state info
switch info
host info
statistics
flow tables
…
…
OpenFlow
P4Runtime
…
network graph
intent
RESTful
API
…
Interface, abstractions for network control apps
SDN
controller
routing
access
control
load
balance
Communication layer: communicate between controller and switches
Network-wide state management layer: state of networks links, switches, services
Interface layer to network control apps: APIs
SDN Controller (Network OS)
23
SDN: Control Plane
Network-control apps:
24
SDN: Control-Data Planes Interaction: Example
25
Link-state info
switch info
host info
statistics
flow tables
…
…
OpenFlow
P4Runtime
…
network graph
intent
RESTful
API
…
Dijkstra’s link-state
routing
s1
s2
s3
s4
S1, experiencing link failure uses OpenFlow port status message to notify controller
1
SDN controller receives OpenFlow message, updates link status info
2
Dijkstra’s routing algorithm application has previously registered to be called when ever link status changes. It is called.
3
Dijkstra’s routing algorithm access network graph info, link state info in controller, computes new routes
4
1
2
3
4
SDN: Control/Dataplane Interaction Example
26
Link-state info
switch info
host info
statistics
flow tables
…
…
OpenFlow
SNMP
…
network graph
intent
RESTful
API
…
Dijkstra’s link-state
routing
s1
s2
s3
s4
link state routing app interacts with flow-table-computation component in SDN controller, which computes new flow tables needed
5
controller uses OpenFlow to install new tables in switches that need updating
6
5
6
1
2
3
4
SDN vs Traditional Approach
27
SDN Reduces Cost of Switches
28
SDN Offers Better Support for Traffic Engineering
29
SDN: Traffic Engineering
30
2
2
1
3
1
1
2
5
3
5
v
w
u
z
y
x
Example 1:
SDN: Traffic Engineering
31
2
2
1
3
1
1
2
5
3
5
v
w
u
z
y
x
App 1
App 2
Can this be achieved by OSPF (or siblings)?
Example 2:
SDN: Traffic Engineering
32
2
2
1
3
1
1
2
5
3
5
v
w
u
z
y
x
Example 3:
SDN Supports Efficient Management of Network Functions
33
Firewall
IDS
Video Encoder
Parental control
Monitoring
Network Functions
Virtualized on Servers
SDN Supports Efficient Management of Network Functions
34
Firewall
IDS
Video Encoder
Monitoring
SDN Supports Efficient Management of Network Functions
35
1
2
3
a
h
d
e
g
b
i
c
f
k
j
Route calculated by OSPF
1
2
3
SDN Deployment
36
SDN: TE for WANs
37
Google: 43 cloud regions (2026)
Expensive links
SDN: TE for WANs
38
SDN: TE for WANs
39
Source: Hong et al., Achieving High Utilization with Software-Driven WAN, SIGCOMM’13. (Microsoft SWAN)
Provision for peak 🡺 < 50% utilization
Smaller peak 🡺 better utilization
Adapt using SDN
Aggregate traffic
SDN: TE for WANs
40
1
4
5
2
3
Distributed: each source chooses its local optimal
A
B
C
1
4
5
2
3
Central optimization using SDN 🡺 global optimal
A
B
C
Google SDN: Control at Three Timescales
41
Hosts: µs to ms
Congestion control
Protective ReRoute: new path
after timeout
Controllers: s to min
B4 traffic engineering (WAN)
Jupiter TE, every 30 s
BwE rate limits
Planning: weeks to months
Topology engineering:
optical switches rewire links
Capacity planning
faster ← reaction time → slower
Software Defined Wide Area Network: SD-WAN
42
Branch office
Main office
Corporate datacenter
ISP(s)
Software Defined Wide Area Network: SD-WAN
43
Branch office
Main office
Corporate datacenter
ISP(s)
SD-WAN Controller
VPN Tunnel
SD-WAN: Advantages
44
SDN Security: Attacks on Control Plane
45
Controller
switch 1
switch 2
Attacker
1 many new flows → Packet-In flood
2 fake link (forged LLDP)
3 plain TCP channel: rules read or injected
SDN for Defense: DDoS and Noisy Neighbors
46
host 1
host 2
host 3
Central DoS server
congestion signals (receivers)
rate limits at senders
SDN and AI
Example: AuTO (SIGCOMM 2018): reinforcement learning for TE
47
Control Plane
Data Plane
Reinforcement Learning (RL) Agent
Reward: minimize latency
Action: install rules
Telemetry: link utilization, queue depth, RTT per flow,…
Decisions: reroute flow X to path Y; install R1, R3 into S1 and S3
R1
R3
Network Virtualization
48
Virtualization in Computing
49
Common Virtualization in Computing
50
Common Virtualization in Computing
51
Hardware: Processor, memory, storage, I/O, …
e.g., VirtualBox
Common Virtualization in Computing
52
Hardware: Processor, memory, storage, I/O, …
e.g., Docker
Virtual LANs: Layer 2 (Ethernet) VLANs
53
L3 Router
L2 Switch
L2 Switch
To other IP subnets or Internet
H1
H2
H3
H4
H5
H6
VLAN 100
VLAN 100
VLAN 100
VLAN 200
VLAN 200
54
802.1 Ethernet frame
dest.
address
source
address
data (payload)
CRC
preamble
type
16 bits: Type
4 bits: Control
12 bits: Tag (VLAN ID)
Recomputed
CRC
802.1Q frame
dest.
address
source
address
data (payload)
CRC
preamble
type
802.1Q VLAN Frame Format
L2 (Ethernet) VLANs
55
Network Virtualization: Modern Definition
56
Network Virtualization: Modern Definition
57
Datacenters: Common Design
58
Server racks
Top of Rack (TOR) switch
Tier-2 switches
Tier-1 switches
Border routers
…
…
…
…
…
…
…
…
Datacenters: Multi-Tenants
59
…
…
…
…
…
…
…
…
Tenant 1:
Star topology, IPv4
100 servers
10.1.1.100
10.1.1.1
10.1.1.2
10.1.1.1
10.1.1.2
10.1.1.100
10.1.1.1
Virtual links (tunnels) between VMs
Server failed 🡺 VM migrated but kept same (virtual) IP address
Datacenters: Multi-Tenants
60
…
…
…
…
…
…
…
…
10.1.1.1
10.1.1.2
10.1.1.100
Tenant 2:
Mesh topology, 3 switches, IPv6, FW, LB, 10 servers
Tenant 2 network will be overlayed over the same physical network
Tenant 1 network
Network Virtualization: Basic Architecture
61
Virtual Networks: Building Blocks
62
Seen and processed by physical network
Added and removed at start/end of tunnel
Seen and processed by vSwitch and VMs
Virtual Networks: Building Blocks
63
Software Switches: Basics
64
OS Kernel
vSwitch App
Software Switches: Prefix Matching
65
Open vSwitch: Microflow and Megaflow Caches
66
Microflow cache (kernel)
exact match, 1 hash lookup
Megaflow cache (kernel)
wildcards, many connections
ovs-vswitchd (user space)
full OpenFlow tables
miss
miss
install megaflow for later packets
hit: forward now
Virtual Switch Offload: SmartNICs
67
Software vSwitch
VM
VM
vSwitch on host CPU cores
NIC
every packet
uses host cores
Offloaded (SmartNIC or IPU)
VM
VM
VF (SR-IOV)
SmartNIC: flow table + tunnels in hardware
vSwitch software: first packet, fills table
Virtual Networks: Distributed Functions
68
Virtual Networks: Distributed Functions
69
Summary
70
Readings
71