101 | | == 3.1 About the OpenFlow controller [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb load-balancer.rb] == |
| 101 | == 3.1 About The Rspec file [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/openflow-loadbalancer-kvm.rspec OpenFlowLBExo.rspec] |
| 102 | - The Rspec file describes a topology we showed earlier--each node is assigned with certain number of interfaces with pre-defined IP addresses |
| 103 | - 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. |
| 104 | - The following section in the Rspec file for node "Switch": |
| 105 | {{{ |
| 106 | <install url="http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/software/of-switch-exo.tar.gz" install_path="/"/> |
| 107 | }}} |
| 108 | means it is going to download that tar ball from the specified URL and extract to directory "/" |
| 109 | - The following section in the Rspec file for node "Switch": |
| 110 | {{{ |
| 111 | <execute shell="bash" command="/tmp/postboot_script_exo.sh $sliceName $self.Name() ; /tmp/of-topo-setup/lb-setup"/> |
| 112 | }}} |
| 113 | names the post-boot script that ExoGENI is going to run for you after the nodes are booted. |
| 114 | - More information about "/tmp/postboot_script_exo.sh": |
| 115 | It is a "hook" to the !LabWiki interface. Experimenter run this so that !LabWiki knows the name of the slice and the hostname of the particular node that OML/OMF toolkits are running on. |
| 116 | - More information about "/tmp/of-topo-setup/lb-setup": |
| 117 | "lb-setup" is to setup the load balancing switch. The source code as well as explanation is as follows: |
| 118 | {{{ |
| 119 | #!/bin/sh |
| 120 | |
| 121 | /tmp/of-topo-setup/prep-trema # install all libraries for trema |
| 122 | /tmp/of-topo-setup/ovs-start # create ovs bridge |
| 123 | |
| 124 | cp /usr/bin/trace-oml2 /usr/bin/trace # a hack to the current LabWiki --> needs to be fixed |
| 125 | cp /usr/bin/nmetrics-oml2 /usr/bin/nmetrics # a hack to the current LabWiki --> needs to be fixed |
| 126 | # download the load balancing openflow controller source code to user directory |
| 127 | wget http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb -O /root/load-balancer.rb |
| 128 | |
| 129 | INTERFACES="192.168.1.1 192.168.2.1 192.168.3.1" |
| 130 | |
| 131 | # wait until all interfaces are up, then fetch the mapping from interface name to its ip/MAC address and save this info in a file /tmp/ifmap |
| 132 | /tmp/of-topo-setup/writeifmap3 |
| 133 | |
| 134 | # add port to the ovs bridge |
| 135 | /tmp/of-topo-setup/find-interfaces $INTERFACES | while read iface; do |
| 136 | ovs-vsctl add-port br0 $iface < /dev/null |
| 137 | done |
| 138 | |
| 139 | # create port map save it to /tmp/portmap |
| 140 | ovs-ofctl show tcp:127.0.0.1:6634 \ |
| 141 | | /tmp/of-topo-setup/ovs-id-ports 192.168.1.1=outside 192.168.2.1=left 192.168.3.1=right \ |
| 142 | > /tmp/portmap |
| 143 | }}} |
| 144 | |
| 145 | == 3.2 About the OpenFlow controller [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb load-balancer.rb] == |