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 == |
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. |
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. |
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 | {{{ |
| 58 | ovs-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: |
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). |
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: |
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). |