Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

20
Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad

Transcript of Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Page 1: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Project Overview

CS5229Lecturer: Dr. Richard MA

TA: Mostafa Rezazad

Page 2: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Variety of SDN Controllers

• NOX/POX• Ryu• Floodlight• OpenDaylight• Pyretic• Frenetic• Procera• RouteFlow• Trema

Page 3: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

POX: Overview

• A platform for building network control applications using Python

• Supports OpenFlow v. 1.0 only

• Advantages:o Widely used, maintained, supportedo Relatively easy to read and write code

• Disadvantages: Performance

Page 4: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

OpenFlowSwitch

OpenFlowSwitch

OpenFlowSwitch

OpenFlo

w

OpenFlo

w

OpenFlo

w

Preview

Control Plane

Data Plane

Listener Control Logic Messager

1

Parse packet and execute control logicFirst packet arrives at switchNo flow table match“PacketIn” event firedPacket sent to controllerCompose and send messageWrite flow table entrySecond packet arrives at switchFlow table matchAction

PacketIn

Msg

Entry 1

2

Page 5: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Learn through an example

• Implement a switcho What is a switch?o What is a hub?

Page 6: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Simple hub

• Ethernet is a broadcast mediumo Hub is a flooding device

Page 7: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Example: Simple Switch

• Switch layer 2:o A multiple port bridge o learn about the MAC addresses on each portso passes MAC frames destined to those ports.

Page 8: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

A

A’

B

B’ C

C’

1 2

345

6

Self-learning, forwarding: example

A A’

Source: ADest: A’

MAC addr interface TTL

switch table (initially empty)

A 1 60

A A’A A’A A’A A’A A’

• frame destination, A’, location unknown: flood

A’ A

• destination A location known:

A’ 4 60

selectively send on just one link

Page 9: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

How it works?

• Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn)

• Step 2: Parse packet and execute control logics

• Step 3: Compose and send the OpenFlow message to the switch

ControllerListenerEvent

def launch ():

1- core.openflow.addListenerByName("PacketIn", _handle_PacketIn)

2- core.registerNew (Tutorial)

Class Tutorial(EventMixin): //EventMixin is the class that raises events

def __init__(self): self.listenTo(core.openflow)

core.openflow_discovery.addListeners(self)//then implement all handlers you need….

Page 10: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

How it works?

• Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn)

• Step 2: Parse packet and execute control logics

• Step 3: Compose and send the OpenFlow message to the switch

ControllerListener Control LogicEvent

def _handle_PacketIn (self, event): packet = event.parsed dst_port = table.get(packet.dst)

def _handle_ConnectioUp (self, event) :log.debug(“Switch %s has come up.”,

dpid_to_str(event.dpid))

Every switch connected to the controller has an id named dpid (data path id).

Page 11: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

How it works?

• Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn)

• Step 2: Parse packet and execute control logics

• Step 3: Compose and send the OpenFlow message to the switch

Listener Control Logic MessagerEvent

Msg

msg = of.ofp_flow_mod() <- This instructs a switch to install a flow table entry

msg.match.dl_src = packet.src another example is:

msg.match.dl_dst = packet.dst _packet_out()

msg.actions.append(of.ofp_action_output(port = dst_port))event.connection.send(msg)

Page 12: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Example: Simple Switch

def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn)

def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst)

msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg)

Step 1: Register event listener

Page 13: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Example: Simple Switch

def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn)

def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst)

msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg)

Step 2: Parse the packet and execute control logics

Page 14: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Example: Simple Switch

def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn)

def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst)

msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg)Step 3: Compose and send OpenFlow

message

Page 15: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Network slicing

• Divide the production network into logical sliceso Each slice controls its own packet

forwarding

• Enforce strong isolation between sliceso Actions in one slice do not affect another

Page 16: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Example1: FlowVisor

• FlowVisor a transparent proxy between switches and multiple controllers

• FlowVisor enforces isolation between each slice

OpenFlowSwitch

OpenFlowSwitch

OpenFlowSwitch

OpenFlowSwitch

OpenFlowSwitch

FlowVisor

Slice 1Controller

Slice 2Controller

Slice 3Controller

OFOF

OF OF

OF

OF OF

OF

Page 17: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

OpenFlowSwitch

Example2: QoS-related Network Slicing• Multiple queues for multiple classes• Guaranteed minimum bandwidth• Queue configuration is not part of the

openflow• Configuration defines packet treatment • Openflow maps flows to queuesRef:http://archive.openflow.org/wk/index.php/Slicing

Controller

OF

Q1 Q2 Q3 Q4 Q5DQ IF1

IF2

IF1IF3

IF4

Page 18: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Your project

• It is not FlowVisor • It is not multiple queues (e.g., QoS)• Special case where multiple bandwidth is

provided• Separate traffics into two slices and assign to

different interfaces (not different controller not different queues)

• Try to keep it simple.

Page 19: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Lets have a look at the skeleton!

Page 20: Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.

Flow Space