Professional Documents
Culture Documents
Takahiro Miyamoto
KDDI R&D Laboratories Inc.
Agenda
What is OpenFlow
Practices
OpenFlow overview
OpenFlow protocol in details
Environment
Practice 1: Configure OpenFlow switches
Practice 2: Use mininet
Practice 3: Use OpenFlow controller
Practice 4: Understand controller behavior
Practice 5: Allow ping traffic
Practice 6: Allow ping between a pair
Practice 7: Control packet by packet
KDDI R&D Laboratories Inc.
8 August 2012
What is OpenFlow
Forwarding function
on per-flow basis
OpenFlow switch
Rule
Action Statistics
Rule
Action Statistics
Rule
Action Statistics
OpenFlow controller
Action Statistics
packet
Flow table
8 August 2012
Features of OpenFlow
8 August 2012
L3 (router)
In
Src Dst Ether VLAN VLAN Src
port MAC MAC Type ID priority IP
L4 (firewall)
Dst IP
IP Src Dst
IP proto ToS Port Port
Payload
8 August 2012
E.g. NAT
Src IP address
Dst IP address
Src port
Dst port
192.168.1.45
192.168.1.45
2222
4325
Dst IP address
Src port
Dst port
192.168.1.45
10.1.1.45
2222
80
Src IP address
Dst IP address
02:11:99:00:00:01
02:11:99:00:00:02
192.168.1.1
192.168.1.25
Rule:
If dst IP address is equal to 192.168.1.25
Action: Set dst MAC address to 00:12:34:56:78:90
Src IP address
Dst IP address
02:11:99:00:00:01
00:12:34:56:78:90
192.168.1.1
192.168.1.25
8 August 2012
Open vSwitch
OpenFlow switch
OpenFlow switch
OpenFlow switch
8 August 2012
2011
2012
2013
Hardware switch
Software switch
Pica8 2010.7
NEC 2011.3
IBM (Blade Networks) 2011.11
Juniper 2012.2
hp 2012.2
LINC 2012.6
Arista
Brocade
Cisco
Ericsson
Extreme
Force10
Under development
gnodal
Today
LineRate
MetaSwitch
stratosphere
8 August 2012
2011
2012
2013
Product
NOX 2008.11
Open Source
NEC 2011.3
Trema 2011.7
Beacon 2011.9
Wakame 2011.12
FloodLight 2012.1
Nicira 2012.2
IXIA 2012.7
Spirent 2012.10
BigSwitch
Midokura
Under development
Stratosphere
Today
8 August 2012
10
8 August 2012
Agenda
What is OpenFlow
Practices
11
OpenFlow overview
OpenFlow protocol in details
Environment
Practice 1: Configure OpenFlow switches
Practice 2: Use mininet
Practice 3: Use OpenFlow controller
Practice 4: Understand controller behavior
Practice 5: Allow ping traffic
Practice 6: Allow ping between a pair
Practice 7: Control packet by packet
KDDI R&D Laboratories Inc.
8 August 2012
Protocol message
Action
12
8 August 2012
Description
HELLO
CS
ERROR
CS
ECHO_REQUEST
CS
ECHO_REPLY
CS
FEATURES_REQUEST
CS
FEATURES_REPLY
SC
SET_CONFIG
CS
GET_CONFIG_REQUEST
CS
GET_CONFIG_REPLY
SC
13
8 August 2012
Description
FLOW_MOD
CS
FLOW_REMOVED
SC
PACKET_IN
SC
PACKET_OUT
CS
PORT_STATUS
SC
PORT_MOD
CS
14
8 August 2012
Description
STATS_REQUEST
CS
STATS_REPLY
SC
BARRIER_REQUEST
CS
BARRIER_REPLY
SC
QUEUE_GET_CONFIG_REQUEST
CS
QUEUE_GET_CONFIG_REPLY
SC
VENDOR
CS
15
8 August 2012
Establish TCP
OpenFlow
controller
HELLO
Check version
HELLO
FEATURES_REQUEST
FEATURES_REPLY
Handshake
SET_CONFIG
ECHO_REQUEST
ECHO_REPLY
16
Keep alive
8 August 2012
17
8 August 2012
Action
18
Description
OUTPUT
SET_VLAN_VID
Set VLAN ID
SET_VLAN_PCP
STRIP_VLAN
Remove VLAN ID
SET_DL_SRC
SET_DL_DST
SET_NW_SRC
SET_NW_DST
SET_NW_TOS
SET_TP_SRC
SET_TP_DST
ENQUEUE
8 August 2012
Port actions
Description
IN_PORT
TABLE
NORMAL
FLOOD
ALL
CONTROLLER
Forward to a controller.
8 August 2012
OpenFlow
switch
host
OpenFlow
controller
send a packet
Check flow table
PACKET_IN
FLOW_MOD
Update flow table
Forward packet
send a packet
20
8 August 2012
OpenFlow
switch
host
OpenFlow
controller
Decide packet behavior
FLOW_MOD
send a packet
Update flow table
Forward packet
send a packet
21
8 August 2012
Agenda
What is OpenFlow
Practices
22
OpenFlow overview
OpenFlow protocol in details
Environment
Practice 1: Configure OpenFlow switches
Practice 2: Use mininet
Practice 3: Use OpenFlow controller
Practice 4: Understand controller behavior
Practice 5: Allow ping traffic
Practice 6: Allow ping between a pair
Practice 7: Control packet by packet
KDDI R&D Laboratories Inc.
8 August 2012
Environment
OpenFlow switch
OpenFlow controller
23
mininet
Original based on FloodLight
8 August 2012
Mininet
24
8 August 2012
25
$
$
$
$
sudo
sudo
sudo
sudo
tunctl t tap0
brctl addbr br0
brctl addif br0 tap0
ifconfig br0 10.0.0.1
$ wget https://github.com/downloads/mininet/mininet/mininet-vmubuntu11.10-052312.vmware.zip
$ unzip mininet-vm-ubuntu11.10-052312.vmware.zip
$ sh Mininet-VM.sh
8 August 2012
FloodLight
26
8 August 2012
Based on FloodLight
27
8 August 2012
Configuration
PC
Mininet-VM
h3
s1
h2
h4
10.0.0.2/24
10.0.0.1/24
28
FloodLight
Internet
8 August 2012
Agenda
What is OpenFlow
Practices
29
OpenFlow overview
OpenFlow protocol in details
Environment
Practice 1: Configure OpenFlow switches
Practice 2: Use mininet
Practice 3: Use OpenFlow controller
Practice 4: Understand controller behavior
Practice 5: Allow ping traffic
Practice 6: Allow ping between a pair
Practice 7: Control packet by packet
KDDI R&D Laboratories Inc.
8 August 2012
Practice 1
30
8 August 2012
Practice 1
{of_switch, [
{controllers, [
{localhost, 6633}
Controller address
]},
{ports, [
Logical ports
[{ofs_port_no, 1},
{interface, "eth0"},
{queues, [{0, [{ofp_queue_prop_min_rate, 0},
{ofp_queue_prop_max_rate, 1000}]}]},
{rate, {1, gibps}}],
[{ofs_port_no, 2},
{interface, "eth1"},
{queues, [{0, [{ofp_queue_prop_min_rate, 0},
{ofp_queue_prop_max_rate, 1000}]}]},
{rate, {1, gibps}}]
]}
]}.
31
8 August 2012
Practice 1
32
8 August 2012
Practice 2
Use mininet
33
8 August 2012
Practice 2
Use mininet
34
8 August 2012
Practice 2
Use mininet
- h* : host
- s* : OpenFlow switch
- c* : OpenFlow controller
35
8 August 2012
Practice 3
$
$
$
$
$
$
$
$
$
$
$
36
8 August 2012
Practice 3
$ cd floodlight-simple
$ mkdir conf
$ vi conf/floodlight.properties
floodlight.properties
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
floodlight.modules =
com.kddi.sdn.floodlight.module.handshake.HandshakeModule,
com.kddi.sdn.floodlight.module.keepalive.KeepaliveModule
37
8 August 2012
Practice 3
Launch FloodLight.
$ cp target/com.kddi.sdn.floodlight.simple-0.0.1.jar .
$ java -jar com.kddi.sdn.floodlight.simple-0.0.1.jar
(Ctrl+C to exit)
Launch mininet.
Controller information
38
8 August 2012
Practice 4
$ cd floodlight-handshakemodule/src/main/java/com/kddi/sdn/floodlight/module/handshake
$ less HandshakeModule.java
39
8 August 2012
Practice 4
40
8 August 2012
Practice 4
41
8 August 2012
Practice 4
42
8 August 2012
Practice 4
43
8 August 2012
Coffee break
OpenFlow1.0
OpenFlow1.1
OpenFlow1.2
OpenFlow1.3
44
:
:
:
:
0x1
0x2
0x3
0x4
8 August 2012
Practice 5
45
8 August 2012
Practice 5
$ cd floodlight-simple
$ vi conf/floodlight.properties
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
floodlight.modules =
com.kddi.sdn.floodlight.module.handshake.HandshakeModule,
com.kddi.sdn.floodlight.module.keepalive.KeepaliveModule,
com.kddi.sdn.floodlight.module.lecture.ping.PingModule
46
8 August 2012
Practice 5
47
8 August 2012
Practice 5
$ cd floodlight-lecture/src/main/java/com/kddi/sdn/floodlight/module/lecture/ping
$ less PingModule.java
48
8 August 2012
Practice 5
49
8 August 2012
Practice 5
50
8 August 2012
Practice 6
Compile sources
51
$ mvn package
$ copy
target/com.kddi.sdn.floodlight.lecture.jar ../floodli
ght-simple/module
8 August 2012
Practice 7
$ cd floodlight-simple
$ vi conf/floodlight.properties
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
floodlight.modules =
com.kddi.sdn.floodlight.module.handshake.HandshakeModule,
com.kddi.sdn.floodlight.module.keepalive.KeepaliveModule,
com.kddi.sdn.floodlight.module.lecture.lldp.LLDPModule
52
8 August 2012
Practice 7
$ cd floodlight-lecture/src/main/java/com/kddi/sdn/floodlight/module/lecture/lldp
$ less LLDPModule.java
53
8 August 2012
Practice 7
54
8 August 2012
Practice 7
55
8 August 2012
56
8 August 2012