Kategoriler
Anlatım Genel Software Defined Networking

How To Install Open vSwitch 2.3.0 to Ubuntu 14.04.1 LTS

Assalamu alaikum wa rahmatullahi wa barakatuh,
Peace be upon you dear visitor 🙂

In this tutorial, I’m going to show you how to install Open vSwitch 2.3.0 in your Ubuntu 14.04.1 LTS. I modified the installation code in Mininet to do that.

If you want to install Mininet and other things (e.g. cbench, wireshark, pox and etc.) from scratch, you should modify the installation script in Mininet, too. Before modifying the installation code, open install.sh in mininet/util directory. Then;

  • Change OVS_RELEASE=1.4.0 to OVS_RELEASE=2.3.0.
  • If you have previous version of Open vSwitch installed in your system, you should remove it. Thus, use remove_ovs function to do that. You can either run this code separately or add to the function all.
  • Comment out ovs line in the function all and add function ubuntuOvs in it.

function all {

echo “Installing all packages except for -eix (doxypy, ivs, nox-classic)…”
kernel
mn_deps
# Skip mn_dev (doxypy/texlive/fonts/etc.) because it’s huge
# mn_dev
of
install_wireshark
remove_ovs
ubuntuOVS
pox
oftest
cbench
echo “Enjoy Mininet!”
}

The script that I use to install Mininet, OpenFlow, OpenFlow v1.3, Wireshark, Floodlight and Open vSwitch 2.3.0 into SDN_RAD folder under home directory is here. Use it at your own risk!

Assalamu alaikum wa rahmatullahi wa barakatuh 🙂

Kategoriler
Anlatım Software Defined Networking

IP Prefix Matching and Flow Insertion using Static Flow Pusher API of Floodlight

Assalamu alaikum wa rahmatullahi wa barakatuh,
Peace be upon you dear visitor 🙂

In this tutorial, I created a simple topology in Mininet (MN). Topology consists of one switch and two hosts. One of hosts is client and another is server. The topology is illustrated as below.

fl_ip_prefix_match_topo

I disabled Forwarding and LearningSwitch modules of Floodlight (FL) by deleting them from /floodlight/src/main/resources/floodlightdefault.properties. Thus, I was able to see that my code works perfectly. If you disable these two modules and run your MN topology code, you see that client and server can not communicate with each other. Because, there will be no flow entry in the switch to forward packets.

In order to provide connection between these two nodes, at first we must insert ARP flow entry to the switch so that client can find server’s MAC address. I used Static Flow Pusher API of Floodlight to insert flows. In the Static Flow Pusher API page, there is a python script that allows developers to insert flow entries to switches. The following two flow codes do the job.

arp_client_server = {
 'switch':"00:00:00:00:00:00:00:01", # DPID of SW
 'name':"arp_client_server", # unique name of flow entry
 'cookie':"1", # opaque identifier
 'priority':"32767", # highest flow priority
 'ingress-port':"1", # packet that comes in from port ### of sw
 'ether-type':"0x806", # hex of ethernet type of ARP
 'active':"true", # activate flow entry
 'actions':"output=2" # forward matched packet from port ### of sw
 }

arp_server_client = {
 'switch':"00:00:00:00:00:00:00:01",
 'name':"arp_server_client", 
 'cookie':"2",
 'priority':"32767",
 'ingress-port':"2",
 'ether-type':"0x806",
 'active':"true",
 'actions':"output=1"
 }

arp_client_server provides ARP packet forwarding from client to server. arp_server_client does the reverse.

As a next step, tcp flow entries must be inserted to the sw. To do so, I wrote the following codes.

ip_host_server = {
 'switch':"00:00:00:00:00:00:00:01",
 'name':"ip_host_server",
 'cookie':"3",
 'priority':"32767", 
 'ether-type':"0x800", # for TCP
 'src-ip':"10.0.0.0/8", # source IP prefix matching
 'active':"true",
 'ingress-port':"1",
 'actions':"output=2"
 }

ip_server_host = {
 'switch':"00:00:00:00:00:00:00:01",
 'name':"ip_server_host",
 'cookie':"4",
 'priority':"32767", 
 'ether-type':"0x800",
 'src-ip':"10.0.0.0/8", 
 'active':"true",
 'ingress-port':"2",
 'actions':"output=1"
 }

Notice that, I used IP prefix matching in src-ip tag. That means, all packets sending from hosts with 10.0.0.0/8 match with this entry. If you do the same, you will have such a switch as shown in the figure below.

fl_ip_prefix_match_sw

After insertion of required flow entries, I ping server from host. The result is as follows:

fl_ip_prefix_match_mn

If you examine the ping result shown above, you will realize that ping time is a lot less when you use Forwarding or LearningSwitch module. That is because, switch already has required flow entries to forward packets.

Assalamu alaikum wa rahmatullahi wa barakatuh 🙂