UserspaceSwitch OnVMware

From OpenFlow Wiki

Jump to: navigation, search

Setting up Userspace OpenFlow switch on VMWare

For those who want to experience basic OpenFlow functionality without committing much hardware resources, Virtual Machines provide a viable alternative. VMWare is one such virtualization tool that allows you to create a network of virtual hosts complete with virtual switches and hubs with relative ease. Below I describe one such network, that I created for trying out Userspace OpenFlow switch.


Vmware Topology.png


Steps

Please follow the below steps for setting up Network of virtual hosts

  1. Create the following virtual hosts in VMware with the specified configuration
    1. openflow-controller with 1GB RAM memory and one Network Adapter
    2. openflow-switch with 1GB RAM memory and three Network Adapters
    3. openflow-host1 with 500MB RAM memory and one Network Adapter
    4. openflow-host2 with 500MB RAM memory and one Network Adapter
    5. Setup the networks between the hosts as shown in the figure above using VMWare virtual switch for OpenNetwork1 and VMware virtual hubs for OpenNetwork2 and OpenNetwork3.
  2. Install Ubuntu 9.10 desktop edition 32 bit/Amd on openflow-controller based on whether you defined 32 bit or 64 bits hosts
  3. Install and verify OpenFlow on openflow-controller following the steps provided at [1]
  4. Clone openflow-switch, openflow-host1, openflow-host2 using the image of openflow-controller
  5. Login to all the Ubuntu hosts and make sure the resident Operating Systems host names match to those of the ones specified in VMware. This is not mandatory but is recommended for the sake of simplicity and consistency
  6. Configure the network interfaces with the IP addresses as specified below
openflow-controller:eth0 -> 192.168.1.1/24
openflow-switch:eth0 -> 192.168.1.2/24
openflow-switch:eth1 -> no IP (would act as a switch port)
openflow-switch:eth2 -> no IP (would act as a switch port)
openflow-host1:eth0 -> 192.168.2.1/24
openflow-host2:eth0 -> 192.168.2.2/24

This should complete the basic host setup.

Run the following command on openflow-controller

sudo controller ptcp:6633 -v

Run the following commands on openflow-switch in different consoles

sudo ofdatapath punix:/var/run/dp0.sock -i eth1,eth2 -v --no-local-port
sudo ofprotocol unix:/var/run/dp0.sock tcp:192.168.1.1:6633 -v --out-of-band

Run the following command on openflow-host1

ping 192.168.2.2

The success of ping command demonstrates userspace OpenFlow switch has been setup successfully and the Controller is working as an L2 MAC learning switch

Follow the thread [2] to learn about the problems, I faced trying to get this setup running. I initially selected VMWare virtual switches for OpenNetwork2 and OpenNetwork3 instead of Hubs and that caused an interesting issue difficult to debug, but offered huge learning.