wiki:GENIEducation/ShufengCheatingSheet

Hints about using GENI Infrastructure as well as other tools in the GENI system

GPO Wiki

ExoGENI

  • Support multiple lines of execute and install in the rspec file for one node? ------ No It still does not support (as of 07/08/2013)
  • ExoGENI relies on neuca service to boot up NIC interfaces (or virtual network interfaces on KVM), which takes some time after the (virtual) machine is boot up
    • Sometimes when experimenter has its own post-boot scripts defined in Rspec, the neuca service failed to boot up the interfaces and assign IP addresses (defined in Rspec) to them.
    • In this case, you need to write your own script to automatically call "/usr/local/bin/neuca-netconf" to boot up and configure the interfaces
    • If your functional script relies on running interfaces, you need to write some supportive script to detect that the interfaces are up and running
    • an example can be found here: http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/software/writeifmap
  • ExoGENI uhvmsite: IP begin with 129
  • ExoGENI rcivmsite: IP begin with 152
  • ExoGENI fiuvmsite: IP begin with 131
  • ExoGENI bbnvmsite: IP begin with 192.1

About trace-oml2

  • run trace-oml2 using the following command:
    sudo trace-oml2 -i eth2 --oml-id eNodeB --oml-domain shufeng-t38-2013-07-03T17-03-28-04-00 --oml-collect tcp:emmy9.casa.umass.edu:3004
    or use a configuration file: 
    sudo trace-oml2 -i eth2 --oml-config OpenFlowTutorial.eNodeB.xml
    The xml file can be something like the following: 
    <omlc id="switch_left" encoding="binary">
      <collect url="tcp:emmy9.casa.umass.edu:3004"name="traffic">
        <stream mp="ip" interval="1">
          <filter field="ip_len" operation="sum" rename="throughput" />
        </stream>
      </collect>
    </omlc>
    
  • trace-oml2 also supports a filter option "-f" or "--filter" that user can define what kind of packets they are particularly interested.

Postgresql

LabWiki uses Postgresql to store experimental data for in the OMF/OML system.

psql -h locahost -U oml -d shufeng-t38-2013-07-03T17-03-28-04-00(your experiment name)       -> to log into the database corresponding to your experiment
\dt       -> show all tables in that database
connect shufeng-t38-2013-07-03T17-03-28-04-00         -> connect to another database

All about LabWiki

  • To set up the new !Labwiki:
  • Server side log files:
    OMF Log: /tmp/[experiment-name].log .. 
    OML log: /var/log/oml2-server.log 
    
  • Client side log file:
    /var/log/omf-resctl.log 
    
  • To plot multiple graphs on LabWiki? Simply define more graphs using defGraph. The defProperty('graph', true, "Display graph or not") will control whether or not to display all defined graphs.
  • For the current LabWiki to work with oml v. 2.10.0 : (as of 07/08/2013)
    • Do not use "uint64" (and some other data types) in your definition of trace/iperf/nmetrics
    • rename your trace/iperf/nmetrics application using, e.g., :
      cp /usr/bin/trace-oml2 /usr/bin/trace
      
  • To write oml configure XML files: http://oml.mytestbed.net/doc/oml/latest/liboml2.conf.5.html
  • To write specific SQL queries: http://sequel.rubyforge.org/rdoc/files/doc/querying_rdoc.html

Traffic Control

tc qdisc add dev eth2 root handle 1:0 netem delay 100ms loss 5%
tc qdisc add dev eth2 parent 1:0 tbf rate 20mbit buffer 20000 limit 16000

It seems that tc qdisc tbf does not work well (in terms of controlling the throughput of TCP flows) on ovs when ovs switch is connected with a controller.
Instead, we use ovs-vsctl:

ovs-vsctl set Interface eth2 ingress_policing_rate=1000
ovs-vsctl set Interface eth2 ingress_policing_burst=100

The above sets the ingress rate to be in 900kbps-1100kbps.
To set it back to no rate control, use:

ovs-vsctl set Interface eth2 ingress_policing_rate=0

It is a little bit tricky to configure delay/loss on an OpenVZ virtual machine
Step 1: find our qdisc family number by executing "sudo /sbin/tc qdisc", a sample output could be like the following:

[shufeng@center ~]$ sudo /sbin/tc qdisc
qdisc htb 270: dev mv6.47 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
qdisc netem 260: dev mv6.47 parent 270:1 limit 1000
qdisc htb 150: dev mv6.41 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
qdisc netem 140: dev mv6.41 parent 150:1 limit 1000
qdisc htb 190: dev mv6.43 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
qdisc netem 180: dev mv6.43 parent 190:1 limit 1000
qdisc htb 230: dev mv6.45 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
qdisc netem 220: dev mv6.45 parent 230:1 limit 1000

Now if the ethernet card you want to change is mv6.43, you can find from following line:

qdisc htb 190: dev mv6.43 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
qdisc netem 180: dev mv6.43 parent 190:1 limit 1000

As a result, you change the delay/loss by executing the following:

sudo /sbin/tc -s qdisc change dev mv6.43 parent 190:1 handle 180: netem limit 1000 delay 100ms loss 5%
sudo /sbin/tc -s qdisc change dev mv6.43 parent 190:1 handle 180: netem limit 1000

OpenVSwitch Commands

ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth2
ovs-vsctl set-fail-mode br0 standalone   (when loses connection with the controller, the switch acts as a normal switch)
ovs-vsctl set-fail-mode br0 secure    (when loses connection with the controller, the switch wont forward any packets)
ovs-vsctl set bridge br0 datapath_type=netdev   (without kernel support, if the vswitch is gonna be used in userspace)

git Commands

git clone [url]
git add -A . (add all files and folders in the current directory)
git commit -m "commit message"
git status (to check the status of your local copy)
git fetch origin
git merge origin/master
git push origin master (upload your local copy to master (global) repository)

OpenFlow Trema

To restart Trema controller as well as the attached switch:

1. kill trema process: kill $(pidof ruby) 
2. delete lock file: rm /opt/trema...../tmp/pid/controller.pid  (controller is the name of your controller, in the case of Load Balancing, its `Load_Balancer`)
3. unlink the switches from controller: ovs-vsctl del-controller br0
4. start controller: /opt/trema....../trema run controller.rb (controller is the name of your controller, in the case of Load Balancing, its  load_balancer.rb)
5. link switches to the controller: ovs-vsctl set-controller br0 tcp:127.0.0.1 
 (might need to wait for 2 seconds for the switch to connect to the controller, to verify that, print something in the "switch_ready" function so that you can see the output when switch is connected)
Last modified 11 years ago Last modified on 07/18/13 12:05:47