301 | | - More information about "/tmp/of-topo-setup/lb-setup": |
302 | | "lb-setup" is to setup the load balancing switch. The source code as well as explanation is as follows: |
303 | | {{{ |
304 | | #!/bin/sh |
305 | | |
306 | | /tmp/of-topo-setup/prep-trema # install all libraries for trema |
307 | | /tmp/of-topo-setup/ovs-start # create ovs bridge |
308 | | |
309 | | cp /usr/bin/trace-oml2 /usr/bin/trace # a hack to the current LabWiki --> needs to be fixed |
310 | | cp /usr/bin/nmetrics-oml2 /usr/bin/nmetrics # a hack to the current LabWiki --> needs to be fixed |
311 | | # download the load balancing openflow controller source code to user directory |
312 | | wget http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/ExoGENI/load-balancer.rb -O /root/load-balancer.rb |
313 | | |
314 | | INTERFACES="192.168.1.1 192.168.2.1 192.168.3.1" |
315 | | |
316 | | # 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 |
317 | | /tmp/of-topo-setup/writeifmap3 |
318 | | |
319 | | # add port to the ovs bridge |
320 | | /tmp/of-topo-setup/find-interfaces $INTERFACES | while read iface; do |
321 | | ovs-vsctl add-port br0 $iface < /dev/null |
322 | | done |
323 | | |
324 | | # create port map save it to /tmp/portmap |
325 | | ovs-ofctl show tcp:127.0.0.1:6634 \ |
326 | | | /tmp/of-topo-setup/ovs-id-ports 192.168.1.1=outside 192.168.2.1=left 192.168.3.1=right \ |
327 | | > /tmp/portmap |
328 | | }}} |
| 301 | - Take a look at the script for setting up the switch node, it is located at the node at "/tmp/of-topo-setup/lb-setup". |