Changes between Version 1 and Version 2 of Tutorials/oMF/tut1


Ignore:
Timestamp:
Oct 15, 2014, 7:01:27 AM (10 years ago)
Author:
wontoniii
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/oMF/tut1

    v1 v2  
    55=== Objective ===
    66
    7 In this exercise we will establish a simple topology consisting of Mobilityfirst routers, hosts and applications, deploy the software components onto physical nodes, and run a end-to-end 'ping' application.
     7In this exercise we will establish a simple topology consisting of MobilityFirst routers, hosts and applications, deploy the software components onto physical nodes, and run an end-to-end 'ping' application. At the end of the exercise, you should expect to acquire a general knowledge of the Mobilityfirst software components and how to utilize them using the Orbit testbed.
    88
    99=== Topology ===
    1010
    11 In this exercise we will start with a simple linear topology consisting of two MobilityFirst routers (MFR) that interconnect two hosts: Host1 will initiate a 'ping' communication and Host2 will respond to the ping request:
     11In this exercise we will use a simple linear topology consisting of two MobilityFirst routers (MFR) that interconnect two hosts: Host1 will initiate a 'ping' communication and Host2 will respond to the ping request:
    1212
    1313{{{
     
    1818=== MobilityFirst ORBIT Image ===
    1919
    20 The complete set of components from the latest release of MobilityFirst software is available as a compressed image within the ORBIT testbed for imaging nodes using the 'omf' tool. The current pre-prepared image is built over Ubuntu 12.04 LTS distribution and will be moved to newer distributions as they become available and we've had a chance to test compatibility. Once logged into the console of the reserved domain, the image can be loaded onto a node using the command line:
    21 
    22 {{{
    23 #!sh
    24 
    25 omf load -i 'mf-release-latest.ndz' -t 'node1-1.sb9.orbit-lab.org'
     20The complete set of components from the latest release of MobilityFirst software is available as a compressed image within the ORBIT testbed for imaging nodes using the 'omf' tool. The current pre-prepared image is built over Ubuntu 12.04 LTS distribution and will be moved to newer distributions as they become available and we have had a chance to test compatibility.
     21
     22A typical Orbit experiment requires the following six steps:
     23
     24 1. [[CollapsibleStart(Create resource reservation)]][[Include(Documentation/Short/CreateRes)]][[CollapsibleEnd]]
     25
     26 2. [[CollapsibleStart(Login into reserved domain: "ssh username@sb1.orbit-lab.org")]][[Include(Documentation/Short/Login)]][[CollapsibleEnd]]
     27
     28 3. [[CollapsibleStart(Load an image on the nodes: "omf load -i baseline.ndz -t all")]] [[Include(Documentation/Short/LoadImage)]][[CollapsibleEnd]]
     29
     30 4. [[CollapsibleStart(Turn the nodes on: "omf tell -a on -t all")]][[Include(Documentation/Short/TellOn)]][[CollapsibleEnd]]
     31
     32 5. [[CollapsibleStart(Execute the experiment: "omf exec test:exp:tutorial:hello-world-wireless -- --res1 node1-1.sb1.orbit-lab.org --res2 node1-2.sb1.orbit-lab.org")]][[Include(Software/cOMF/aExec)]][[CollapsibleEnd]]
     33
     34 6. Analyze the results
     35
     36While, most of the experiments follow the presented structure, for this specific tutorial some simplifications have been applied.
     37
     38From now on, the following assumptions are considered:
     39
     40 * You will be working with resources belonging to the Orbid grid.
     41 * You have been assigned a group number.
     42
     43While for this experiment we are using the grid, it is not a strict a requirement and for the successful execution of the experiment any sandbox with at least 4 nodes could be employed.
     44
     45Once logged into the grid console:
     46
     47{{{
     48#!sh
     49
     50Command to access???
     51}}}
     52
     53
     54
     55{{{
     56#!sh
     57
     58omf load -i 'mf-release-latest.ndz' -t system:topo:mf-group1
    2659}}}
    2760
     
    3770=== Deploy Network ===
    3871
    39 Software and experiment control in the ORBIT testbed can be automated greatly using the OMF framework. An OMF control script is written in Ruby and allows the experimenter to specify the set of nodes, their network configuration, to specify software components and arguments, and to control their execution on one or more nodes. We will use an OMF script to bring up 4 ORBIT nodes to host our topology, with corresponding software components as shown below:
    40 
    41 {{{
    42 #!sh
    43                  mfping                               mfping
    44 Software         mfapi lib     gnrs      gnrs         mfapi lib
    45                  mfstack       click     click        mfstack
    46                                  
    47 Topology         Host1 ------- MFR1 ---- MFR2 ------- Host2
    48 
    49 ORBIT Node       node1-1       node1-2   node1-3      node1-4
    50 }}}
    51 
    52 The entire script is available as part of the tutorial package as orbit/tutorial/scripts/exercise1.rb
    53 
    54 The following sub-sections dissect the key parts of this script:
     72Software and experiment control in the ORBIT testbed can be automated greatly using the OMF framework. An OMF control script is written in Ruby and allows the experimenter to specify the set of nodes, their network configuration, to specify software components and arguments, and to control their execution on one or more nodes. We will use an OMF script to bring up 4 ORBIT nodes to host our topology, with corresponding software components.
     73
     74We will first introduce the main details of the scripts that will be run and then will step to the execution itself.
    5575
    5676==== Software Component Specification ====
     
    6282
    6383defApplication('MF-Router', 'router') {|app|
    64     app.shortDescription = "Click-based MobilityFirst Router"
    65     app.path = ";/usr/local/bin/click"
    66 
    67     # click options
    68     app.defProperty('num_threads', 'number of threads', "--threads",{:type =>; :integer, :mandatory => true, :default => 4, :order => 1})
    69     app.defProperty('ctrl_port', 'port for Click control socket', "--port",{:type => :integer, :order => 2})
    70 
    71     # click config file
    72     app.defProperty('config_file', 'Click configuration file', nil,{:type => :string,:mandatory=> true})
    73 
    74     # keyword parameters used in click config file
    75     app.defProperty('my_GUID', 'router GUID', "my_GUID",{:type => :string, :mandatory => true})
    76     app.defProperty('topo_file', 'path to topology file', "topo_file",{:type => :string, :mandatory => true})
    77     app.defProperty('core_dev', 'core network interface', "core_dev",{:type => :string,:mandatory=> true})
    78     app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "GNRS_server_ip",{:type => :string,:mandatory=> true})
    79     app.defProperty('GNRS_server_port', 'Port of GNRS server', "GNRS_server_port",{:type => :string,:mandatory=> true})
    80     app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "GNRS_server_ip",{:type => :string,:default=> "0.0.0.0"})
    81     app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "GNRS_server_port",{:type => :string,:default=> 10001})
    82     app.defProperty('edge_dev', 'edge network interface', "edge_dev",{:type => :string,:mandatory=> true})
    83     app.defProperty('edge_dev_ip', 'IP assigned to edge interface', "edge_dev_ip",{:type => :string,:mandatory=> true})
     84        app.shortDescription = "Click-based MobilityFirst Access Router"
     85        app.path = "/usr/local/src/mobilityfirst/eval/orbit/tutorial/scripts/ARWrapper.sh"
     86        # click options
     87        app.defProperty('num_threads', 'number of threads', "-t",{:type => :integer, :mandatory => true, :default => 4, :order => 1})
     88        app.defProperty('ctrl_port', 'port for Click control socket', "-c",{:type => :integer, :order => 2})
     89        # click config file
     90        app.defProperty('config_file', 'Click configuration file', "-C",{:type => :string,:mandatory=> true})
     91        # keyword parameters used in click config file
     92        app.defProperty('my_GUID', 'router GUID', "-m",{:type => :string, :mandatory => true})
     93        app.defProperty('topo_file', 'path to topology file', "-f",{:type => :string, :mandatory => true})
     94        app.defProperty('core_dev', 'core network interface', "-d",{:type => :string,:mandatory => true})
     95        app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "-s",{:type => :string,:mandatory => true})
     96        app.defProperty('GNRS_server_port', 'Port of GNRS server', "-p",{:type => :string,:mandatory => true})
     97        app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "-i",{:type => :string,:default => "0.0.0.0"})
     98        app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "-P",{:type => :string,:default => "10001"})
     99        app.defProperty('edge_dev', 'edge network interface', "-D",{:type => :string,:mandatory => true})
     100        app.defProperty('edge_dev_ip', 'IP assigned to edge interface', "-I",{:type => :string,:mandatory => true})
    84101}
     102
     103defApplication('MF-GNRS', 'gnrs') {|app|
     104        app.shortDescription = "GNRS Server"
     105        app.path = "/usr/local/src/mobilityfirst/eval/orbit/tutorial/scripts/GNRSWrapper.sh"
     106        app.defProperty('log4j_config_file', 'log 4j configuration file', "-d",{:type => :string, :order => 1})
     107        app.defProperty('jar_file', 'server jar file with all dependencies', "-j" ,{:type => :string, :mandatory=> true, :default => "/usr/local/src/mobilityfirst/gnrs/jserver/target/gnrs-server-1.0.0-SNAPSHOT-jar-with-dependencies.jar", :order => 2})
     108        app.defProperty('config_file', 'server configuration file', "-c",{:type => :string, :mandatory=> true, :order => 3})
     109}
     110
     111#Enable OML reporting by default
     112defApplication('MF-HostStack', 'hoststack') {|app|
     113        app.shortDescription = "MF host network stack"
     114        app.path = "/usr/local/bin/mfstack"
     115        app.defProperty('log_level', 'log level', nil,{:type => :string, :mandatory => true, :order => 1, :default => "-e"}) # default is 'error'
     116        app.defProperty('config_file', 'stack configuration file', nil,{:type => :string, :mandatory => true, :order => 2})
     117}
    85118}}}
    86119
     
    95128{{{
    96129#!ruby
     130
    97131for i in 1..num_routers
    98         defTopology("topo:router_#{i}") { |t|
    99                 aNode = routersTopo.getNodeByIndex(i-1)
    100                 t.addNode(aNode)
    101                 print "Adding node: ", aNode, " router with GUID: #{i+num_hosts}\n"
    102         }
    103 
    104         defGroup("router_#{i}", "topo:router_#{i}") {|node|
    105                 node.addApplication('MF-Router') {|app|
    106                     app.setProperty('my_GUID', router_guid[i-1])
    107                     app.setProperty('topo_file', topo_file)
    108                     app.setProperty('conf_file', click_conf)
    109                     app.setProperty('core_dev', core_dev)
    110                     app.setProperty('gnrs_server_ip', router_gnrs_if_ip[i-1])
    111                     app.setProperty('gnrs_server_port', gnrs_server_port)
    112                     app.setProperty('edge_dev', edge_dev)
    113                     app.setProperty('edge_dev_ip', router_wifi_if_ip[i-1])
    114                 }
    115 
    116                 node.addApplication('MF-GNRS') {|app|
    117                     app.setProperty('config_file', gnrs_conf_file)
    118                 }
    119         }
     132        defTopology("topo:router_#{i}") { |t|
     133                aNode = routersTopo.getNodeByIndex(i-1)
     134                t.addNode(aNode)
     135                info aNode, " assigned role of router with GUID: #{i}"
     136        }
     137 
     138        defGroup("router_#{i}", "topo:router_#{i}") {|node|
     139                node.addApplication('MF-Router') {|app|
     140                        app.setProperty('num_threads', router_threads)
     141                        app.setProperty('config_file', click_conf)
     142                        app.setProperty('my_GUID', router_guid[i-1])
     143                        app.setProperty('topo_file', rtr_topo_file)
     144                        app.setProperty('core_dev', core_dev)
     145                        app.setProperty('GNRS_server_ip', GNRS_server_ip)
     146                        app.setProperty('GNRS_server_port', GNRS_server_port)
     147                        app.setProperty('GNRS_listen_ip', "192.168.100.#{i}")
     148                        app.setProperty('GNRS_listen_port', GNRS_listen_port)
     149                        app.setProperty('edge_dev', edge_dev)
     150                        app.setProperty('edge_dev_ip', router_ether_if_ip[i-1])
     151                }
     152
     153          #If is the first router add the GNRS
     154          if i == 1
     155      aNode = routersTopo.getNodeByIndex(i-1)
     156      info aNode, " will also host the GNRS server"
     157                  node.addApplication('MF-GNRS') {|app|
     158                    app.setProperty('log4j_config_file', GNRS_log_file)
     159                    app.setProperty('jar_file', GNRS_jar_file)
     160                    app.setProperty('config_file', GNRS_conf_file)
     161                  }
     162          end
     163       
     164          node.net.e0.ip = "192.168.100.#{i}"
     165          node.net.e0.netmask = '255.255.255.0'
     166   
     167    node.net.w0.mode = "adhoc"
     168    node.net.w0.type = 'g'
     169    node.net.w0.channel = "11"
     170    node.net.w0.essid = "SSID_group_#{i}"
     171    node.net.w0.ip = "192.168.#{i}.1"
     172        }
    120173end
    121 }}}
    122 
    123 ==== Configuring the Network Interfaces ====
     174
     175#Create host groups
     176for i in 1..num_hosts
     177        defTopology("topo:host_#{i}") { |t|
     178                aNode = hostsTopo.getNodeByIndex(i-1)
     179                t.addNode(aNode)
     180                info aNode, " assigned role of client with GUID: #{100 + i}"
     181        }
     182 
     183        defGroup("host_#{i}", "topo:host_#{i}") {|node|
     184                node.addApplication('MF-HostStack') {|app|
     185                        app.setProperty('config_file', hoststack_conf_file[i-1])
     186                        app.setProperty('log_level', log_level)
     187                }
     188         
     189    #node.net.e0.ip = "192.168.#{i}.#{i+100}"
     190          #node.net.e0.netmask = '255.255.255.0'
     191   
     192    node.net.w0.mode = "adhoc"
     193    node.net.w0.type = 'g'
     194    node.net.w0.channel = "11"
     195    node.net.w0.essid = "SSID_group_#{i}"
     196    node.net.w0.ip = "192.168.#{i}.2"
     197        }
     198end
     199}}}
     200
     201==== Starting the MobilityFirst Components ====
     202
     203The following snippet shows the starting of the router software and the gnrs servers on the two router nodes:
    124204
    125205{{{
    126206#!ruby
     207    onEvent(:ALL_UP) do |event|
     208   
     209    info "This is my first MobilityFirst experiment"
     210
     211    info "Initializing resources"
    127212    # clean up and initialize networking for routers
    128213    for i in 1..num_routers
     
    131216        # gnrsd cleanup
    132217        group("router_#{i}").exec("killall -9 java")
    133 
    134         # bring up gnrs interface if required - in sb4 we use ctrl iface
    135         # group("router_#{i}").exec("ifconfig " + core_dev + " " + router_gnrs_if_ip + " netmask " + router_gnrs_if_netmask)
    136                
    137         #bring up edge wifi interface
    138         group("router_#{i}").exec("modprobe ath5k")
    139         group("router_#{i}").exec("ifconfig " + edge_dev + " " + router_wifi_if_ip + " netmask " + wifi_netmask)
    140     end         
    141                    
     218    end
     219
    142220    #clean up and initialize networking for hosts
    143221    for i in 1..num_hosts
    144222        group("host_#{i}").exec("killall -9 mfstack")
    145 
    146         #bring up edge wifi interface
    147         group("host_#{i}").exec("modprobe ath5k")
    148         group("host_#{i}").exec("ifconfig " + edge_dev + " " + host_wifi_if_ip + " netmask " + wifi_netmask)
    149     end
    150 }}}
    151 
    152 ==== Starting the MobilityFirst Components ====
    153 
    154 The following snippet shows the starting of the router software and the gnrs servers on the two router nodes:
    155 
    156 {{{
    157 #!ruby
    158     # bring up the routers (along with gnrs servers)
    159     print "Bringing up routers...\n"
     223    end
     224    wait 20
     225   
     226    # bring up routers (along with gnrs servers)
     227    info "Bringing up routers..."
    160228    for i in 1..num_routers
    161229        group("router_#{i}").startApplications
    162230    end
    163 }}}
     231    wait 5
     232
     233    info "Bringing up host stacks..."
     234    for i in 1..num_hosts
     235        group("host_#{i}").startApplications
     236    end
     237   
     238    info "Access the nodes to run a program"
     239
     240    wait 10000
     241
     242    Experiment.done
     243    end
     244}}}
     245
     246==== Executing the script ====
     247
     248In order to execute the just described script, download it to your console home folder copying and pasting the following command:
     249
     250{{{
     251#!sh
     252    wget www.winlab.rutgers.edu/~bronzino/downlaods/exercise1.rb
     253}}}
     254
     255Once the file has been downloaded, execute it with the following command:
     256
     257{{{
     258#!sh
     259    omf exec exercise1.rb
     260}}}
     261
     262The obtained output should resamble the follwoing snippet:
     263
     264{{{
     265#!sh
     266   
     267 INFO NodeHandler: OMF Experiment Controller 5.4 (git 3fb37b9)
     268 INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
     269 INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
     270 INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
     271 INFO NodeHandler: Slice ID: default_slice (default)
     272 INFO NodeHandler: Experiment ID: default_slice-2014-10-15t02.12.19.869-04.00
     273 INFO NodeHandler: Message authentication is disabled
     274 INFO Experiment: load system:exp:stdlib
     275 INFO property.resetDelay: resetDelay = 230 (Fixnum)
     276 INFO property.resetTries: resetTries = 1 (Fixnum)
     277 INFO Experiment: load system:exp:eventlib
     278 INFO Experiment: load system:exp:winlib
     279 INFO Experiment: load exercise1.rb
     280 INFO Topology: Loaded topology '/tmp/pxe_slice-2014-10-15t02.10.16.594-04.00-topo-success'.
     281 INFO Topology: Loaded topology 'system:topo:imaged'.
     282 INFO exp: node1-2.grid.orbit-lab.org assigned role of router with GUID: 1
     283 INFO exp: node1-2.grid.orbit-lab.org will also host the GNRS server
     284 INFO exp: node2-1.grid.orbit-lab.org assigned role of router with GUID: 2
     285 INFO exp: node1-1.grid.orbit-lab.org assigned role of router with GUID: 101
     286 INFO exp: node2-2.grid.orbit-lab.org assigned role of router with GUID: 102
     287 INFO exp: Definition of resources completed
     288 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [0 sec.]
     289 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [10 sec.]
     290 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [20 sec.]
     291 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [31 sec.]
     292 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [41 sec.]
     293 INFO stdlib: Waiting for nodes (Up/Down/Total): 0/4/4 - (still down: node1-2.grid.orbit-lab.org,node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [51 sec.]
     294 INFO node2-2.grid.orbit-lab.org: Device 'net/w0' reported Not-Associated
     295 INFO node1-2.grid.orbit-lab.org: Device 'net/w0' reported Not-Associated
     296 INFO stdlib: Waiting for nodes (Up/Down/Total): 2/2/4 - (still down: node2-1.grid.orbit-lab.org,node1-1.grid.orbit-lab.org) [61 sec.]
     297 INFO node2-2.grid.orbit-lab.org: Device 'net/w0' reported 76:01:22:6E:DB:FD
     298 INFO ALL_UP: Event triggered. Starting the associated tasks.
     299 INFO exp: This is my first MobilityFirst experiment
     300 INFO exp: Initializing resources
     301 INFO exp: Request from Experiment Script: Wait for 20s....
     302 INFO node1-2.grid.orbit-lab.org: Device 'net/w0' reported 76:5D:54:9F:2E:AE
     303 INFO node2-1.grid.orbit-lab.org: Device 'net/w0' reported 76:01:22:6E:DB:FD
     304 INFO node1-1.grid.orbit-lab.org: Device 'net/w0' reported 76:5D:54:9F:2E:AE
     305 INFO exp: Bringing up routers...
     306 INFO exp: Request from Experiment Script: Wait for 5s....
     307 INFO exp: Bringing up host stacks...
     308 INFO exp: Access the nodes to run a program
     309 INFO exp: Request from Experiment Script: Wait for 10000s....
     310}}}
     311
     312A few comments on the obtained output:
     313  * temp
    164314
    165315=== Test The Network ===
    166316
    167 Once the host and router components are up, you can log in to the sender and receiver host nodes (two separate terminals) and run the 'mfping' application.
     317Once the host and router components are up, you can log in to the sender (host identified by GUID 101) and receiver (host identified by GUID 102) host nodes (two separate terminals) and run the 'mfping' application.
    168318
    169319Run the mfping 'server' specifying the application GUID:
     
    187337
    188338}}}
     339
     340
     341=== References ===
     342
     343For more information regarding the MobilityFirst project, visit the project page: http://mobilityfirst.winlab.rutgers.edu/
     344
     345For more information regarding the prototype design and updated status, visit the wiki page: https://mobilityfirst.orbit-lab.org/
     346