• No results found

LuaFlow, an open source Openflow Controller

N/A
N/A
Protected

Academic year: 2021

Share "LuaFlow, an open source Openflow Controller"

Copied!
40
0
0

Loading.... (view fulltext now)

Full text

(1)

LuaFlow, an open source

Openflow Controller

Raphael Amorim

[email protected]

[email protected]

Renato Aguiar

[email protected]

Workshop 2012

(2)

Talk Overview

• What is OpenFlow?

• How OpenFlow Works

• Lua Flow approach

• Demo

(3)

Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Ap p App App Ap p App App Specialized Packet Forwarding Hardware Operating System Operating System Operating System Operating System Operating System Ap p App App

Current Internet

(4)

Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Ap p App App Specialized Packet Forwarding Hardware Operating System Operating System Operating System Operating System Operating System Ap p App App Network Operating System

App

App

App

“Software Defined Networking” approach

to open it

(5)

App

Simple Packet Forwarding Hardware Simple Packet Forwarding Hardware Simple Packet

App

App

Simple Packet Forwarding

Hardware Simple Packet Forwarding

Hardware

Network Operating System

1. Open interface to hardware

3. Well-defined open API 2. At least one good operating systemExtensible, possibly open-source

(6)
(7)

Short Story: OpenFlow is an API

• Control how packets are forwarded

• Make deployed networks programmable

– not just configurable

• Makes innovation easier

• Goal

(experimenter’s perspective):

– No more special purpose test-beds

– Validate your experiments on deployed

hardware with real traffic at full line speed

(8)

How Does

(9)
(10)

Data Path (Hardware)

Data Path (Hardware)

Control Path

Control Path

Control Path (Software)

Control Path (Software)

(11)

Data Path (Hardware)

Data Path (Hardware)

Control Path

Control Path

OpenFlow

OpenFlow

OpenFlow Controller

OpenFlow Controller

(12)

Controller

PC

Hardware Layer Software Layer Flow Table MAC

src MACdst IPSrc IPDst TCPsport TCPdport Action

OpenFlow Firmware

* * 5.6.7.8 * * * port 1 port 4 port 3 port 2 port 1 1.2.3.4 5.6.7.8

(13)

OpenFlow Basics

Flow Table Entries

Switch

Port MACsrc MACdst

Eth type VLAN

ID

IP

Src IPDst IPProt TCPsport TCPdport

Rule Action Stats

1. Forward packet to port(s)

2. Encapsulate and forward to controller

3. Drop packet

4. Send to normal processing pipeline

5. Modify Fields

+ mask what fields to match

(14)

Examples

Switching

*

Switch

Port MACsrc MACdst Ethtype VLANID IPSrc IPDst IPProt TCPsport TCPdport Action * 00:1f:.. * * * * * * * port6

Flow Switching

port3 Switch

Port MACsrc MACdst Ethtype VLANID IPSrc IPDst IPProt TCPsport TCPdport Action 00:20.. 00:1f.. 0800 vlan1 1.2.3.4 5.6.7.8 4 17264 80 port6

Firewall

*

Switch

Port MACsrc MACdst Ethtype VLANID IPSrc IPDst IPProt TCPsport TCPdport Forward

(15)

Examples

Routing

*

Switch

Port MACsrc MACdst Ethtype VLANID IPSrc IPDst IPProt TCPsport TCPdport Action * * * * * 5.6.7.8 * * * port6

VLAN Switching

*

Switch

Port MACsrc MACdst Ethtype VLANID IPSrc IPDst IPProt TCPsport TCPdport Action

* * vlan1 * * * * *

port6, port7, port9 00:1f..

(16)

OpenFlowSwitch.org

Controller

OpenFlow

Switch

PC

OpenFlow Usage

Dedicated OpenFlow Network

OpenFlow

Switch

OpenFlow

Switch

OpenFlow Protocol

Rule Action Statistics

Rule Action Statistics Rule Action Statistics

Alice Bob

(17)

Experiment Design Decisions

• Forwarding logic (of course)

• Centralized vs. distributed control

• Fine vs. coarse grained rules

• Reactive vs. Proactive rule creation

(18)

Centralized vs Distributed

Control

Centralized Control

OpenFlow Switch OpenFlow Switch OpenFlow Switch Controller

Distributed Control

OpenFlow Switch OpenFlow Switch OpenFlow Switch Controller Controller Controller

(19)

Flow Routing vs. Aggregation

Both models are possible with OpenFlow

Flow-Based

Every flow is individually

set up by controller

Exact-match flow entries

Flow table contains one

entry per flow

Good for fine grain

control, e.g. campus

networks

Aggregated

One fow entry covers large

groups of fows

Wildcard fow entries

Flow table contains one entry

per category of fows

Good for large number of

fows, e.g. backbone

(20)

Reactive vs. Proactive

Both models are possible with OpenFlow

Reactive

First packet of flow

triggers controller to

insert flow entries

Efficient use of flow

table

Every flow incurs small

additional flow setup

time

If control connection

lost, switch has limited

utility

Proactive

Controller pre-populates fow

table in switch

Zero additional fow setup

time

Loss of control connection

does not disrupt traffic

Essentially requires

(21)

Examples of OpenFlow in Action

• VM migration across subnets

• Identity-Based QoS

• Energy-efficient data center network

• Network slicing

(22)
(23)

Slide Credits

• Guido Appenzeller

• Nick McKeown

• Guru Parulkar

• Brandon Heller

• Rob Sherwood

• Lots of others

(24)
(25)

Official Open Source controllers

• NOX (Python/C)

– Mixed approach

• Beacon (Java)

– Focus in production environments

– Java “enterprise” code

• Trema (Ruby)

(26)

There's a strong correlation between the

length of code (number of tokens) and

programmers' productivity

e.g. Arc Programming Language [Paul Graham]

With smaller code:

- less time to write consistent code

- less chances for bugs

LuaFlow is specialized for programmers' productivity,

But not compromising efficiency

(27)

... because we write it in C and Lua

(NOX written in C++ and Python, Beacon written

in Java)

This is the main reason!

(28)

switches{ switch1 = {datapath_id = "00:00:00:00:00:00:00:01"}, switch2 = {datapath_id = "00:00:00:00:00:00:00:02"}, } hosts{ host1 = {mac = "00:00:00:00:00:03"}, host2 = {mac = "00:00:00:00:00:04"}, }

-- Connections: Connection.switch[port#] = {switch=port#} or -- Connection.switch[port#] = {host} or

-- Connection.host = {switch=port#}

Connection.host1 = { switch1 = 2} Connection.host2 = { switch2 = 2} Connection.switch1[1] = { switch2 = 1}

(29)
(30)
(31)
(32)
(33)

# NOX Python inst.install_datapath_flow( dpid, extract_flow(packet), CACHE_TIMEOUT, openflow.OFP_FLOW_PERMANENT, [[openflow.OFPAT_OUTPUT, [0, prt[0]]]], bufid, openflow.OFP_DEFAULT_PRIORITY, inport, buf # Luaflow add_simple_flow(dpid, flow, buffer_id, out_port, cache_timeout)

VS

(34)

Catching network events

function switch_ready(dpid, features)

function switch_ready(dpid, features)

print(">> New switch connected: " .. dpid) for k,v in pairs(features) do

if k == "ports" then for i,p in ipairs(v) do print("Port " .. i) for k1,v1 in pairs(p) do print(k1, v1) end end else print(k, v) end end end

(35)

Catching network events

function packet_in(dpid, buffer_id, flow)

print(">> New packet (" .. buffer_id .. ") received from " .. dpid) local idle_timeout = 10

local out_port = "all"

add_simple_flow(dpid, flow, buffer_id, out_port, idle_timeout)

(36)

Base classes

base_config.lua

custom_topology_config.lua

Topology.lua

Port.lua

Host.lua

Switch.lua

Link.lua

Dijkstra.lua

Controller.lua

Flow.lua

(37)

Base classes

require "Topology"

myTopology = Topology:new{name = "mininet"}

myTopology:load_config("custom_topology_config.lua")

function switch_ready(dpid, features)

print(">> New switch connected: " .. dpid) --TODO

--Insert switch features into switch objects

end

function packet_in(dpid, buffer_id, flow)

print(">> New packet received from " .. dpid)

route = myTopology:getRoute(flow.dl_src, flow.dl_dst) ...

(38)
(39)

Next steps

• Pure lua controller using ffi/luajit

• More real-world scenarios

• Serious evaluation

• Open WRT Openflow wireless devices

• Community pull-requests

(40)

Questions?

References

Related documents

The purpose of this study was to investigate the patterns of visual behaviour and cogni- tive processes of experienced elementary teachers and pre-service teachers in an initial

Any European decision will have to take notice of the priority of the cultural aspect over the competition aspect, hence the main question that has to be addressed is exactly

Section 3 is devoted to the bounded from below case where we prove that the nearest neighbor classifier reaches the minimax rate of convergence for the excess risk under

本稿では,対称分布でなく,非対称な分布の位置尺度母数のロバスト推定をDesgagné

points out that employers have a large financial incentive to not pay overtime. By increasing the amount of employees who are eligible for overtime so drastically, employers are

Through treatment options like Employee Assistance Programs (EAPs) such as Screening, Brief Intervention, and Referral to Treatment (SBIRT), employers can provide services

Hence, we do find long-term effects of unpaid overtime: A persistent increase in average unpaid overtime work of one hour per week goes along with an increase in hourly real

Based on the analysis, a normalised bispectral peak in conjunction with signal kurtosis is developed to diagnose common compressor faults including valve leakage,