Changes between Version 1 and Version 2 of GENIEducation/HyperNets


Ignore:
Timestamp:
08/06/13 16:24:51 (11 years ago)
Author:
shuang@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIEducation/HyperNets

    v1 v2  
    11[[PageOutline]]
    2 = Hints about using GENI Infrastructure as well as other tools in the GENI system =
     2= All About HyperNet Architecture =
    33
    4 == GPO Wiki ==
    5  - To find ppl: http://groups.geni.net/syseng/wiki/ContactInfo#CurrentGPOpeople
    6  - New Experiment Tutorial Template: http://groups.geni.net/geni/wiki/GENIEducation/SampleAssignments/Template/ExerciseLayout
     4== To Build a Network Hypervisor Server ==
    75
    8 == ExoGENI ==
    9  - 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)
    10  - 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
    11   - 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.
    12   - 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
    13   - If your functional script relies on running interfaces, you need to write some supportive script to detect that the interfaces are up and running
    14   - an example can be found here: http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/software/writeifmap
    15  - ExoGENI uhvmsite: IP begin with 129
    16  - ExoGENI rcivmsite: IP begin with 152
    17  - ExoGENI fiuvmsite: IP begin with 131
    18  - ExoGENI bbnvmsite: IP begin with 192.1
    19 
    20 == About trace-oml2 ==
    21  - run trace-oml2 using the following command:
    22 {{{
    23 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
    24 or use a configuration file:
    25 sudo trace-oml2 -i eth2 --oml-config OpenFlowTutorial.eNodeB.xml
    26 The xml file can be something like the following:
    27 <omlc id="switch_left" encoding="binary">
    28   <collect url="tcp:emmy9.casa.umass.edu:3004"name="traffic">
    29     <stream mp="ip" interval="1">
    30       <filter field="ip_len" operation="sum" rename="throughput" />
    31     </stream>
    32   </collect>
    33 </omlc>
    34 }}}
    35  - trace-oml2 also supports a filter option "-f" or "--filter" that user can define what kind of packets they are particularly interested.
    36   - http://linux.die.net/man/7/pcap-filter shows how to write a filter
    37 
    38 == Postgresql ==
    39 !LabWiki uses Postgresql to store experimental data for in the OMF/OML system.
    40 {{{
    41 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
    42 \dt       -> show all tables in that database
    43 connect shufeng-t38-2013-07-03T17-03-28-04-00         -> connect to another database
    44 }}}
    45 
    46 == All about !LabWiki ==
    47  - To set up the new !Labwiki:
    48   - git clone https://github.com/geni-gimi/GIMI.git
    49   - install iRods from www.irods.org
    50   - create an irods account from GENI portal
    51   - run gimi_init.py from the GIMI.git you cloned in the 1st step
    52 
    53  - Server side log files:
    54 {{{
    55 OMF Log: /tmp/[experiment-name].log ..
    56 OML log: /var/log/oml2-server.log
    57 }}}
    58  - Client side log file:
    59 {{{
    60 /var/log/omf-resctl.log
    61 }}}
    62  - To plot multiple graphs on !LabWiki?
    63   Simply define more graphs using `defGraph`. The defProperty('graph', true, "Display graph or not") will control whether or not to display all defined graphs.
    64  - For the current !LabWiki to work with oml v. 2.10.0 : (as of 07/08/2013)
    65   - Do not use "uint64" (and some other data types) in your definition of trace/iperf/nmetrics
    66   - rename your trace/iperf/nmetrics application using, e.g., :
    67   {{{
    68   cp /usr/bin/trace-oml2 /usr/bin/trace
    69   }}}
    70  - To write oml configure XML files: http://oml.mytestbed.net/doc/oml/latest/liboml2.conf.5.html
    71  - To write specific SQL queries: http://sequel.rubyforge.org/rdoc/files/doc/querying_rdoc.html
    72 
    73 == Traffic Control ==
    74 {{{
    75 tc qdisc add dev eth2 root handle 1:0 netem delay 100ms loss 5%
    76 tc qdisc add dev eth2 parent 1:0 tbf rate 20mbit buffer 20000 limit 16000
    77 }}}
    78 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. [[BR]]
    79 Instead, we use ovs-vsctl:
    80 {{{
    81 ovs-vsctl set Interface eth2 ingress_policing_rate=1000
    82 ovs-vsctl set Interface eth2 ingress_policing_burst=100
    83 }}}
    84 The above sets the ingress rate to be in 900kbps-1100kbps. [[BR]]
    85 To set it back to no rate control, use:
    86 {{{
    87 ovs-vsctl set Interface eth2 ingress_policing_rate=0
    88 }}}
    89 
    90 It is a little bit tricky to configure delay/loss on an OpenVZ virtual machine [[BR]]
    91 Step 1: find our qdisc family number by executing "sudo /sbin/tc qdisc", a sample output could be like the following:
    92 {{{
    93 [shufeng@center ~]$ sudo /sbin/tc qdisc
    94 qdisc htb 270: dev mv6.47 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
    95 qdisc netem 260: dev mv6.47 parent 270:1 limit 1000
    96 qdisc htb 150: dev mv6.41 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
    97 qdisc netem 140: dev mv6.41 parent 150:1 limit 1000
    98 qdisc htb 190: dev mv6.43 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
    99 qdisc netem 180: dev mv6.43 parent 190:1 limit 1000
    100 qdisc htb 230: dev mv6.45 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
    101 qdisc netem 220: dev mv6.45 parent 230:1 limit 1000
    102 }}}
    103 Now if the ethernet card you want to change is mv6.43, you can find from following line:
    104 {{{
    105 qdisc htb 190: dev mv6.43 root refcnt 2 r2q 10 default 1 direct_packets_stat 0
    106 qdisc netem 180: dev mv6.43 parent 190:1 limit 1000
    107 }}}
    108 As a result, you change the delay/loss by executing the following:
    109 {{{
    110 sudo /sbin/tc -s qdisc change dev mv6.43 parent 190:1 handle 180: netem limit 1000 delay 100ms loss 5%
    111 sudo /sbin/tc -s qdisc change dev mv6.43 parent 190:1 handle 180: netem limit 1000
    112 }}}
    113 
    114 == OpenVSwitch Commands ==
    115 {{{
    116 ovs-vsctl add-br br0
    117 ovs-vsctl add-port br0 eth2
    118 ovs-vsctl set-fail-mode br0 standalone   (when loses connection with the controller, the switch acts as a normal switch)
    119 ovs-vsctl set-fail-mode br0 secure    (when loses connection with the controller, the switch wont forward any packets)
    120 ovs-vsctl set bridge br0 datapath_type=netdev   (without kernel support, if the vswitch is gonna be used in userspace)
    121 }}}
    122 
    123 == git Commands ==
    124 {{{
    125 git clone [url]
    126 git add -A . (add all files and folders in the current directory)
    127 git commit -m "commit message"
    128 git status (to check the status of your local copy)
    129 git fetch origin
    130 git merge origin/master
    131 git push origin master (upload your local copy to master (global) repository)
    132 }}}
    133 
    134 == OpenFlow Trema ==
    135 To restart Trema controller as well as the attached switch:
    136 {{{
    137 1. kill trema process: kill $(pidof ruby)
    138 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`)
    139 3. unlink the switches from controller: ovs-vsctl del-controller br0
    140 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)
    141 5. link switches to the controller: ovs-vsctl set-controller br0 tcp:127.0.0.1
    142  (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)
    143 }}}
     6== To use a HyperNet App ==