wiki:GENIEducation/SampleAssignments/TcpAssignment/ExerciseLayout/DesignSetup

Version 13 (modified by shuang@bbn.com, 7 years ago) (diff)

--

<TCP ASSIGNMENT>

Hello GENI index Hello GENI index Hello GENI index

The following is all done on MAC OS X (ubuntu should be similar)

STEPS FOR SETTING UP

Using Omni:
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
A small hint: make sure u have installed xcode before hand, if u are using MAC.
An even better hint: use App store to install xcode, much faster :-)

Note: while compiling M2Crypto using "pip install M2Crypto", there are a lot of warnings, ignore them.
Note: you need to change the first line of omni-configure.py to "#!/usr/local/bin/python" to make omni config work.
Note: you need to move readyToLogin.py from gcf/examples/ to gcf/src/
Note: it is recommended to change the first line of every .py file in the gcf/src directory to #!/usr/local/bin/python (on MAC OS X)

2. Use Omni to create the topology:
Download the RSPEC from http://www.cs.purdue.edu/homes/fahmy/geni/geni-tcp_exp.tar.gz
untar the tar ball using:

tar xzvf geni-tcp_exp.tar.gz

The tar ball contains 3 files: Makefile star.rspec tcp_exp.c
star.rspec is the RSPEC file we need.
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 'shufengTCP' 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 shufengTCP, URN urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP, Expiration 2013-05-08 21:17:05
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed createslice:

  Options as run:
		framework: portal
		project: ShufengProject

  Args: createslice shufengTCP

  Result Summary: Created slice with Name shufengTCP, URN urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP, Expiration 2013-05-08 21:17:05
 
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 shufengTCP 20130509

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-09T00:00:00'
INFO:omni:Slice shufengTCP now expires at 2013-05-09 00:00:00 UTC
INFO:omni:Slice urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP expires within 1 day on 2013-05-09 00:00:00 UTC
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed renewslice:

  Options as run:
		framework: portal
		project: ShufengProject

  Args: renewslice shufengTCP 20130509

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

Step 3. Create Sliver using star.rspec:

omni.py createsliver -a pg-utah shufengTCP star.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+shufengTCP expires within 1 day on 2013-05-09 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 star.rspec for slice urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP
INFO:omni: (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=03ab3733e54e717594433659b39ca150)
INFO:omni:Got return from CreateSliver for slice shufengTCP at https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0:
INFO:omni:<!-- Reserved resources for:
	Slice: shufengTCP
	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="center" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc73" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+127723">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD"/>
    </sliver_type>
    <interface client_id="center:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+127730" mac_address="00034794bc44"><ip address="10.10.1.2" type="ipv4"/></interface>
    <interface client_id="center:if1" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth0" sliver_id="urn:publicid:IDN+emulab.net+sliver+127733" mac_address="00034773942f"><ip address="10.10.2.2" type="ipv4"/></interface>
    <interface client_id="center:if2" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth1" sliver_id="urn:publicid:IDN+emulab.net+sliver+127736" mac_address="000347739430"><ip address="10.10.3.2" type="ipv4"/></interface>
    <interface client_id="center:if3" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127739" mac_address="0002b335e0a5"><ip address="10.10.4.2" type="ipv4"/></interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc73"/><host name="center.shufengTCP.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc73.emulab.net" port="22" username="shufeng"/></services></node>
<node client_id="left" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc81" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+127725">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD"/>
    </sliver_type>
    <interface client_id="left:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc81:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127729" mac_address="0002b33f7333"><ip address="10.10.1.1" type="ipv4"/></interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc81"/><host name="left.shufengTCP.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc81.emulab.net" port="22" username="shufeng"/></services></node>
<node client_id="right" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc55" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+127724">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD"/>
    </sliver_type> <interface client_id="right:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc55:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127732" mac_address="0002b33f7449"><ip address="10.10.2.1" type="ipv4"/></interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc55"/><host name="right.shufengTCP.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc55.emulab.net" port="22" username="shufeng"/></services></node>
<link client_id="leftLink" sliver_id="urn:publicid:IDN+emulab.net+sliver+127728" vlantag="260">
    <interface_ref client_id="left:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc81:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127729"/>
    <interface_ref client_id="center:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth4" sliver_id="urn:publicid:IDN+emulab.net+sliver+127730"/>
</link>
<link client_id="rightLink" sliver_id="urn:publicid:IDN+emulab.net+sliver+127731" vlantag="284">
    <interface_ref client_id="right:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc55:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127732"/>
    <interface_ref client_id="center:if1" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth0" sliver_id="urn:publicid:IDN+emulab.net+sliver+127733"/>
</link>
<node client_id="top" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc47" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+127722">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD"/>
    </sliver_type>
    <interface client_id="top:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc47:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127735" mac_address="0002b33f73e7"><ip address="10.10.3.1" type="ipv4"/></interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc47"/><host name="top.shufengTCP.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc47.emulab.net" port="22" username="shufeng"/></services></node>
<node client_id="bottom" exclusive="true" component_id="urn:publicid:IDN+emulab.net+node+pc84" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" sliver_id="urn:publicid:IDN+emulab.net+sliver+127726">
    <sliver_type name="raw-pc">
        <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD"/>
    </sliver_type>
    <interface client_id="bottom:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc84:eth1" sliver_id="urn:publicid:IDN+emulab.net+sliver+127738" mac_address="00034773a1f4"><ip address="10.10.4.1" type="ipv4"/></interface>
<rs:vnode xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1" name="pc84"/><host name="bottom.shufengTCP.panther.emulab.net"/><services><login authentication="ssh-keys" hostname="pc84.emulab.net" port="22" username="shufeng"/></services></node>
<link client_id="topLink" sliver_id="urn:publicid:IDN+emulab.net+sliver+127734" vlantag="290">
    <interface_ref client_id="top:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc47:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127735"/>
    <interface_ref client_id="center:if2" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth1" sliver_id="urn:publicid:IDN+emulab.net+sliver+127736"/>
</link>
<link client_id="bottomLink" sliver_id="urn:publicid:IDN+emulab.net+sliver+127737" vlantag="262">
    <interface_ref client_id="bottom:if0" component_id="urn:publicid:IDN+emulab.net+interface+pc84:eth1" sliver_id="urn:publicid:IDN+emulab.net+sliver+127738"/>
    <interface_ref client_id="center:if3" component_id="urn:publicid:IDN+emulab.net+interface+pc73:eth3" sliver_id="urn:publicid:IDN+emulab.net+sliver+127739"/>
</link>
</rspec>
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed createsliver:

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

  Args: createsliver shufengTCP star.rspec

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

The above output shows the reserved nodes: pc73, pc81, pc55, pc47, pc84 and how they are connected. In this case, pc73 is the central node of the star topology.
Alternatively, you can use the following command to show the reserved nodes as well as ways to login:

readyToLogin.py shufengTCP -a pg-utah

The result is something like the following:

#========================================
#SSH CONFIGURATION INFO for User shufeng
#========================================
 
Host right
  Port 22
  HostName pc55.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host bottom
  Port 22
  HostName pc84.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host center
  Port 22
  HostName pc73.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host top
  Port 22
  HostName pc47.emulab.net
  User shufeng 
  IdentityFile /Users/shuang/.ssh/geni_key 
 
Host left
  Port 22
  HostName pc81.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@pc55.emulab.net &

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

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

top's geni_status is: ready (am_status:ready) 
User shufeng logins to top using:
	xterm -e ssh -i /Users/shuang/.ssh/geni_key shufeng@pc47.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@pc81.emulab.net &

Step 4. Renew the sliver:

omni.py renewsliver -a pg-utah shufengTCP 20130509

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+shufengTCP expires within 1 day on 2013-05-09 00:00:00 UTC
INFO:omni:Renewing Sliver shufengTCP until 2013-05-09 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
WARNING:omni:Failed to renew sliver urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP on unspecified_AM_URN (https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0) (got result 'None'). Error from Aggregate: code 14. protogeni AM code: 14: slice is busy; try again later (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=daae02988bdac3f0d008b48b6397e0fb).
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed renewsliver:

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

  Args: renewsliver shufengTCP 20130509

  Result Summary: Slice urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP expires within 1 day(s) on 2013-05-09 00:00:00 UTC
Failed to renew sliver urn:publicid:IDN+panther:ShufengProject+slice+shufengTCP on unspecified_AM_URN (https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0) (got result 'None'). Error from Aggregate: code 14. protogeni AM code: 14: slice is busy; try again later (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=daae02988bdac3f0d008b48b6397e0fb).
 
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.

OK. After this point, we are ready to log on to the nodes and do our experiments! :-)

Using GENI Portal:
0. GET GENI Portal Account
As usual, get a GENI Portal account via: Portal Main Site
Here is a very good tutorial on setting up GENI Portal account: Setup_Portal_Account

1. Prepare Omni by following this tutorial: HelloOmni
As a result, if you have already installed omni, all u need to do now is to do "omni-configure.py -f portal"
Apparently GENI Portal also uses Omni to control and manage GENI resources.

Very Important: using omni-configure.py -f portal will over-write ~/.ssh/geni_key and ~/.ssh/geni_key.pub. The result is, user can not login the reserved nodes using their omni keys (the original geni_key pair)
So, the simplest way to deal with this is, over-write the public/private keys. i.e., type 'Y' when prompt asks whether you want to replace the two files

2. Using GENI Portal to create the star topology

Step 1. Log in to your Portal account, and then create a slice using the "create slice" button. Note that you should give your slice a unique name. Here I used "shufengPortalTCP"
Step 2. Click your newly created slice, choose "add resources"

Step 3. Pick "TCP Assignment - Virtual Machine" in the drop-down box right to "Choose Resources"
And choose an Aggregate, in our case, we choose "GPO instaGENI", then click "Reserve Resources"
This particular RSPEC file will reserve a 5 virtual machines forming a star topology as described earlier.

Step 4. If there is no error(s), the output should be as follows. Note that at this point the nodes are not ready yet.

Step 5. Go back to the slice page and wait until the slivers are ready.
Since we reserved our nodes from GPO instaGENI, we only need to click the "get status" button on GPO instaGENI column.
A note of "READY" with green background means the slivers are ready. (Do not forget to renew your slice after it is ready). See:

Step 6. Click "Details" button to get the detailed information, including the ways to login each nodes and then start to do your experiment!

Next: Run Experiment

Attachments (4)

Download all attachments as: .zip