= [wiki:GENIEducation/SampleAssignments/OpenFlowAssignment/ExerciseLayout OPENFLOW ASSIGNMENT] = {{{ #!html
Hello GENI index Hello GENI index Hello GENI index
}}} = STEPS FOR SETTING UP = ''' Using Omni to get physical PCs from ProtoGENI:''' [[BR]] '''0. Get account: (Ignore this if you already have one) [[BR]]''' Go to [https://www.pgeni.gpolab.bbn.com/reqaccount.php3 Request_GENI_Account] for an emulab account and to join a GENI project.[[BR]] 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''' [[BR]] Here is a very good tutorial on setting up Omni environment: [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/HelloOmni HelloOmni] [[BR]] Simply follow the tutorial to set up Omni. = Create an Experimental Topology for Firewall with OpenFlow = '''1. Use Omni to create the topology: [[BR]]''' Download the RSPEC from http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/fw.rspec [[BR]] Next, we need to create this experiment using the RSPEC file: [[BR]] '''Step 1. Create slice (use a unique name for your slice):''' {{{ omni.py createslice }}} 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: INFO:omni: 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. [[BR]] 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. [[BR]] 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.[[BR]] 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! :-) = 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. [[BR]] '''1. Use Omni to create the topology: [[BR]]''' Download the RSPEC from http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/lb.rspec [[BR]] Next, we need to create this experiment using the RSPEC file: [[BR]] '''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. [[BR]] 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.[[BR]] 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! :-) = [wiki:GENIEducation/SampleAssignments/OpenFlowAssignment/ExerciseLayout/Execute Next: Run Experiment] =