Changes between Version 53 and Version 54 of GENIEducation/SampleAssignments/OpenFlowLoadBalancerTutorial/ExerciseLayout/Execute


Ignore:
Timestamp:
07/17/13 11:20:24 (6 years ago)
Author:
shuang@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIEducation/SampleAssignments/OpenFlowLoadBalancerTutorial/ExerciseLayout/Execute

    v53 v54  
    1818
    1919
    20 = 1. Implement a Load Balancing OpenFlow Controller =
    21  
    22 == 1.1 Experimental Setup ==
    23   [[Image(OpenFlowLBExo.png, 30%, nolink)]] [[BR]]
    24   At this point, we assume that you have already created the topology, otherwise: [[BR]]
    25   Follow instructions in the [http://groups.geni.net/geni/wiki/GENIEducation/SampleAssignments/OpenFlowLoadBalancerTutorial/ExerciseLayout/DesignSetup DesignSetup] step to build a load balancing experiment topology. Your GENI resources will be configured in a manner similar to the above figure. The various parts of the diagram are as follows:
    26     - '''Inside and Outside Nodes''': These nodes can be any ExoGENI Virtual Nodes.
    27     - '''Switch:''' This node is a Linux host running Open vSwitch. Your Load Balancing OpenFlow Controller will be running on this node as well. '''This is the main node that you will be working on'''.
    28     - '''Traffic Shaping Nodes (Left and Right)''': These are Linux hosts with two network interfaces. You can configure netem on the two traffic shaping nodes to have differing characteristics; the specific values don’t matter, as long as they are reasonable. Use several different delay/loss combinations as you test your load balancer.
    29     - '''Aggregator''': This node is a Linux host running Open vSwitch with a switch controller that will cause TCP connections to “follow” the decisions made by your OpenFlow controller on the Switch node. So leave this node alone, you only need to implement the OpenFlow controller on node "Switch".
    30 
    31 == 1.2 Run an example Load Balancing OpenFlow Controller ==
     20= 2. Implement a Load Balancing OpenFlow Controller =
     21
     22== 2.1 Run an example Load Balancing OpenFlow Controller ==
    3223  An example OpenFlow Controller that assigns incoming TCP connections to alternating paths '''based on total number of flows''' is already downloaded for you. You can find it (load-balancer.rb) in the home directory of node "Switch". [[BR]]
    33   - Log on to node "Switch", wait until all interfaces are up and running by issuing "ifconfig" and making sure eth1, eth2, eth3 are up and assigned with valid IP addresses. [[BR]]
     24  - 2.1.1 Log on to node "Switch", wait until all interfaces are up and running by issuing "ifconfig" and making sure eth1, eth2, eth3 are up and assigned with valid IP addresses. [[BR]]
    3425  Start the example Load Balancer by executing the following:
    3526  {{{
    3627  /opt/trema-trema-f995284/trema run /root/load-balancer.rb
    3728  }}}
    38   - After you started your Load Balancer, you should be able to see the following (Switch id may vary):
     29  - 2.1.2 After you started your Load Balancer, you should be able to see the following (Switch id may vary):
    3930  {{{
    4031  OpenFlow Load Balancer Conltroller Started!
     
    4334  This means the OpenFlow Switch is connected to your controller and you can start testing your OpenFlow Load Balancer now.
    4435 
    45 == 1.3 Use GIMI Portal to run the experiment and monitor the load balancer ==
    46    - Log on to your !LabWiki Account on http://emmy9.casa.umass.edu:3005 , on the `Prepare` Column, type "OpenFlow", it will pop up with a list of .rb choices. Choose any one, and replace the whole content with the ruby script [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/loadbalancer_monitor.rb HERE].
    47    - Log on to node "Switch" and do "ifconfig" to see the IP addresses on each interfaces.
     36== 2.2 Use GIMI Portal to run the experiment and monitor the load balancer ==
     37   - 2.2.1 Log on to your !LabWiki Account on http://emmy9.casa.umass.edu:3005 , on the `Prepare` Column, type "OpenFlow", it will pop up with a list of .rb choices. Choose any one, and replace the whole content with the ruby script [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/loadbalancer_monitor.rb HERE].
     38   - 2.2.2 Log on to node "Switch" and do "ifconfig" to see the IP addresses on each interfaces.
    4839    - '''Note''': You may not be able to see all interfaces up immediately when node "Switch" is ready; wait for some more time (about 1 min) then try "ifconfig" again.
    4940    - Identify the two interfaces that you want to monitor: the interfaces with IP address 192.168.2.1 and 192.168.3.1 respectively. On the !LabWiki page, in your ruby script, find the following line:
     
    5445###### Change the above to the correct interfaces ######
    5546}}}
    56    - Change eth1 and eth3 to the corresponding two interfaces you found with IP address 192.168.2.1 (the interface that connects to the left path) and 192.168.3.1 (the interface that connects to the right path) and press the "save" icon on your !LabWiki page.
    57    - Drag the `file Icon` at the left-top corner on your !LabWiki page from `Prepare` column and drop it to `Execute` column. Fill in the name of your !LabWiki experiment (this can be anything), the name of your slice (this has to be your slice name), and type "true" in the graph box to enable graphs. And then press "Start Experiment" button.
     47   - 2.2.3 Change eth1 and eth3 to the corresponding two interfaces you found with IP address 192.168.2.1 (the interface that connects to the left path) and 192.168.3.1 (the interface that connects to the right path) and press the "save" icon on your !LabWiki page.
     48   - 2.2.4 Drag the `file Icon` at the left-top corner on your !LabWiki page from `Prepare` column and drop it to `Execute` column. Fill in the name of your !LabWiki experiment (this can be anything), the name of your slice (this has to be your slice name), and type "true" in the graph box to enable graphs. And then press "Start Experiment" button.
    5849   - '''Note''': Do not start another experiment (i.e., drag and drop the file icon in !LabWiki and press "Start Experiment") before your current experiment is finished.
    5950   
    60 == (Optional) 1.4 Fetch experimental results from your iRods account ==
    61  - Log in your iRods account on https://www.irods.org/web/index.php, use "emmy9.casa.umass.edu" as Host/IP, "1247" as Port.
    62  - Download your experimental results from your user directory under /geniRenci/home/
    63 
    64 == 1.5 Change link parameters of left path using tc and repeat the experiment ==
    65  - Log on to node "left" and change the link capacity for the interface with IP address "192.168.2.2" (use "ifconfig" to find the correct interface, here we assume eth1 is the interface connecting to node "Switch"):
    66 {{{
    67 ovs-vsctl set Interface eth1 ingress_policing_rate=10000
    68 }}}
    69  The above will rate-limit the connection from node "Switch" to node "left" to have a bandwidth of 10Mbps.
    70 
    71 == 1.6 Repeat Experiment with limited bandwidth on Left path ==
    72  - On node "Switch", press "Ctrl" and "c" key to kill your Load Balancer process on node "Switch"
    73  - On node "Switch", use the following command to disconnect the OpenFlow Switch from the controller:
     51== (Optional) 2.3 Fetch experimental results from your iRods account ==
     52 - 2.3.1 Log in your iRods account on https://www.irods.org/web/index.php, use "emmy9.casa.umass.edu" as Host/IP, "1247" as Port.
     53 - 2.3.2 Download your experimental results from your user directory under /geniRenci/home/
     54
     55== 2.4 Change link parameters of left path using "ovs-vsctl" and repeat the experiment ==
     56 - 2.4.1 Log on to node "left" and change the link capacity for the interface with IP address "192.168.2.2" (use "ifconfig" to find the correct interface, here we assume eth1 is the interface connecting to node "Switch"):
     57{{{
     58ovs-vsctl set Interface eth1 ingress_policing_rate=100000
     59}}}
     60 The above will rate-limit the connection from node "Switch" to node "left" to have a bandwidth of 100Mbps.
     61 - Other ways to e.g., change link delay and lossrate using "tc qdisc netem" can be found in Section 4.
     62
     63== 2.5 Repeat Experiment with limited bandwidth on Left path ==
     64 - 2.5.1 On node "Switch", press "Ctrl" and "c" key to kill your Load Balancer process on node "Switch"
     65 - 2.5.2 On node "Switch", use the following command to disconnect the OpenFlow Switch from the controller:
    7466 {{{
    7567 ovs-vsctl del-controller br0
    7668 }}}
    77  - On node "Switch", start your Load Balancer using the following command:
     69 - 2.5.3 On node "Switch", start your Load Balancer using the following command:
    7870 {{{
    7971 /opt/trema-trema-f995284/trema run /root/load-balancer.rb
    8072 }}}
    81  - Start a new command line window, log onto node "Switch", use the following command to connect the OpenFlow Switch to the controller:
     73 - 2.5.4 Start a new command line window, log onto node "Switch", use the following command to connect the OpenFlow Switch to the controller:
    8274 {{{
    8375 ovs-vsctl set-controller br0 tcp:127.0.0.1 ptcp:6634:127.0.0.1
    8476 }}}
    85  - Go back to your !LabWiki web page, drag and drop the `file icon` and repeat the experiment, as described in section 2.3, using a different experiment name (the slice name should stay the same).
    86  - When your experiment is done, you need to stop the Load Balancer:
    87   - On node "Switch", use the following command to disconnect the OpenFlow Switch from the controller:
    88   {{{
    89   ovs-vsctl del-controller br0
    90   }}}
    91   - On node "Switch", press "Ctrl" and "c" key to kill your Load Balancer process on node "Switch"
     77 - 2.5.5 Go back to your !LabWiki web page, drag and drop the `file icon` and repeat the experiment, as described in section 2.3, using a different experiment name (the slice name should stay the same).
    9278
    9379 Questions:
     
    9682 - To answer the above question, you need to understand the Load Balancing controller. Check out the "load-balancer.rb" file in your home directory on node "Switch". Check Section 2 for hints/explanations about this OpenFlow Controller.
    9783
    98 == 1.7 Automate your experiment using !LabWiki ==
    99  - Add code in your !LabWiki script to automate starting and stoping your OpenFlow Controller:
     84== 2.6 Modify the OpenFlow Controller to balance throughput among all the TCP flows ==
     85 - You need to calculate the average per-flow throughput observed from both left and right path in function "stats_reply" in your load-balancer.rb
     86 - In function "decide_path", change the path decision based on the calculated average per-flow throughput: forward the flow onto the path with more average per-flow throughput. (Why? TCP tries its best to consume the whole bandwidth so more throughput means network is not congested)
     87 - If you do not know where to start, check the hints in Section 3.1.
     88  - If you really do not know where to start after reading the hints, download the answer directly from [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer-solution.rb load-balancer-solution.rb].
     89  - Save the above solution in your home directory then re-do the experiment on !LabWiki. '''Note:''' you need to change your !LabWiki script at line 185 to use the correct Load Balancing controller (e.g., if your controller is "load-balancer-solution.rb", you should run "/opt/trema-trema-f995284/trema run /root/load-balancer-solution.rb > /tmp/lb.tmp")
     90 - Redo the experiment using your new OpenFlow Controller following steps in Section 2.5, check the graphs plotted on !LabWiki as well as the controller's log on node "Switch" at /tmp/lb.tmp and see the difference.
     91 - When your experiment is done, you need to stop the Load Balancer:
     92  - On node "Switch", use the following command to disconnect the OpenFlow Switch from the controller:
     93  {{{
     94  ovs-vsctl del-controller br0
     95  }}}
     96  - On node "Switch", press "Ctrl" and "c" key to kill your Load Balancer process on node "Switch"
     97
     98== 2.7 Automate your experiment using !LabWiki ==
     99 - 2.7.1 Add code in your !LabWiki script to automate starting and stoping your OpenFlow Controller:
    100100  - Go back to your !LabWiki page, un-comment the script from line 184 to line 189 to start your OpenFlow Controller automatically on !LabWiki
    101101  - Uncomment the script from line 205 to line 209 to stop your OpenFlow Controller automatically on !LabWiki
    102  - On your !LabWiki web page, drag and drop the `file icon` and repeat the experiment, as described in section 2.3, using a different experiment name (the slice name should stay the same).
    103 
    104 ==  1.8 Modify the OpenFlow Controller to balance throughput among all the TCP flows ==
    105  - You need to calculate the average per-flow throughput observed from both left and right path in function "stats_reply" in your load-balancer.rb
    106  - In function "decide_path", change the path decision based on the calculated average per-flow throughput: forward the flow onto the path with more average per-flow throughput. (Why? TCP tries its best to consume the whole bandwidth so more throughput means network is not congested)
    107  - If you do not know where to start, check the hints in Section 2.1.
    108   - If you really do not know where to start after reading the hints, download the answer directly from [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer-solution.rb load-balancer-solution.rb].
    109   - Save the above solution in your home directory then re-do the experiment on !LabWiki. '''Note:''' you need to change your !LabWiki script at line 185 to use the correct Load Balancing controller (e.g., if your controller is "load-balancer-solution.rb", you should run "/opt/trema-trema-f995284/trema run /root/load-balancer-solution.rb > /tmp/lb.tmp")
    110  - Redo the above experiment, check the graphs plotted on !LabWiki as well as the controller's log on node "Switch" at /tmp/lb.tmp and see the difference.
     102 - 2.7.2 On your !LabWiki web page, drag and drop the `file icon` and repeat the experiment, as described in section 2.3, using a different experiment name (the slice name should stay the same).
    111103 - If you have more time or are interested in trying out things, go ahead and try section 1.9. The tutorial is over now and feel free to ask questions :-)
    112104
    113 == 1.9 Try more experiments using different kinds of OpenFlow Load Balancers ==
     105== 2.8 Try more experiments using different kinds of OpenFlow Load Balancers ==
    114106 - You can find more load balancers from http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer/
    115107 - To try out any one of them, follow the steps:
     
    129121  - Load balancers that begin with "load-balancer-throughput" picks path based on the total throughput sent out to each path: the one with '''more throughput''' is picked
    130122
    131 = 2. Hints / Explanation =
    132 == 2.1 About the OpenFlow controller [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb load-balancer.rb] ==
     123= 3. Hints / Explanation =
     124== 3.1 About the OpenFlow controller [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb load-balancer.rb] ==
    133125  - Trema web site: http://trema.github.io/trema/
    134126  - Treme ruby API document: http://rubydoc.info/github/trema/trema/master/frames
     
    160152}}}
    161153
    162 == 2.2 About The Rspec file [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/openflow-loadbalancer-kvm.rspec OpenFlowLBExo.rspec] ==
     154== 3.2 About The Rspec file [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/openflow-loadbalancer-kvm.rspec OpenFlowLBExo.rspec] ==
    163155  - The Rspec file describes a topology we showed earlier--each node is assigned with certain number of interfaces with pre-defined IP addresses
    164156  - Some of the nodes are loaded with softwares and post-scripts. We will take node "Switch" as an example since it is the most complicated one.
     
    204196   }}}
    205197
    206 == 2.3 About the GIMI script you run on !LabWiki ==
     198== 3.3 About the GIMI script you run on !LabWiki ==
    207199 - Line 1 to Line 128: the definition of oml trace and oml nmetrics library. It basically defines the command line options for oml2-trace and oml2-nmetrics, as well as the output (the monitoring data that is going to be stored into the oml server)
    208200  - users are not supposed to modify them
     
    238230  - The second graph uses the monitoring results from oml2-trace to display the throughput observed from each of the interfaces.
    239231
    240 = 3. Tips: Debugging an OpenFlow Controller =
     232= 4. Tips: Debugging an OpenFlow Controller =
    241233You will find it helpful to know what is going on inside your OpenFlow controller and its associated switch when implementing these exercises. [[BR]]
    242234This section contains a few tips that may help you out if you are using the Open vSwitch implementation provided with this tutorial.