SlideShare a Scribd company logo
1 of 39
Download to read offline
Fabrizio Granelli fabrizio.granelli@unitn.it
SDN LABORATORY
Downloads for SDN Lab
¨ Download the VMs from
https://github.com/mininet/openflow-tutorial/wiki/Installing-Required-
Software
¨ Verify software requirements:
Refer to https://github.com/mininet/openflow-tutorial/wiki/Home for
more details
OS Type OS Version
Virtualization
Software
X Server Terminal
Windows 7+ VirtualBox Xming PuTTY
Windows XP VirtualBox Xming PuTTY
Mac
OS X 10.7-10.9
Lion/Mountain
Lion/ Mavericks
VirtualBox
download and
install XQuartz
Terminal.app
(built in)
Linux Ubuntu 10.04+ VirtualBox
X server
already
installed
gnome terminal
+ SSH built in
OpenFlow building blocks
Controller
NOX
Slicing
Software
FlowVisor
Expedient
3
Controller
Applications
LAVI
ENVI (GUI) Aggregation
n-Casting
NetFPGA
Software
Ref. Switch
Broadcom
Ref. Switch
OpenWRT
PCEngine
WiFi AP
Commercial Switches Stanford Provided
OpenFlow
Switches
SNAC
Stanford Provided
Monitoring/
debugging tools
oflops
oftrace openseer
OpenVSwitch
HP, NEC, Pronto,
Juniper.. and many
more
Beacon Helios Maestro
Trend
Computer Industry Network Industry
Open interface to hardware
Many operating systems, or
Many versions
Open interface to hardware
Isolated “slices”
5
Switch Based Virtualization
Exists for NEC, HP switches but not flexible enough
Normal L2/L3 Processing
Flow Table
Production VLANs
Research VLAN 1
Controller
Research VLAN 2
Flow Table
Controller
6
FlowVisor-based Virtualization
OpenFlow
Switch
OpenFlow
Protocol
OpenFlow FlowVisor
& Policy Control
Fabrizio’s
Controller
Bob’s
Controller
Alice’s
Controller
OpenFlow
Protocol
OpenFlow
Switch
OpenFlow
Switch
7
Topology
discovery is
per slice
OpenFlow
Protocol
OpenFlow
FlowVisor & Policy Control
Broadcast
Multicast
OpenFlow
Protocol
http
Load-balancer
FlowVisor-based Virtualization
OpenFlow
Switch
OpenFlow
Switch
OpenFlow
Switch
8
Separation not only
by VLANs, but any
L1-L4 pattern
dl_dst=FFFFFFFFFFFF tp_src=80, or
tp_dst=80
FlowSpace: Maps Packets to Slices
FlowVisor Message Handling
OpenFlow
Firmware
Data Path
Alice
Controller
Bob
Controller
Cathy
Controller
FlowVisor
OpenFlow
OpenFlow
Packet
Exception
Policy Check:
Is this rule
allowed?
Policy Check:
Who controls
this packet?
Full Line Rate
Forwarding
Rule
Packet
Introduction to Mininet
¨ Mininet
¤ A network emulator which creates realistic virtual network
¤ Runs real kernel, switch and application code on a single machine
¤ Provides both Command Line Interface (CLI) and Application
Programming Interface (API)
n CLI: interactive commanding
n API: automation
¤ Abstraction
n Host: emulated as an OS level process
n Switch: emulated by using software-based switch
n E.g., Open vSwitch, SoftSwitch
Mininet Installation (1/2)
¨ Mininet VM Installation
¤ The easiest and most fool-proof way of installing Mininet
¤ Procedures
n Download the Mininet pre-installed VM image
n Download and install one of the hypervisors (e.g., VirtualBox, Qemu, VMware
Workstation, VMware Fusion, or KVM)
n Import VM image into selected hypervisor
¨ Native Installation from Source
¤ Recommended OS: Ubuntu 11.10 and later
¤ Procedures
n Download source from github
n Full installation: Mininet + Open vSwtich + wireshark + etc.
n Minimum installation: + Mininet + Open vSwitch
$ git clone git://github.com/mininet/mininet
$ mininet/util/install.sh -a
$ mininet/util/install.sh -fnv
Mininet Installation (2/2)
¨ Native Installation from Package
¤ Recommended OS: Ubuntu 12.04 and later
¤ Procedures
n Remove all previously installed Mininet and Open vSwitch
n Install Mininet package according to your Ubuntu version (choose one of them!)
n Deactive OpenvSwitch controller if it is running
n You can also install additional software from mininet source
$ sudo rm -rf /usr/local/bin/mn /usr/local/bin/mnexec 
/usr/local/lib/python*/*/*mininet* 
/usr/local/bin/ovs-* /usr/local/sbin/ovs-*
$ sudo apt-get install mininet
$ sudo apt-get install mininet/quantal-backports
$ sudo apt-get install mininet/precise-backports
Ubuntu 13.04
Ubuntu 12.10
Ubuntu 12.04
$ sudo service openvswitch-controller stop
$ sudo update-rc.d openvswitch-controller disable
$ git clone git://github.com/mininet/mininet
$ mininet/util/install.sh -fw
Mininet Tutorial (1/7)
¨ Mininet Command Line Interface Usage
¤ Interact with hosts and switches
n Start a minimal topology
n Start a minimal topology using a remote controller
n Start a custom topology
n Display nodes
n Display links
n Dump information about all nodes
$ sudo mn
mininet> nodes
mininet> net
mininet> dump
$ sudo mn --controller=remote,ip=[IP_ADDDR],port=[listening port]
$ sudo mn --custom [topo_script_path] --topo=[topo_name]
Mininet Tutorial (2/7)
¨ Mininet Command Line Interface Usage
¤ Interact with hosts and switches
n Check the IP address of a certain node
n Print the process list from a host process
¤ Test connectivity between hosts
n Verify the connectivity by pinging from host0 to host1
n Verify the connectivity between all hosts
mininet> h1 ifconfig -a
mininet> h1 ps -a
mininet> h1 ping -c 1 h2
mininet> pingall
Mininet Tutorial (3/7)
¨ Mininet Command Line Interface Usage
¤ Run a regression test
n Traffic receive preparation
n Traffic generation from client
¤ Link variations
¤ Python Interpreter
n Print accessible local variables
n Execute a method through invoking mininet API
$ sudo mn -link tc,bw=[bandwidth],delay=[delay_in_millisecond]
mininet> iperf -s -u -p [port_num] &
mininet> iperf -c [IP] -u -t [duration] -b [bandwidth] -p [port_num] &
$ py locals()
$ py [mininet_name_space].[method]
Mininet Tutorial (4/7)
¨ Mininet Application Programming Interface Usage
¤ Low-level API: nodes and links
n mininet.node.Node
n A virtual network node, which is a simply in a network namespace
n mininet.link.Link
n A basic link, which is represented as a pair of nodes
Class Method Description
Node
MAC/setMAC Return/Assign MAC address of a node or specific interface
IP/setIP Return/Assign IP address of a node or specific interface
cmd Send a command, wait for output, and return it
terminate Send kill signal to Node and clean up after it
Link Link Create a link to another node, make two new interfaces
h1 = Host( 'h1' )
h2 = Host( 'h2' )
s1 = OVSSwitch( 's1', inNamespace=False )
c0 = Controller( 'c0', inNamespace=False )
Link( h1, s1 )
Link( h2, s1 )
h1.setIP( '10.1/8' )
h2.setIP( '10.2/8' )
c0.start()
s1.start( [ c0 ] )
print h1.cmd( 'ping -c1', h2.IP() )
s1.stop()
c0.stop()
Mininet Tutorial (5/7)
¨ Mininet Application Programming Interface Usage
¤ Middle-level API: network object
n mininet.net.Mininet
n Network emulation with hosts spawned in network namespaces
Class Method Description
Net
addHost Add a host to network
addSwitch Add a switch to network
addLink Link two nodes into together
addController Add a controller to network
getNodeByName Return node(s) with given name(s)
start Start controller and switches
stop Stop the controller, switches and hosts
ping Ping between all specified hosts and return all data
net = Mininet()
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2' )
s1 = net.addSwitch( 's1' )
c0 = net.addController( 'c0' )
net.addLink( h1, s1 )
net.addLink( h2, s1 )
net.start()
print h1.cmd( 'ping -c1', h2.IP() )
CLI( net )
net.stop()
Mininet Tutorial (6/7)
¨ Mininet Application Programming Interface Usage
¤ High-level API: topology templates
n mininet.topo.Topo
n Data center network representation for structured multi-trees
Class Method Description
Topo
Methods similar to net E.g., addHost, addSwitch, addLink,
addNode Add node to graph
addPort Generate port mapping for new edge
switches Return all switches
Hosts/nodes/switches/links Return all hosts
isSwitch Return true if node is a switch, return false otherwise
class SingleSwitchTopo( Topo ):
"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()
Mininet Tutorial (7/7)
¨ Mininet Application Programming Interface Usage
¤ Customized topology
# cat custom.py
LEN_DPID = 16
from mininet.topo import Topo
class MyTopo( Topo ):
def name_dpid( self, index ):
dpid = '%02d' % ( index )
zeros = '0' * ( LEN_DPID - len( dpid ) )
name = 's%02d' % ( index )
return { 'name':name, 'dpid':zeros + dpid }
def build( self, count=1):
hosts = [ self.addHost( 'h%d' % i )
for i in range( 1, count + 1 ) ]
s1 = self.addSwitch( **self.name_dpid(1) )
for h in hosts:
self.addLink( h, s1 )
topos = { 'mytopo': MyTopo }
# mn --custom custom.py --topo mytopo,3
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3
More examples can be found here:
https://github.com/mininet/mininet/tree/master/examples
Two Flow Insertion Methods
¨ Reactive Flow Insertion
¤ A non-matched packet reaches an OpenFlow switch, it is sent to the
controller, based on the packet an appropriate flow is inserted
¨ Proactive Flow Insertion
¤ Flow can be inserted proactively by the controller in switches before packet
arrive
OpenFlow
Controller
host1 host2
switch1 (reactive) switch2 (proactive)
acquire
route
insert
flow
SRC DST ACT …
SRC DST ACT …
h1 h2 p1
SRC DST ACT …
h1 h2 p1
Mininet OpenFlow tutorial
¨ Download the VMs from
https://github.com/mininet/openflow-tutorial/wiki/Installing-Required-
Software
¨ Verify software requirements:
Refer to https://github.com/mininet/openflow-tutorial/wiki/Home for
more details
OS Type OS Version
Virtualization
Software
X Server Terminal
Windows 7+ VirtualBox Xming PuTTY
Windows XP VirtualBox Xming PuTTY
Mac
OS X 10.7-10.9
Lion/Mountain
Lion/ Mavericks
VirtualBox
download and
install XQuartz
Terminal.app
(built in)
Linux Ubuntu 10.04+ VirtualBox
X server
already
installed
gnome terminal
+ SSH built in
Mininet VM Setup
¨ Once you have downloaded the .ovf image,
¤ Start up VirtualBox, then select File>Import Appliance
and select the .ovf image that you downloaded.
¨ You may also be able to simply double-click the
.ovf file to open it up in your installed virtualization
program.
¤ Next, press the "Import" button.
¨ This step will take a while - the unpacked image is
about 3 GB.
Setting up the VM for ssh access
¨ If you are running VirtualBox, you should make sure your VM has
two network interfaces. One should be a NAT interface that it can
use to access the Internet, and the other should be a host-only
interface to enable it to communicate with the host machine. For
example, your NAT interface could be eth0 and have a 10.x IP
address, and your host-only interface could be eth1 and have a
192.168.x IP address. You should ssh into the host-only interface at
its associated IP address. Both interfaces should be configured using
DHCP.
¨ From the virtual machine console, log in to the VM, then enter:
¨ You should see three interfaces(eth0, eth1, lo), Both eth0 and eth1
should have IP address assigned. If this is not the case, type
¨ For the access to the VM:
$ ifconfig -a
$ sudo dhclient ethX
$ ssh -X [user]@[Guest IP Here]
Alternative: using the VM GUI
¨ Log in to the VM console window, and type:
¨ At this point, you should be able to start an X11
session in the VM console window by typing:
$ sudo apt-get update && sudo apt-get install xinit lxde
virtualbox-guest-dkms
$ startx
Development Tools
¨ OpenFlow Controller: sits above the OpenFlow interface. The OpenFlow reference
distribution includes a controller that acts as an Ethernet learning switch in
combination with an OpenFlow switch. You'll run it and look at messages being sent.
Then, in the next section, you'll write our own controller on top of NOX or Beacon
(platforms for writing controller applications).
¨ OpenFlow Switch: sits below the OpenFlow interface. The OpenFlow reference
distribution includes a user-space software switch. Open vSwitch is another software
but kernel-based switch, while there is a number of hardware switches available
from Broadcom (Stanford Indigo release), HP, NEC, and others.
¨ ovs-ofctl: command-line utility that sends quick OpenFlow messages, useful for
viewing switch port and flow stats or manually inserting flow entries.
¨ Wireshark: general (non-OF-specific) graphical utility for viewing packets. The
OpenFlow reference distribution includes a Wireshark dissector, which parses
OpenFlow messages sent to the OpenFlow default port (6633) in a conveniently
readable way.
¨ iperf: general command-line utility for testing the speed of a single TCP connection.
¨ Mininet: network emulation platform. Mininet creates a virtual OpenFlow network -
controller, switches, hosts, and links - on a single real or virtual machine. More
Mininet details can be found at the Mininet web page.
¨ cbench: utility for testing the flow setup rate of OpenFlow controllers.
Start a simple network
$ sudo mn --topo single,3 --mac --switch ovsk --controller remote
What did we do?
¨ Created 3 virtual hosts, each with a separate IP
address.
¨ Created a single OpenFlow software switch in the
kernel with 3 ports.
¨ Connected each virtual host to the switch with a virtual
ethernet cable.
¨ Set the MAC address of each host equal to its IP.
¨ Configure the OpenFlow switch to connect to a remote
controller.
$ sudo mn --topo single,3 --mac --switch ovsk --controller remote
Some relevant mininet commands
¨ To see the list of nodes available, in the Mininet console, run:
¨ To see a list of available commands, in the Mininet console, run:
¨ To run a single command on a node, prepend the command with the name
of the node. For example, to check the IP of a virtual host, in the Mininet
console, run:
¨ The alternative - better for running interactive commands and watching
debug output - is to spawn an xterm for one or more virtual hosts. In the
Mininet console, run:
¨ If Mininet is not working correctly (or has crashed and needs to be
restarted), first quit Mininet if necessary (using the exit command, or control-
D), and then try clearing any residual state or processes using:
mininet> nodes
mininet> h1 ifconfig
mininet> help
mininet> xterm h1 h2
$ sudo mn -c
ovs-ofctl example usage
¨ Create another terminal window:
¨ The show command connects to the switch and
dumps out its port state and capabilities.
¨ Here's a more useful command:
¨ Since we haven't started any controller yet, the
flow-table should be empty.
$ sudo ovs-ofctl show s1
$ sudo ovs-ofctl dump-flows s1
Ping test
¨ Now, go back to the mininet console and try to ping h2
from h1. In the Mininet console:
¨ Note that the name of host h2 is automatically replaced
when running commands in the Mininet console with its IP
address (10.0.0.2).
¨ Do you get any replies? Why? Why not?As you saw
before, switch flow table is empty.
¨ Besides that, there is no controller connected to the
switch and therefore the switch doesn't know what to do
with incoming traffic, leading to ping failure.
mininet> h1 ping -c3 h2
Ping test – manual config
¨ You'll use ovs-ofctl to manually install the necessary
flows. In your SSH terminal:
¨ This will forward packets coming at port 1 to port 2
and vice-versa. Verify by checking the flow-table:
¨ Run the ping command again. In your mininet console:
¨ Do you get replies now? Check the flow-table again
and look the statistics for each flow entry. Is this what
you expected to see based on the ping traffic?
# sudo ovs-ofctl add-flow s1 in_port=1,actions=output:2
# sudo ovs-ofctl add-flow s1 in_port=2,actions=output:1
# ovs-ofctl dump-flows s1
mininet> h1 ping -c3 h2
Run Wireshark
¨ The VM image includes the OpenFlow Wireshark dissector pre-
installed. Wireshark is extremely useful for watching OpenFlow
protocol messages, as well as general debugging.
¨ You'll probably get a warning message for using wireshark with root
access. Press OK.
¨ Now, set up a filter for OpenFlow control traffic, by using the ’tcp
port 6653' filter (Capture->Options).
¨ Click on Capture->Interfaces in the menu bar. Click on the Start
button next to 'lo', the loopback interface. You may see some
packets going by.
¨ Press the apply button to apply the filter to all recorded traffic.
(See https://wiki.wireshark.org/OpenFlow for more info on OF support
in Wireshark)
$ sudo wireshark &
Start basic controller
¨ With the Wireshark dissector listening, start the
OpenFlow reference controller. In your SSH
terminal:
¨ This starts a simple controller that acts as a learning
switch without installing any flow-entries. The
parameters represent the listening port for the
controller (6653) and the verbose option ‘-v’
¨ You should see a bunch of messages displayed in
Wireshark, from the Hello exchange onwards.
$ sudo controller –v ptcp:6653 &
Using the controller
¨ First, we need to delete the flowtable in the switch
and the ARP tables in the hosts:
¨ Do the ping in the Mininet console:
¨ Repeat the command: what happens?
mininet> h1 ping -c1 h2
sudo ovs-ofctl del-flows s1
mininet> h1 ip -s -s neigh flush all
mininet> h2 ip -s -s neigh flush all
Benchmark controller w/iperf
¨ We will benchmark the reference controller in mininet
¨ In the mininet console run:
¨ This Mininet command runs an iperf TCP server on one
virtual host, then runs an iperf client on a second virtual
host. Once connected, they blast packets between each
other and report the results.
¨ Now compare with the user-space switch. In the mininet
console:
¨ Start the same Mininet with the user-space switch:
mininet> iperf
mininet> exit
$ sudo mn --topo single,3 --controller remote --switch user
Benchmark controller w/iperf
¨ Run one more iperf test with the reference
controller:
¨ With the user-space switch, packets must cross from
user-space to kernel-space and back on every hop,
rather than staying in the kernel as they go through
the switch. The user-space switch is easier to modify
(no kernel oops'es to deal with), but slower for
simulation.
¨ Exit Mininet:
mininet> iperf
mininet> exit
Slicing using FlowVisor
¨ See the following tutorial
Fabrizio Granelli
fabrizio.granelli@unitn.it
Any questions?

More Related Content

Similar to 3-sdn-lab.pdf

OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Python Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One BugPython Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One Bugdelimitry
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation ToolsEdwin Beekman
 
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworknix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworkSander van der Burg
 
"Taming the Dragon": Get Started with Zenoh
"Taming the Dragon": Get Started with Zenoh"Taming the Dragon": Get Started with Zenoh
"Taming the Dragon": Get Started with ZenohZettaScaleTechnology
 
6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of servers6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of serversvideos
 
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGPiotr Kieszczyński
 
5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Manovideos
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleChanaka Lasantha
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in DockerEric Ahn
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
Assisted-Installer-DevConf-US-2021
Assisted-Installer-DevConf-US-2021Assisted-Installer-DevConf-US-2021
Assisted-Installer-DevConf-US-2021Nir Magnezi
 
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021Freddy Rolland
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivAleksey Asiutin
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionHiveMQ
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)iman darabi
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Evgeny Antyshev
 

Similar to 3-sdn-lab.pdf (20)

OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Python Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One BugPython Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One Bug
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation Tools
 
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworknix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
 
"Taming the Dragon": Get Started with Zenoh
"Taming the Dragon": Get Started with Zenoh"Taming the Dragon": Get Started with Zenoh
"Taming the Dragon": Get Started with Zenoh
 
6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of servers6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of servers
 
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUG
 
5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Assisted-Installer-DevConf-US-2021
Assisted-Installer-DevConf-US-2021Assisted-Installer-DevConf-US-2021
Assisted-Installer-DevConf-US-2021
 
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021
"Look Ma, no hands! Zero Touch Provisioning for OpenShift" DevConf.US 2021
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ Extension
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
 

Recently uploaded

CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

3-sdn-lab.pdf

  • 2. Downloads for SDN Lab ¨ Download the VMs from https://github.com/mininet/openflow-tutorial/wiki/Installing-Required- Software ¨ Verify software requirements: Refer to https://github.com/mininet/openflow-tutorial/wiki/Home for more details OS Type OS Version Virtualization Software X Server Terminal Windows 7+ VirtualBox Xming PuTTY Windows XP VirtualBox Xming PuTTY Mac OS X 10.7-10.9 Lion/Mountain Lion/ Mavericks VirtualBox download and install XQuartz Terminal.app (built in) Linux Ubuntu 10.04+ VirtualBox X server already installed gnome terminal + SSH built in
  • 3. OpenFlow building blocks Controller NOX Slicing Software FlowVisor Expedient 3 Controller Applications LAVI ENVI (GUI) Aggregation n-Casting NetFPGA Software Ref. Switch Broadcom Ref. Switch OpenWRT PCEngine WiFi AP Commercial Switches Stanford Provided OpenFlow Switches SNAC Stanford Provided Monitoring/ debugging tools oflops oftrace openseer OpenVSwitch HP, NEC, Pronto, Juniper.. and many more Beacon Helios Maestro
  • 5. Open interface to hardware Many operating systems, or Many versions Open interface to hardware Isolated “slices” 5
  • 6. Switch Based Virtualization Exists for NEC, HP switches but not flexible enough Normal L2/L3 Processing Flow Table Production VLANs Research VLAN 1 Controller Research VLAN 2 Flow Table Controller 6
  • 7. FlowVisor-based Virtualization OpenFlow Switch OpenFlow Protocol OpenFlow FlowVisor & Policy Control Fabrizio’s Controller Bob’s Controller Alice’s Controller OpenFlow Protocol OpenFlow Switch OpenFlow Switch 7 Topology discovery is per slice
  • 8. OpenFlow Protocol OpenFlow FlowVisor & Policy Control Broadcast Multicast OpenFlow Protocol http Load-balancer FlowVisor-based Virtualization OpenFlow Switch OpenFlow Switch OpenFlow Switch 8 Separation not only by VLANs, but any L1-L4 pattern dl_dst=FFFFFFFFFFFF tp_src=80, or tp_dst=80
  • 10. FlowVisor Message Handling OpenFlow Firmware Data Path Alice Controller Bob Controller Cathy Controller FlowVisor OpenFlow OpenFlow Packet Exception Policy Check: Is this rule allowed? Policy Check: Who controls this packet? Full Line Rate Forwarding Rule Packet
  • 11. Introduction to Mininet ¨ Mininet ¤ A network emulator which creates realistic virtual network ¤ Runs real kernel, switch and application code on a single machine ¤ Provides both Command Line Interface (CLI) and Application Programming Interface (API) n CLI: interactive commanding n API: automation ¤ Abstraction n Host: emulated as an OS level process n Switch: emulated by using software-based switch n E.g., Open vSwitch, SoftSwitch
  • 12. Mininet Installation (1/2) ¨ Mininet VM Installation ¤ The easiest and most fool-proof way of installing Mininet ¤ Procedures n Download the Mininet pre-installed VM image n Download and install one of the hypervisors (e.g., VirtualBox, Qemu, VMware Workstation, VMware Fusion, or KVM) n Import VM image into selected hypervisor ¨ Native Installation from Source ¤ Recommended OS: Ubuntu 11.10 and later ¤ Procedures n Download source from github n Full installation: Mininet + Open vSwtich + wireshark + etc. n Minimum installation: + Mininet + Open vSwitch $ git clone git://github.com/mininet/mininet $ mininet/util/install.sh -a $ mininet/util/install.sh -fnv
  • 13. Mininet Installation (2/2) ¨ Native Installation from Package ¤ Recommended OS: Ubuntu 12.04 and later ¤ Procedures n Remove all previously installed Mininet and Open vSwitch n Install Mininet package according to your Ubuntu version (choose one of them!) n Deactive OpenvSwitch controller if it is running n You can also install additional software from mininet source $ sudo rm -rf /usr/local/bin/mn /usr/local/bin/mnexec /usr/local/lib/python*/*/*mininet* /usr/local/bin/ovs-* /usr/local/sbin/ovs-* $ sudo apt-get install mininet $ sudo apt-get install mininet/quantal-backports $ sudo apt-get install mininet/precise-backports Ubuntu 13.04 Ubuntu 12.10 Ubuntu 12.04 $ sudo service openvswitch-controller stop $ sudo update-rc.d openvswitch-controller disable $ git clone git://github.com/mininet/mininet $ mininet/util/install.sh -fw
  • 14. Mininet Tutorial (1/7) ¨ Mininet Command Line Interface Usage ¤ Interact with hosts and switches n Start a minimal topology n Start a minimal topology using a remote controller n Start a custom topology n Display nodes n Display links n Dump information about all nodes $ sudo mn mininet> nodes mininet> net mininet> dump $ sudo mn --controller=remote,ip=[IP_ADDDR],port=[listening port] $ sudo mn --custom [topo_script_path] --topo=[topo_name]
  • 15. Mininet Tutorial (2/7) ¨ Mininet Command Line Interface Usage ¤ Interact with hosts and switches n Check the IP address of a certain node n Print the process list from a host process ¤ Test connectivity between hosts n Verify the connectivity by pinging from host0 to host1 n Verify the connectivity between all hosts mininet> h1 ifconfig -a mininet> h1 ps -a mininet> h1 ping -c 1 h2 mininet> pingall
  • 16. Mininet Tutorial (3/7) ¨ Mininet Command Line Interface Usage ¤ Run a regression test n Traffic receive preparation n Traffic generation from client ¤ Link variations ¤ Python Interpreter n Print accessible local variables n Execute a method through invoking mininet API $ sudo mn -link tc,bw=[bandwidth],delay=[delay_in_millisecond] mininet> iperf -s -u -p [port_num] & mininet> iperf -c [IP] -u -t [duration] -b [bandwidth] -p [port_num] & $ py locals() $ py [mininet_name_space].[method]
  • 17. Mininet Tutorial (4/7) ¨ Mininet Application Programming Interface Usage ¤ Low-level API: nodes and links n mininet.node.Node n A virtual network node, which is a simply in a network namespace n mininet.link.Link n A basic link, which is represented as a pair of nodes Class Method Description Node MAC/setMAC Return/Assign MAC address of a node or specific interface IP/setIP Return/Assign IP address of a node or specific interface cmd Send a command, wait for output, and return it terminate Send kill signal to Node and clean up after it Link Link Create a link to another node, make two new interfaces h1 = Host( 'h1' ) h2 = Host( 'h2' ) s1 = OVSSwitch( 's1', inNamespace=False ) c0 = Controller( 'c0', inNamespace=False ) Link( h1, s1 ) Link( h2, s1 ) h1.setIP( '10.1/8' ) h2.setIP( '10.2/8' ) c0.start() s1.start( [ c0 ] ) print h1.cmd( 'ping -c1', h2.IP() ) s1.stop() c0.stop()
  • 18. Mininet Tutorial (5/7) ¨ Mininet Application Programming Interface Usage ¤ Middle-level API: network object n mininet.net.Mininet n Network emulation with hosts spawned in network namespaces Class Method Description Net addHost Add a host to network addSwitch Add a switch to network addLink Link two nodes into together addController Add a controller to network getNodeByName Return node(s) with given name(s) start Start controller and switches stop Stop the controller, switches and hosts ping Ping between all specified hosts and return all data net = Mininet() h1 = net.addHost( 'h1' ) h2 = net.addHost( 'h2' ) s1 = net.addSwitch( 's1' ) c0 = net.addController( 'c0' ) net.addLink( h1, s1 ) net.addLink( h2, s1 ) net.start() print h1.cmd( 'ping -c1', h2.IP() ) CLI( net ) net.stop()
  • 19. Mininet Tutorial (6/7) ¨ Mininet Application Programming Interface Usage ¤ High-level API: topology templates n mininet.topo.Topo n Data center network representation for structured multi-trees Class Method Description Topo Methods similar to net E.g., addHost, addSwitch, addLink, addNode Add node to graph addPort Generate port mapping for new edge switches Return all switches Hosts/nodes/switches/links Return all hosts isSwitch Return true if node is a switch, return false otherwise class SingleSwitchTopo( Topo ): "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()
  • 20. Mininet Tutorial (7/7) ¨ Mininet Application Programming Interface Usage ¤ Customized topology # cat custom.py LEN_DPID = 16 from mininet.topo import Topo class MyTopo( Topo ): def name_dpid( self, index ): dpid = '%02d' % ( index ) zeros = '0' * ( LEN_DPID - len( dpid ) ) name = 's%02d' % ( index ) return { 'name':name, 'dpid':zeros + dpid } def build( self, count=1): hosts = [ self.addHost( 'h%d' % i ) for i in range( 1, count + 1 ) ] s1 = self.addSwitch( **self.name_dpid(1) ) for h in hosts: self.addLink( h, s1 ) topos = { 'mytopo': MyTopo } # mn --custom custom.py --topo mytopo,3 *** Creating network *** Adding controller *** Adding hosts: h1 h2 h3 More examples can be found here: https://github.com/mininet/mininet/tree/master/examples
  • 21. Two Flow Insertion Methods ¨ Reactive Flow Insertion ¤ A non-matched packet reaches an OpenFlow switch, it is sent to the controller, based on the packet an appropriate flow is inserted ¨ Proactive Flow Insertion ¤ Flow can be inserted proactively by the controller in switches before packet arrive OpenFlow Controller host1 host2 switch1 (reactive) switch2 (proactive) acquire route insert flow SRC DST ACT … SRC DST ACT … h1 h2 p1 SRC DST ACT … h1 h2 p1
  • 22. Mininet OpenFlow tutorial ¨ Download the VMs from https://github.com/mininet/openflow-tutorial/wiki/Installing-Required- Software ¨ Verify software requirements: Refer to https://github.com/mininet/openflow-tutorial/wiki/Home for more details OS Type OS Version Virtualization Software X Server Terminal Windows 7+ VirtualBox Xming PuTTY Windows XP VirtualBox Xming PuTTY Mac OS X 10.7-10.9 Lion/Mountain Lion/ Mavericks VirtualBox download and install XQuartz Terminal.app (built in) Linux Ubuntu 10.04+ VirtualBox X server already installed gnome terminal + SSH built in
  • 23. Mininet VM Setup ¨ Once you have downloaded the .ovf image, ¤ Start up VirtualBox, then select File>Import Appliance and select the .ovf image that you downloaded. ¨ You may also be able to simply double-click the .ovf file to open it up in your installed virtualization program. ¤ Next, press the "Import" button. ¨ This step will take a while - the unpacked image is about 3 GB.
  • 24. Setting up the VM for ssh access ¨ If you are running VirtualBox, you should make sure your VM has two network interfaces. One should be a NAT interface that it can use to access the Internet, and the other should be a host-only interface to enable it to communicate with the host machine. For example, your NAT interface could be eth0 and have a 10.x IP address, and your host-only interface could be eth1 and have a 192.168.x IP address. You should ssh into the host-only interface at its associated IP address. Both interfaces should be configured using DHCP. ¨ From the virtual machine console, log in to the VM, then enter: ¨ You should see three interfaces(eth0, eth1, lo), Both eth0 and eth1 should have IP address assigned. If this is not the case, type ¨ For the access to the VM: $ ifconfig -a $ sudo dhclient ethX $ ssh -X [user]@[Guest IP Here]
  • 25. Alternative: using the VM GUI ¨ Log in to the VM console window, and type: ¨ At this point, you should be able to start an X11 session in the VM console window by typing: $ sudo apt-get update && sudo apt-get install xinit lxde virtualbox-guest-dkms $ startx
  • 26. Development Tools ¨ OpenFlow Controller: sits above the OpenFlow interface. The OpenFlow reference distribution includes a controller that acts as an Ethernet learning switch in combination with an OpenFlow switch. You'll run it and look at messages being sent. Then, in the next section, you'll write our own controller on top of NOX or Beacon (platforms for writing controller applications). ¨ OpenFlow Switch: sits below the OpenFlow interface. The OpenFlow reference distribution includes a user-space software switch. Open vSwitch is another software but kernel-based switch, while there is a number of hardware switches available from Broadcom (Stanford Indigo release), HP, NEC, and others. ¨ ovs-ofctl: command-line utility that sends quick OpenFlow messages, useful for viewing switch port and flow stats or manually inserting flow entries. ¨ Wireshark: general (non-OF-specific) graphical utility for viewing packets. The OpenFlow reference distribution includes a Wireshark dissector, which parses OpenFlow messages sent to the OpenFlow default port (6633) in a conveniently readable way. ¨ iperf: general command-line utility for testing the speed of a single TCP connection. ¨ Mininet: network emulation platform. Mininet creates a virtual OpenFlow network - controller, switches, hosts, and links - on a single real or virtual machine. More Mininet details can be found at the Mininet web page. ¨ cbench: utility for testing the flow setup rate of OpenFlow controllers.
  • 27. Start a simple network $ sudo mn --topo single,3 --mac --switch ovsk --controller remote
  • 28. What did we do? ¨ Created 3 virtual hosts, each with a separate IP address. ¨ Created a single OpenFlow software switch in the kernel with 3 ports. ¨ Connected each virtual host to the switch with a virtual ethernet cable. ¨ Set the MAC address of each host equal to its IP. ¨ Configure the OpenFlow switch to connect to a remote controller. $ sudo mn --topo single,3 --mac --switch ovsk --controller remote
  • 29. Some relevant mininet commands ¨ To see the list of nodes available, in the Mininet console, run: ¨ To see a list of available commands, in the Mininet console, run: ¨ To run a single command on a node, prepend the command with the name of the node. For example, to check the IP of a virtual host, in the Mininet console, run: ¨ The alternative - better for running interactive commands and watching debug output - is to spawn an xterm for one or more virtual hosts. In the Mininet console, run: ¨ If Mininet is not working correctly (or has crashed and needs to be restarted), first quit Mininet if necessary (using the exit command, or control- D), and then try clearing any residual state or processes using: mininet> nodes mininet> h1 ifconfig mininet> help mininet> xterm h1 h2 $ sudo mn -c
  • 30. ovs-ofctl example usage ¨ Create another terminal window: ¨ The show command connects to the switch and dumps out its port state and capabilities. ¨ Here's a more useful command: ¨ Since we haven't started any controller yet, the flow-table should be empty. $ sudo ovs-ofctl show s1 $ sudo ovs-ofctl dump-flows s1
  • 31. Ping test ¨ Now, go back to the mininet console and try to ping h2 from h1. In the Mininet console: ¨ Note that the name of host h2 is automatically replaced when running commands in the Mininet console with its IP address (10.0.0.2). ¨ Do you get any replies? Why? Why not?As you saw before, switch flow table is empty. ¨ Besides that, there is no controller connected to the switch and therefore the switch doesn't know what to do with incoming traffic, leading to ping failure. mininet> h1 ping -c3 h2
  • 32. Ping test – manual config ¨ You'll use ovs-ofctl to manually install the necessary flows. In your SSH terminal: ¨ This will forward packets coming at port 1 to port 2 and vice-versa. Verify by checking the flow-table: ¨ Run the ping command again. In your mininet console: ¨ Do you get replies now? Check the flow-table again and look the statistics for each flow entry. Is this what you expected to see based on the ping traffic? # sudo ovs-ofctl add-flow s1 in_port=1,actions=output:2 # sudo ovs-ofctl add-flow s1 in_port=2,actions=output:1 # ovs-ofctl dump-flows s1 mininet> h1 ping -c3 h2
  • 33. Run Wireshark ¨ The VM image includes the OpenFlow Wireshark dissector pre- installed. Wireshark is extremely useful for watching OpenFlow protocol messages, as well as general debugging. ¨ You'll probably get a warning message for using wireshark with root access. Press OK. ¨ Now, set up a filter for OpenFlow control traffic, by using the ’tcp port 6653' filter (Capture->Options). ¨ Click on Capture->Interfaces in the menu bar. Click on the Start button next to 'lo', the loopback interface. You may see some packets going by. ¨ Press the apply button to apply the filter to all recorded traffic. (See https://wiki.wireshark.org/OpenFlow for more info on OF support in Wireshark) $ sudo wireshark &
  • 34. Start basic controller ¨ With the Wireshark dissector listening, start the OpenFlow reference controller. In your SSH terminal: ¨ This starts a simple controller that acts as a learning switch without installing any flow-entries. The parameters represent the listening port for the controller (6653) and the verbose option ‘-v’ ¨ You should see a bunch of messages displayed in Wireshark, from the Hello exchange onwards. $ sudo controller –v ptcp:6653 &
  • 35. Using the controller ¨ First, we need to delete the flowtable in the switch and the ARP tables in the hosts: ¨ Do the ping in the Mininet console: ¨ Repeat the command: what happens? mininet> h1 ping -c1 h2 sudo ovs-ofctl del-flows s1 mininet> h1 ip -s -s neigh flush all mininet> h2 ip -s -s neigh flush all
  • 36. Benchmark controller w/iperf ¨ We will benchmark the reference controller in mininet ¨ In the mininet console run: ¨ This Mininet command runs an iperf TCP server on one virtual host, then runs an iperf client on a second virtual host. Once connected, they blast packets between each other and report the results. ¨ Now compare with the user-space switch. In the mininet console: ¨ Start the same Mininet with the user-space switch: mininet> iperf mininet> exit $ sudo mn --topo single,3 --controller remote --switch user
  • 37. Benchmark controller w/iperf ¨ Run one more iperf test with the reference controller: ¨ With the user-space switch, packets must cross from user-space to kernel-space and back on every hop, rather than staying in the kernel as they go through the switch. The user-space switch is easier to modify (no kernel oops'es to deal with), but slower for simulation. ¨ Exit Mininet: mininet> iperf mininet> exit
  • 38. Slicing using FlowVisor ¨ See the following tutorial