You are on page 1of 46

SDN

An Open Source Demo


Cisco Networking Academy
November 2018 Global IPD Week
#NetAcadIPD
Dr. Jawad Khalife
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
SDN: An Open Source Demo
SDN Concepts

SDN is a Data-Center driven initiative for virtualization:

 Increased:
o Efficiency
o Scalable

 An architecture to centrally control and program


virtual Networks inside a Datacenter.

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
SDN: An Open Source Demo
SDN Concepts

Control, SDN
Program Entire Network
Control

Physical
separation

Forwarding

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
SDN: An Open Source Demo
SDN Concepts

SDN is a new network architecture with:

1. Centralized Control of Virtual Nodes


 Control-Data Separation (Controller)

2. Programmable Nodes (Software defined)


 Control-Data Protocol (OpenFlow)

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
SDN: An Open Source Demo
SDN Concepts

SDN is a new network architecture with:

1. Centralized Control of Virtual Nodes


 Control-Data Separation (Controller)

2. Programmable Nodes (Software defined)


 Control-Data Protocol (OpenFlow)

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
SDN: An Open Source Demo
SDN Concepts

SDN is a new network architecture with:

1. Centralized Control of Virtual Nodes


 Control-Data Separation (Controller)

2. Programmable Nodes (Software defined)


 Control-Data Protocol (OpenFlow)

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
SDN: An Open Source Demo
SDN Controller

Control

Physical
separation

Forwarding

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
SDN: An Open Source Demo
SDN Controller
Traditional networks

App App App

Operating
System
App App App
Specialized Packet
Forwarding Hardware
Operating
System

App App App Specialized Packet


Forwarding Hardware
Operating
System
App App App
Specialized Packet
Forwarding Hardware Operating
System

Specialized Packet
App App App
Forwarding Hardware

Operating
System

Specialized Packet
Forwarding Hardware
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
SDN: An Open Source Demo
SDN Controller
Control Programs SDN based networks
Network Operating System

Simple Packet
Forwarding
Hardware Simple Packet
Forwarding
Hardware

Simple Packet
Forwarding
Hardware
Simple Packet
Forwarding
Hardware

Simple Packet
Forwarding
Hardware © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Dr. Jawad Khalife
SDN: An Open Source Demo
SDN Controller

SDN is a new network architecture with:

1. Centralized Control of Virtual Nodes


 Control-Data Separation (Controller)

2. Programmable Nodes (Software defined)


 Control-Data Protocol (OpenFlow)

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
SDN: An Open Source Demo
OpenFlow
Control, Program
(Open Flow Language) How does the controller instructs
Control
the forwarding devices?
Physical
separation

Forwarding

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
SDN: An Open Source Demo
OpenFlow
Open Flow forwarding (Reactive)
 For every flow the SDN device sends a “PACKET IN” message to the controller

 The controller based on what application’s needs sends a “PACKET OUT” message

Controller

SDN
Device PACKET IN
Packet Out SDN
Device SDN
Device
SDN
Device

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
SDN: An Open Source Demo
OpenFlow
Open Flow forwarding (Proactive)
 The controller preprograms the forwarding table of devices according to the application

 When the flow matching the preprogramed flow entry enters the device the controller is NOT
consulted

Controller
pre-configured rules
SDN
Device

SDN
Device SDN
Device
SDN
Device
pre-configured rules pre-configured rules
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
SDN: An Open Source Demo
OpenFlow (Forwarding Rules)
Rule Action Stats

Packet + byte counters

1.Forward packet to port(s)


2.Encapsulate and forward to controller
3.Drop packet
4.Send to normal processing pipeline
5.…

Switch MAC MAC Eth VLAN IP IP IP TCP TCP


Port src dst type ID Src Dst Prot sport dport
+ mask Up to Layer 4
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
SDN: An Open Source Demo
OpenFlow (Forwarding Rules)
Layer 2 Switching Layer 3
(MAC/VLAN) Routing

Fields to match against flows


Wild Card Filters
Wild Card Matching:
▪ IN Port ▪ TCP/UDP Src ▪ Aggregated MAC-subnet: MAC-src: A.*,
▪ VLAN ID Port MAC-dst: B.*
▪ VLAN Priority ▪ TCP/UDP Dst ▪ Aggregated IP-subnet: IP-src:
▪ Ether Frame Type Port 192.168.*/24, IP-dst: 200.12.*/24
▪ IP Type of Service ▪ VLAN Priority
▪ IP Protocol ▪ MPLS Label
▪ IP Type of Service
▪ IP Src Address

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
SDN: An Open Source Demo
OpenFlow (Rules Examples)
 Switching
Switch MAC MAC Eth VLAN IP IP IP TCP TCP
Action
Port src dst type ID Src Dst Prot sport dport
* * 00:1f:.. * * * * * * * port6

 Routing
Switch MAC MAC Eth VLAN IP IP IP TCP TCP
Action
Port src dst type ID Src Dst Prot sport dport
* * * * * * 5.6.7.8 * * * port6

 Firewall
Switch MAC MAC Eth VLAN IP IP IP TCP TCP
Action
Port src dst type ID Src Dst Prot sport dport
* * * * * * * * * 22 drop
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
SDN: An Open Source Demo
OpenFlow (Forwarding Table)

Actual Flow Table Example

Protocol QoS

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
Let’s put all together…

SDN
Real Case Examples

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
Software Defined Networks
Open Flow Messages
▪ Example: H1 HTTP Request to H4

• 1 FW
• 2 routers
• 2 Switches
• 8 Cables

…..Replaced by

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
Software Defined Networks
Open Flow Messages
▪ Example: H1 HTTP Request to H4

• 1 Controller
• 1 Switch

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Open Flow
Reactive scenario

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
Software Defined Networks
Open Flow Messages: Reactive scenario
▪ Example: H1 HTTP Request to H4

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
Software Defined Networks
Open Flow Messages: Reactive scenario
▪ Example: H1 HTTP Request to H4

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
Software Defined Networks
Open Flow Messages: Reactive scenario
▪ Example: H1 HTTP Request to H4

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Software Defined Networks
Open Flow Messages: Reactive scenario
▪ Example: H1 HTTP Request to H4

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
Software Defined Networks
Open Flow Messages: Reactive scenario
▪ Example: H1 HTTP Request to H4

NO more referral to the controller


as flow entries are now created

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Open Flow
Proactive scenario

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
Software Defined Networks
Open Flow Messages: Proactive scenario
▪ Example: H1 HTTP Request to H4

NO referral to the controller if flow


entries are proactively created

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
SDN: An Open Source Demo
OpenSource SDN (Open Controllers)
Name Lang Platform(s) License Original Notes
Author
OpenFlow C Linux OpenFlow Stanford/Nicira not designed for
Reference License extensibility

NOX Python Linux GPL Nicira actively developed


, C++

Beacon Java Win, Mac, GPL (core), David Erickson runtime modular, web UI
Linux, FOSS (Stanford) framework, regression test
Android Licenses for framework
your code

Maestro Java Win, Mac, LGPL Zheng Cai


Linux (Rice)

Trema Ruby, Linux GPL NEC includes emulator,


C regression test framework
RouteFlow ? Linux Apache CPqD (Brazil) virtual IP routing as a
service
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
SDN: An Open Source Demo
OpenSource SDN (OpenFlow Switches)
• Open vSwitch: Open Source and popular as 2014.

• Indigo: Open source implementation that runs on Mac OS X.

• LINC: Open source implementation that runs on Linux, Solaris, Windows,


MacOS, and FreeBSD.
• Pantou: Turns a commercial wireless router/access point to an OpenFlow enabled
switch. OpenFlow runs on OpenWRT. Supports generic Broadcom and some
models of LinkSys and TP-Link access points with Broadcom and Atheros
chipsets.
• Of13softswitch: User-space software switch based on Ericsson TrafficLab 1.1
softswitch.

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
SDN: An Open Source Demo
Conclusion
• SDN
 Efficiency, Ease of management

• SDN:
 Data-Center driven initiative
 Centralized , programmable virtual network (Custom
Forwarding Policy)
Separation of control and data plane
OpenFlow, an Interface to program switches via controller

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
Agenda

SDN Concepts

SDN Controller

OpenFlow

OpenSource SDN

Mininet Demo

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
SDN: An Open Source Demo
Mininet Emulator

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
SDN: An Open Source Demo
Mininet Emulator
 Virtual test bed and development environment for
software-defined networks (SDN).

 Mininet enables SDN development on any laptop or PC

 SDN designs can move seamlessly between Mininet


and the real hardware.

 Mininet provides an extensible Python API for network


creation and experimentations.

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 39
SDN: An Open Source Demo
Mininet Emulator (LAB Requirements)

 To implement an SDN (Software Defined Networks) LAB based on


mininet 64-bit virtual machine (using VMware).
 Windows host PC:
 Minimum 4GB of RAM
 Latest Virtual Box | VMWARE Player installed
 Mininet VM file:
 VM can be downloaded from the link below:
 http://onlab.vicci.org/mininet-vm/mininet-2.2.0-150106-ubuntu-14.04-
server-amd64.zip
 The basic installation steps can be checked here:
 https://github.com/mininet/openflow-tutorial/wiki/Installing-Required-
Software
 Run mininet: To verify installation, just run the mininet VM and test login
(mininet, mininet).
 Optional: Setting SSH is optional with putty.exe and Xming Server
installed on windows host PC.

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
SDN: An Open Source Demo
Mininet Emulator (Simple Topologies)
Creating Simple Topology:
firefox httpd
# sudo mn
Host Switch Host
Creating Topologies:
# mn
# mn --topo tree,depth=3,fanout=3 --link=tc,bw=10
# mn --topo linear,100

Testing with Xterm:

mininet> xterm h1 h2
h1# wireshark &
h2# python -m SimpleHTTPServer 80 &
h1# firefox & © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41
Dr. Jawad Khalife
SDN: An Open Source Demo
Mininet Emulator (Simple Topologies)
Topology:
• 2 Hosts
• 1 Switch
Controller • 1 Controller

firefox httpd

h1 Switch h2
eth1 10.0.0.2
10.0.0.1 eth0 S1

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 42
SDN: An Open Source Demo
Mininet Emulator (Simple Topologies)
Topology:
Controller • 2 Hosts
C0 • 1 Switch
port6633
loopback
• 1 Controller
(127.0.0.1:6633)

loopback
S1 OpenFlow (127.0.0.1:6634)
dpctl
(user space
Switch process)
s1-eth0 s1-eth1

h1-eth0 h2-eth0

h1 h2
10.0.0.1 10.0.0.2

virtual hosts
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 43
SDN: An Open Source Demo
Mininet Emulator (Custom Topologies)
Creating custom Topologies:
# mn --custom custom.py --topo mytopo

class SingleSwitchTopo( mytopo ):


"Single Switch Topology" def
build( self, count=1):
hosts = [ self.addHost( 'h%d' % i )
for i in range( 1, count + 1 ) ] s1 =
self.addSwitch( 's1' )
for h in hosts: self.addLink(
h, s1 )

net = Mininet( topo=SingleSwitchTopo( 3 ) )


net.start()
CLI( net )
net.stop()
Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 44
SDN: An Open Source Demo
Mininet Emulator (References)

Mininet FAQ:
https://github.com/mininet/mininet/wiki/FAQ#NAT

Mininet Walkthrough:
http://mininet.org/walkthrough/

Dr. Jawad Khalife © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 45

You might also like