SDN Manual
SDN Manual
Aim:
mininet>
Step3.To display the list of Mininet CLI commands and examples on
their usage, type the The following command:
help
Test connectivity
h1pingh2
Mininet>dump: This command shows the dump information about all
nodes available in the current Mininet network.
Creation of Topologies in mininet;
Linear topology
In mininet we have various topologies like minimal, single, reversed, linear, tree
topology etc.
Result:
Thus the above setup our own virtual SDN lab Virtualbox/Mininet
Environment for SDN has been successfully executed.
Ex. No : Setup your own virtual SDN lab using ODL
1(ii) https://www.kathara.org
Aim:
To setup our own virtual SDN lab with https://www.kathara.org
Procedure:
SDN with OpenDaylight controller
Setting up the OpenDaylight controller
Result:
Thus the above setup our own virtual SDN using ODL has been
successfully executed.
Ex. No :
Setup your own virtual SDN lab using GNS3
1(iii)
Aim:
Install VMware Fusion (Mac) or VMware Workstation (Windows). Normally these are
paid ($$) commercial products, but SOECS has free licenses for Pacific students.
Do not use the stripped-down free VMware Player. It does not come with support for
the VIX API, which allows programs (like the GNS3 network simulator) to control the
operation of virtual machines.
Note: Install GNS3 inside your native operating system. Do not put it inside your
Ubuntu VM or you'll run into an eventual issue with nested virtual machines. We'll use
Ubuntu for class projects and homework assignments.
1. Go to https://www.gns3.com/
2. Select “Free Download"
3. Select Windows, Mac, or Linux as appropriate, and then “Download"
4. Create your GNS3 Community Account as prompted, login, and then return to
the Download page
5. Run the installer you downloaded and accept the default options. (If prompted,
permit ubridge to run as root to capture packets)
After installing the base GNS3 program, you next need to install the “GNS3 VM”. It’s
a Ubuntu Linux virtual machine that has all the necessary software pre-installed that
allows you to simulate more complicated devices. This is why VMware was needed as
the first installation step - it will be doing some of the virtualization heavy lifting.
1. Go to https://www.gns3.com/software/download-vm
2. Select the image for “VMware Workstation and Fusion"
3. Extract the .zip file
4. Launch VMware (Fusion or Workstation)
5. Select “Import” (or “Open a Virtual Machine”) and navigate to the .ovf file
("GNS3 VM.ovf") that you just downloaded and unzipped
6. Let VMware import it as a new VM. Accept the default location and accept the
default name it offers ("GNS3 VM") since that will simplify locating it later.
1. Launch GNS3
2. Mac: You will see the prompt “uBridge requires root permissions to interact
with network interfaces”. Say YES, that will allow us to connect GNS3 with the
real network if we desire.
3. Next, choose how to run your GNS3 network simulations. Your choices are:
1. Run appliances on my local computer
2. Run appliances in a virtual machine <- Choose this option
3. Run appliances on a remote server
4. Next, enter the GNS3 local server settings
1. The default server path, binding, and port are fine here
5. Next, enter the “GNS 3 VM” settings
1. If you correctly installed the GNS3 VM above (downloaded it, imported it
into VMware, and accepted the default name of “GNS 3”), it should be
auto-detected now. One CPU core and 2048MB of RAM should be
sufficient to accommodate all the virtual routers we might want to
simulate at any given time. Hopefully.
6. VMware should be automatically launched now, and start running the GNS 3
VM by itself. This is thanks to the VIX API that allows GNS3 to control
VMware.
7. Complete the setup wizard. Note: You can change these settings at any time by
locating the “Setup Wizard” from the application menus.
Out of the box, GNS3 doesn’t come with any routers, just a very basic switch, hub, and
a stripped down “computer” suitable for basic network connectivity tests. That’s about
it. However, by integrating with some emulator software (QEMU) and a x86/x64
virtualization engine (VMware), it has the capability to run real operating systems for
routers. As in, you can give GNS3 the same binary image you'd load on the real router,
and (with proper configuration...) it will "just work". So, rather than working with a
facsimile of a router, you can interact with the real router software.
Let's configure GNS3 with the image of a real router from MikroTik, which is the same
vendor as the routers that are in the networking lab in CTC 214. As a bonus, unlike
certain other vendors (cough Cisco cough), their OS images are freely available and
easy to download.
1. Go to https://mikrotik.com/
2. Click on “Software"
3. Scroll down to their “Cloud Hosted Router” section. That’s just their marketing
term for a software router (Linux + their proprietary command line interface)
that could run on any old PC that has a couple of network cards in it.
4. Look at the column labeled “Stable”, and go down to the row labeled “Raw disk
image”. That’s the download link you want.
1. For example, in August 2020 the latest stable release was 6.47.1, and the
download link for the raw disk image
was https://download.mikrotik.com/routeros/6.47.1/chr-6.47.1.img.zip
5. Unzip the file
Next, configure GS3 to recognize this image as a valid router, suitable for placement
into a network diagram:
Behind the scenes, GNS3 will copy the disk image for the Mikrotik router into the
GNS VM (in VMware) that you installed previously. That VM contains all the
necessary software and settings to virtualize this router.
Lab 1 Network Diagram (Note: Subnet labels and dashed borders are for
informational use only)
5. Press the Start button to launch your two virtual PCs and router. All the links
should turn from RED to GREEN.
6. Press the Console Connect to All Nodes button to pull up a terminal to all
three devices. (You could right-click on each and choose Console as well, but
we need to configure all three).
At the MikroTIk console:
1. Note: We are configuring the router first, because we can’t configure the PC
network fully until the default gateway (the router) exists.
2. Enter the default Mikrotik login of admin with a blank password.
3. Select N when prompted to view the license file.
4. Configure two interfaces (corresponding to the two wires plugged in)
1. ip address add address=10.11.12.254/24 interface=ether1
2. ip address add address=20.30.40.254/24 interface=ether2
5. Print the configuration to confirm: ip address print
1. Show the help menu for available command (recall that this is a rudimentary
simulated PC): help
2. Configure an IP address: ip 10.11.12.1/24 10.11.12.254
1. This sets up a subnet of 10.11.12/24, assigns the PC the IP address
10.11.12.1, with a default gateway of 10.11.12.254 (which is the router)
3. Show the configuration: show ip
4. Save the configuration to persist after power cycling: save
1. Go to the PC 1 console
2. Ping PC2 through the router: ping 20.30.40.1
3. You should see something to the effect of 84 bytes from 20.30.40.1 icmp_seq=1
ttl=63 time=2.699 ms indicating that PC2 is responding to PC1.
4. Press CTRL-C to exit
Result:
Thus the above setup our own virtual SDN using GNS3 has been
successfully executed.
Ex. No : 2 Create a simple mininet topology with SDN controller and use
Wireshark to capture and visualize the OpenFlow messages
such as OpenFlow FLOW MOD, PACKET IN, PACKET
OUT etc.
Aim:
To create a simple mininet topology with SDN controller and use Wireshark to capture
and visualize the OpenFlow messages such as OpenFlow FLOW MOD, PACKET IN,
PACKET OUT etc.
Procedure:
Standalone Open Flow network with controller
Setup
In order to setup a local controller, the default controller “open vswitch-test controller”
was installed. This controller is setup to run in a different terminal (fig2.1) before
running the Mininet SDN network.
Figure2.2:StartupSDN
Here, we can observe an activated controller and its links in addition to the default
nodes setup insection 1.
Unlike insection1, the flow table of the OVS switch is not empty. It contains a single
flow entry. Observing some fields of this entry:
Action : CONTROLLER
priority : 0
duration : 22.137s
no -packets : 12
no-byte : 976
Attempt pings between hosts.
The pings are successful, and have a 0% packet loss rate. Unlike in section 1, here the
controller is taking the routing decisions and setting up the path for the package to be
sent.
Check the switch flow table after pings.
The image 2.6 shows the complete flow table after pinging is done in both directions to
and from h1 and h2.
Hence, it can be observed that the first four entries are (internet control message
protocol) ICMP packet flows, the next four are (address resolution protocol) ARP
packet flows.
Each of these sets off our entries describes a particular flow of either the request
(icmp_type=8; arp_op=1) or reply (icmp_type=0; arp_op=2) from h1 to h2 and vice
versa. This can be seen by observing the fields dl src and dl dst, which gives the source
and destination data link layer (MAC) address. Alternatively, the nw src and nw dst
shows the network layer address of the flow being forwarded by the switch. Similarly,
the in port shows the port name in the SDN. Finally, the output port for a packet with
the corresponding properties of the flow entry is specified in the ‘actions’ field.
The priority of all the above mentioned flows is 1, which is higher than the controller-
bound flow with a priority of 0.The idle timeout is 60s.It is expected that this flow will
be removed from the table once this time period has passed with no activity of
transmitting packets.
It can be noted that with 5 pings done in either direction in figure 2.5 above, the n
packets of each flow type that was passed after the flow entry was set up is 4.
The last entry is the same as in figure2.4, with the expected increase in the duration,
npackets and nbytes fields. This entry will always be visible in the following sections.
The image figure2.8 above shows the first few flow entries. Below are some images
that take a look at these entries in detail. The Open Flow OFPT flow entries are of
mainly three types:
OFPT PACKET_IN: Packet sent into controller from switch.
OFPT PACKET_OUT: Packet sent out from controller to switch.
OFPT FLOW MOD: Packet sent from controller to switch to modify the state of an
Open Flow switch[1].
Figure 2.9: OpenFlow flow entries: CLI
Highlighted in figure 2.9 are the flows that have CLI packets encapsulated inside.
First, the switch sends the packet-into the controller, encapsulating the unmatched
message. The controller then sends a flow-mod that modifies the flow table, and
returns the CLI packet with the packet-out. An icmp-csum or check-sum is used to
confirm correct reception of this packet.
Corresponding to the two new flow entries in figure 3.7, two OFPT FLOW MOD
packets have been captured. A closer look at the content of the packet reveals that the
content is mostly identical, as shown in figures 3.9b and 3.9c, but with different port
numbers under the ”action” field.
Result:
Thus the creation of simple mininet topology with SDN controller and
use Wireshark to capture and visualize the OpenFlow messages such as
OpenFlow FLOW MOD, PACKET IN, PACKET OUT etc has been
successfully created.
Ex. No : 3 Create a SDN application that uses the Northbound API to
program flow table rules on the switch for various use cases
like L2 learning switch, Traffic Engineering, Firewall etc
Aim:
To create a SDN application that uses the Northbound API to program flow table rules
on the switch for various use cases like L2 learning switch, Traffic Engineering,
Firewall etc
Procedure:
feature:install odl-l2switch-switch-ui
The above command will create a virtual network consisting of 3 switches. Each
switch will connect to the controller located at the specified IP, i.e. 127.0.0.1
The above command has the “mac” option, which makes it easier to distinguish
between Host MAC addresses and Switch MAC addresses.
h1 ping h2
The above command will cause host1 (h1) to ping host2 (h2)
pingall
Address Observations
Checking Hosts
Host information is added to the Topology data tree.
● Host address
● Attachment point (link) to a node/switch
This host information and attachment point information can be checked through a
browser or a REST Client.
http://10.194.126.91:8080/restconf/operational/network-topology:network-topology/
topology/flow:1/
Hosts
● A status of “forwarding” means the link is active and packets are flowing on it.
● A status of “discarding” means the link is inactive and packets are not sent over
it.
The STP status of a link can be checked through a browser or a REST Client.
http://10.194.126.91:8080/restconf/operational/opendaylight-inventory:nodes/node/
openflow:1/node-connector/openflow:1:2
STP status
Mininet commands
link s1 s2 down
This will bring the link between switch1 (s1) and switch2 (s2) down
link s1 s2 up
This will bring the link between switch1 (s1) and switch2 (s2) up
link s1 h1 down
This will bring the link between switch1 (s1) and host1 (h1) down
Result:
Thus the create a SDN application that uses the Northbound API to
program flow table rules on the switch for various use cases has been
successfully executed.
Ex. No : 4 Create a simple end-to-end network service with two VNFs
using vim-emu
Aim:
To create a simple end-to-end network service with two VNFs using vim-emu
https://github.com/containernet/vim-emu
Procedure:
Step : 1 Installation
Open vSwitch must be installed on the host on which you want to install OSM and
vim-emu.
$ ./install_osm.sh --vimemu
Configure environment
You need to set the correct environment variables, i.e., you need to get the IP address
of the vim-emu container to be able to add it as a VIM to your OSM installation:
# list vims
$ osm vim-list
+----------+--------------------------------------+
| vim name | uuid |
+----------+--------------------------------------+
| emu-vim1 | a8175948-efcf-11e7-94ad-00163eba993f |
+----------+--------------------------------------+
# NS
$ osm nsd-create vim-emu/examples/services/pingpong_nsd.tar.gz
# You can now check OSM's GUI to see the VNFs and NS in the catalog. Or:
$ osm vnfd-list
+-----------+--------------------------------------+
| vnfd name | id |
+-----------+--------------------------------------+
| ping | 2c632bc7-15f6-4997-a581-b9032ea4672c |
| pong | e6fe076d-9d1f-4f05-a641-44b3e09df961 |
+-----------+--------------------------------------+
$ osm nsd-list
+----------+--------------------------------------+
| nsd name | id |
+----------+--------------------------------------+
| pingpong | 776746fe-7c48-4f0c-8509-67da1f8c0678 |
+----------+--------------------------------------+
$ osm ns-list
+------------------+--------------------------------------+--------------------+---------------
+-----------------+
| ns instance name | id | operational status | config status | detailed
status |
+------------------+--------------------------------------+--------------------+---------------
+-----------------+
| test | 566e6c36-5f42-4f3d-89c7-dadcca01ae0d | running | configured |
done |
+------------------+--------------------------------------+--------------------+---------------
+-----------------+
+=========+=================+==========+================+=====
===============+
| dc2 | dc2 | dc2.s1 | 0| 0|
+---------+-----------------+----------+----------------+--------------------+
| dc1 | dc1 | dc1.s1 | 0| 0|
+---------+-----------------+----------+----------------+--------------------+
# check running service
$ sudo docker exec vim-emu vim-emu compute list
+--------------+----------------------------+---------------+------------------
+-------------------------+
| Datacenter | Container | Image | Interface list | Datacenter interfaces
|
+==============+============================+===============+=
=================+=========================+
| dc1 | dc1_test.ping.1.ubuntu | ubuntu:trusty | ping0-0 | dc1.s1-eth2
|
+--------------+----------------------------+---------------+------------------
+-------------------------+
| dc1 | dc1_test.pong.2.ubuntu | ubuntu:trusty | pong0-0 | dc1.s1-eth3
|
+--------------+----------------------------+---------------+------------------
+-------------------------+
Result:
Thus the creation of a simple end-to-end network service with two VNFs using
vim-emu has been successfully executed.
Ex. No : 5
Install OSM and onboard and
orchestrate network service.
Aim:
Procedure:
Pre-requirements:
In order to install OSM, you will need, at least, a single server or VM with the
following requirements:
OSM client is installed by default in the host where OSM is installed, but it can be also
installed as a standalone client in an Ubuntu 22.04 system, following the procedure
below:
# Install dependencies
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-pip
# Install dependencies
sudo apt-get update
sudo apt-get install -y git wget make
sudo apt-get install -y python3 python3-dev python3-pip
# Upgrade pip to the latest version (with sudo, to install it globally for all users)
sudo -H python3 -m pip install -U pip
# Install OSM IM and its dependencies via pip (installed with sudo, to install it
globally for all users)
sudo -H python3 -m pip install -r
"https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=$
{OSM_CLIENT_VERSION}"
sudo -H python3 -m pip install "git+https://osm.etsi.org/gerrit/osm/IM.git@$
{OSM_CLIENT_VERSION}#egg=osm-im" --upgrade
# Install dependencies
sudo dnf upgrade -y
sudo dnf install -y libcurl-devel openssl-devel
sudo dnf install -y git wget make patch gcc
sudo dnf install -y python310 python310-devel
# Upgrade pip to the latest version (with sudo, to install it globally for all users)
sudo -H python3 -m pip install -U pip
# Install OSM IM and its dependencies via pip (installed with sudo, to install it
globally for all users)
sudo -H python3 -m pip install -r
"https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=$
{OSM_CLIENT_VERSION}"
sudo -H bash -c "PATH=$PATH:/usr/local/bin python3 -m pip install
\"git+https://osm.etsi.org/gerrit/osm/IM.git@${OSM_CLIENT_VERSION}#egg=osm-
im\" --upgrade"
# Install dependencies
sudo apt-get update
sudo apt-get install -y git wget make
sudo apt-get install -y python3 python3-setuptools python3-dev python3-pip
# Upgrade pip to the latest version (with sudo, to install it globally for all users)
sudo -H python3 -m pip install -U pip
# Install OSM IM and its dependencies via pip (installed with sudo, to install it
globally for all users)
sudo -H python3 -m pip install -r
"https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=$
{OSM_CLIENT_VERSION}"
sudo -H python3 -m pip install "git+https://osm.etsi.org/gerrit/osm/IM.git@$
{OSM_CLIENT_VERSION}#egg=osm-im" --upgrade
# Logout and login so that PATH can be updated. Executable osm will be found in
/home/ubuntu/.local/bin
which osm
Once WSL is installed with an Ubuntu 22.04 distro, you can install OSM following the
instruccions in (#how-to-install-osm-client-in-ubuntu-2204)
6. Steps to install OSM Client directly in Windows with Conda and Git
You can install both programs with Chocolatey, the package manager for Windows.
Open a CMD window and run the following commands:
● C:\tools\miniconda3
● C:\tools\miniconda3\Scripts
● C:\tools\miniconda3\Library\bin
Make sure that aliases for Python are disabled in Windows Configuration. Go to
Settings > Apps > Apps & features, and click on “Manage app execution aliases”. Then
disable aliases for Python.
Open Git Bash and run the following commands to create a Conda environment with
Python 3.8 and initialize all shells to work with Conda:
# Install conda and install some packages via conda (which will install dependent
libraries)
conda activate osm-env
# Upgrade pip to the latest version (with sudo, to install it globally for all users)
python -m pip install -U pip
# Decide which version to use (e.g., v15.0)
export OSM_CLIENT_VERSION=v15.0
Software Requirements
1. Install UIM on a WebLogic server. See UIM Installation Guide for installation
instructions.
2. Navigate to the UIM_Home/cartridges/base directory and deploy the following
UIM cartridges into UIM in the order they are listed:
o ora_uim_baseextpts
o ora_uim_basemeasurements
o ora_uim_basetechnologies
o ora_uim_basespecifications
o ora_uim_baserulesets
o OracleComs_NSO_BaseCartridge
See UIM Cartridge Guide for instructions about deploying cartridges into UIM.
3. (Optional) If you want to use the sample cartridges that are provided with
Network Service Orchestration, navigate to
the UIM_Home/cartridges/sample directory and deploy the sample cartridges
into UIM.
Note:
Before deploying the sample cartridges, deploy the ora_uim_common cartridge.
See "About the Sample Network Services" for more information about the
sample cartridges provided with Network Service Orchestration.
Result:
Thus the above network of OSM and onboard and orchestrate network service
has been successfully installed.