wiki:GENIEducation/SampleAssignments/OpenFlowAssignment/ExerciseLayout/DesignSetup

Version 2 (modified by shuang@bbn.com, 12 years ago) (diff)

--

OPENFLOW ASSIGNMENT

Hello GENI index Hello GENI index Hello GENI index

STEPS FOR SETTING UP

Using Omni to get physical PCs from ProtoGENI:
0. Get account: (Ignore this if you already have one)
Go to Request_GENI_Account for an emulab account and to join a GENI project.
Apparently you need to join a GENI project (which is created by PIs/GPOs/others who have permission to do so) in order to use GENI resources.

1. Prepare Omni
Here is a very good tutorial on setting up Omni environment: HelloOmni
Simply follow the tutorial to set up Omni.

Create an Experimental Topology for Firewall with OpenFlow

1. Use Omni to create the topology:
Download the RSPEC from http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/fw.rspec
Next, we need to create this experiment using the RSPEC file:

Step 1. Create slice (use a unique name for your slice):

omni.py createslice <slice name>

Output should be something like the following (here I am using 'OpenFlowFW' as the sample slice name):

INFO:omni:Loading config file /Users/shuang/.gcf/omni_config
INFO:omni:Using control framework portal
INFO:omni:Created slice with Name OpenFlowFW, URN urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW, Expiration 2013-05-20 21:42:26
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed createslice:

  Options as run:
		framework: portal
		project: ShufengProject

  Args: createslice OpenFlowFW

  Result Summary: Created slice with Name OpenFlowFW, URN urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW, Expiration 2013-05-20 21:42:26
 
INFO:omni: ============================================================

Step 2. Renew Slice (to make sure that your reservation does not expire before you finished your experiment, renew the slice to a specific time):

omni.py renewslice OpenFlowFW 20130521

Output:

INFO:omni:Loading config file /Users/shuang/.gcf/omni_config
INFO:omni:Using control framework portal
INFO:omni.pgch:Requesting new slice expiration '2013-05-21T00:00:00'
INFO:omni:Slice OpenFlowFW now expires at 2013-05-21 00:00:00 UTC
INFO:omni:Slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW expires within 1 day on 2013-05-21 00:00:00 UTC
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed renewslice:

  Options as run:
		framework: portal
		project: ShufengProject

  Args: renewslice OpenFlowFW 20130521

  Result Summary: Slice OpenFlowFW now expires at 2013-05-21 00:00:00 UTC
Slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW expires within 1 day(s) on 2013-05-21 00:00:00 UTC 
INFO:omni: ============================================================

Step 3. Create Sliver using fw.rspec:

omni.py createsliver -a pg-utah OpenFlowFW fw.rspec

Output:

INFO:omni:Loading config file /Users/shuang/.gcf/omni_config
INFO:omni:Using control framework portal
INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
INFO:omni:Slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW expires within 1 day on 2013-05-21 00:00:00 UTC
INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
INFO:omni:Creating sliver(s) from rspec file fw.rspec for slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW
INFO:omni: (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=eaad7201112953f49037e03149fa15ce)
INFO:omni:Got return from CreateSliver for slice OpenFlowFW at https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0:
INFO:omni:<!-- Reserved resources for:
	Slice: OpenFlowFW
	at AM:
	URN: unspecified_AM_URN
	URL: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
 -->
INFO:omni:<rspec xmlns="http://www.protogeni.net/resources/rspec/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2                            http://www.protogeni.net/resources/rspec/2/manifest.xsd                            " type="manifest">
<node client_id="router" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc140" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+129503">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops:FEDORA15-STD"/>
    </sliver_type>
    <interface client_id="router:right" component_id="urn:publicid:IDN+emulab.net+interface+pc140:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129513" mac_address="0002b335f1b7">
        <ip netmask="255.255.255.0" type="ipv4" address="10.10.11.2"/>
    </interface>
    <interface client_id="router:switch" component_id="urn:publicid:IDN+emulab.net+interface+pc140:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+129506" mac_address="00034794c7fd">
        <ip netmask="255.255.255.0" type="ipv4" address="10.10.10.2"/>
    </interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc140"/><host name="router.OpenFlowFW.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc140.emulab.net" port="22" username="shufeng"/></services></node>
<node client_id="switch" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc137" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+129502">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops:FEDORA15-STD"/>
    </sliver_type>
    <services>
        <install url="http://www.cs.purdue.edu/homes/fahmy/geni/tarballs/openvswitch-1.6.1-F15.tar.gz" install_path="/"/>
        <install url="http://www.cs.purdue.edu/homes/fahmy/geni/tarballs/trema-trema-8e97343-F15.tar.gz" install_path="/opt"/>
        <install url="http://www.cs.purdue.edu/homes/fahmy/geni/tarballs/of-topo-setup.tar.gz" install_path="/tmp"/>
        <execute shell="sh" command="cd /tmp/of-topo-setup &amp;&amp; ./switch-setup"/>
    <login authentication="ssh-keys" hostname="pc137.emulab.net" port="22" username="shufeng"/></services>
    <interface client_id="switch:router" component_id="urn:publicid:IDN+emulab.net+interface+pc137:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+129507" mac_address="00d0b725463a">
        <ip netmask="255.255.255.0" type="ipv4" address="192.168.129.1"/>
    </interface>
    <interface client_id="switch:left" component_id="urn:publicid:IDN+emulab.net+interface+pc137:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129510" mac_address="0002b3861f8b">
        <ip netmask="255.255.255.0" type="ipv4" address="192.168.128.1"/>
    </interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc137"/><host name="switch.OpenFlowFW.panther.emulab.net"/></node>
<node client_id="right" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc135" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+129501">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops:FEDORA15-STD"/>
    </sliver_type>
    <interface client_id="right:router" component_id="urn:publicid:IDN+emulab.net+interface+pc135:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129512" mac_address="0002b3861d13">
        <ip netmask="255.255.255.0" type="ipv4" address="10.10.11.1"/>
    </interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc135"/><host name="right.OpenFlowFW.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc135.emulab.net" port="22" username="shufeng"/></services></node>
<node client_id="left" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc138" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+129500">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops:FEDORA15-STD"/>
    </sliver_type>
    <services>
        <install url="http://www.cs.purdue.edu/homes/fahmy/geni/tarballs/of-topo-setup.tar.gz" install_path="/tmp"/>
        <execute shell="sh" command="cd /tmp/of-topo-setup &amp;&amp; ./left-setup"/>
    <login authentication="ssh-keys" hostname="pc138.emulab.net" port="22" username="shufeng"/></services>
    <interface client_id="left:switch" component_id="urn:publicid:IDN+emulab.net+interface+pc138:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129509" mac_address="0002b365d12b">
        <ip netmask="255.255.255.0" type="ipv4" address="10.10.10.1"/>
    </interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc138"/><host name="left.OpenFlowFW.panther.emulab.net"/></node>
<link client_id="switch-router" sliver_id="urn:publicid:IDN+emulab.net+sliver+129505" vlantag="260">
    <interface_ref client_id="router:switch" component_id="urn:publicid:IDN+emulab.net+interface+pc140:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+129506"/>
    <interface_ref client_id="switch:router" component_id="urn:publicid:IDN+emulab.net+interface+pc137:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+129507"/>
</link>
<link client_id="left-switch" sliver_id="urn:publicid:IDN+emulab.net+sliver+129508" vlantag="263">
    <interface_ref client_id="left:switch" component_id="urn:publicid:IDN+emulab.net+interface+pc138:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129509"/>
    <interface_ref client_id="switch:left" component_id="urn:publicid:IDN+emulab.net+interface+pc137:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129510"/>
</link>
<link client_id="right-router" sliver_id="urn:publicid:IDN+emulab.net+sliver+129511" vlantag="262">
    <interface_ref client_id="right:router" component_id="urn:publicid:IDN+emulab.net+interface+pc135:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129512"/>
    <interface_ref client_id="router:right" component_id="urn:publicid:IDN+emulab.net+interface+pc140:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+129513"/>
</link>
</rspec>
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed createsliver:

  Options as run:
		aggregate: ['pg-utah']
		framework: portal
		project: ShufengProject

  Args: createsliver OpenFlowFW fw.rspec

  Result Summary: Got Reserved resources RSpec from www-emulab-net-protogeniv2 
INFO:omni: ============================================================

The above output shows the reserved nodes: pc140, pc135, pc137, pc138 and how they are connected.
Alternatively, you can use the following command to show the reserved nodes as well as ways to login:

readyToLogin.py OpenFlowFW -a pg-utah

When the nodes are not ready, the status will be notready or changing. In this case, you simply have to wait then try the above command again.
Otherwise, the result is something like the following:

#========================================
#SSH CONFIGURATION INFO for User shufeng
#========================================
 
Host right
  Port 22
  HostName pc135.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host router
  Port 22
  HostName pc140.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host left
  Port 22
  HostName pc138.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host switch
  Port 22
  HostName pc137.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 

================================================================================
LOGIN INFO for AM: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
================================================================================

right's geni_status is: ready (am_status:ready) 
User shufeng logins to right using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc135.emulab.net &

router's geni_status is: ready (am_status:ready) 
User shufeng logins to router using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc140.emulab.net &

left's geni_status is: ready (am_status:ready) 
User shufeng logins to left using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc138.emulab.net &

switch's geni_status is: ready (am_status:ready) 
User shufeng logins to switch using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc137.emulab.net &

Step 4. Renew the sliver:

omni.py renewsliver -a pg-utah OpenFlowFW 20130521

Output:

INFO:omni:Loading config file /Users/shuang/.gcf/omni_config
INFO:omni:Using control framework portal
INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
INFO:omni:Slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW expires within 1 day on 2013-05-21 00:00:00 UTC
INFO:omni:Renewing Sliver OpenFlowFW until 2013-05-21 00:00:00+00:00 (UTC)
INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
INFO:omni: (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=20886a427910fadd245e7eac8028dd6e)
INFO:omni:Renewed sliver urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW at unspecified_AM_URN (https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0) until 2013-05-21T00:00:00+00:00 (UTC)
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed renewsliver:

  Options as run:
		aggregate: ['pg-utah']
		framework: portal
		project: ShufengProject

  Args: renewsliver OpenFlowFW 20130521

  Result Summary: Slice urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW expires within 1 day(s) on 2013-05-21 00:00:00 UTC
Renewed sliver urn:publicid:IDN+panther:ShufengProject+slice+OpenFlowFW at unspecified_AM_URN (https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0) until 2013-05-21T00:00:00+00:00 (UTC)
 
INFO:omni: ============================================================

Note: When dealing with specific slivers, we need to add "-a pg-utah" to specify which aggregate manager we want to use (i.e., from where we want to reserve the resources). In our case here, we are using utah aggregate.
For a list of available aggregates, please see the file ~/.gcf/omni_config, check out ProtoGENI AMs section.

OK. After this point, we are ready to log on to the nodes and do the OpenFlow FireWall experiments! :-)
Please go to Next: Run Experiment to checkout the instructions on running the firewall experiment.

Create an Experimental Topology for LoadBalancing with OpenFlow

To create the Load Balancing Topology, simply follow the same steps as when you created the Fire Wall Topology.
1. Use Omni to create the topology:
Download the RSPEC from http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/lb.rspec
Next, we need to create this experiment using the RSPEC file:

Step 1. Create slice (use a unique name for your slice): Here I am using OpenFlowLB

omni.py createslice OpenFlowLB

Step 2. Renew Slice (to make sure that your reservation does not expire before you finished your experiment, renew the slice to a specific time):

omni.py renewslice OpenFlowLB 20130521

Step 3. Create Sliver using lb.rspec:

omni.py createsliver -a pg-utah OpenFlowLB lb.rspec

Again, you can use the following command to show the reserved nodes as well as ways to login:

readyToLogin.py OpenFlowLB -a pg-utah

When the nodes are not ready, the status will be notready or changing. In this case, you simply have to wait then try the above command again.
Otherwise, the result is something like the following:

#========================================
#SSH CONFIGURATION INFO for User shufeng
#========================================
 
Host right
  Port 22
  HostName pc135.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host router
  Port 22
  HostName pc140.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host left
  Port 22
  HostName pc138.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host switch
  Port 22
  HostName pc137.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 

================================================================================
LOGIN INFO for AM: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
================================================================================

right's geni_status is: ready (am_status:ready) 
User shufeng logins to right using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc135.emulab.net &

router's geni_status is: ready (am_status:ready) 
User shufeng logins to router using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc140.emulab.net &

left's geni_status is: ready (am_status:ready) 
User shufeng logins to left using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc138.emulab.net &

switch's geni_status is: ready (am_status:ready) 
User shufeng logins to switch using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc137.emulab.net &

Step 4. Renew the sliver:

omni.py renewsliver -a pg-utah OpenFlowLB 20130521

Note: When dealing with specific slivers, we need to add "-a pg-utah" to specify which aggregate manager we want to use (i.e., from where we want to reserve the resources). In our case here, we are using utah aggregate.
For a list of available aggregates, please see the file ~/.gcf/omni_config, check out ProtoGENI AMs section.

OK. After this point, we are ready to log on to the nodes and do the OpenFlow Load Balancing experiments! :-)
Please go to Next: Run Experiment to checkout the instructions on running the load balancing experiment.

Next: Run Experiment