Changes between Version 31 and Version 32 of GIMIv1.1Tutorial/Orchestrate


Ignore:
Timestamp:
10/19/12 16:48:51 (12 years ago)
Author:
Cong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GIMIv1.1Tutorial/Orchestrate

    v31 v32  
    5454----
    5555
    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  INFO NodeHandler: OMF Experiment Controller 5.4 (git e0eefcf)
    123  INFO NodeHandler: Slice ID: gimi20
    124  INFO NodeHandler: Experiment ID: gimi20-2012-10-18t14.14.10-04.00
    125  INFO NodeHandler: Message authentication is disabled
    126  WARN NodeHandler: AM support disabled - any service calls will fail!
    127  INFO Experiment: load system:exp:stdlib
    128  INFO property.resetDelay: resetDelay = 210 (Fixnum)
    129  INFO property.resetTries: resetTries = 1 (Fixnum)
    130  INFO Experiment: load system:exp:eventlib
    131  INFO Experiment: load routing.rb
    132  INFO Topology: Loading topology 'nodeA'.
    133  INFO Topology: Loading topology 'nodeB'.
    134  INFO Topology: Loading topology 'nodeC'.
    135  INFO Topology: Loading topology 'nodeD'.
    136  INFO Topology: Loading topology 'nodeE'.
    137  INFO Experiment: Switching ON resources which are OFF
    138  INFO ALL_UP: Event triggered. Starting the associated tasks.
    139  INFO exp: Request from Experiment Script: Wait for 1s....
    140  INFO exp: Changing routing setup
    141  INFO exp: Routing setup finished
    142  INFO exp: Request from Experiment Script: Wait for 5s....
    143  INFO exp: Stopping applications
    144  INFO exp: Request from Experiment Script: Wait for 1s....
    145  INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
    146  INFO NodeHandler:
    147  INFO NodeHandler: Shutting down experiment, please wait...
    148  INFO NodeHandler:
    149  INFO run: Experiment gimi20-2012-10-18t14.14.10-04.00 finished after 0:16
    150 }}}
    151 
    152 ----
    153 
    154 === C.1.3 Verification of Topology ===
     56=== C.1.2 Verification of Topology ===
    15557After establishing the slice on which the experiment will be executed, the experimenter will be most likely
    156 be interested in verifying if the slice has been initiated correctly. In this tutorial, we use an [[http://emmy9.casa.umass.edu:/GEC15-GIMI-Tutorial/ping_all.rb OMF experiment script]] that executes pings between neighboring nodes.
     58be interested in verifying if the slice has been initiated correctly. In this tutorial, we use an [[http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/step1-ping_all.rb OMF experiment script]] that executes pings between neighboring nodes.
    15759
    15860{{{
     
    312214{{{
    313215$ cd ~/Tutorials/GIMI/common/
    314 $ omf-5.4 exec --no-am -S gimiXX ping_all.rb
     216$ omf-5.4 exec --no-am -S gimiXX step1-ping_all.rb
    315217}}}
    316218
     
    366268----
    367269
     270=== C.1.3 Setup Routing in Experiment Topology ===
     271In 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/step2-routing.rb OMF experiment script]]. The one we use for this tutorial is shown below.
     272
     273{{{
     274defGroup('Node1', "nodeA")
     275defGroup('Node2', "nodeB")
     276defGroup('Node3', "nodeC")
     277defGroup('Node4', "nodeD")
     278defGroup('Node5', "nodeE")
     279
     280
     281onEvent(:ALL_UP) do |event|
     282  wait 1
     283  info 'Changing routing setup'
     284
     285  group('Node1').exec("route add -net 192.168.1.0/24 gw 192.168.4.10")
     286  group('Node1').exec("route add -net 192.168.2.0/24 gw 192.168.4.10")
     287  group('Node1').exec("route add -net 192.168.3.0/24 gw 192.168.5.12")
     288  group('Node1').exec("route add -net 192.168.6.0/24 gw 192.168.5.12")
     289  group('Node1').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
     290
     291  group('Node2').exec("route add -net 192.168.3.0/24 gw 192.168.1.13")
     292  group('Node2').exec("route add -net 192.168.5.0/24 gw 192.168.4.11")
     293  group('Node2').exec("route add -net 192.168.6.0/24 gw 192.168.2.12")
     294  group('Node2').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
     295
     296  group('Node3').exec("route add -net 192.168.1.0/24 gw 192.168.3.13")
     297  group('Node3').exec("route add -net 192.168.4.0/24 gw 192.168.5.11")
     298  group('Node3').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
     299
     300  group('Node4').exec("route add -net 192.168.2.0/24 gw 192.168.3.12")
     301  group('Node4').exec("route add -net 192.168.4.0/24 gw 192.168.1.10")
     302  group('Node4').exec("route add -net 192.168.5.0/24 gw 192.168.3.12")
     303  group('Node4').exec("route add -net 192.168.6.0/24 gw 192.168.3.12")
     304  group('Node4').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
     305
     306  group('Node5').exec("route add -net 192.168.2.0/24 gw 192.168.6.12")
     307  group('Node5').exec("route add -net 192.168.1.0/24 gw 192.168.6.12")
     308  group('Node5').exec("route add -net 192.168.3.0/24 gw 192.168.6.12")
     309  group('Node5').exec("route add -net 192.168.4.0/24 gw 192.168.6.12")
     310  group('Node5').exec("route add -net 192.168.5.0/24 gw 192.168.6.12")
     311
     312  info 'Routing setup finished'
     313  wait 5
     314  info 'Stopping applications'
     315  allGroups.stopApplications
     316  wait 1
     317  Experiment.done
     318end
     319}}}
     320
     321This script can be easily adapted if the experimenter wishes to set up the routing between the nodes
     322differently.
     323
     324The script is executed from the user workspace as follows:
     325
     326{{{
     327$ cd ~/Tutorials/GIMI/common/
     328$ omf-5.4 exec --no-am -S gimiXX step2-routing.rb
     329}}}
     330
     331Where gimiXX has to be replaced by the slice name you are using for your experiment.
     332
     333You should see the following output after executing the omf command.
     334
     335{{{
     336 INFO NodeHandler: OMF Experiment Controller 5.4 (git e0eefcf)
     337 INFO NodeHandler: Slice ID: gimi20
     338 INFO NodeHandler: Experiment ID: gimi20-2012-10-18t14.14.10-04.00
     339 INFO NodeHandler: Message authentication is disabled
     340 WARN NodeHandler: AM support disabled - any service calls will fail!
     341 INFO Experiment: load system:exp:stdlib
     342 INFO property.resetDelay: resetDelay = 210 (Fixnum)
     343 INFO property.resetTries: resetTries = 1 (Fixnum)
     344 INFO Experiment: load system:exp:eventlib
     345 INFO Experiment: load routing.rb
     346 INFO Topology: Loading topology 'nodeA'.
     347 INFO Topology: Loading topology 'nodeB'.
     348 INFO Topology: Loading topology 'nodeC'.
     349 INFO Topology: Loading topology 'nodeD'.
     350 INFO Topology: Loading topology 'nodeE'.
     351 INFO Experiment: Switching ON resources which are OFF
     352 INFO ALL_UP: Event triggered. Starting the associated tasks.
     353 INFO exp: Request from Experiment Script: Wait for 1s....
     354 INFO exp: Changing routing setup
     355 INFO exp: Routing setup finished
     356 INFO exp: Request from Experiment Script: Wait for 5s....
     357 INFO exp: Stopping applications
     358 INFO exp: Request from Experiment Script: Wait for 1s....
     359 INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
     360 INFO NodeHandler:
     361 INFO NodeHandler: Shutting down experiment, please wait...
     362 INFO NodeHandler:
     363 INFO run: Experiment gimi20-2012-10-18t14.14.10-04.00 finished after 0:16
     364}}}
     365
     366----
     367
     368=== C.1.4 Verification of Routing ===
     369After establishing the routing, we use an [[http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/step3-ping_e2e.rb OMF experiment script]] that executes pings between each pair of nodes that contains one hop, to verify the correctness of routing setup.
     370
     371{{{
     372defProperty('source1', "nodeA", "ID of a resource")
     373defProperty('source2', "nodeB", "ID of a resource")
     374defProperty('source3', "nodeC", "ID of a resource")
     375defProperty('source4', "nodeD", "ID of a resource")
     376defProperty('source5', "nodeE", "ID of a resource")
     377
     378defProperty('sinkaddr11', '192.168.1.13', "Ping destination address")
     379defProperty('sinkaddr12', '192.168.3.13', "Ping destination address")
     380defProperty('sinkaddr13', '192.168.6.14', "Ping destination address")
     381
     382defProperty('sinkaddr21', '192.168.6.14', "Ping destination address")
     383
     384defProperty('sinkaddr41', '192.168.4.11', "Ping destination address")
     385defProperty('sinkaddr42', '192.168.5.11', "Ping destination address")
     386defProperty('sinkaddr43', '192.168.6.14', "Ping destination address")
     387
     388defProperty('sinkaddr51', '192.168.5.11', "Ping destination address")
     389defProperty('sinkaddr52', '192.168.2.10', "Ping destination address")
     390defProperty('sinkaddr53', '192.168.3.13', "Ping destination address")
     391
     392defApplication('ping_app', 'pingmonitor') do |a|
     393        a.path = "/root/pingWrap.rb"
     394        a.version(1, 2, 0)
     395        a.shortDescription = "Wrapper around ping"
     396        a.description = "ping application"
     397        a.defProperty('dest_addr', 'Address to ping', '-a', {:type => :string, :dynamic => false})
     398        a.defProperty('count', 'Number of times to ping', '-c', {:type => :integer, :dynamic => false})
     399        a.defProperty('interval', 'Interval between pings in s', '-i', {:type => :integer, :dynamic => false})
     400       
     401        a.defMeasurement('myping') do |m|
     402            m.defMetric('dest_addr',:string)
     403            m.defMetric('ttl',:int)
     404            m.defMetric('rtt',:float)
     405            m.defMetric('rtt_unit',:string)
     406        end
     407end
     408
     409defGroup('Source1', property.source1) do |node|
     410      node.addApplication("ping_app") do |app|
     411          app.setProperty('dest_addr', property.sinkaddr11)
     412          app.setProperty('count', 30)
     413          app.setProperty('interval', 1)
     414          app.measure('myping', :samples => 1)
     415      end
     416     
     417      node.addApplication("ping_app") do |app|
     418          app.setProperty('dest_addr', property.sinkaddr12)
     419          app.setProperty('count', 30)
     420          app.setProperty('interval', 1)
     421          app.measure('myping', :samples => 1)
     422      end
     423
     424      node.addApplication("ping_app") do |app|         
     425          app.setProperty('dest_addr', property.sinkaddr13)
     426          app.setProperty('count', 30)             
     427          app.setProperty('interval', 1)                 
     428          app.measure('myping', :samples => 1)
     429      end
     430end
     431
     432defGroup('Source2', property.source1) do |node|
     433    node.addApplication("ping_app") do |app|             
     434        app.setProperty('dest_addr', property.sinkaddr21)       
     435        app.setProperty('count', 30)           
     436        app.setProperty('interval', 1)               
     437        app.measure('myping', :samples => 1)                 
     438    end               
     439end
     440
     441defGroup('Source4', property.source3) do |node|
     442      node.addApplication("ping_app") do |app|
     443          app.setProperty('dest_addr', property.sinkaddr41)
     444          app.setProperty('count', 30)
     445          app.setProperty('interval', 1)
     446          app.measure('myping', :samples => 1)
     447      end
     448
     449      node.addApplication("ping_app") do |app|
     450          app.setProperty('dest_addr', property.sinkaddr42)
     451          app.setProperty('count', 30)
     452          app.setProperty('interval', 1)
     453          app.measure('myping', :samples => 1)
     454      end
     455
     456      node.addApplication("ping_app") do |app|
     457          app.setProperty('dest_addr', property.sinkaddr43)
     458          app.setProperty('count', 30)
     459          app.setProperty('interval', 1)
     460          app.measure('myping', :samples => 1)
     461      end
     462end
     463
     464defGroup('Source5', property.source3) do |node|
     465          node.addApplication("ping_app") do |app|
     466              app.setProperty('dest_addr', property.sinkaddr51)
     467              app.setProperty('count', 30)
     468              app.setProperty('interval', 1)
     469              app.measure('myping', :samples => 1)
     470          end
     471
     472          node.addApplication("ping_app") do |app|
     473              app.setProperty('dest_addr', property.sinkaddr52)
     474              app.setProperty('count', 30)
     475              app.setProperty('interval', 1)
     476              app.measure('myping', :samples => 1)
     477          end
     478
     479          node.addApplication("ping_app") do |app|
     480              app.setProperty('dest_addr', property.sinkaddr53)
     481              app.setProperty('count', 30)
     482              app.setProperty('interval', 1)
     483              app.measure('myping', :samples => 1)
     484          end
     485end
     486
     487onEvent(:ALL_UP_AND_INSTALLED) do |event|
     488      info "Starting the ping"
     489      allGroups.startApplications
     490      wait 5
     491      info "Stopping the ping"
     492      allGroups.stopApplications
     493      Experiment.done
     494end
     495}}}
     496
     497The script is executed from the user workspace as follows:
     498
     499{{{
     500$ cd ~/Tutorials/GIMI/common/
     501$ omf-5.4 exec --no-am -S gimiXX step3-ping_e2e.rb.rb
     502}}}
     503
     504Where gimiXX has to be replaced by the slice name you are using for your experiment.
     505
     506You should see the following output after executing the omf command.
     507
     508{{{
     509 INFO NodeHandler: OMF Experiment Controller 5.4 (git e0eefcf)
     510 INFO NodeHandler: Slice ID: gimi20
     511 INFO NodeHandler: Experiment ID: gimi20-2012-10-18t14.03.42-04.00
     512 INFO NodeHandler: Message authentication is disabled
     513 WARN NodeHandler: AM support disabled - any service calls will fail!
     514 INFO Experiment: load system:exp:stdlib
     515 INFO property.resetDelay: resetDelay = 210 (Fixnum)
     516 INFO property.resetTries: resetTries = 1 (Fixnum)
     517 INFO Experiment: load system:exp:eventlib
     518 INFO Experiment: load ping_all.rb
     519 INFO property.source1: source1 = "nodeA" (String)
     520 INFO property.source2: source2 = "nodeB" (String)
     521 INFO property.source3: source3 = "nodeC" (String)
     522 INFO property.source4: source4 = "nodeD" (String)
     523 INFO property.source5: source5 = "nodeE" (String)
     524 INFO property.sinkaddr11: sinkaddr11 = "192.168.4.10" (String)
     525 INFO property.sinkaddr12: sinkaddr12 = "192.168.5.12" (String)
     526 INFO property.sinkaddr21: sinkaddr21 = "192.168.4.11" (String)
     527 INFO property.sinkaddr22: sinkaddr22 = "192.168.2.12" (String)
     528 INFO property.sinkaddr23: sinkaddr23 = "192.168.1.13" (String)
     529 INFO property.sinkaddr31: sinkaddr31 = "192.168.5.11" (String)
     530 INFO property.sinkaddr32: sinkaddr32 = "192.168.2.10" (String)
     531 INFO property.sinkaddr33: sinkaddr33 = "192.168.3.13" (String)
     532 INFO property.sinkaddr34: sinkaddr34 = "192.168.6.14" (String)
     533 INFO property.sinkaddr41: sinkaddr41 = "192.168.1.10" (String)
     534 INFO property.sinkaddr42: sinkaddr42 = "192.168.3.12" (String)
     535 INFO property.sinkaddr51: sinkaddr51 = "192.168.6.12" (String)
     536 INFO Topology: Loading topology 'nodeA'.
     537 INFO Topology: Loading topology 'nodeB'.
     538 INFO Topology: Loading topology 'nodeC'.
     539 INFO Topology: Loading topology 'nodeD'.
     540 INFO Topology: Loading topology 'nodeE'.
     541 INFO Experiment: Switching ON resources which are OFF
     542 INFO ALL_UP_AND_INSTALLED: Event triggered. Starting the associated tasks.
     543 INFO exp: Starting the ping
     544 INFO exp: Request from Experiment Script: Wait for 5s....
     545 INFO exp: Stopping the ping
     546 INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
     547 INFO NodeHandler:
     548 INFO NodeHandler: Shutting down experiment, please wait...
     549 INFO NodeHandler:
     550 INFO run: Experiment gimi20-2012-10-18t14.03.42-04.00 finished after 0:16
     551}}}
     552
     553----
     554
    368555=== C.2 Running Actual Experiment ===
    369556
     
    460647end
    461648}}}
     649
     650The script is executed from the user workspace as follows:
     651
     652{{{
     653$ cd ~/Tutorials/GIMI/common/
     654$ omf-5.4 exec --no-am -S gimiXX step4-otg_nmetrics.rb
     655}}}
     656
     657Where gimiXX has to be replaced by the slice name you are using for your experiment.
    462658
    463659You should see the following output (or similar) after executing the omf command.