Changes between Initial Version and Version 1 of GEC13Agenda/ExperimenterWorkflowTutorial/Tutorial


Ignore:
Timestamp:
03/12/12 19:22:49 (12 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC13Agenda/ExperimenterWorkflowTutorial/Tutorial

    v1 v1  
     1[[PageOutline]]
     2= Experimenter Workflow =
     3[[br]]
     4= Prework =
     5   1. Download and install [http://www.virtualbox.org/ VirtualBox] on your
     6machine, we have tested versions 4.1.8
     7      * If you run Ubuntu 10.04, it comes with !VirtualBox 3.1.6_OSE, which will
     8not work, please download the latest version. 
     9   2. [https://www.planet-lab.org/GEC11/ UPDATE Download] the VM image
     10   3. Run !VirtualBox and Import Appliance (File->Import Ampliance), accept the
     11default settings for the VM.
     12      * If you are using a FAT32 filesystem you will NOT be able to load the
     13image.
     14   4. Start the VM and log in
     15   5. Change the default password, click on the getversion task bar on the top,
     16on the right on the user 'geni', and choose the Change Password button.
     17   6. Verify that the VM has connectivity. Start Firefox (shortcut on the top
     18bar) and try to load Google. If you can't reach any website, restore VM's
     19Network connection.
     20      * On the far right on the top bar, there is the network icon (two opposite
     21facing arrows).
     22      * Click that icon and choose 'Auto eth0'.
     23      * Try loading the webpage again.
     24
     25= Useful Tips =
     26   * You '''can copy-paste''' between the host and the guest VM.
     27   * In the terminal within the VM, use '''Ctrl-Shift-C to copy''' and
     28'''Ctrl-Shift-V to paste'''.
     29   * vim and emacs editors are installed on the VM, so feel free to use them for
     30editing your files
     31     To replace a pattern within the file:
     32      * If you are using vim, while in command mode, type:
     33      {{{
     34      %s/pattern/replace_text/gc
     35      }}}
     36      And press 'y' for the instances of the pattern you want replaced, 'n'
     37otherwise.
     38      * If you are using emacs, press Alt-x and then type:
     39      {{{
     40query-replace
     41      }}}
     42      and press ENTER. Enter the pattern to be replaced, press ENTER, enter the
     43text you want to replace it with and press ENTER. Press 'y' for the instances of
     44the pattern you want replaced, 'n' otherwise.
     45   * If you want to have a shared folder between your machine and the VM so that
     46it's easier to transfer files during the tutorial, you have to do this before
     47starting the VM. Follow
     48[http://ozz314.wordpress.com/2008/05/08/virtualbox-shared-folders-between-ubuntu-guest-and-mac-host/
     49these instructions]   
     50   * If you get an error running Omni, look at the
     51[http://trac.gpolab.bbn.com/gcf/wiki/OmniTroubleShoot troubleshoot page] for
     52help.
     53
     54= Overview of Alice's Experiment =
     55Alice and Bob, two GENI experimenters, have volunteered to help us write these
     56instructions. They are going to reserve separate hosts but they will be sharing
     57the network infrastructure.
     58
     59[[Image(alice-bob-setup.png, 60%)]]
     60
     61Alice's information for the tutorial is :
     62|| '''<USERNAME>''' || alice || The user name for the tutorial's GPO ProtoGENI
     63account ||
     64||'''ProtoGENI host''' || pg46.emulab.net (@clemson)|| Node controlled by Utah's
     65ProtoGENI AM ||
     66||'''<PCNAME>''' || pg46 || For PG rspec ||
     67||'''MyPLC host''' || of-planet1.stanford.edu || Node controlled by Stanford's
     68MyPLC AM ||
     69||'''Backup MyPLC host''' || navis.gpolab.bbn.com || Node controlled by GPO's
     70MyPLC AM, if you run into problems with the first MyPLC host, you can try again
     71with this host||
     72||'''<SUBNET>''' || 10.42.122.0/24 || The subnet to use for Layer3 ping ||
     73||'''<SUBNET-OCT>''' || 122 || For the OF rspec ||
     74||'''<ETH-TYPE>''' || 10122 || The ethernet type for Layer2 ping, for the OF
     75rspec||
     76||'''<PORT>''' || 10122 || The port that the OpenFlow controller is listening on
     77||
     78
     79And after Alice and Bob completed the tutorial, Alice's scratchpad is :
     80
     81|| '''SCRATCHPAD''' ||'''Complete this info'''  || ||
     82||'''My MyPLC host IP(131)''' || 10.42.131. '''90'''  || IP address of your
     83MyPLC host on the pre-configured subnet ||
     84||'''MyPLC login name''' ||'''pgenigpolabbbncom_aliceslice '''|| Your login name
     85to the MyPLC hosts ||
     86||'''Neighbor's MyPLC host IP(131)''' || 10.42.131. '''52'''|| IP address of
     87your neighbor's MyPLC host on the pre-configured subnet ||
     88||'''My MyPLC host IP(your subnet)''' || 10.42 . '''122''' . '''90'''|| The IP
     89address of your MyPLC host on your subnet ||
     90||'''Neighbor's MyPLC host IP(your subnet)''' || 10.42 . '''122''' . '''52'''||
     91IP address of your neighbor's MyPLC host on the your subnet ||
     92
     93= I. Getting Started =
     94
     95== 1. Firewalls ==
     96Some of the compute resources are behind a firewall.
     97To avoid any firewall problems, please first login to
     98"ops.pgeni.gpolab.bbn.com", since we might
     99need to tunnel some traffic through this connections.
     100
     101To do that :
     102   * '''Open a terminal window ''' (there is a shortcut on the top bar).
     103   * ''' Change to the directory of your team '''. Substitute ## with the number of your team.
     104{{{
     105cd Tutorials/ExptWorkflow/gpousr##
     106}}}
     107
     108   * '''Connect to ops.pgeni.gpolab.bbn.com '''
     109{{{
     110xterm -e ssh -i ssh/geni_key -F ssh/config gpousr##@ops &
     111}}}
     112
     113== 1. Configure Omni ==
     114The purpose of this first exercise is to setup
     115[http://trac.gpolab.bbn.com/gcf/wiki/Omni Omni] to use your credentials and
     116keys.
     117
     118=== 1a. Setup omni ===
     119Omni uses as input a configuration file, where you can specify information such
     120as which clearinghouse to use, where your certificate and keys are located, etc.
     121Under the ''Tutorials/Omni/<username>'' directory (where <username> is your
     122username on the piece of paper you were given upon entering the room), there is
     123a configuration file, ''omni_config''.
     124
     125   * '''Open a terminal''' (there is a shortcut on the top bar).
     126   * First lets update the files that are on the VM:
     127      {{{
     128cd Tutorials/Omni/
     129downloadRSpecs.sh
     130      }}}
     131   
     132   * The rest of the tutorial assumes that you are under the
     133''Tutorials/Omni/<username>'' directory :
     134      {{{
     135cd <username>
     136      }}}
     137   * '''Remove the passphrase''' from your certificate. For security best
     138practices you should keep a passphrase on your certificate. To avoid typing the
     139passphrase throughout the tutorial, we will temporarily remove the passphrase.
     140Run
     141   {{{
     142   clear_cert.sh <username>
     143   }}}
     144   It will prompt you for the passphrase which should be included on the slip
     145that was given to you.
     146   * Verify that you have the necessary credential and key files
     147     {{{
     148     ls ssh |grep <username>
     149     }}}
     150     For gpousr21 the output looks like :
     151     {{{
     152geni@geni-vm:~/omni_tutorial$ ls ssh | grep gpousr21
     153gpousr21_cert_ct.pem
     154gpousr21_cert.pem
     155gpousr21_key
     156gpousr21_key.pub
     157     }}}
     158
     159   || gpousr21_cert_ct.pem || Cleartext certificate for gpousr21, i.e. does not
     160require any passphrase ||
     161   || gpousr21_cert.pem || Encrypted certificate for gpousr21 ||
     162   || gpousr21_key || The private key that gpousr21 would use to login to the
     163nodes ||
     164   || gpousr21_key.pub || The corresponding public key that gpousr21 will ask to
     165be loaded to the nodes ||
     166
     167   * '''Look at the  omni_config'''. Open omni_config. For the tutorial you
     168should use the cleartext certificate, but when running your own experiments, for
     169security best practices always use your encrypted certificate.
     170
     171   For ''gpousr21'' using a cleartext certificate the omni_config file looks
     172like :
     173
     174   {{{
     175# This file is the omni_config for GEC 12 tutorial
     176# Experimental topologies on the GENI Mesoscale network with Omni
     177
     178# General section of omni config
     179[omni]
     180default_cf = pgeni
     181users = gpousr21
     182
     183# ---------- Users ----------
     184[gpousr21]
     185# Make sure the urn matches the URN of the credential
     186urn = urn:publicid:IDN+pgeni.gpolab.bbn.com+user+gpousr21
     187
     188# Public key to be installed in compute resources. For multiple
     189# keys use a comma separated file
     190keys = ~/Tutorials/Omni/gpousr20/ssh/gpousr21_key.pub
     191
     192# If -a option is not specified the omni command will by run against all
     193# the following AMs
     194aggregates =  http://emulab.net/protogeni/xmlrpc/am,
     195https://pgeni.gpolab.bbn.com/protogeni/xmlrpc/am,
     196http://myplc.gpolab.bbn.com:12346/, http://myplc.clemson.edu:12346/,
     197https://myplc.stanford.edu:12346/,
     198https://wings-openflow-1.wail.wisc.edu:12346/,
     199https://of.cs.washington.edu:12346/, https://plc.orbit-lab.org:12346/,
     200https://myplc.grnoc.iu.edu:12346/, https://myplc.cip.gatech.edu:12346/,
     201https://foam-tutorial.gpolab.bbn.com:3626/foam/gapi/1
     202
     203# ---------- Frameworks ----------
     204[pgeni]
     205type = pg
     206ch = https://www.emulab.net:443/protogeni/xmlrpc/ch
     207sa = https://www.pgeni.gpolab.bbn.com:443/protogeni/xmlrpc/sa
     208
     209# Use the following two lines if you are using
     210# a certificate with a passphrase
     211#cert = ~/Tutorials/Omni/gpousr21/ssh/gpousr21_cert.pem
     212#key = ~/Tutorials/Omni/gpousr21/ssh/gpousr21_cert.pem
     213
     214# Use the following two lines if you are using
     215# a cleartext cert.
     216cert = ~/Tutorials/Omni/gpousr21/ssh/gpousr21_cert_ct.pem
     217key = ~/Tutorials/Omni/gpousr21/ssh/gpousr21_cert_ct.pem
     218
     219#------AM nicknames----------------
     220# Instead of typing the whole url of an AM in the -a option you can
     221# specify a nickname in this section and use the nickname instead
     222
     223# Format :
     224# Nickname=URN, URL
     225# URN is optional
     226[aggregate_nicknames]
     227# ProtoGENI AMs and PlanetLab central
     228pg-gpo=urn:publicid:IDN+pgeni.gpolab.bbn.com+authority+am,https://pgeni.gpolab.bbn.com/protogeni/xmlrpc/am
     229pg-utah=,https://www.emulab.net/protogeni/xmlrpc/am
     230pg-ky=urn:publicid:IDN+uky.emulab.net+authority+am,https://www.uky.emulab.net/protogeni/xmlrpc/am
     231plc=,https://www.planet-lab.org:12346
     232
     233# Private myplc installations
     234pl-gpo=,http://myplc.gpolab.bbn.com:12346/
     235pl-clemson=,http://myplc.clemson.edu:12346/
     236pl-stanford=,https://myplc.stanford.edu:12346/
     237pl-wisconsin=,https://wings-openflow-1.wail.wisc.edu:12346/
     238pl-washington=,https://of.cs.washington.edu:12346/
     239pl-rutgers=,https://plc.orbit-lab.org:12346/
     240pl-indiana=,https://localhost:1234/
     241pl-gatech=,https://localhost:2346/
     242
     243
     244# Tutorial OpenFlow AM
     245of-tut=,https://foam-tutorial.gpolab.bbn.com:3626/foam/gapi/1
     246
     247# Other OpenFlow AMs
     248of-gpo=,https://foam.gpolab.bbn.com:3626/foam/gapi/1
     249   }}}
     250
     251   Note, the pgeni framework definition includes the Utah Emulab clearinghouse,
     252which is the only clearinghouse for ProtoGENI aggregates. For additional
     253configuration details please see the [http://trac.gpolab.bbn.com/gcf/wiki/Omni
     254Omni] page for more details.  The omni_configuration parameters shown define the
     255following:  [[BR]]
     256   || '''Parameter'''   || ''' Use'''  ||
     257   || default_cf||  Default Clearinghouse and credentials used if not specified
     258on the command line.  ||
     259   || users||  users setting used when reserving slices. ||
     260   || urn||  The username URN ||
     261   || keys|| A comma separated list of public ssh key files to be uploaded to
     262the Clearinghouse and to your resources ||
     263   || type||  Clearinghouse/credentials type "pg" indicates ProtoGENI, see the
     264[http://trac.gpolab.bbn.com/gcf/wiki/Omni Omni] page. ||
     265   || ch||  ProtoGENI Clearinghouse URL. ||
     266   || sa|| Slice Authority URL. ||
     267   || cert||  Location of your SSL encrypted certificate (contains both a
     268certificate and a key). ||
     269   || key||  Location of your SSL encrypted key (contains both a certificate and
     270a key). ||
     271   || <AM nickname>|| Optional URN, required URL of an Aggregate Manager. ||
     272
     273   * Verify that the user URN is correct.
     274     Get the URN from your omni config
     275     {{{
     276     grep urn omni_config
     277     }}}
     278     Verify that it matches the urn in your cert (disregard the leading URI:)
     279     {{{
     280     openssl x509 -noout -text -in ./ssh/<username>_cert_ct.pem | grep
     281'urn:publicid'
     282     }}}
     283     For gpousr21 the output looks like
     284     {{{
     285geni@geni-vm:~/omni_tutorial$ grep urn omni_config
     286urn = urn:publicid:IDN+pgeni.gpolab.bbn.com+user+gpousr21
     287geni@geni-vm:~/omni_tutorial$ openssl x509 -noout -text -in
     288./ssh/gpousr21_cert_ct.pem | grep 'urn:publicid'
     289                URI:urn:publicid:IDN+pgeni.gpolab.bbn.com+user+gpousr21,
     290email:gpousr21@pgeni.gpolab.bbn.com
     291     }}}
     292
     293=== 1b. Test configuration ===
     294In order to test that our configuration is correct, you can issue a getversion
     295command. For this step we have used !PlanetLab's AM, but you can use any
     296Aggregate Manager(AM).
     297{{{
     298omni.py getversion -a http://www.planet-lab.org:12346
     299}}}
     300
     301Or equivalently using the !PlanetLab nickname:
     302{{{
     303omni.py getversion -a plc
     304}}}
     305
     306gpousr21 decided to use !PlanetLab central :
     307{{{
     308#!xml
     309geni@geni-tutorial:~/Tutorials/Omni/gpousr21$ omni.py getversion -a plc
     310INFO:omni:Loading config file omni_config
     311INFO:omni:Using control framework pgeni
     312INFO:omni:Substituting AM nickname plc with URL
     313https://www.planet-lab.org:12346, URN unspecified_AM_URN
     314INFO:omni:AM URN: unspecified_AM_URN (url: https://www.planet-lab.org:12346) has
     315version:
     316INFO:omni:{   'ad_rspec_versions': [   {   'extensions': [
     317'http://www.protogeni.net/resources/rspec/ext/gre-tunnel/1',
     318                                                   'http://www.protogeni.net/resources/rspec/ext/other-ext/3'],
     319                                 'namespace':
     320'http://www.protogeni.net/resources/rspec/2',
     321                                 'schema':
     322'http://www.protogeni.net/resources/rspec/2/ad.xsd',
     323                                 'type': 'ProtoGENI',
     324                                 'version': '2'},
     325                             {   'extensions': [],
     326                                 'namespace': None,
     327                                 'schema': None,
     328                                 'type': 'SFA',
     329                                 'version': '1'}],
     330    'code_tag': '1.0-35',
     331    'code_url': 'git://git.onelab.eu/sfa.git@sfa-1.0-35',
     332    'default_ad_rspec': {   'extensions': [],
     333                            'namespace': None,
     334                            'schema': None,
     335                            'type': 'SFA',
     336                            'version': '1'},
     337    'geni_api': 1,
     338    'hostname': 'www.planet-lab.org',
     339    'hrn': 'plc',
     340    'interface': 'aggregate',
     341    'request_rspec_versions': [   {   'extensions': [
     342'http://www.protogeni.net/resources/rspec/ext/gre-tunnel/1',
     343                                                        'http://www.protogeni.net/resources/rspec/ext/other-ext/3'],
     344                                      'namespace':
     345'http://www.protogeni.net/resources/rspec/2',
     346                                      'schema':
     347'http://www.protogeni.net/resources/rspec/2/request.xsd',
     348                                      'type': 'ProtoGENI',
     349                                      'version': '2'},
     350                                  {   'extensions': [],
     351                                      'namespace': None,
     352                                      'schema': None,
     353                                      'type': 'SFA',
     354                                      'version': '1'}],
     355    'sfa': 1,
     356    'testbed': 'myplc'}
     357INFO:omni: ------------------------------------------------------------
     358INFO:omni: Completed getversion:
     359
     360  Options as run:
     361    aggregate: plc
     362    framework: pgeni
     363    native: True
     364
     365  Args: getversion
     366
     367  Result Summary:
     368Got version for 1 out of 1 aggregates
     369 
     370INFO:omni: ============================================================
     371}}}
     372
     373== 2. Make a slice ==
     374Before we continue with the rest of the tutorial, we need to create a slice that
     375will contain all our slivers with the different AMs.
     376Since the omni_config specifies using GPO's ProtoGENI as the Slice Authority
     377(SA), your slice will be created in the pgeni.gpolab.bbn.com namespace. 
     378
     379=== 2a. Createslice ===
     380For this tutorial we will create a slice named ''gposlice##'' (where ## matches
     381your username); you should always choose a slice name that is meaningful to you.
     382To avoid confusion, avoid creating a slice with the same name as your username
     383(i.e. if your username is ''alice'', don't name your slice ''alice'' too).
     384{{{
     385omni.py createslice gposlice##
     386}}}
     387
     388
     389=== 2b. Renew Slice ===
     390Note in the above output that our new slice expires soon. Your slivers can not
     391last longer then your slice, and your resources will go away when the
     392reservation expires. For your experiments be sure to renew your slice for the
     393duration of your experiment. For the tutorial you don't need to extend the
     394lifetime, but if you wanted to, this is what it would look like:
     395
     396{{{
     397omni.py renewslice gposlice## 20111105T00:00:00
     398}}}
     399
     400For Alice the output would like:
     401{{{
     402geni@geni-tutorial:~/Tutorials/Omni/gpousr21$ omni.py renewslice gposlice21
     40320111105T00:00:00
     404INFO:omni:Loading config file omni_config
     405INFO:omni:Using control framework pgeni
     406INFO:omni.protogeni:Requesting new slice expiration '2011-11-05T00:00:00'
     407INFO:omni:Slice gposlice21 now expires at 2011-11-05 00:00:00 UTC
     408INFO:omni:Slice urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+gposlice21 expires
     409on 2011-11-05 00:00:00 UTC
     410INFO:omni: ------------------------------------------------------------
     411INFO:omni: Completed renewslice:
     412
     413  Options as run:
     414    framework: pgeni
     415    native: True
     416
     417  Args: renewslice gposlice21 20111105T00:00:00
     418
     419  Result Summary: Slice gposlice21 now expires at 2011-11-05 00:00:00 UTC
     420Slice urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+gposlice21 expires on
     4212011-11-05 00:00:00 UTC
     422INFO:omni: ============================================================
     423
     424}}}
     425
     426'''Note:''' You can not renew the slice expiration time to an earlier time that
     427its current expiration time. Also there is no deleteslice operation. However,
     428you can delete all the slivers in your slice and let the slice expire.
     429
     430
     431=== 2c. List your Slices ===
     432If you want to find out what slices you currently have, you can use an Omni
     433command to {{{listmyslices}}}.
     434{{{
     435omni.py listmyslices <username>
     436}}}
     437
     438We've pre-reserved resources in a second slice (ctrl##) in advance of the
     439tutorial for each user.
     440
     441So for gpousr21 the output would look like :
     442{{{
     443geni@geni-tutorial:~/Tutorials/Omni/gpousr21$ omni.py listmyslices gpousr21
     444INFO:omni:Loading config file omni_config
     445INFO:omni:Using control framework pgeni
     446INFO:omni:User 'gpousr21' has slices:
     447  urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+gposlice21
     448  urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+ctrl21
     449INFO:omni: ------------------------------------------------------------
     450INFO:omni: Completed listmyslices:
     451
     452  Options as run:
     453    framework: pgeni
     454    native: True
     455
     456  Args: listmyslices gpousr21
     457
     458  Result Summary: Found 2 slices for user 'gpousr21'.
     459 
     460INFO:omni: ============================================================
     461
     462}}}
     463
     464== 3. Make a ProtoGENI sliver ==
     465The first resource we are going to add to our slice is a ProtoGENI host.
     466
     467=== 3a. Createsliver ===
     468Under the ''Tutorials/Omni/<username>'' directory, there is a directory called
     469''rspecs'' that has all the necessary RSpecs for the tutorial. For this tutorial
     470we are going to use ProtoGENI hosts from GPO's ProtoGENI, as well as Wide Area
     471ProtoGENI hosts from Utah's ProtoGENI cluster.
     472   * If your ProtoGENI host is in the '''emulab.net'''(e.g. pg30.emulab.net),
     473namespace then it belongs to Utah's cluster and you should use Utah's AM
     474(nickname: pg-utah), and use '''rspecs/final/protogeni_utah_<username>.rspec'''
     475
     476   * If your ProtoGENI host is in the '''pgeni.gpolab.bbn.com'''(e.g.
     477pc1.pgeni.gpolab.bbn.com), namespace then it belongs to GPO's cluster and you
     478should use GPO's AM (nickname: pg-gpo), and use
     479'''rspecs/final/protogeni_gpo_<username>_v02.rspec'''
     480
     481   * '''Advanced Option''': If you are interested in creating your own RSpecs
     482follow the instructions under [#ReservingProtoGENInodeswithFlack Reserving
     483ProtoGENI nodes with Flack].  Then skip to the [#a3b.Sliverstatus Next Step].
     484
     485   gpousr21 was assigned host pc1.pgeni.gpolab.bbn.com so she should use
     486pg_gpo.rspec:
     487   {{{
     488#!xml
     489<!--
     490This rspec will reserve one wide-area ProtoGENI host
     491
     492AM: http://www.emulab.net/protogeni/xmlrpc/am
     493-->
     494<!--  This file is an rspec for GEC 12 tutorial
     495-->
     496
     497<rspec type="request"
     498       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     499http://www.protogeni.net/resources/rspec/2/request.xsd"
     500       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     501       xmlns="http://www.protogeni.net/resources/rspec/2">
     502
     503  <node client_id="pc1"
     504        component_manager_id="urn:publicid:IDN+pgeni.gpolab.bbn.com+authority+cm"
     505        component_id="urn:publicid:IDN+pgeni.gpolab.bbn.com+node+pc1"
     506        component_name="pc1" exclusive="true">
     507    <sliver_type name="raw-pc">
     508      <disk_image
     509name="urn:publicid:IDN+pgeni.gpolab.bbn.com+image+emulab-ops//UBUNTU1004-STD"/>
     510    </sliver_type>
     511    <services>
     512      <execute command="cd /home/gpousr21/config_dir;./install.sh" shell="sh "
     513/>
     514      <install install_path="/home/gpousr21"
     515url="http://192.1.249.166:8383/gec12tutorial_ubuntu.tar.gz" file_type="tar.gz"/>
     516    </services>
     517  </node>
     518
     519</rspec>
     520
     521
     522   }}}
     523
     524   * Now you are ready to reserve your host on the '''appropriate''' AM. For
     525easy access and to be able to copy and paste AM URLs that are used in this
     526tutorial, we made a [#AMURLTable table]. If your node is '''pg46.emulab.net''',
     527you are sharing your node with Alice. Alice has already created the sliver for
     528you, so you can run the 'createsliver' command, and its ok if it fails.
     529  {{{
     530omni.py createsliver -a <AM_NICKNAME> gposlice## rspecs/final/<rspec_file>
     531}}}
     532
     533The output should look like :
     534{{{
     535#!xml
     536
     537geni@geni-vm:~/omni_tutorial$ omni.py createsliver -a
     538http://www.emulab.net/protogeni/xmlrpc/am aliceslice rspecs/pg_utah.rspec
     539
     540FILL IN HERE
     541
     542}}}
     543
     544=== 3b. Sliverstatus ===
     545
     546We asked for an exclusive ProtoGENI host, which means that the node needs to be
     547loaded with the right OS and booted, before our sliver is ready to use. This
     548will take a while. We can check the status of our sliver, using the
     549''sliverstatus'' call.
     550
     551{{{
     552omni.py sliverstatus -a <AM_NICKNAME> gposlice##
     553}}}
     554
     555The status will probably be 'not ready', you can continue with the next steps of
     556the tutorial, and we will come back to this node later.
     557
     558= II. Using Physical Topology to Influence Your Experiment =
     559
     560In this exercise we are going to test and see how the underlying network
     561topology can affect the topology of your experiment. For this exercise we have
     562already setup the networking portion of the exercise, so you just need to
     563reserve your compute resources.
     564
     565== 1. Make a MyPLC sliver ==
     566For this exercise you would need to reserve two MyPlc hosts, each in a different
     567AM.
     568Under the rspecs directory (Tutorials/ExptWorkflow/gpousr##/rspecs/) there
     569are the two MyPLC rspecs that you should use.
     570
     571   * The name of the rspec is of the form myplc-<site>-<node>.rspec. You should
     572take a look in this [#AMURLTable table] to find out what is the
     573nickname for the AM, and try to reserve the sliver. Also open your omni_config file
     574and check how the nicknames are defined.
     575
     576   * '''Advanced Option''': If you are interested in creating your own RSpecs
     577follow the instructions under
     578[##CreatingPlanetLabRequestRSpecsfromAdvertisementRSpecs Creating PL Request
     579RSpecs from Ad. RSpecs]. Then skip to the [#a2.Logintothenodes---OmniScripting
     580Next Step].
     581
     582   gpousr21 was assigned hosts bain.gpolab.bbn.com
     583   {{{
     584#!xml
     585<?xml version="1.0" ?>
     586<!-- Resources at AM:
     587  URN: http://myplc.gpolab.bbn.com:12346/
     588 -->
     589
     590<rspec type="request"
     591       xmlns="http://www.protogeni.net/resources/rspec/2"
     592       xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     593       xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
     594       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     595       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     596http://www.protogeni.net/resources/rspec/2/request.xsd">
     597    <node
     598component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+bain.gpolab.bbn.com"
     599    component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     600    component_name="bain.gpolab.bbn.com"
     601    exclusive="false"
     602    client_id="ganel">
     603        <sliver_type name="plab-vnode"/>
     604    </node>
     605</rspec>
     606   }}}
     607
     608   * Now you are ready to reserve your host on the '''appropriate''' AM. For
     609easy access and to be able to copy and paste AM URLs and nicknames that are used
     610in this tutorial, we made a [#AMURLTable table].
     611  {{{
     612omni.py createsliver -a <AM_NICKNAME> gposlice## rspecs/<rspec_file>
     613}}}
     614
     615The output should look like :
     616{{{
     617#!xml
     618
     619geni@geni-tutorial:~/Tutorials/ExptWorkflow/gpousr10$ omni.py createsliver sliceomni10
     620rspecs/final/myplc-gpolab-ganel.rspec -a pl-gpo
     621INFO:omni:Loading config file omni_config
     622INFO:omni:Using control framework pgeni
     623INFO:omni:Slice urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+sliceomni10 expires
     624within 1 day on 2011-11-04 06:57:31 UTC
     625INFO:omni:Substituting AM nickname pl-gpo with URL
     626http://myplc.gpolab.bbn.com:12346/, URN unspecified_AM_URN
     627INFO:omni:Substituting AM nickname pl-gpo with URL
     628http://myplc.gpolab.bbn.com:12346/, URN unspecified_AM_URN
     629INFO:omni:Creating sliver(s) from rspec file
     630rspecs/final/myplc-gpolab-ganel.rspec for slice
     631urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+sliceomni10
     632INFO:omni:Asked http://myplc.gpolab.bbn.com:12346/ to reserve resources. Result:
     633INFO:omni:<?xml version="1.0" ?>
     634INFO:omni:<!-- Reserved resources for:
     635  Slice: sliceomni10
     636  At AM:
     637  URL: http://myplc.gpolab.bbn.com:12346/
     638 -->
     639INFO:omni:<rspec expires="2011-11-04T01:58:07Z" generated="2011-11-04T00:58:07Z"
     640type="manifest" xmlns="http://www.protogeni.net/resources/rspec/2"
     641xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     642xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
     643xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     644xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     645http://www.protogeni.net/resources/rspec/2/manifest.xsd"> 
     646    <node client_id="ganel.gpolab.bbn.com"
     647component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+ganel.gpolab.bbn.com"
     648component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     649component_name="ganel.gpolab.bbn.com" exclusive="false"
     650sliver_id="urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+sliceomni10:291:4:0">   
     651        <hardware_type name="plab-pc"/>   
     652        <hardware_type name="pc"/>   
     653        <location country="us" latitude="42.3897" longitude="-71.1475"/>   
     654        <sliver_type name="plab-vnode"/>   
     655    </node> 
     656</rspec>
     657INFO:omni: ------------------------------------------------------------
     658INFO:omni: Completed createsliver:
     659
     660  Options as run:
     661    aggregate: pl-gpo
     662    framework: pgeni
     663    native: True
     664
     665  Args: createsliver sliceomni10 rspecs/final/myplc-gpolab-ganel.rspec
     666
     667  Result Summary: Slice urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+sliceomni10
     668expires within 1 day(s) on 2011-11-04 06:57:31 UTC
     669Reserved resources on http://myplc.gpolab.bbn.com:12346/. 
     670INFO:omni: ============================================================
     671}}}
     672
     673Follow the same procedure to reserve your second myPLC host.
     674
     675== 2. Login to the nodes --- Omni Scripting ==
     676
     677After reserving the nodes, we are ready to login. When reserving !PlanetLab
     678resources, using a different clearinghouse, the login name that should be used
     679to access the nodes is ''''not'''' the username. The username is listed as part
     680of the sliverstatus call. For common functionality like this that is expected to
     681be used often, omni gives you the capability of writing scripts and including
     682omni as a library.
     683Under omni_tutorial there is a folder 'example_scripts' that includes example
     684python scripts that use Omni. One script that is available is the
     685''getMyLogin.py'' script that will return the exact command for logging-in to
     686your nodes.
     687{{{
     688readyToLogin -a <AM_NICKNAME> gposlice##
     689}}}
     690
     691The script will return the actual command that you would need to use for logging
     692in.
     693
     694For gpousr21 the script would return :
     695
     696{{{
     697================================================================================
     698Aggregate [https://myplc.stanford.edu:12346] has a PlanetLab sliver.
     699of-planet1.stanford.edu's pl_boot_state is:
     700  boot
     701Login using:
     702  xterm -e ssh -i ssh/gpousr21_key
     703pgenigpolabbbncom_gposlice21@bain.gpolab.bbn.com &
     704
     705================================================================================
     706}}}
     707
     708For user gpousr21 this would be :
     709{{{
     710xterm -e ssh -i ssh/gpousr##_key -F ssh/config gpousr##@ops &
     711}}}
     712
     713'''Note''': If your hosts are in Georgia Tech you would need to use the
     714connection through ops.
     715To do that run
     716{{{
     717xterm -e ssh -i ssh/gpousr##_key -F ssh/config <hostname> &
     718}}}
     719
     720For gpousr21 that would be :
     721{{{
     722xterm -e ssh -i ssh/gpousr21_key -F ssh/config bain &
     723}}}
     724
     725== 3. Test Different Topologies  ==
     726The Mesoscaly deployment can offer, different topologies even if the
     727communication is between the same hosts. We have provisioned
     728two different subnets in the Mesoscale infrastructure, each using a different
     729VLAN (one using 3715 and the other 3716).
     730
     731The two subnets that have been provisioned are '''10.42.131.0/24''' on 3715 and
     732'''10.42.132.0/24''' on 3716.
     733
     734First of all let's see how we can figure out the IP of the hosts we reserved :
     735
     736   * List all the interfaces in your host. You will see that there many
     737interfaces of the form eth1.XXXX
     738   {{{
     739   /sbin/ifconfig
     740   }}}
     741   Part of the output would look like :
     742   {{{
     743   eth1.1750:42147 Link encap:Ethernet  HWaddr 00:B0:D0:E1:6F:78 
     744          inet addr:10.42.147.90  Bcast:10.42.147.255  Mask:255.255.255.0
     745          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     746
     747   eth1.1750:42148 Link encap:Ethernet  HWaddr 00:B0:D0:E1:6F:78 
     748          inet addr:10.42.148.90  Bcast:10.42.148.255  Mask:255.255.255.0
     749          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     750   }}}
     751
     752   * Figure out the last octet of the IP address of your hosts. The way these
     753MyPLC hosts are setup, is that they have multiple subinterfaces, each configured
     754to be part of a different IP subnet. Almost all subnets in the hosts are in the
     755form of 10.42.Y.0/24. You will notice that for all these subnets, your host has
     756the same last octet.  In the example above all the subinterfaces of eth1, will
     757have an IP address that will end in '''90''' (10.42.147.'''90''',
     75810.42.148.'''90''')
     759
     760   * Ping over 3715. After loging in to your hosts ping from host1 to host2.
     761Assuming that host2 has a last octet of YYY you should:
     762
     763   {{{
     764ping 10.42.131.YYY
     765   }}}
     766   Notice the RTT on the packets.
     767
     768   * Ping over 3716. After loging in to your hosts ping from one host2 to host1.
     769Assuming that host1 has XXX as it's last octet you should ping
     770
     771   {{{
     772ping 10.42.132.XXX
     773   }}}
     774   Notice the RTT on the packets and compare it with the above ping.
     775
     776= III. Exercise 3: Run a Layer 2 Experiment =
     777= V. Run a Layer 2 ping =
     778The mesoscale GENI resources are connected on Layer 2, which enables Layer 2, i.e. non-IP experiments. In this exercise we are going
     779to run a layer 2 ping program, where we are going to send raw Ethernet frames of a custom Ethernet type to a server and receive a reply.
     780Currently MyPLC only supports IP experiments, so we will use our ProtoGENI host which we have reserved in the beginning.
     781   * check that your sliver is ready
     782   {{{
     783   omni.py sliverstatus -a <AM_NICKNAME> <SLICE_NAME>
     784   }}}
     785
     786   * If your sliver is ready, login to the node (if your host is '''pg33''', '''pg32''' please read the notes):
     787   {{{
     788   ssh -i ./ssh/geni_key <username>@<host>
     789   }}}
     790
     791      For Alice, that has reserved node pg46.emulab.net:
     792   {{{
     793   ssh -i ./ssh/geni_key alice@pg46.emulab.net
     794   }}}
     795
     796   '''NOTE 1:''' If your node is '''pg32.emulab.net''' or '''pg33.emulab.net''', you will need to do some extra work to login to the node. The control interface of these nodes is behind a firewall so you will login to your node through 'ops.pgeni.gpolab.bbn.com'. Run
     797   {{{
     798   xterm -e ssh -i ssh/<username>_key -L2222:<host>:22 <username>@ops.pgeni.gpolab.bbn.com &
     799   }}}
     800   This command forwards local port 2222 to go through the connection at ops.pgeni.gpolab.bbn.com and from there connect to your host on port 22.
     801   Now you are ready to login to your node
     802   {{{
     803   ssh -i /ssh/<username>_key <username>@localhost -p 2222
     804   }}}
     805   
     806   '''NOTE 2:''' If your node is '''pg46.emulab.net''', remember you are sharing your node with Alice. To login to the node do :
     807    {{{
     808    xterm -e ssh -i ~/omni_tutorial/ssh/<USERNAME>_key alice@pg46.emulab.net &
     809    }}}
     810
     811   
     812
     813   * Check to see that the software has been downloaded :
     814   {{{
     815   [alice@protogeni1 ~]$ ls
     816   config_dir  pingPlus
     817   }}}
     818
     819   * Configure the node. When you login to the node, the data interface of the host is not configured.
     820   {{{
     821    [alice@protogeni1 ~]$ /sbin/ifconfig
     822   }}}
     823   This should list only two interface, the loopback and the control interface. Part of the tarball that was downloaded, is a script that will configure the node, and compile the Layer 2 ping software. Run
     824   {{{
     825    ./config_dir/configure.sh
     826   }}}
     827   The output for Alice would look like
     828   {{{
     829[alice@protogeni1 ~]$ ./config_dir/configure.sh
     830DEVICE=eth1.1750
     831 USERCTL=no
     832 VLAN=yes
     833 IPADDR=10.42.131.146
     834 NETMASK=255.255.255.0
     835 BOOTPROTO=static
     836 ONBOOT=yes
     837
     838Added VLAN with VID == 1750 to IF -:eth1:-
     839gcc    -c -o packetFunctions.o packetFunctions.c
     840gcc    -c -o pingPlusListener.o pingPlusListener.c
     841gcc  packetFunctions.o pingPlusListener.o  -o pingPlusListener
     842gcc    -c -o pingPlus.o pingPlus.c
     843gcc  packetFunctions.o pingPlus.o -o pingPlus
     844   }}}
     845   Verify that the data interface is up :
     846   {{{
     847   [alice@protogeni1 ~]$ /sbin/ifconfig
     848   }}}
     849   and note the name of the data interface, the data interface is the one that has an IP address in the 10.42.131.0/24 subnet:
     850   {{{
     851   eth1.1750 Link encap:Ethernet  HWaddr 00:1F:29:32:92:4D 
     852          inet addr:10.42.131.146  Bcast:10.42.131.255  Mask:255.255.255.0
     853          inet6 addr: fe80::21f:29ff:fe32:924d/64 Scope:Link
     854          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     855          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
     856          TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
     857          collisions:0 txqueuelen:0
     858          RX bytes:5428 (5.3 KiB)  TX bytes:3482 (3.4 KiB)
     859
     860   }}}
     861   In this case the name is 'eth1.1750'.
     862
     863   * Run the Layer 2 Ping
     864   We have pre-configured the network to forward along Layer2 packets of Ethernet type '10131', so let's try pinging with that.
     865   The software that is going to send Layer 2 pings, is called pingPlus. Change to the pingPlus directory :
     866   {{{
     867   cd pingPlus
     868   }}}
     869   There is a server running at a host with mac address '00:15:17:d4:64:c2'. Run the client :
     870   {{{
     871   sudo ./pingPlus 00:15:17:d4:64:c2 <interface_name> 10131
     872   }}}
     873   For Alice the output would be :
     874   {{{
     875[alice@protogeni1 ~/pingPlus]$ sudo ./pingPlus 00:15:17:d4:64:c2 eth1.1750 10131
     876RQ:'5019+6242' to 0:15:17:d4:64:c2.
     877RL:5019+6242=11261 from 0:15:17:d4:64:c2.
     878   }}}
     879   Send a stream of packets, by specifying the number of packets as the last parameter :
     880   {{{
     881   sudo ./pingPlus 00:15:17:d4:64:c2 <interface_name> 10131 10
     882   }}}
     883   '''Note:'''If the program is stuck waiting for a reply for more than 1 minute, press '''Ctrl-C''' to exit.
     884
     885Congratulations you ran a Layer two experiment across the country!
     886
     887
     888= III. Exercise 2: Using !OpenFlow to Create Your Experiment's Topology =
     889Another way to control the path that your packets are taking is with OpenFlow
     890controllers. In this exercise we are going to use an OpenFlow controller that
     891will deflect packets from one server to another one.  We will start first by
     892reserving an OpenFlow sliver.
     893
     894== 1. Make an OpenFlow sliver ==
     895
     896In the previous step, we have used a pre-configured setup to run our test. In
     897this experiment we will first reserve an OpenFlow sliver that will point to a
     898controller to control our traffic.
     899
     900=== 1a. !OpenFlow controller ===
     901In a typical !OpenFlow experiment, the first step is to figure out where you are
     902going to run your controller. The !OpenFlow controller should be able to accept
     903connections from switches. To make this tutorial simpler we have already setup
     904the controllers in separate slices for each user.
     905The name of your controller slice is "ctrlXX" and it contains one myplc host,
     906"navis.gpolab.bbn.com", where your controller will be running on
     907port "100XX".
     908
     909In the previous example we have pointed all the traffic for subnets
     91010.42.131.0/24, 10.42.132.0/24 to a switch !OpenFlow controller, that's why you
     911were able to ping between your hosts, using that subnet.
     912
     913=== 1b. !OpenFlow sliver ===
     914Until you have reserved an !OpneFlow sliver, traffic would not be forwarded
     915between your hosts on your assigned subnet.
     916   
     917   * Personalize your rspec. There is a sample !OpenFlow rspec, under the rspecs
     918folder ('''rspecs/openflow-tutorial-template.rspec'''), that you would need to
     919modify in order to reserve the flowspace that has been assigned to you. In the
     920beginning of the file there is a list of tags you would need to replace. More
     921specifically
     922       * <USERNAME> : Your usernamer
     923       * <CTRL-PORT> : The port that your controller will be listening on on
     924navis.gpolab.bbn.com
     925       * <VLAN> : Which core VLAN you are using for your experiment.
     926       * <IP_SUBNET_OCT> : The last octet of the subnet that has been assigned
     927to you
     928       * <ETH_TYPE_1>, <ETH_TYPE_2>  : The ethtypes that have been assigned to
     929you for use in this exercise
     930
     931   * Create the OpenFlow sliver. The flowspace for the tutorial is managed by an
     932AM running at GPO :
     933   {{{
     934   omni.py createsliver gposliceXX ./rspecs/openflow-tutorial-template.rspec -a
     935of-tut
     936   }}}
     937
     938   * Login to your controller machine :
     939   {{{
     940   xterm -e ssh -i ssh/gpousrXX_key pgenigpolabbbncom_XX@bain.gpolab.bbn.com &
     941   }}}
     942   {{{
     943   xterm -e ssh -i ssh/gpousr21_key
     944pgenigpolabbbncom_gposlice21@bain.gpolab.bbn.com &
     945   }}}
     946
     947   * Run your controller. First of all verify that there is no other controller
     948running. Run
     949   {{{
     950   ps -ef |grep nox_core
     951   }}}
     952   If there is one, make sure you kill it before you start the new one.
     953   In order to start your controller do the following
     954   {{{
     955   cd nox_build/src
     956   ./nox_core -i ptcp:<PORT> -d l2deflect
     957   }}}
     958
     959
     960=== 1d. Deflect layer 2 ping using your controller ===
     961For this exercise we have already reserved the hosts for you. There are two
     962layer 2 ping servers running and one host that will be used as a client. You
     963will need to login to the client using your key.
     964{{{
     965ssh -i ssh/gpousrXX_key inki@pg30.emulab.net
     966}}}
     967
     968After you login run :
     969{{{
     970cd pingPlus
     971}}}
     972
     973Run a layer two ping using each one of your two ethernet types. What do you
     974notice?
     975{{{
     976sudo ./pingPlus 00:15:17:d4:64:c2 eth1.1750 <ETH_TYPE1>
     977sudo ./pingPlus 00:15:17:d4:64:c2 eth1.1750 <ETH_TYPE2>
     978}}}
     979
     980= IV. Exercise 3: Using Software Routers to Create Your Experiment Topology =
     981In this exercise we are going to use a click router to bandwidth limit our
     982traffic. For this we are going to use the protogeni host you
     983reserved in the beginning.
     984
     985'''Note:''' If you are using one of the hosts pc1.gpolab.bbn.com,
     986pc11.gpolab.bbn.com or pg30.emulab.net your node has already been
     987reserved. Please call us to tell you how to access it. 
     988
     989   * check that your sliver is ready
     990   {{{
     991   omni.py sliverstatus -a <AM_NICKNAME> gpousr##
     992   }}}
     993
     994   * If your sliver is ready, run readyToLogin to figure out how to login to the
     995node. (if your host is '''pg33''' please read the notes):
     996   {{{
     997   readyToLogin -a <AM_NICKNAME> gposlice##
     998   }}}
     999
     1000
     1001   '''NOTE 1:''' If your node is '''pg33.emulab.net''' then run
     1002   {{{
     1003   xterm -e xterm -e ssh -i ssh/gpousr##_key -F ssh/config gpousr##@pg33 & &
     1004   }}}
     1005   
     1006   * Check to see that the software has been downloaded :
     1007   {{{
     1008   [alice@protogeni1 ~]$ ls
     1009   config_dir  pingPlus click-2.0.1
     1010   }}}
     1011
     1012   * Configure the node. When you login to the node, the data interface of the
     1013host is not configured.
     1014   {{{
     1015    [alice@protogeni1 ~]$ /sbin/ifconfig
     1016   }}}
     1017   This should list only two interface, the loopback and the control interface.
     1018Part of the tarball that was downloaded, is a script that will configure the
     1019node, and compile the Layer 2 ping software. Run
     1020   {{{
     1021    ./config_dir/configure.sh
     1022   }}}
     1023   The output for Alice would look like
     1024   {{{
     1025[alice@protogeni1 ~]$ ./config_dir/configure.sh
     1026DEVICE=eth1.1750
     1027 USERCTL=no
     1028 VLAN=yes
     1029 IPADDR=10.42.131.146
     1030 NETMASK=255.255.255.0
     1031 BOOTPROTO=static
     1032 ONBOOT=yes
     1033
     1034Added VLAN with VID == 1750 to IF -:eth1:-
     1035gcc    -c -o packetFunctions.o packetFunctions.c
     1036gcc    -c -o pingPlusListener.o pingPlusListener.c
     1037gcc  packetFunctions.o pingPlusListener.o  -o pingPlusListener
     1038gcc    -c -o pingPlus.o pingPlus.c
     1039gcc  packetFunctions.o pingPlus.o -o pingPlus
     1040   }}}
     1041   Verify that the data interface is up :
     1042   {{{
     1043   [alice@protogeni1 ~]$ /sbin/ifconfig
     1044   }}}
     1045   and note the name of the data interface, the data interface is the one that
     1046has an IP address in the 10.42.131.0/24 subnet:
     1047   {{{
     1048   eth1.1750 Link encap:Ethernet  HWaddr 00:1F:29:32:92:4D 
     1049          inet addr:10.42.131.146  Bcast:10.42.131.255  Mask:255.255.255.0
     1050          inet6 addr: fe80::21f:29ff:fe32:924d/64 Scope:Link
     1051          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     1052          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
     1053          TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
     1054          collisions:0 txqueuelen:0
     1055          RX bytes:5428 (5.3 KiB)  TX bytes:3482 (3.4 KiB)
     1056
     1057   }}}
     1058   In this case the name is 'eth1.1750'.
     1059
     1060   * Configure the click router
     1061   {{{
     1062   cd click-2.0.1/conf
     1063   }}}
     1064   And edit the "gec12_conf.click" file to personalize it.
     1065   * '''IF_NAME''' is the name of the interface that was configured in the
     1066previous step
     1067   * '''MAC_ADDRESS''' is the mac address of that interface.
     1068
     1069   * Run the click router
     1070   {{{
     1071   cd ../userlevel/
     1072   sudo ./click ../conf/gec12_conf.click
     1073   }}}
     1074
     1075   * Start the new controller. First of all kill the controller that is
     1076currently
     1077   {{{
     1078   ps -ef |grep nox_core
     1079   sudo kill -9 <PID>
     1080   }}}
     1081   Start the new controller
     1082   {{{
     1083   ./nox_core -i ptcp:<PORT> -d mbox
     1084   }}}
     1085
     1086   * On your two PL hosts install iperf by running :
     1087   {{{
     1088   sudo yum install iperf
     1089   }}}
     1090
     1091   * And then on one host run the server
     1092   {{{
     1093   iperf -s -i 2
     1094   }}}
     1095   Run the client on the other host
     1096   {{{
     1097   iperf -c <host> -i 2
     1098   }}}
     1099
     1100   Look how your traffic is capped.
     1101= V. Cleanup resources =
     1102Although all your reservations, have expiration times, its always good practice
     1103to release the resources, after your experiment is over to make them available
     1104to other experimenters.
     1105
     1106=== 1. Deletesliver ===
     1107For each createsliver that you have run, you will need to run deletesliver to
     1108release the resources
     1109{{{
     1110omni.py deletesliver -a <AM URL> <username>slice
     1111}}}
     1112For Alice this would look like
     1113{{{
     1114# Delete ProtoGENI sliver
     1115omni.py deletesliver -a http://www.emulab.net/protogeni/xmlrpc/am aliceslice
     1116
     1117# Delete MyPLC slivers
     1118omni.py deletesliver -a https://myplc.stanford.edu:12346 aliceslice
     1119
     1120#Delete OpenFlow slivers
     1121 omni.py deletesliver -a
     1122https://expedient-tutorial.gpolab.bbn.com:1443/openflow/gapi/1 aliceslice
     1123}}}
     1124
     1125You can not delete your slice. Although this will be cleaned up when it expires,
     1126it should be an empty container and thus does not hold up any resources.
     1127
     1128Congratulations, you have finished the tutorial! Now you are ready to design and
     1129run your own experiments. Don't hesitate to [mailto:help@geni.net email us] with
     1130any questions you might have.
     1131
     1132= VI. Get Your Own Account =
     1133The accounts, that you used in the above steps, will be deactivated after the
     1134tutorial. If you do not already have an account at GPO's ProtoGENI cluster, you
     1135should get your own account so that you can further experiment with GENI.
     1136
     1137=== 1a. Get a temporary account ===
     1138To get a temporary account that will be deactivated on August 12th 2011, apply
     1139for an account at this page https://www.pgeni.gpolab.bbn.com/joinproject.php3.
     1140For Project name use : Gec11Gpo.
     1141
     1142=== 1b. Get a permanent account ===
     1143If you would like to run your own experiments in this infrastructure, please
     1144contact us at [mailto:help@geni.net] to get a permanent account.
     1145
     1146=== 2. Getting to Know Omni ===
     1147Now that you have your own account, you should configure Omni to use your own
     1148personal info, instead of the pre-made accounts.
     1149==== 2a. Generate and Download your ProtoGENI certificate ====
     1150      a. Start Firefox within the VM and
     1151[https://www.pgeni.gpolab.bbn.com/login.php3] log in to your account.
     1152      b. Select ''Generate SSL Cert'' and follow instructions.
     1153      c. Select ''Download your SSL Cert'' (it's on the left of the page), and
     1154click on the 'Download it in PEM format' link.
     1155      d. Copy the contents of the page (Ctrl-A, Ctrl-C)
     1156      e. Open a terminal (there is a shortcut on the top bar) under the
     1157omni_tutorial directory there should be an ssh directory
     1158      {{{
     1159cd omni_tutorial/ssh
     1160      }}}
     1161      f. Open a file called <username>_cert.pem, paste your cert(Ctrl-Shift-V)
     1162and save.
     1163      {{{
     1164pico <username>_cert.pem>
     1165Ctrl-Shift-V
     1166Ctrl-X
     1167      }}}
     1168      g. Remove the passphrase from your certificate. For security best
     1169practices you should keep a passphrase on your certificate. If you want to avoid
     1170typing your passphrase throughout the tutorial, you might want to temporarily
     1171remove your passphrase
     1172      {{{
     1173openssl rsa -in ./<username>_cert.pem -out ./<username>_cert_ct.pem
     1174openssl x509 -in ./<username>_cert.pem >> ./<username>_cert_ct.pem
     1175chmod 400 ./<username>_cert_ct.pem
     1176      }}}
     1177       If you want a way to type your passphrase only once per session, look
     1178[http://trac.gpolab.bbn.com/gcf/wiki/OmniTroubleShoot#Q.WhydoesOmnipromptformyPEMpassphrasesomanytimesCantOmnipromptonlyonce
     1179here].
     1180
     1181==== 2b. Generate a pair of private/public keys. ====
     1182In order to be able to login to the resources you will reserve will need a pair
     1183of keys. You can use any set of existing keys you might have, or you can
     1184generate a new pair. For security best practices you should  have a passphrase
     1185on your keys.
     1186{{{
     1187ssh-keygen -f <username>_key
     1188}}}
     1189
     1190Now you can go back to [wiki:GEC11NetworkingExperiments/Tutorial#I.ConfigureOmni
     1191(I)] and follow the steps using your own certificate and key.
     1192
     1193= Creating PlanetLab Request RSpecs from Advertisement RSpecs =
     1194
     1195   1. Use Omni to download and save the advertised RSpec from the aggregate you
     1196care about.
     1197      a. In general the command is:
     1198      {{{
     1199$ omni.py -a <url or nickname of aggregate> -t ProtoGENI 2 -o listresources
     1200      }}}
     1201      For example, to get the request RSpec from the MyPLC at the GPO Lab:
     1202      {{{
     1203$ omni.py -a pl-gpo -t ProtoGENI 2 -o listresources
     1204      }}}
     1205      (Version 2 of the AM API renames the ProtoGENI v2 RSpecs as GENI v3 RSpecs
     1206so in the near future the command will become: {{{$ omni.py <url or nickname of
     1207aggregate> -t GENI 3 -o listresources}}})
     1208      b. The output of this command is:
     1209      {{{
     1210geni@geni-tutorial:~/Tutorials/Omni/gpousr20$ omni.py -a pl-gpo -t ProtoGENI 2
     1211-o listresources
     1212INFO:omni:Loading config file omni_config
     1213INFO:omni:Using control framework pgeni
     1214INFO:omni:Saving output to a file.
     1215INFO:omni:Substituting AM nickname pl-gpo with URL
     1216http://myplc.gpolab.bbn.com:12346/, URN unspecified_AM_URN
     1217INFO:omni:Listed resources on 1 out of 1 possible aggregates.
     1218INFO:omni:Writing to 'rspec-myplc-gpolab-bbn-com-12346-.xml'
     1219INFO:omni: ------------------------------------------------------------
     1220INFO:omni: Completed listresources:
     1221
     1222  Options as run:
     1223    aggregate: pl-gpo
     1224    framework: pgeni
     1225    native: True
     1226    output: True
     1227    rspectype: ('ProtoGENI', '2')
     1228
     1229  Args: listresources
     1230
     1231  Result Summary: Retrieved resources from 1 aggregates.
     1232Wrote rspecs from 1 aggregates to 1 files
     1233Saved listResources RSpec at unspecified_AM_URN to file
     1234rspec-myplc-gpolab-bbn-com-12346-.xml.
     1235.
     1236INFO:omni: ============================================================
     1237      }}}
     1238
     1239   2. Copy and edit the RSpec file.
     1240      a. Copy the advertisement RSpec file.  The new file will become the
     1241request RSpec.  In general this would be:
     1242{{{
     1243cp <advertisement RSpec filename> <manifest RSpec filename>
     1244}}}
     1245      The value of {{{<advertisement RSpec filename>}}} appears in the Omni
     1246summary.
     1247      In this case we will generate a request for the node "navis":
     1248      {{{
     1249cp rspec-myplc-gpolab-bbn-com-12346-.xml pl-gpo-navis.rspec
     1250      }}}
     1251      b. Edit the request Rspec file:
     1252      {{{
     1253emacs pl-gpo-navis.rspec &
     1254      }}}
     1255      or
     1256      {{{
     1257vi pl-gpo-navis.rspec
     1258      }}}
     1259      c. Edit the {{{<rspec>}}} tag.
     1260         i. In the {{{<rspec>}}} tag, remove the {{{expires}}} and
     1261{{{generated}}} attributes.
     1262         ii. In the {{{<rspec>}}} tag, change the {{{type="advertisement"}}}
     1263attribute to {{{type="request"}}}.
     1264         iii. In the {{{<rspec>}}} tag, change 'ad' to 'request' in the schema
     1265location. That is, change this:
     1266         {{{
     1267xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     1268http://www.protogeni.net/resources/rspec/2/ad.xsd"
     1269}}}
     1270         To this:
     1271         {{{
     1272xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     1273http://www.protogeni.net/resources/rspec/2/request.xsd"
     1274         }}}
     1275         iv. The {{{<rspec>}}} tag should now look like this (note that the
     1276whitespace has been adjusted for ease of reading):
     1277         {{{
     1278<rspec type="request"
     1279       xmlns="http://www.protogeni.net/resources/rspec/2"
     1280       xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     1281       xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
     1282       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     1283       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     1284http://www.protogeni.net/resources/rspec/2/request.xsd">
     1285         }}}
     1286      d. Remove the {{{node}}} tags you do not want to request. 
     1287         i. For example to only reserve the node {{{navis.gpolab.bbn.com}}}
     1288remove the following text:
     1289         {{{
     1290    <node
     1291component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+bain.gpolab.bbn.com"
     1292          component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1293          component_name="bain.gpolab.bbn.com"
     1294          exclusive="false">   
     1295    ....
     1296   </node> 
     1297    <node
     1298component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+sardis.gpolab.bbn.com"
     1299          component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1300          component_name="sardis.gpolab.bbn.com"
     1301          exclusive="false">
     1302    ....     
     1303   </node> 
     1304    <node
     1305component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+ganel.gpolab.bbn.com"
     1306          component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1307          component_name="ganel.gpolab.bbn.com" exclusive="false">
     1308    ....     
     1309   </node> 
     1310    <node
     1311component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+gardil.gpolab.bbn.com"
     1312          component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1313          component_name="gardil.gpolab.bbn.com" exclusive="false">   
     1314    ....
     1315    </node>
     1316}}}
     1317         ii. At this point the entire file should look like this:
     1318         {{{
     1319<?xml version="1.0" ?>
     1320<!-- Resources at AM:
     1321  URN: unspecified_AM_URN
     1322  URL: http://myplc.gpolab.bbn.com:12346/
     1323 -->
     1324<rspec type="request"
     1325       xmlns="http://www.protogeni.net/resources/rspec/2"
     1326       xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     1327       xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
     1328       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     1329       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     1330http://www.protogeni.net/resources/rspec/2/request.xsd"> 
     1331    <node
     1332component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+navis.gpolab.bbn.com"
     1333component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1334component_name="navis.gpolab.bbn.com" exclusive="false">   
     1335        <hardware_type name="plab-pc"/>   
     1336        <hardware_type name="pc"/>   
     1337        <available now="true"/>   
     1338        <sliver_type name="plab-vnode">     
     1339            <planetlab:initscript name="gpolab_sirius"/>     
     1340        </sliver_type>   
     1341        <location country="us" latitude="42.3897" longitude="-71.1475"/>   
     1342    </node> 
     1343</rspec>
     1344}}}
     1345      d. Edit the {{{<node>}}} tag you are trying to reserve.
     1346         i. Remove all {{{<hardware_type>}}}, {{{<available>}}},
     1347{{{<location>}}}, and {{{<planetlab:initscript"/>}}} tags which exist from the
     1348{{{<node>}}} tag you are trying to reserve. 
     1349         ii. Add the attribute {{{client_id}}} to the {{{<node>}}} tag you are
     1350trying to reserve.  The value is your choice, so here we will use
     1351{{{client_id="navis"}}}.
     1352         iii. The final request RSpec file should look like this:
     1353         {{{
     1354<?xml version="1.0" ?>
     1355<!-- Resources at AM:
     1356  URN: unspecified_AM_URN
     1357  URL: http://myplc.gpolab.bbn.com:12346/
     1358 -->
     1359<rspec type="request"
     1360       xmlns="http://www.protogeni.net/resources/rspec/2"
     1361       xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     1362       xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
     1363       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     1364       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     1365http://www.protogeni.net/resources/rspec/2/request.xsd"> 
     1366    <node
     1367component_id="urn:publicid:IDN+plc:gpolab:gpolab+node+navis.gpolab.bbn.com"
     1368component_manager_id="urn:publicid:IDN+plc:gpolab+authority+am"
     1369component_name="navis.gpolab.bbn.com" exclusive="false" client_id="navis">   
     1370        <sliver_type name="plab-vnode">         
     1371        </sliver_type>   
     1372    </node> 
     1373</rspec>
     1374}}}
     1375      e. Save the file.
     1376 3. Run rspeclint to verify that the file is correct.  If it works, you should
     1377see no errors returned by the call.
     1378 In general, this is:
     1379 {{{
     1380rspeclint http://www.protogeni.net/resources/rspec/2
     1381http://www.protogeni.net/resources/rspec/2/request.xsd <request RSpec filename>
     1382}}}
     1383 For this example do:
     1384 {{{
     1385rspeclint http://www.protogeni.net/resources/rspec/2
     1386http://www.protogeni.net/resources/rspec/2/request.xsd pl-gpo-navis.rspec
     1387}}}
     1388
     1389= Reserving ProtoGENI nodes with Flack =
     1390These instructions assume you have already created a slice using omni.
     1391
     1392   1. Login to GPO's ProtoGENI instance with your tutorial credentials
     1393      a. Click on: https://www.pgeni.gpolab.bbn.com/login.php3
     1394      b. Use your GPO tutorial username and password as listed on the sheet of
     1395paper you were handed on the way into the tutorial.
     1396   2. Login to Flack.
     1397      a. Open a separate browser window or tab.
     1398      b. Click on: http://www.protogeni.net
     1399      c. Scroll down to the large map in the middle of the page.
     1400      d. Click "Login"
     1401      e. In the pull down menu in the upper right hand corner select:
     1402pgeni.gpolab.bbn.com
     1403      f. Click "Download"
     1404      g. Enter the password from the sheet of paper in the box near the bottom.
     1405      h. Click "OK" in the lower left hand corner.
     1406      i. You are now logged in.
     1407   3. Reserve the ProtoGENI node listed on your sheet of paper.
     1408      a. For a '''ProtoGENI Utah''' node, do the following:
     1409         i. In the Resources window on the right, select the button for your
     1410slice. A window will open.
     1411         ii. Click on "utahemulab.cm".
     1412         iii. Find the node listed on the sheet of paper in the list of nodes on
     1413the left.
     1414         iv. Drag your node onto the blank canvas on the right.
     1415         v. Click on the blue "i" (Information) icon on the node.
     1416         vi. Click "Add Install Service"
     1417         vii. In the two boxes, enter the following filling in your username:
     1418"/home/<username>" in "http://192.1.249.166:8383/gec12tutorial_fedora.tar.gz"
     1419         viii. Click "Add Execute Service"
     1420         ix. In the box, enter the following filling in your username: "cd
     1421/home/<username>/config_dir;./install.sh"
     1422         xi. Confirm Rspec version is set to "2" in the pull-down menu in the
     1423upper right hand corner.
     1424         xi. Click "Apply"
     1425         '''Note''' : After hitting apply, click on the blue "i" button again,
     1426if you can't see the information you entered, then :
     1427            a. Close this window.
     1428            b. On your VM open the rspec with your favorite editor, and copy the
     1429whole rspec
     1430            c. On your slice canvas on the top, there is an import button. From
     1431the list, choose the "Import from clipboard" option.
     1432            d. The node should appear on your canvas, press the blue "i" button
     1433to verify that it is loaded correctly.
     1434         xii. Click "Submit"
     1435      a. For a '''ProtoGENI GPO''' node, do the following:
     1436         i. In the Resources window on the right, select the button for your
     1437slice. A window will open.
     1438         ii. Click on "bbn-pgeni.cm" (not "bbn-pgeni1.cm", "bbn-pgeni2.cm", or
     1439"bbn-pgeni3.cm").
     1440         iii. Find the node listed on the sheet of paper in the list of nodes on
     1441the left.
     1442         iv. Drag your node onto the blank canvas on the right.
     1443         v. Click on the blue "i" (Information) icon on the node.
     1444         vi. Click "Add Install Service"
     1445         vii. In the two boxes, enter the following filling in your username:
     1446"/home/<username>" in "http://192.1.249.166:8383/gec12tutorial_ubuntu.tar.gz"
     1447         viii. Click "Add Execute Service"
     1448         ix. In the box,  enter the following filling in your username: "cd
     1449/users/<username> ;sudo /bin/sh ./config_dir/install.sh"
     1450         x. For the test image, enter:
     1451"urn:publicid:IDN+pgeni.gpolab.bbn.com+image+emulab-ops//UBUNTU1004-STD"
     1452         xi. Choose Rspec version "0.2" from the pull-down menu in the upper
     1453right hand corner.
     1454         xi. Click "Apply"
     1455         xii. Click "Submit"
     1456   4. Confirm the reserved node is visible via omni.
     1457      a. If you reserved a '''ProtoGENI Utah''' host, run:
     1458         {{{
     1459omni.py -a pg-utah -t ProtoGENI 2 listresources <slicename>
     1460         }}}
     1461      b. If you reserved a '''ProtoGENI GPO''' host, run:
     1462         {{{
     1463omni.py -a pg-gpo -t ProtoGENI 0.2 listresources <slicename>
     1464         }}}
     1465   5. Note that you can also download the request RSpec from Flack for later use
     1466in a AM API client tool like Omni.
     1467       i. In Flack, click on the magnifying glass in the upper right hand
     1468corner. 
     1469       ii.  The request RSpec will appear in the window.
     1470       iii.  You can then choose to download the RSpec in a file or copy it to
     1471the clipboard.
     1472
     1473= AM URL Table =
     1474|| AM || Nickname ||URL ||
     1475|| TUTORIAL AM ||||||
     1476|| Clemson's MyPLC ||pl-clemson || http://myplc.clemson.edu:12346 ||
     1477|| GPO's ProtoGENI || pg-gpo ||http://www.pgeni.gpolab.bbn.com/protogeni/xmlrpc/am ||
     1478|| GPO's MyPLC || pl-gpo || http://myplc.gpolab.bbn.com:12346 ||
     1479|| GPO's Tutorial OF || of-tut ||https://foam-tutorial.gpolab.bbn.com:3626/foam/gapi/1||
     1480|| Rutgers MyPLC || pl-rutgers || https://plc.orbit-lab.org:12346/ ||
     1481|| Stanford's MyPLC || pl-stanford || https://myplc.stanford.edu:12346 ||
     1482|| Utah's ProtoGENI || pg-utah || http://www.emulab.net/protogeni/xmlrpc/am ||
     1483|| Washington's MyPLC || pl-washington || https://of.cs.washington.edu:12346/ ||
     1484|| Wisconsin's MyPLC ||pl-wisconsin|| https://wings-openflow-1.wail.wisc.edu:12346/ ||
     1485|| OTHER || || ||
     1486|| !PlanetLab ||plc||http://www.planet-lab.org:12346 ||
     1487|| Kentucky's ProtoGENI || pg-ky ||https://www.uky.emulab.net/protogeni/xmlrpc/am ||