54 | | |
55 | | === C.1.2 Verification of Topology === |
| 54 | ---- |
| 55 | |
| 56 | === C.1.2 Setup Routing in Experiment Topology === |
| 57 | In more complex topologies routing has to be set up. In our case, this is achieved with the aid of an [[http://emmy9.casa.umass.edu:/GEC15-GIMI-Tutorial/routing.rb OMF experiment script]]. The one we use for this tutorial is shown below. |
| 58 | |
| 59 | {{{ |
| 60 | defGroup('Node1', "nodeA") |
| 61 | defGroup('Node2', "nodeB") |
| 62 | defGroup('Node3', "nodeC") |
| 63 | defGroup('Node4', "nodeD") |
| 64 | defGroup('Node5', "nodeE") |
| 65 | |
| 66 | |
| 67 | onEvent(:ALL_UP) do |event| |
| 68 | wait 1 |
| 69 | info 'Changing routing setup' |
| 70 | |
| 71 | group('Node1').exec("route add -net 192.168.1.0/24 gw 192.168.4.10") |
| 72 | group('Node1').exec("route add -net 192.168.2.0/24 gw 192.168.4.10") |
| 73 | group('Node1').exec("route add -net 192.168.3.0/24 gw 192.168.5.12") |
| 74 | group('Node1').exec("route add -net 192.168.6.0/24 gw 192.168.5.12") |
| 75 | group('Node1').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
| 76 | |
| 77 | group('Node2').exec("route add -net 192.168.3.0/24 gw 192.168.1.13") |
| 78 | group('Node2').exec("route add -net 192.168.5.0/24 gw 192.168.4.11") |
| 79 | group('Node2').exec("route add -net 192.168.6.0/24 gw 192.168.2.12") |
| 80 | group('Node2').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
| 81 | |
| 82 | group('Node3').exec("route add -net 192.168.1.0/24 gw 192.168.3.13") |
| 83 | group('Node3').exec("route add -net 192.168.4.0/24 gw 192.168.5.11") |
| 84 | group('Node3').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
| 85 | |
| 86 | group('Node4').exec("route add -net 192.168.2.0/24 gw 192.168.3.12") |
| 87 | group('Node4').exec("route add -net 192.168.4.0/24 gw 192.168.1.10") |
| 88 | group('Node4').exec("route add -net 192.168.5.0/24 gw 192.168.3.12") |
| 89 | group('Node4').exec("route add -net 192.168.6.0/24 gw 192.168.3.12") |
| 90 | group('Node4').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
| 91 | |
| 92 | group('Node5').exec("route add -net 192.168.2.0/24 gw 192.168.6.12") |
| 93 | group('Node5').exec("route add -net 192.168.1.0/24 gw 192.168.6.12") |
| 94 | group('Node5').exec("route add -net 192.168.3.0/24 gw 192.168.6.12") |
| 95 | group('Node5').exec("route add -net 192.168.4.0/24 gw 192.168.6.12") |
| 96 | group('Node5').exec("route add -net 192.168.5.0/24 gw 192.168.6.12") |
| 97 | |
| 98 | info 'Routing setup finished' |
| 99 | wait 5 |
| 100 | info 'Stopping applications' |
| 101 | allGroups.stopApplications |
| 102 | wait 1 |
| 103 | Experiment.done |
| 104 | end |
| 105 | }}} |
| 106 | |
| 107 | This script can be easily adapted if the experimenter wishes to set up the routing between the nodes |
| 108 | differently. |
| 109 | |
| 110 | The script is executed from the user workspace as follows: |
| 111 | |
| 112 | {{{ |
| 113 | $ cd ~/Tutorials/GIMI/common/ |
| 114 | $ omf-5.4 exec --no-am -S gimiXX routing.rb |
| 115 | }}} |
| 116 | |
| 117 | Where gimiXX has to be replaced by the slice name you are using for your experiment. |
| 118 | |
| 119 | You should see the following output after executing the omf command. |
| 120 | |
| 121 | {{{ |
| 122 | |
| 123 | }}} |
| 124 | |
| 125 | ---- |
| 126 | |
| 127 | === C.1.3 Verification of Topology === |
226 | | === C.1.3 Setup Routing in Experiment Topology === |
227 | | In more complex topologies routing has to be set up. In our case, this is achieved with the aid of an [[http://emmy9.casa.umass.edu:/GEC15-GIMI-Tutorial/routing.rb OMF experiment script]]. The one we use for this tutorial is shown below. |
228 | | |
229 | | {{{ |
230 | | defGroup('Node1', "nodeA") |
231 | | defGroup('Node2', "nodeB") |
232 | | defGroup('Node3', "nodeC") |
233 | | defGroup('Node4', "nodeD") |
234 | | defGroup('Node5', "nodeE") |
235 | | |
236 | | |
237 | | onEvent(:ALL_UP) do |event| |
238 | | wait 1 |
239 | | info 'Changing routing setup' |
240 | | |
241 | | group('Node1').exec("route add -net 192.168.1.0/24 gw 192.168.4.10") |
242 | | group('Node1').exec("route add -net 192.168.2.0/24 gw 192.168.4.10") |
243 | | group('Node1').exec("route add -net 192.168.3.0/24 gw 192.168.5.12") |
244 | | group('Node1').exec("route add -net 192.168.6.0/24 gw 192.168.5.12") |
245 | | group('Node1').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
246 | | |
247 | | group('Node2').exec("route add -net 192.168.3.0/24 gw 192.168.1.13") |
248 | | group('Node2').exec("route add -net 192.168.5.0/24 gw 192.168.4.11") |
249 | | group('Node2').exec("route add -net 192.168.6.0/24 gw 192.168.2.12") |
250 | | group('Node2').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
251 | | |
252 | | group('Node3').exec("route add -net 192.168.1.0/24 gw 192.168.3.13") |
253 | | group('Node3').exec("route add -net 192.168.4.0/24 gw 192.168.5.11") |
254 | | group('Node3').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
255 | | |
256 | | group('Node4').exec("route add -net 192.168.2.0/24 gw 192.168.3.12") |
257 | | group('Node4').exec("route add -net 192.168.4.0/24 gw 192.168.1.10") |
258 | | group('Node4').exec("route add -net 192.168.5.0/24 gw 192.168.3.12") |
259 | | group('Node4').exec("route add -net 192.168.6.0/24 gw 192.168.3.12") |
260 | | group('Node4').exec("echo 1 > /proc/sys/net/ipv4/ip_forward") |
261 | | |
262 | | group('Node5').exec("route add -net 192.168.2.0/24 gw 192.168.6.12") |
263 | | group('Node5').exec("route add -net 192.168.1.0/24 gw 192.168.6.12") |
264 | | group('Node5').exec("route add -net 192.168.3.0/24 gw 192.168.6.12") |
265 | | group('Node5').exec("route add -net 192.168.4.0/24 gw 192.168.6.12") |
266 | | group('Node5').exec("route add -net 192.168.5.0/24 gw 192.168.6.12") |
267 | | |
268 | | info 'Routing setup finished' |
269 | | wait 5 |
270 | | info 'Stopping applications' |
271 | | allGroups.stopApplications |
272 | | wait 1 |
273 | | Experiment.done |
274 | | end |
275 | | }}} |
276 | | |
277 | | This script can be easily adapted if the experimenter wishes to set up the routing between the nodes |
278 | | differently. |
279 | | |
280 | | The script is executed from the user workspace as follows: |
281 | | |
282 | | {{{ |
283 | | $ cd ~/Tutorials/GIMI/common/ |
284 | | $ omf-5.4 exec --no-am -S gimiXX routing.rb |
285 | | }}} |
286 | | |
287 | | Where gimiXX has to be replaced by the slice name you are using for your experiment. |
288 | | |
289 | | You should see the following output after executing the omf command. |
290 | | |
291 | | {{{ |
292 | | |
293 | | }}} |
294 | | |