SlideShare a Scribd company logo
Presented by
Momina MasoodMININET DEMO
1
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)
• CLI: interactive commanding
• API: automation
 Abstraction
• Host: emulated as an OS level process
• Switch: emulated by using software-based switch
• E.g., Open vSwitch, SoftSwitch
2
INTRODUCTION TO MININET
Your SDN
Command-Line Interface
Scripting API
VM, native laptop, or native server
3
FLOW OF THE LAB
 Download the virtual machine
 Setup the virtual machine
 Check the setup in Linux
 Create the network
 Examine the network
 Work with basic OpenFlow commands
 Add a controller
4
DOWNLOAD THE VIRTUAL MACHINE
 For this lab a virtual machine appliance in ovf format must be
downloaded from the OpenFlow Tutorial website here
 https://github.com/downloads/mininet/mininet/mininet-2.0.0-113012-amd64-ovf.zip
 Download this file
 Expand the zip file
 You should see these files
5
SETUP THE VIRTUAL MACHINE
 To import this appliance into VirtualBox
 Select
 File
 Import Appliance
 Select the ovf image
 Press the Import button
 This lab requires two virtual NICs
 The first one should be set to host-only network
 The second one to NAT
6
CHECK LINUX
 Mininet is a command line tool that runs in Linux
 The Mininet prompt looks like this
 mininet>
 The Linux prompt ends with a $ for a normal user
 It ends in # for the root account
 We will use the sudo command to run the Linux commands with root
privileges at the normal user prompt
7
LOGIN VM
 Start the virtual machine
 Login to Linux
 The login is
 mininet
 mininet
 The screen should look like this
8
LOGIN VM
9
VM NETWORK CONFIGURATION
 Let’s see if the two network interfaces are setup correctly
 At the Linux prompt enter
 ifconfig
10
VM NETWORK CONFIGURATION
 Three interfaces should appear
 Two physical interfaces called
 eth0
 eth1
 And the loopback interface
11
VM NETWORK CONFIGURATION
 One of the physical interfaces should have a 192 address and the
other a 10 address
 We will access the virtual machine using a terminal program using the
192 address
 If either of the eth Ethernet interfaces are missing, run this command
 sudo dhclient ethx
 Where the x in ethx is the number of the interface
12
SET UP NETWORK ACCESS
13
SET UP NETWORK ACCESS
 As you can see the eth1 interface is missing
 After the dhclient command is run this appears
 sudo dhclient ethx
 Where the x in ethx is the number of the interface
14
SET UP NETWORK ACCESS
15
 The tutorial VM is shipped without a desktop environment, to reduce its size. All
the exercises will be done through X forwarding, where programs display graphics
through an X server running on the host OS.
 Open a terminal (Terminal.app in Mac, Gnome terminal in Ubuntu, etc). In that
terminal, run:
 $ ssh -X [user]@[Guest IP Here]
 Replace [user] with the correct user name for your VM image.
 Replace [Guest] with the IP you just noted.
 If ssh does not connect, make sure that you can ping the IP address you are connecting to.
ACCESS VM VIA SSH
16
 To not use X11 and log in to the VM console window - not via an ssh
session!
 Install GUI
 Login VM, and type:
$ sudo apt-get update && sudo apt-get install xinit lxde virtualbox-guest-dkms
 At this point, you should be able to start an X11 session in the VM
console window by typing:
$ startx
ALTERNATIVE: RUN A GUI IN THE VM CONSOLE
WINDOW
17
MININET TUTORIAL
 Mininet Command Line Interface Usage
 Interact with hosts and switches
• Start a minimal topology
The default run of Mininet sudo mn will create a topology consisting of one controller (c0), one switc
h (s1) and two hosts (h1 and h2).
• Display nodes
• Display links
• Dump information about all nodes
• Exit Mininet:
$ sudo mn
mininet> nodes
mininet> net
mininet> dump
The switches generated with Mininet will
be just simple forwarding devices, without
any "brain" of their own (no control plane)
mininet> exit
18
To help you start up, here are the most important options for running Mininet:
 --topo=TOPO represents the topology of the virtual network, where TOPO could
be:
 minimal - this is the default topology with 1 switch and 2 hosts
 single,X - a single switch with X hosts attached to it
 linear,X - creates X switches connected in a linear/daisy-chain fashion, each switch with one
host attached
 tree,X,Y - a tree topology with X depth, Y fanout
 --switch=SWITCH creates different type of switches, such as:
 ovsk - this is the default Open vSwitch that comes preinstalled in the VM
 user - this is a switch running in software namespace (much slower)
MININET TUTORIAL
19
 --controller=CONTROLLER where CONTROLLER can be:
 ovsc - this creates the default OVS Controller that comes preinstalled in the VM
 nox - this creates the well-known NOX controller
 remote - does not create a controller but instead listens for connections from
external controllers
 --mac set easy-to-read MAC addresses for the devices
 For more information
$ mn help
MININET TUTORIAL
20
 Display Mininet Command Line Interface (CLI) commands:
mininet> help
 Display nodes:
mininet> nodes
 If the first string of the CLI command is a host, switch or controller name, the
command is executed on that node. For instance, to show the interface of host
h1:
mininet> h1 ifconfig
 Test connectivity between hosts. For example, test the connectivity between h1
and h2:
mininet> h1 ping h2
 Alternatively, you can test the connectivity between all hosts by typing:
mininet> pingall
 Exit Mininet:
mininet> exit
 Clean up: After every exit do cleanup
$ sudo mn -c
MORE COMMANDS
21
NETWORK TOPOLOGY
 sudo mn --topo single,4 --mac --switch ovsk
22
 $ sudo mn --topo linear,3
NETWORK TOPOLOGY
23
 sudo mn --topo tree,2,3 --mac --switch ovsk --controller=remote
Where (--topo tree,depth=2,fanout=3)
NETWORK TOPOLOGY
24
sudo mn --link tc,bw=20,delay=20ms
Take a moment to think about our current, very basic,
topology.
(h1)-----20ms-----(s1)-----20ms-----(h2)
Q: When you send a ping, you measure the roundtrip delay for
an ICMP packet to travel from one host to another. Assuming
our current deployment, what will be the reported roundtrip
delay?
EXAMPLE
25
A1: ~80 ms
 Let’s test that assertion!
 mininet> h1 ping -c 8 h2
EXAMPLE (CONT..)
26
 Do not confuse the dpctl with a controller (it's not the same thing) -
dpctl is just a management/monitoring utility!
SIMPLE EXERCISE
Use ovs-oftcl instead of dpctl
for open vSwitch when running
a controller
In this scenario we have no
remote controller running
27
STEP 1: Start Mininet with a single switch (the default, Open vSwitch =
ovsk) and 3 hosts:
 mininet@mininet-vm:~$ sudo mn --topo=single,3 --mac --switch=ovsk --
controller=remote
EXERCISE (CONT..)
This message: "Unable to contact the remote
controller at 127.0.0.1:6633". This is because,
for the time being, we are going to use mininet
without any controller
28
 In order to double-check that everything started correctly, use the
following mininet commands:
 nodes - to list all virtual devices in the topology
 net - to list of links between them
 dump - to see more info about the hosts
EXERCISE (CONT..)
29
STEP 2: Open terminals for each host and run tcpdump on each:
Attention: for Windows/MAC users, make sure you installed & run Xming/XQuartz,
plus you enabled X-forwarding if you are using ssh session to the Mininet VM!
> xterm h1 h2 h3
 In the xterms for h2 and h3, run tcpdump, a utility to print the packets seen by a
host:
# tcpdump -XX -n -i h2-eth0
and respectively:
# tcpdump -XX -n -i h3-eth0
 In the xterm for h1, send a ping:
# ping -c1 10.0.0.2
EXERCISE (CONT..)
30
STEP 3: Test connectivity between h1 and h2: on host h1 perform a
ping -c3 10.0.0.2 (the IP address of host h2)
EXERCISE (CONT..)
31
Results:
 ping will fail, because the switch does NOT know what to do with
such traffic (and remember, we don't run any controller)
EXERCISE (CONT..)
32
 Checking the list of flows on the switch (with command dpctl dump-
flows) will show an empty list (again, nobody told the switch how to
deal with the traffic)
CHECKING FLOW RULES
33
Open new terminal window or create a second SSH window, if you
don't already have one, and run:
$ dpctl show tcp:127.0.0.1:6634
 The 'show' command connects to the switch and dumps out its port
state and capabilities.
$ dpctl dump-flows tcp:127.0.0.1:6634
 Since we haven't started any controller yet, the flow-table should be
empty.
CHECKING FLOW RULES
34
STEP 4: Manually add flows on the switch to allow connectivity
between h1 and h2
 Use the dpctl add-flow utility to manually install flows on the switch
that will allow connectivity between host h1 and host h2.
 $ dpctl add-flow tcp:127.0.0.1:6634 in_port=1,actions=output:2
everything received on port 1 (in_port) send out on port 2
 $ dpctl add-flow tcp:127.0.0.1:6634 in_port=2,actions=output:1
everything received on port 2 (return traffic) send out on port 1
ADDING FLOW RULES
35
FLOW RULES
36
Result:
 ping is successful
 tcpdump on host h2 shows the traffic from/to h1 (ARP and ICMP)
 tcpdump on host h3 does not see anything (not even the ARP which
should be broadcast)!
FLOW RULES
37
ACTIVATE WIRESHARK
 Start Wireshark as a background process
 $sudo wireshark $
 Click on OK to clear any error messages
38
OBSERVE SDN TRAFFIC
 Start a capture in Wireshark using the loopback interface
 Create and apply a filter for just the OpenFlow traffic by entering a
display filter in Wireshark using the string
 of
39
LOAD THE CONTROLLER
 To generate some traffic we will load a controller as that is the next
step anyway
 There are a number of software based or hardware based controllers
that can be used in an SDN
 In this example we will load the POX controller
40
LOAD THE CONTROLLER
 To start POX enter these commands
 $cd pox
 ./pox.py forwarding.l2_learning
41
LOAD THE CONTROLLER
42
OBSERVE SDN TRAFFIC
 Switch back to the Wireshark window to see the activity as the
controller loads
43
OBSERVE SDN TRAFFIC
44
GUI - Automatic Creation of Mininet Scripts
 Visual Network Description - VND (http://www.ramonfontes.com/vnd) - A GUI tool
that allows automatic creation of Mininet and Openflow Controllers Scripts.
GUI - MiniEdit
 Included in Mininet in the examples/ directory. miniedit.py
MININET APPS
45
 The MiniEdit script is located in Mininet’s examples folder.
 To run MiniEdit, execute the command:
$ sudo ~/mininet/examples/miniedit.py
 Mininet needs to run with root privileges so start MiniEdit using the
sudo command.
START MINIEDIT
46
MINIEDIT GUI
47
CREATE A CUSTOM NETWORK TOPOLOGY
48
 Right-click on each controller and select Properties from the menu
that appears.
 The default port number for each controller is 6633.
 Change this so the port numbers used by controllers c0, c1, and c2 are 6633, 6634,
and 6635, respectively.
CONFIGURE THE CONTROLLERS
49
CONFIGURE THE CONTROLLERS
50
 To set MiniEdit preferences, Edit → Preferences. In the dialogue box
that appears, make the changes you need.
SET MINIEDIT PREFERENCES
51
 Set the Start CLI option
SET MINIEDIT PREFERENCES
52
SAVE THE CONFIGURATION
Save topology file
 To save the Mininet Topology (*.mn) file, click on File in the top menu
bar and select Save from the drop-down menu. Type in a file name
and save the file.
Save custom Mininet script
 To save the Mininet Custom Topology (*.py) file, click on File in the
top menu bar and select Save Level 2 Script from the drop-down
menu. Type in the file name and save the file.
53
 To start the simulation scenario, click the Run button on the MiniEdit
GUI
RUN THE MINIEDIT NETWORK SCENARIO
In the terminal window from which
you started MiniEdit, you will see
some messages showing the
progress of the simulation startup and
then the Miniedit CLI prompt
(because we checked Start CLI box in
the MiniEdit preferences window).
54
View Open vSwitch configurations
EXPERIMENT WITH THE NETWORK
55
Check switch flow tables
CONT..
56
 First change the userid from root to mininet
# su mininet
 Then, check the flow table on switch s1 using the commands below.
It should be empty.
$ sudo ovs-ofctl dump-flows s1
CONT..
57
 Open a xterm window on hosts h1 and h8. Right-click on each host in
the MiniEdit GUI and select Terminal from the menu that appears.
 In the h1 xterm window, start a Wireshark with the command, wireshark &.
 In the h8 xterm window, start a packet trace with the command tcpdump.
$ tcpdump –n –i h8-eth0
 Run a ping command to send traffic between host h1 and h8
mininet> h1 ping h8
RUN PROGRAMS TO GENERATE AND MONITOR
TRAFFIC
58
CONT..
59
 Right-click on link. Choose Link Down from the menu that appears
SIMULATE A BROKEN LINK
60
 Ping again
 no more traffic is received at host h8 and that the ping command shows packets
sent from host h1 are not being responded to
 Restore the link by choosing Link Up
 Check flow tables
$ sudo ovs-ofctl dump-flows s1
CONT..
61
 Quit Wireshark and tcpdump on hosts h1 and h8.
 Quit the ping command in the MiniEdit console window by pressing
Ctrl-C on the keyboard.
 Then, quit the Mininet CLI by typing exit at the mininet> prompt.
 Now, press the Stop button on the MiniEdit GUI.
STOP THE SIMULATION
62
 $ cd ~/mininet/<filepath>
 $ sudo chmod 777 <filename>.py
 $ sudo ./<filename>.py
RUN A SAVED MININET CUSTOM TOPOLOGY
SCRIPT
63
 Open web browser and go to http://www.ramonfontes.com/vnd/#
VISUAL NETWORK DESCRIPTION(VND)
64
 Create the following topology using drag/drop
CREATE A CUSTOM NETWORK TOPOLOGY
65
SAVE TOPOLOGY
66
CONT..
67
 Set the file executable
CONT..
68
 Using the l2_multi pox controller module to find the shortest path
from sender to receiver to send packets.
 Run the l2_multi pox controller.
 Use discovery module to construct the network topology.
 When the topology is known, the l2_multi can use Floyd-Warshall
algorithm to find a shortest path.
 Note l2_multi.py is under /pox/pox/forwarding and discovery.py is
under /pox/pox/openflow
RUN CONTROLLER
69
RUN CONTROLLER
 ./pox.py log.level --DEBUG log forwarding.l2_multi
openflow.discovery
70
 Open another terminal and run the script
RUN SCRIPT
71
 Ping test
CONT..
72
 There are two paths from h1 to h2, i.e.
 h1->s3->s4->h2
 h1->s3->s5->s6->s4->h4.
 The shortest path is h1->s3->s4->h2.
 Check the rules for s3 (we can see the rules for arp and ip operations
between 10.0.0.1 (h1) and 10.0.0.2(h2))
CONT..
73
CONT..
mininet> sh ovs-ofctl dump-flows s3
74
 Check the rules for s4 (we can see the rules for arp and ip operations
between 10.0.0.1 (h1) and 10.0.0.2(h2))
CONT..
75
 No rules for s5 and s6.
Because the packets from h1 will not go via s5 and s6 to h2.
CONT..
76
77
RYU CONTROLLER
78
INSTALL RYU
$ sudo apt-get install git python-dev python-setuptools python-pip
$ git clone https://github.com/osrg/ryu.git
$ cd ryu
$ sudo pip install .
79
 Switching hubs have a variety of functions
 Learns the MAC address of the host connected to a port and retains it in the MAC
address table.
 When receiving packets addressed to a host already learned, transfers them to the
port connected to the host.
 When receiving packets addressed to an unknown host, performs flooding.
SWITCHING HUB
 Initial status
SWITCHING HUB BY OPENFLOW
80
81
 Host A -> Host B
SWITCHING HUB BY OPENFLOW
SWITCHING HUB BY OPENFLOW
82
 Host B -> Host A
SWITCHING HUB BY OPENFLOW
83
 Host A -> Host B
EXECUTION OF RYU APPLICATION
84
CONT..
85
CONT..
86
CONT..
87
EXECUTING THE SWITCHING HUB
88
CONT..
89
 Execute ping from host 1 to host 2
 mininet> h1 ping –c 1 h2
 Before executing the ping command, execute the tcpdump command so that it is
possible to check what packets were received by each host.
CONFIRMING OPERATION
90
PING TEST
91
CONT..
92
CONT..
93
DUMP FLOW RULES
94
CONT..
95
CONT..
96
 for more:http://www.brianlinkletter.com/how-to-use-miniedit-mininets-
graphical-user-interface/
 https://github.com/ramonfontes/vnd-sdn-
version/blob/master/README.md
REFRENCES
97
98

More Related Content

What's hot

Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조
Seung-Hoon Baek
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
Te-Yen Liu
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
Laurent Bernaille
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
YongKi Kim
 
VLAN vs VXLAN
VLAN vs VXLANVLAN vs VXLAN
VLAN vs VXLAN
GLC Networks
 
An introduction to the prpl foundation
An introduction to the prpl foundationAn introduction to the prpl foundation
An introduction to the prpl foundation
Imagination Technologies
 
Chassis Cluster Configuration
Chassis Cluster ConfigurationChassis Cluster Configuration
Chassis Cluster ConfigurationKashif Latif
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
vivekkonnect
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
Juniper Srx quickstart-12.1r3
Juniper Srx quickstart-12.1r3Juniper Srx quickstart-12.1r3
Juniper Srx quickstart-12.1r3Mohamed Al-Natour
 
VXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building Blocks
APNIC
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay Networks
Docker, Inc.
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
tmavroidis
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirt
plarsen67
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitchSim Janghoon
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zun
heut2008
 

What's hot (20)

Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
VLAN vs VXLAN
VLAN vs VXLANVLAN vs VXLAN
VLAN vs VXLAN
 
An introduction to the prpl foundation
An introduction to the prpl foundationAn introduction to the prpl foundation
An introduction to the prpl foundation
 
Chassis Cluster Configuration
Chassis Cluster ConfigurationChassis Cluster Configuration
Chassis Cluster Configuration
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Juniper Srx quickstart-12.1r3
Juniper Srx quickstart-12.1r3Juniper Srx quickstart-12.1r3
Juniper Srx quickstart-12.1r3
 
VXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building Blocks
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay Networks
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirt
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zun
 

Similar to Mininet demo

SDNDS.TW Mininet
SDNDS.TW MininetSDNDS.TW Mininet
SDNDS.TW Mininet
NCTU
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation Tools
Edwin Beekman
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUG
Piotr Kieszczyński
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)
iman darabi
 
Linux router
Linux routerLinux router
Secure LXC Networking
Secure LXC NetworkingSecure LXC Networking
Secure LXC Networking
Marian Marinov
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
Shafaan Khaliq Bhatti
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
Hanan Nmr
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
Adrien Blind
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
Cohesive Networks
 
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
videos
 
Meetup docker using software defined networks
Meetup docker   using software defined networksMeetup docker   using software defined networks
Meetup docker using software defined networksOCTO Technology
 
Workshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure DetectionWorkshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure Detection
Vincent Composieux
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
Laurent Bernaille
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
Binary Studio
 
Docker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversDocker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan Drivers
Brent Salisbury
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
videos
 

Similar to Mininet demo (20)

3-sdn-lab.pdf
3-sdn-lab.pdf3-sdn-lab.pdf
3-sdn-lab.pdf
 
SDNDS.TW Mininet
SDNDS.TW MininetSDNDS.TW Mininet
SDNDS.TW Mininet
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation Tools
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
OVS-NFV Tutorial
 
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUG
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)
 
Linux router
Linux routerLinux router
Linux router
 
Secure LXC Networking
Secure LXC NetworkingSecure LXC Networking
Secure LXC Networking
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
 
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
 
Meetup docker using software defined networks
Meetup docker   using software defined networksMeetup docker   using software defined networks
Meetup docker using software defined networks
 
Workshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure DetectionWorkshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure Detection
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
Docker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversDocker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan Drivers
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 

Recently uploaded

重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 

Recently uploaded (20)

重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 

Mininet demo

  • 2. 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) • CLI: interactive commanding • API: automation  Abstraction • Host: emulated as an OS level process • Switch: emulated by using software-based switch • E.g., Open vSwitch, SoftSwitch 2
  • 3. INTRODUCTION TO MININET Your SDN Command-Line Interface Scripting API VM, native laptop, or native server 3
  • 4. FLOW OF THE LAB  Download the virtual machine  Setup the virtual machine  Check the setup in Linux  Create the network  Examine the network  Work with basic OpenFlow commands  Add a controller 4
  • 5. DOWNLOAD THE VIRTUAL MACHINE  For this lab a virtual machine appliance in ovf format must be downloaded from the OpenFlow Tutorial website here  https://github.com/downloads/mininet/mininet/mininet-2.0.0-113012-amd64-ovf.zip  Download this file  Expand the zip file  You should see these files 5
  • 6. SETUP THE VIRTUAL MACHINE  To import this appliance into VirtualBox  Select  File  Import Appliance  Select the ovf image  Press the Import button  This lab requires two virtual NICs  The first one should be set to host-only network  The second one to NAT 6
  • 7. CHECK LINUX  Mininet is a command line tool that runs in Linux  The Mininet prompt looks like this  mininet>  The Linux prompt ends with a $ for a normal user  It ends in # for the root account  We will use the sudo command to run the Linux commands with root privileges at the normal user prompt 7
  • 8. LOGIN VM  Start the virtual machine  Login to Linux  The login is  mininet  mininet  The screen should look like this 8
  • 10. VM NETWORK CONFIGURATION  Let’s see if the two network interfaces are setup correctly  At the Linux prompt enter  ifconfig 10
  • 11. VM NETWORK CONFIGURATION  Three interfaces should appear  Two physical interfaces called  eth0  eth1  And the loopback interface 11
  • 12. VM NETWORK CONFIGURATION  One of the physical interfaces should have a 192 address and the other a 10 address  We will access the virtual machine using a terminal program using the 192 address  If either of the eth Ethernet interfaces are missing, run this command  sudo dhclient ethx  Where the x in ethx is the number of the interface 12
  • 13. SET UP NETWORK ACCESS 13
  • 14. SET UP NETWORK ACCESS  As you can see the eth1 interface is missing  After the dhclient command is run this appears  sudo dhclient ethx  Where the x in ethx is the number of the interface 14
  • 15. SET UP NETWORK ACCESS 15
  • 16.  The tutorial VM is shipped without a desktop environment, to reduce its size. All the exercises will be done through X forwarding, where programs display graphics through an X server running on the host OS.  Open a terminal (Terminal.app in Mac, Gnome terminal in Ubuntu, etc). In that terminal, run:  $ ssh -X [user]@[Guest IP Here]  Replace [user] with the correct user name for your VM image.  Replace [Guest] with the IP you just noted.  If ssh does not connect, make sure that you can ping the IP address you are connecting to. ACCESS VM VIA SSH 16
  • 17.  To not use X11 and log in to the VM console window - not via an ssh session!  Install GUI  Login VM, and type: $ sudo apt-get update && sudo apt-get install xinit lxde virtualbox-guest-dkms  At this point, you should be able to start an X11 session in the VM console window by typing: $ startx ALTERNATIVE: RUN A GUI IN THE VM CONSOLE WINDOW 17
  • 18. MININET TUTORIAL  Mininet Command Line Interface Usage  Interact with hosts and switches • Start a minimal topology The default run of Mininet sudo mn will create a topology consisting of one controller (c0), one switc h (s1) and two hosts (h1 and h2). • Display nodes • Display links • Dump information about all nodes • Exit Mininet: $ sudo mn mininet> nodes mininet> net mininet> dump The switches generated with Mininet will be just simple forwarding devices, without any "brain" of their own (no control plane) mininet> exit 18
  • 19. To help you start up, here are the most important options for running Mininet:  --topo=TOPO represents the topology of the virtual network, where TOPO could be:  minimal - this is the default topology with 1 switch and 2 hosts  single,X - a single switch with X hosts attached to it  linear,X - creates X switches connected in a linear/daisy-chain fashion, each switch with one host attached  tree,X,Y - a tree topology with X depth, Y fanout  --switch=SWITCH creates different type of switches, such as:  ovsk - this is the default Open vSwitch that comes preinstalled in the VM  user - this is a switch running in software namespace (much slower) MININET TUTORIAL 19
  • 20.  --controller=CONTROLLER where CONTROLLER can be:  ovsc - this creates the default OVS Controller that comes preinstalled in the VM  nox - this creates the well-known NOX controller  remote - does not create a controller but instead listens for connections from external controllers  --mac set easy-to-read MAC addresses for the devices  For more information $ mn help MININET TUTORIAL 20
  • 21.  Display Mininet Command Line Interface (CLI) commands: mininet> help  Display nodes: mininet> nodes  If the first string of the CLI command is a host, switch or controller name, the command is executed on that node. For instance, to show the interface of host h1: mininet> h1 ifconfig  Test connectivity between hosts. For example, test the connectivity between h1 and h2: mininet> h1 ping h2  Alternatively, you can test the connectivity between all hosts by typing: mininet> pingall  Exit Mininet: mininet> exit  Clean up: After every exit do cleanup $ sudo mn -c MORE COMMANDS 21
  • 22. NETWORK TOPOLOGY  sudo mn --topo single,4 --mac --switch ovsk 22
  • 23.  $ sudo mn --topo linear,3 NETWORK TOPOLOGY 23
  • 24.  sudo mn --topo tree,2,3 --mac --switch ovsk --controller=remote Where (--topo tree,depth=2,fanout=3) NETWORK TOPOLOGY 24
  • 25. sudo mn --link tc,bw=20,delay=20ms Take a moment to think about our current, very basic, topology. (h1)-----20ms-----(s1)-----20ms-----(h2) Q: When you send a ping, you measure the roundtrip delay for an ICMP packet to travel from one host to another. Assuming our current deployment, what will be the reported roundtrip delay? EXAMPLE 25
  • 26. A1: ~80 ms  Let’s test that assertion!  mininet> h1 ping -c 8 h2 EXAMPLE (CONT..) 26
  • 27.  Do not confuse the dpctl with a controller (it's not the same thing) - dpctl is just a management/monitoring utility! SIMPLE EXERCISE Use ovs-oftcl instead of dpctl for open vSwitch when running a controller In this scenario we have no remote controller running 27
  • 28. STEP 1: Start Mininet with a single switch (the default, Open vSwitch = ovsk) and 3 hosts:  mininet@mininet-vm:~$ sudo mn --topo=single,3 --mac --switch=ovsk -- controller=remote EXERCISE (CONT..) This message: "Unable to contact the remote controller at 127.0.0.1:6633". This is because, for the time being, we are going to use mininet without any controller 28
  • 29.  In order to double-check that everything started correctly, use the following mininet commands:  nodes - to list all virtual devices in the topology  net - to list of links between them  dump - to see more info about the hosts EXERCISE (CONT..) 29
  • 30. STEP 2: Open terminals for each host and run tcpdump on each: Attention: for Windows/MAC users, make sure you installed & run Xming/XQuartz, plus you enabled X-forwarding if you are using ssh session to the Mininet VM! > xterm h1 h2 h3  In the xterms for h2 and h3, run tcpdump, a utility to print the packets seen by a host: # tcpdump -XX -n -i h2-eth0 and respectively: # tcpdump -XX -n -i h3-eth0  In the xterm for h1, send a ping: # ping -c1 10.0.0.2 EXERCISE (CONT..) 30
  • 31. STEP 3: Test connectivity between h1 and h2: on host h1 perform a ping -c3 10.0.0.2 (the IP address of host h2) EXERCISE (CONT..) 31
  • 32. Results:  ping will fail, because the switch does NOT know what to do with such traffic (and remember, we don't run any controller) EXERCISE (CONT..) 32
  • 33.  Checking the list of flows on the switch (with command dpctl dump- flows) will show an empty list (again, nobody told the switch how to deal with the traffic) CHECKING FLOW RULES 33
  • 34. Open new terminal window or create a second SSH window, if you don't already have one, and run: $ dpctl show tcp:127.0.0.1:6634  The 'show' command connects to the switch and dumps out its port state and capabilities. $ dpctl dump-flows tcp:127.0.0.1:6634  Since we haven't started any controller yet, the flow-table should be empty. CHECKING FLOW RULES 34
  • 35. STEP 4: Manually add flows on the switch to allow connectivity between h1 and h2  Use the dpctl add-flow utility to manually install flows on the switch that will allow connectivity between host h1 and host h2.  $ dpctl add-flow tcp:127.0.0.1:6634 in_port=1,actions=output:2 everything received on port 1 (in_port) send out on port 2  $ dpctl add-flow tcp:127.0.0.1:6634 in_port=2,actions=output:1 everything received on port 2 (return traffic) send out on port 1 ADDING FLOW RULES 35
  • 37. Result:  ping is successful  tcpdump on host h2 shows the traffic from/to h1 (ARP and ICMP)  tcpdump on host h3 does not see anything (not even the ARP which should be broadcast)! FLOW RULES 37
  • 38. ACTIVATE WIRESHARK  Start Wireshark as a background process  $sudo wireshark $  Click on OK to clear any error messages 38
  • 39. OBSERVE SDN TRAFFIC  Start a capture in Wireshark using the loopback interface  Create and apply a filter for just the OpenFlow traffic by entering a display filter in Wireshark using the string  of 39
  • 40. LOAD THE CONTROLLER  To generate some traffic we will load a controller as that is the next step anyway  There are a number of software based or hardware based controllers that can be used in an SDN  In this example we will load the POX controller 40
  • 41. LOAD THE CONTROLLER  To start POX enter these commands  $cd pox  ./pox.py forwarding.l2_learning 41
  • 43. OBSERVE SDN TRAFFIC  Switch back to the Wireshark window to see the activity as the controller loads 43
  • 45. GUI - Automatic Creation of Mininet Scripts  Visual Network Description - VND (http://www.ramonfontes.com/vnd) - A GUI tool that allows automatic creation of Mininet and Openflow Controllers Scripts. GUI - MiniEdit  Included in Mininet in the examples/ directory. miniedit.py MININET APPS 45
  • 46.  The MiniEdit script is located in Mininet’s examples folder.  To run MiniEdit, execute the command: $ sudo ~/mininet/examples/miniedit.py  Mininet needs to run with root privileges so start MiniEdit using the sudo command. START MINIEDIT 46
  • 48. CREATE A CUSTOM NETWORK TOPOLOGY 48
  • 49.  Right-click on each controller and select Properties from the menu that appears.  The default port number for each controller is 6633.  Change this so the port numbers used by controllers c0, c1, and c2 are 6633, 6634, and 6635, respectively. CONFIGURE THE CONTROLLERS 49
  • 51.  To set MiniEdit preferences, Edit → Preferences. In the dialogue box that appears, make the changes you need. SET MINIEDIT PREFERENCES 51
  • 52.  Set the Start CLI option SET MINIEDIT PREFERENCES 52
  • 53. SAVE THE CONFIGURATION Save topology file  To save the Mininet Topology (*.mn) file, click on File in the top menu bar and select Save from the drop-down menu. Type in a file name and save the file. Save custom Mininet script  To save the Mininet Custom Topology (*.py) file, click on File in the top menu bar and select Save Level 2 Script from the drop-down menu. Type in the file name and save the file. 53
  • 54.  To start the simulation scenario, click the Run button on the MiniEdit GUI RUN THE MINIEDIT NETWORK SCENARIO In the terminal window from which you started MiniEdit, you will see some messages showing the progress of the simulation startup and then the Miniedit CLI prompt (because we checked Start CLI box in the MiniEdit preferences window). 54
  • 55. View Open vSwitch configurations EXPERIMENT WITH THE NETWORK 55
  • 56. Check switch flow tables CONT.. 56
  • 57.  First change the userid from root to mininet # su mininet  Then, check the flow table on switch s1 using the commands below. It should be empty. $ sudo ovs-ofctl dump-flows s1 CONT.. 57
  • 58.  Open a xterm window on hosts h1 and h8. Right-click on each host in the MiniEdit GUI and select Terminal from the menu that appears.  In the h1 xterm window, start a Wireshark with the command, wireshark &.  In the h8 xterm window, start a packet trace with the command tcpdump. $ tcpdump –n –i h8-eth0  Run a ping command to send traffic between host h1 and h8 mininet> h1 ping h8 RUN PROGRAMS TO GENERATE AND MONITOR TRAFFIC 58
  • 60.  Right-click on link. Choose Link Down from the menu that appears SIMULATE A BROKEN LINK 60
  • 61.  Ping again  no more traffic is received at host h8 and that the ping command shows packets sent from host h1 are not being responded to  Restore the link by choosing Link Up  Check flow tables $ sudo ovs-ofctl dump-flows s1 CONT.. 61
  • 62.  Quit Wireshark and tcpdump on hosts h1 and h8.  Quit the ping command in the MiniEdit console window by pressing Ctrl-C on the keyboard.  Then, quit the Mininet CLI by typing exit at the mininet> prompt.  Now, press the Stop button on the MiniEdit GUI. STOP THE SIMULATION 62
  • 63.  $ cd ~/mininet/<filepath>  $ sudo chmod 777 <filename>.py  $ sudo ./<filename>.py RUN A SAVED MININET CUSTOM TOPOLOGY SCRIPT 63
  • 64.  Open web browser and go to http://www.ramonfontes.com/vnd/# VISUAL NETWORK DESCRIPTION(VND) 64
  • 65.  Create the following topology using drag/drop CREATE A CUSTOM NETWORK TOPOLOGY 65
  • 68.  Set the file executable CONT.. 68
  • 69.  Using the l2_multi pox controller module to find the shortest path from sender to receiver to send packets.  Run the l2_multi pox controller.  Use discovery module to construct the network topology.  When the topology is known, the l2_multi can use Floyd-Warshall algorithm to find a shortest path.  Note l2_multi.py is under /pox/pox/forwarding and discovery.py is under /pox/pox/openflow RUN CONTROLLER 69
  • 70. RUN CONTROLLER  ./pox.py log.level --DEBUG log forwarding.l2_multi openflow.discovery 70
  • 71.  Open another terminal and run the script RUN SCRIPT 71
  • 73.  There are two paths from h1 to h2, i.e.  h1->s3->s4->h2  h1->s3->s5->s6->s4->h4.  The shortest path is h1->s3->s4->h2.  Check the rules for s3 (we can see the rules for arp and ip operations between 10.0.0.1 (h1) and 10.0.0.2(h2)) CONT.. 73
  • 74. CONT.. mininet> sh ovs-ofctl dump-flows s3 74
  • 75.  Check the rules for s4 (we can see the rules for arp and ip operations between 10.0.0.1 (h1) and 10.0.0.2(h2)) CONT.. 75
  • 76.  No rules for s5 and s6. Because the packets from h1 will not go via s5 and s6 to h2. CONT.. 76
  • 78. 78 INSTALL RYU $ sudo apt-get install git python-dev python-setuptools python-pip $ git clone https://github.com/osrg/ryu.git $ cd ryu $ sudo pip install .
  • 79. 79  Switching hubs have a variety of functions  Learns the MAC address of the host connected to a port and retains it in the MAC address table.  When receiving packets addressed to a host already learned, transfers them to the port connected to the host.  When receiving packets addressed to an unknown host, performs flooding. SWITCHING HUB
  • 80.  Initial status SWITCHING HUB BY OPENFLOW 80
  • 81. 81  Host A -> Host B SWITCHING HUB BY OPENFLOW
  • 82. SWITCHING HUB BY OPENFLOW 82  Host B -> Host A
  • 83. SWITCHING HUB BY OPENFLOW 83  Host A -> Host B
  • 84. EXECUTION OF RYU APPLICATION 84
  • 90.  Execute ping from host 1 to host 2  mininet> h1 ping –c 1 h2  Before executing the ping command, execute the tcpdump command so that it is possible to check what packets were received by each host. CONFIRMING OPERATION 90
  • 97.  for more:http://www.brianlinkletter.com/how-to-use-miniedit-mininets- graphical-user-interface/  https://github.com/ramonfontes/vnd-sdn- version/blob/master/README.md REFRENCES 97
  • 98. 98

Editor's Notes

  1. Start a minimal topology using a remote controller $ sudo mn --controller=remote,ip=[IP_ADDDR],port=[listening port] Default ip_addr=127.0.0.1, port=6633 Start a custom topology $ sudo mn --custom [topo_script_path] --topo=[topo_name]