wiki:Tutorials/oMF/tut1

Version 25 (modified by wontoniii, 10 years ago) ( diff )

Exercise 1: Simple MobilityFirst Network Deployment and Test

Design/Setup

Objective

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 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 deploy and configure them using the Orbit testbed.

Topology

In 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:

No image "MFTurorialNetwork.png" attached to Tutorials/oMF

MobilityFirst ORBIT Image

The complete set of components from the latest release of the 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.

A typical Orbit experiment requires the following six steps:

  1. Create resource reservation

    Creating a Reservation

    Before you can access the testbed, you need to make a reservation for a particular domain and get it approved by the reservation service.

    First time users are highly encouraged to reserve time on a sandbox instead of the main grid, and start with the provided "Hello World" experiment.

  1. Login into reserved domain: "ssh username@sb1.orbit-lab.org"

    Login into reserved domain

    During your approved time slot, you will be able to ssh into the console of the respective domain. A console is a dedicated machine that allows access to all resources in that domain.

    For example, to access the sandbox1:

    yourhost>ssh username@console.sb1.orbit-lab.org
    
    Using username "username".
    Authenticating with public key "xxxxxxxxx"
    Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-36-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Mon Jan 28 20:25:50 EST 2013
    
      System load:  0.0               Processes:           93
      Usage of /:   2.7% of 69.43GB   Users logged in:     0
      Memory usage: 6%                IP address for eth0: 10.50.18.10
      Swap usage:   0%                IP address for eth1: 10.18.0.10
    
      Graph this data and manage this system at https://landscape.canonical.com/
    
    9 packages can be updated.
    0 updates are security updates.
    
    |-----------------------------------------------------------------|
    |                 *** For authorized use only ***                 |
    | This system is for the use of authorized users only.  All users |
    | are expected to comply with the "Acceptable Use Policy" availa- |
    | ble at http://www.orbit-lab.org/AUP.html                        |
    | Individuals using this computer system, are subject to having   |
    | all of their activities on this system monitored and recorded   |
    | by system personnel.                                            |
    |                                                                 |
    | Anyone using this system expressly consents to such monitoring  |
    | and is advised that if such monitoring reveals possible         |
    | evidence of criminal activity, system personnel may provide the |
    | evidence of such monitoring to law enforcement officials.       |
    |                                                                 |
    | Email question, comments or problems to help@orbit-lab.org      |
    |-----------------------------------------------------------------|
    
    username@console.sb1:~$ 
    
  1. Load an image on the nodes: "omf load -i baseline.ndz -t all"

    Load an Image

    1. Before we begin using the nodes, it's a good idea to check their status first. This is done with the omf stat command.

      omf stat

      This omf command is used to display the power status of the node/domain.

      Usage: omf stat

      username@consoles.outdoor:omf stat
      Returns the status of the nodes in a testbed
      Usage:
            omf-5.4 stat [-h] [-s] [-t TOPOLOGY] [-c AGGREGATE]
       
            With: 
            -h, --help                print this help message
            -s, --summary             print a summary of the node status for the testbed
            -c, --config AGGREGATE    use testbed AGGREGATE
            -t, --topology TOPOLOGY   a valid topology file or description (defaults to 'system:topo:all')
       
            Some Examples: 
                          omf-5.4 stat
                          omf-5.4 stat -s
                          omf-5.4 stat -t omf.nicta.node1,omf.nicta.node2 -c sb1
                          omf-5.4 stat -t system:topo:all -c grid
      

      Individual nodes are identified in the output of stat command by their fully qualified domain name (FQDN). This establishes their "coordinates" and the "domain" to which they belong. Nodes in different domains typically can NOT see each other. Node can be in 1 of 3 states:

      POWEROFF Node is Available for use but turned off
      POWERON Node is Available and is on
      NOT REGISTERED Node is not Available for use

      Example: omf stat on the outdoor domain

      user@console.outdoor:~# omf stat -t all
      
       INFO NodeHandler: OMF Experiment Controller 5.4 (git 6d34264)
       INFO NodeHandler: Slice ID: default_slice (default)
       INFO NodeHandler: Experiment ID: default_slice-2012-10-14t14.42.15-04.00
       INFO NodeHandler: Message authentication is disabled
       INFO Experiment: load system:exp:stdlib
       INFO property.resetDelay: value = 210 (Fixnum)
       INFO property.resetTries: value = 1 (Fixnum)
       INFO Experiment: load system:exp:eventlib
       INFO Experiment: load system:exp:stat
       INFO Topology: Loading topology ''.
       INFO property.nodes: value = "system:topo:all" (String)
       INFO property.summary: value = false (FalseClass)
       INFO Topology: Loading topology 'system:topo:all'.
       Talking to the CMC service, please wait
      -----------------------------------------------
       Domain: outdoor.orbit-lab.org
       Node: node3-6.outdoor.orbit-lab.org   	 State: NOT REGISTERED
       Node: node3-3.outdoor.orbit-lab.org   	 State: POWEROFF
       Node: node2-10.outdoor.orbit-lab.org    State: POWEROFF
       Node: node1-10.outdoor.orbit-lab.org    State: POWEROFF
       Node: node1-8.outdoor.orbit-lab.org   	 State: POWERON
       Node: node1-6.outdoor.orbit-lab.org   	 State: POWERON
       Node: node3-2.outdoor.orbit-lab.org   	 State: POWEROFF
       Node: node3-1.outdoor.orbit-lab.org   	 State: POWEROFF
       Node: node1-3.outdoor.orbit-lab.org   	 State: POWERON
       Node: node3-5.outdoor.orbit-lab.org   	 State: POWEROFF
       Node: node2-5.outdoor.orbit-lab.org   	 State: NOT REGISTERED
       Node: node1-2.outdoor.orbit-lab.org   	 State: POWERON
      -----------------------------------------------
       INFO Experiment: Switching ON resources which are OFF
       INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
       INFO NodeHandler: 
       INFO NodeHandler: Shutting down experiment, please wait...
       INFO NodeHandler: 
       INFO run: Experiment default_slice-2012-10-14t14.42.15-04.00 finished after 0:6
      

    2. It is recommended that the node be in the POWEROFF state prior to any experiment process. If the node is in the POWERON state you can use the omf tell command to get the node into the off state.

      omf tell

      OMF command to control the power state/reset the nodes.

      Usage: omf tell

      user@console:omf tell
      Switch ON/OFF and reboot the nodes in a testbed
      Usage:
            omf tell [-h] -t TOPOLOGY -a ACTION [-c AGGREGATE]
       
            With: 
            -h, --help           print this help message
       
            -a, --action ACTION  specify an action
            ACTION:
            on              turn node(s) ON
            offs            turn node(s) OFF (soft)
            offh            turn node(s) OFF (hard)
            reboot          reboots node(s) (soft)
            reset           resets node(s) (hard)
       
            -h, --help                print this help message
            -t, --topology TOPOLOGY   a valid topology file or description (MANDATORY)
            -c, --config AGGREGATE    use testbed AGGREGATE
       
            Some Examples: 
                          omf tell -a reset -t node1-1.grid.orbit-lab.org
                          omf tell -a on -t system:topo:all -c grid
                          omf tell -a reboot -t node1-1
                          omf tell -a offh -t [1..2,1..5]
                          omf tell -a offh -t system:topo:all
                          omf tell -a reset -t system:topo:imaged
      

      The commands are: on, offh (equivalent to pulling out the power cord), offs (software shutdown), reboot (software reboot) and reset (hardware reset).

      Example: turn off node1-1 on the outdoor domain

      user@console.outdoor:~# omf tell -a offh -t node1-1
      
       INFO NodeHandler: OMF Experiment Controller 5.4 (git 3fb37b9)
       INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
       INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
       INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
       INFO NodeHandler: Slice ID: default_slice (default)
       INFO NodeHandler: Experiment ID: default_slice-2014-09-30t00.24.28.504-04.00
       INFO NodeHandler: Message authentication is disabled
       INFO Experiment: load system:exp:stdlib
       INFO property.resetDelay: resetDelay = 230 (Fixnum)
       INFO property.resetTries: resetTries = 1 (Fixnum)
       INFO Experiment: load system:exp:eventlib
       INFO Experiment: load system:exp:winlib
       INFO Experiment: load system:exp:tell
       INFO property.nodes: nodes = "node1-1" (String)
       INFO property.command: command = "offh" (String)
      
      Talking to the CMC service, please wait
      -----------------------------------------------
       Node: node1-1.outdoor.orbit-lab.org   	 Reply: OK
      -----------------------------------------------
      
       INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
       INFO NodeHandler: 
       INFO NodeHandler: Shutting down experiment, please wait...
       INFO NodeHandler: 
       INFO run: Experiment default_slice-2014-09-30t00.24.28.504-04.00 finished after 0:10
      

    3. Once node set is on an POWEROFF state, load an image with omf load command

      omf load

      Load command is used to put an image onto the hard disk of the node.

      Usage: omf load

      Install a given disk image on the nodes in a testbed
      Usage:
            omf-5.4 load [-h] [-i IMAGE_PATH] [-o TIMEOUT] [-t TOPOLOGY] [-c AGGREGATE]
       
            With: 
            -h, --help                print this help message
            -c, --config AGGREGATE    use testbed AGGREGATE
            -t, --topology TOPOLOGY   a valid topology file or description (defaults to 'system:topo:all')
                                      (if a file 'TOPOLOGY' doesn't exist, interpret it as a comma-separated list of nodes)
            -i, --image IMAGE         disk image to load
                                      (default is 'baseline.ndz', the latest stable baseline image)
            -o, --timeout TIMEOUT     a duration (in sec.) after which imageNodes should stop waiting for
                                      nodes that have not finished their image installation
                                      (default is 800 sec, i.e. 13min 20sec)
                --outpath PATH        Path where the resulting Topologies should be saved
                                      (default is '/tmp')
                --outprefix PREFIX    Prefix to use for naming the resulting Topologies
                                      (default is your experiment ID)
       
            Some Examples: 
                          omf-5.4 load
                          omf-5.4 load -t system:topo:all -i baseline-2.4.ndz
                          omf-5.4 load -t omf.nicta.node1 -i wireless-2.6.ndz
                          omf-5.4 load -t omf.nicta.node1,omf.nicta.node2 -i baseline.ndz -o 400
                          omf-5.4 load -t system:topo:circle -i my_Own_Image.ndz
                          omf-5.4 load -t my_Own_Topology -i baseline-2.2.ndz -t 600 -c grid
                          omf-5.4 load -t my_Own_Topology --outpath ./ --outprefix my_Own_Prefix
      

      Two important arguments are TOPOLOGY describing the set of nodes one wishes to image , and !IMAGE specifying the name of the image one wants to load the nodes with. If the imaging process does not does not finish within the default timeout period, that period can be increase by using the -o flag (e.g. -o 1600). Typical command to load both nodes of sandbox 1 with the baseline image would look like:

      Example: omf load-i baseline.ndz -t node1-1

      username@console.sb3:~$ omf load -i baseline.ndz -t node1-1
      
      DEBUG FQDN:console.sb3.orbit-lab.org:
       INFO NodeHandler: OMF Experiment Controller 5.4 (git 861d645)
       INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
       INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
       INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
       INFO NodeHandler: Add domain http - http://external1.orbit-lab.org:5054/
       INFO NodeHandler: Slice ID: pxe_slice
       INFO NodeHandler: Experiment ID: pxe_slice-2018-08-08t13.41.37.814-04.00
       INFO NodeHandler: Message authentication is disabled
       INFO Experiment: load system:exp:stdlib
       INFO property.resetDelay: resetDelay = 230 (Fixnum)
       INFO property.resetTries: resetTries = 1 (Fixnum)
       INFO Experiment: load system:exp:eventlib
       INFO Experiment: load system:exp:winlib
       INFO Experiment: load system:exp:imageNode
       INFO property.nodes: nodes = "node1-1" (String)
       INFO property.image: image = "baseline.ndz" (String)
       INFO property.domain: domain = "sb3.orbit-lab.org" (String)
       INFO property.outpath: outpath = "/tmp" (String)
       INFO property.outprefix: outprefix = "pxe_slice-2018-08-08t13.41.37.814-04.00" (String)
       INFO property.timeout: timeout = 800 (Fixnum)
       INFO property.resize: resize = nil (NilClass)
       INFO Topology: Loaded topology 'system:topo:registered'.
       INFO property.resetDelay: resetDelay = 100 (Fixnum)
       INFO Experiment: Resetting resources
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [0 sec.]
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [10 sec.]
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [20 sec.]
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [30 sec.]
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [40 sec.]
       INFO stdlib: Waiting for nodes (Up/Down/Total): 0/1/1 - (still down: node1-1.sb3.orbit-lab.org) [50 sec.]
       INFO exp: Progress(0/0/1): 0/0/0 min(node1-1.sb3.orbit-lab.org)/avg/max (59) - Timeout: 790 sec.
       INFO ALL_UP: Event triggered. Starting the associated tasks.
       INFO BRING_UP: Event triggered. Starting the associated tasks.
       INFO Experiment: Bringing up resources
       INFO exp: Progress(0/0/1): 50/50/50 min(node1-1.sb3.orbit-lab.org)/avg/max (59) - Timeout: 780 sec.
       INFO exp: Progress(0/0/1): 80/80/80 min(node1-1.sb3.orbit-lab.org)/avg/max (59) - Timeout: 770 sec.
       INFO exp: Progress(1/0/1): 100/100/100 min()/avg/max (59) - Timeout: 760 sec.
       INFO exp:  -----------------------------
       INFO exp:  Imaging Process Done
       INFO exp:  1 node successfully imaged - Topology saved in '/tmp/pxe_slice-2018-08-08t13.41.37.814-04.00-topo-success.rb'
       INFO exp:  -----------------------------
       INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
       INFO NodeHandler:
       INFO NodeHandler: Shutting down experiment, please wait...
       INFO NodeHandler:
       INFO NodeHandler: Shutdown flag is set - Turning Off the resources
       INFO run: Experiment pxe_slice-2018-08-08t13.41.37.814-04.00 finished after 1:44
      
      

      If the node is in the NOT REGISTERED state, you may need to wait for it to recover the POWEROFF state (it some times requires a few moments for the services to sync up). If the node takes more than 60 seconds to come out of the NODE NOT AVAILABLE state please report it to an administrator.
  1. Turn the nodes on: "omf tell -a on -t all"

    Turn the Nodes ON

    To turn the nodes on use omf tell command:

    omf tell

    OMF command to control the power state/reset the nodes.

    Usage: omf tell

    user@console:omf tell
    Switch ON/OFF and reboot the nodes in a testbed
    Usage:
          omf tell [-h] -t TOPOLOGY -a ACTION [-c AGGREGATE]
     
          With: 
          -h, --help           print this help message
     
          -a, --action ACTION  specify an action
          ACTION:
          on              turn node(s) ON
          offs            turn node(s) OFF (soft)
          offh            turn node(s) OFF (hard)
          reboot          reboots node(s) (soft)
          reset           resets node(s) (hard)
     
          -h, --help                print this help message
          -t, --topology TOPOLOGY   a valid topology file or description (MANDATORY)
          -c, --config AGGREGATE    use testbed AGGREGATE
     
          Some Examples: 
                        omf tell -a reset -t node1-1.grid.orbit-lab.org
                        omf tell -a on -t system:topo:all -c grid
                        omf tell -a reboot -t node1-1
                        omf tell -a offh -t [1..2,1..5]
                        omf tell -a offh -t system:topo:all
                        omf tell -a reset -t system:topo:imaged
    

    The commands are: on, offh (equivalent to pulling out the power cord), offs (software shutdown), reboot (software reboot) and reset (hardware reset).

    Example: turn off node1-1 on the outdoor domain

    user@console.outdoor:~# omf tell -a offh -t node1-1
    
     INFO NodeHandler: OMF Experiment Controller 5.4 (git 3fb37b9)
     INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
     INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
     INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
     INFO NodeHandler: Slice ID: default_slice (default)
     INFO NodeHandler: Experiment ID: default_slice-2014-09-30t00.24.28.504-04.00
     INFO NodeHandler: Message authentication is disabled
     INFO Experiment: load system:exp:stdlib
     INFO property.resetDelay: resetDelay = 230 (Fixnum)
     INFO property.resetTries: resetTries = 1 (Fixnum)
     INFO Experiment: load system:exp:eventlib
     INFO Experiment: load system:exp:winlib
     INFO Experiment: load system:exp:tell
     INFO property.nodes: nodes = "node1-1" (String)
     INFO property.command: command = "offh" (String)
    
    Talking to the CMC service, please wait
    -----------------------------------------------
     Node: node1-1.outdoor.orbit-lab.org   	 Reply: OK
    -----------------------------------------------
    
     INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
     INFO NodeHandler: 
     INFO NodeHandler: Shutting down experiment, please wait...
     INFO NodeHandler: 
     INFO run: Experiment default_slice-2014-09-30t00.24.28.504-04.00 finished after 0:10
    

  1. 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"

    omf exec

    Usage: omf exec

    user@console: omf exec
    
    OMF Experiment Controller 5.4 (git 9ac2ff9)
    
    Execute an experiment script
    
    Usage:  exec [OPTIONS] ExperimentName [-- EXP_OPTIONS]
    
    	ExperimentName is the filename of the experiment script
    	[EXP_OPTIONS] are any options defined in the experiment script
    	[OPTIONS] are any of the following:
    
        -a, --allow-missing              Continue experiment even if some nodes did not check in
        -C, --configfile FILE            File containing local configuration parameters
        -c, --config NAME                Configuration section from the config file ('default' if omitted)
        -d, --debug                      Operate in debug mode
        -i, --interactive                Run the experiment controller in interactive mode
        -l, --libraries LIST             Comma separated list of libraries to load (defaults to [system:exp:stdlib,system:exp:eventlib])
            --log FILE                   File containing logging configuration information
        -m, --message MESSAGE            Message to add to experiment trace
        -n, --just-print                 Print the commands that would be executed, but do not execute them
        -p, --print URI                  Print to the console the content of the experiment resource URI
        -o, --output-result FILE         File to write final state information to
        -e, --experiment-id EXPID        Set the ID for this experiment, instead of the default standard ID
        -O, --output-app                 Display STDOUT & STDERR output from the executed applications
        -r, --reset                      If set, then reset (reboot) the nodes before the experiment
        -S, --slice NAME                 Name of the Slice where this EC should operate
        -s, --shutdown                   If set, then shut down resources at the end of an experiment
        -t, --tags TAGS                  Comma separated list of tags to add to experiment trace
            --oml-uri URI                The URI to the OML server for this experiment
        -x, --extra-libs LIST            Comma separated list of libraries to load in addition to [system:exp:stdlib,system:exp:eventlib]
            --slave-mode EXPID           Run in slave mode in disconnected experiment, EXPID is the exp. ID
            --slave-mode-resource NAME   When in slave mode, NAME is the HRN of the resource for this EC
        -h, --help                       Show this message
        -v, --version                    Show the version
    

  1. Analyze the results

While, most of the experiments follow the presented structure, for this specific tutorial some simplifications have been applied.

From now on, the following assumptions are considered:

  • You will be working with resources belonging to the Orbid grid.
  • You have been assigned a group number, username and password.

While 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 (i.e. sb4, sb9, etc.).

First of all, log in into the grid console using SSH:

ssh username@console.grid.orbit-lab.org

For simplicity, open 3 different consoles on your laptop and access the grid's console with all of them; you will need them in the continuation of the exercise. From the console we will start loading the Mobilityfirst image into the four nodes that have been assigned to you:

omf load -i 'mf-release-latest.ndz' -t system:topo:mf-groupX

system:topo:mf-groupX represents the topology of 4 nodes that has been assigned to you're group and mf-groupX has to be replaced by the group id assigned to you.

For example, mf-group1 will load the image on nodes 'node20-20,node20-19,node19-19,node19-20'

If at the end of the execution, the final output of your console looks similar to:

INFO exp:  ----------------------------- 
 INFO exp:  Imaging Process Done 
 INFO exp:  4 nodes successfully imaged - Topology saved in '/tmp/pxe_slice-2014-10-15t02.10.16.594-04.00-topo-success.rb'
 INFO exp:  ----------------------------- 
 INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
 INFO NodeHandler: 
 INFO NodeHandler: Shutting down experiment, please wait...
 INFO NodeHandler: 
 INFO NodeHandler: Shutdown flag is set - Turning Off the resources
 INFO run: Experiment pxe_slice-2014-10-15t02.10.16.594-04.00 finished after 1:50

your nodes have been imaged correctly.

Deploy Network

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.

We will first introduce the main details of the scripts that will be run and then we will step to the execution process itself.

Software Component Specification

The following snippet shows the specification of the MobilityFirst components along with the required arguments:

#Application definition of a MobilityFirst access router
defApplication('MF-Router', 'router') {|app|
    app.shortDescription = "Click-based MobilityFirst Access Router"
    app.path = "/usr/local/src/mobilityfirst/eval/orbit/tutorial/scripts/ARWrapper.sh" 
    # click options
    app.defProperty('num_threads', 'number of threads', "-t",{:type => :integer, :mandatory => true, :default => 4, :order => 1})
    app.defProperty('ctrl_port', 'port for Click control socket', "-c",{:type => :integer, :order => 2})
    # click config file 
    app.defProperty('config_file', 'Click configuration file', "-C",{:type => :string,:mandatory=> true})
    # keyword parameters used in click config file
    app.defProperty('my_GUID', 'router GUID', "-m",{:type => :string, :mandatory => true})
    app.defProperty('topo_file', 'path to topology file', "-f",{:type => :string, :mandatory => true})
    app.defProperty('core_dev', 'core network interface', "-d",{:type => :string,:mandatory => true})
    app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "-s",{:type => :string,:mandatory => true})
    app.defProperty('GNRS_server_port', 'Port of GNRS server', "-p",{:type => :string,:mandatory => true})
    app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "-i",{:type => :string,:default => "0.0.0.0"})
    app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "-P",{:type => :string,:default => "10001"})
    app.defProperty('edge_dev', 'edge network interface', "-D",{:type => :string,:mandatory => true})
    app.defProperty('edge_dev_ip', 'IP assigned to edge interface', "-I",{:type => :string,:mandatory => true})
}

#Application definition of a GNRS server
defApplication('MF-GNRS', 'gnrs') {|app|
    app.shortDescription = "GNRS Server"
    app.path = "/usr/local/src/mobilityfirst/eval/orbit/tutorial/scripts/GNRSWrapper.sh" 
    app.defProperty('log4j_config_file', 'log 4j configuration file', "-d",{:type => :string, :order => 1})
    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})
    app.defProperty('config_file', 'server configuration file', "-c",{:type => :string, :mandatory=> true, :order => 3})
}

#Application definition of the client network protocol stack
defApplication('MF-HostStack', 'hoststack') {|app|
    app.shortDescription = "MF host network stack"
    app.path = "/usr/local/bin/mfstack" 
    app.defProperty('log_level', 'log level', nil,{:type => :string, :mandatory => true, :order => 1, :default => "-e"}) # default is 'error'
    app.defProperty('config_file', 'stack configuration file', nil,{:type => :string, :mandatory => true, :order => 2})
}

A few considerations on the defined applications:

  • As seen above, the router is configured with both 'core' and 'edge' interfaces. Different router configurations are available depending on the required functionality. In this case we use what we call a MobilityFirst Access Router, which has the particularity of having the core interfaces connected towards the core of the network, while the edge interface enables hosts to connect and access the MobilityFirst network.
  • For this basic setup, the GNRS has been configured to be running as a single instance, but in a larger experiment, it is designed to be a distributed system deployed at different locations.
  • Most of the client settings are located in a configuration file pre-loaded on the Orbit image.

Setting up the Software Node Groups

The following shows how the node groups for the routers are setup in the OMF control scripts. Node groups allows experimenters to use single statements to set configuration (e.g. network interfaces) and execute commands across all nodes in the group.

#Create router groups
for i in 1..num_routers
        #Create a topology with a single router in it
    defTopology("topo:router_#{i}") { |t|
        aNode = routersTopo.getNodeByIndex(i-1)
        t.addNode(aNode)
        info aNode, " assigned role of router with GUID: #{i}"
    }
  
        #Through the group definition we set up the applications to run
    defGroup("router_#{i}", "topo:router_#{i}") {|node|
        node.addApplication('MF-Router') {|app|
            app.setProperty('num_threads', router_threads)
            app.setProperty('config_file', click_conf)
            app.setProperty('my_GUID', router_guid[i-1])
            app.setProperty('topo_file', rtr_topo_file)
            app.setProperty('core_dev', core_dev)
            app.setProperty('GNRS_server_ip', GNRS_server_ip)
            app.setProperty('GNRS_server_port', GNRS_server_port)
            app.setProperty('GNRS_listen_ip', "192.168.100.#{i}")
            app.setProperty('GNRS_listen_port', GNRS_listen_port)
            app.setProperty('edge_dev', edge_dev)
            app.setProperty('edge_dev_ip', router_ether_if_ip[i-1])
        }

      #If it is the first router add the GNRS
      if i == 1
                aNode = routersTopo.getNodeByIndex(i-1)
                info aNode, " will also host the GNRS server"
        node.addApplication('MF-GNRS') {|app|
              app.setProperty('log4j_config_file', GNRS_log_file)
              app.setProperty('jar_file', GNRS_jar_file)
              app.setProperty('config_file', GNRS_conf_file)
        }
      end
    
          #Setup the node interfaces
          #The first ethernet interface is used as the core interface
      node.net.e0.ip = "192.168.100.#{i}"
      node.net.e0.netmask = '255.255.255.0'
    
          #The first wireless interface is used to give access to clients
          node.net.w0.mode = "adhoc"
          node.net.w0.type = 'g'
          node.net.w0.channel = "11"
          node.net.w0.essid = "SSID_group_#{i}"
          node.net.w0.ip = "192.168.#{i}.1"
    }
end

#Create host groups
for i in 1..num_hosts
        #Create a topology with a single router in it
    defTopology("topo:host_#{i}") { |t|
        aNode = hostsTopo.getNodeByIndex(i-1)
        t.addNode(aNode)
        info aNode, " assigned role of client with GUID: #{100 + i}"
    }
  
        #Through the group definition we set up the applications to run
    defGroup("host_#{i}", "topo:host_#{i}") {|node|
        node.addApplication('MF-HostStack') {|app|
            app.setProperty('config_file', hoststack_conf_file[i-1])
            app.setProperty('log_level', log_level)
        }
    
          #The first wifi interface is used to connect to the Access Router
          node.net.w0.mode = "adhoc"
          node.net.w0.type = 'g'
          node.net.w0.channel = "11"
          node.net.w0.essid = "SSID_group_#{i}"
          node.net.w0.ip = "192.168.#{i}.2"
      }
end

As can be seen above, properties which were defined in the MF-Router, MF-GNRS and MF-HostStack applications have been set here. Moreover, node interfaces have been set up, and IP addresses have been assigned to them. As we discussed earlier the router is configured with both edge and core interfaces. The ethernet interface is used to connect to the core of the network, and the wireless interface is for connection to the clients. On the other side, the client is equipped with wifi interface to connect to the access router.

Execute

Starting the MobilityFirst Components

The following snippet shows the starting of the router software and the gnrs servers on the two router nodes:

    onEvent(:ALL_UP_AND_INSTALLED) do |event|
    
    info "This is my first MobilityFirst experiment"

    info "Initializing resources"
    # clean up and initialize networking for routers
    for i in 1..num_routers
        # click router cleanup 
        group("router_#{i}").exec("killall -9 click")
        # gnrsd cleanup 
        group("router_#{i}").exec("killall -9 java")
    end

    #clean up and initialize networking for hosts
    for i in 1..num_hosts
        group("host_#{i}").exec("killall -9 mfstack")
    end
    wait 20
    
    # bring up routers (along with gnrs servers)
    info "Bringing up routers..."
    for i in 1..num_routers
        group("router_#{i}").startApplications
    end
    wait 5

    info "Bringing up host stacks..."
    for i in 1..num_hosts
        group("host_#{i}").startApplications
    end
    
    info "Access the nodes to run a program"

    wait 10000

    Experiment.done
    end

To make sure, our experiment will not conflict with any prior running processes on the node groups, killall command is used to terminate all processes associated with routers, GNRS and host stack. After waiting for a reasonable time, first the routers are brought up and we start the applications on them, and then the hosts are brought up, starting the applications on them.

Executing the script

First of all you will first need to turn your assigned nodes on:

    omf tell -a on -t system:topo:imaged

In order to execute the just described script, download it to your console home folder copying and pasting the following command:

    wget www.winlab.rutgers.edu/~bronzino/downloads/orbit/exercise1.rb

Once the file has been downloaded, execute it with the following command:

    omf exec exercise1.rb

The obtained output should resamble the follwoing snippet:

   
 INFO NodeHandler: OMF Experiment Controller 5.4 (git 3fb37b9)
 INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
 INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
 INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
 INFO NodeHandler: Slice ID: default_slice (default)
 INFO NodeHandler: Experiment ID: default_slice-2014-10-15t02.12.19.869-04.00
 INFO NodeHandler: Message authentication is disabled
 INFO Experiment: load system:exp:stdlib
 INFO property.resetDelay: resetDelay = 230 (Fixnum)
 INFO property.resetTries: resetTries = 1 (Fixnum)
 INFO Experiment: load system:exp:eventlib
 INFO Experiment: load system:exp:winlib
 INFO Experiment: load exercise1.rb
 INFO Topology: Loaded topology '/tmp/pxe_slice-2014-10-15t02.10.16.594-04.00-topo-success'.
 INFO Topology: Loaded topology 'system:topo:imaged'.
 INFO exp: node1-1.grid.orbit-lab.org assigned role of router with GUID: 1
 INFO exp: node1-1.grid.orbit-lab.org will also host the GNRS server
 INFO exp: node1-2.grid.orbit-lab.org assigned role of router with GUID: 2
 INFO exp: node2-1.grid.orbit-lab.org assigned role of client with GUID: 101
 INFO exp: node2-2.grid.orbit-lab.org assigned role of client with GUID: 102
 INFO exp: Definition of resources completed
 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.]
 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.]
 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.]
 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.]
 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.]
 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.]
 INFO node2-2.grid.orbit-lab.org: Device 'net/w0' reported Not-Associated
 INFO node1-2.grid.orbit-lab.org: Device 'net/w0' reported Not-Associated
 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.]
 INFO node2-2.grid.orbit-lab.org: Device 'net/w0' reported 76:01:22:6E:DB:FD
 INFO ALL_UP: Event triggered. Starting the associated tasks.
 INFO exp: This is my first MobilityFirst experiment
 INFO exp: Initializing resources
 INFO exp: Request from Experiment Script: Wait for 20s....
 INFO node1-2.grid.orbit-lab.org: Device 'net/w0' reported 76:5D:54:9F:2E:AE
 INFO node2-1.grid.orbit-lab.org: Device 'net/w0' reported 76:01:22:6E:DB:FD
 INFO node1-1.grid.orbit-lab.org: Device 'net/w0' reported 76:5D:54:9F:2E:AE
 INFO exp: Bringing up routers...
 INFO exp: Request from Experiment Script: Wait for 5s....
 INFO exp: Bringing up host stacks...
 INFO exp: Access the nodes to run a program
 INFO exp: Request from Experiment Script: Wait for 10000s....

A few comments on the obtained output:

  • The experiment ID can be seen on one of the first lines, it will be useful for using OML to retrieve the output for OML-enabled experiments. (this experiment does not have any outputs.)
  • The GUIDs assigned to the nodes can be seen. The routers (nodes1-1 and 1-2 on the grid) have GUID 1 and 2, and the hosts (nodes2-1 and 2-2 on the grid) have GUID 101 and 102. Since we have a simple topology in this experiment, only a single instance of GNRS server is running, which as shown above is hosted by router with GUID 1.

Test The Network

Once 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. In order to access a running Orbit node ssh into it as follow:

ssh root@nodex-y

Where x-y has to be replaced by the actual numbers identifying the node.

Once logged in, run the mfping 'server' specifying the application GUID:

mfping -s -m 102 -o 101

where "-s" specifies that the host is running as server, "-m" specifies the source guid and "-o" the destination one

To run the mfping 'client'

mfping -c -m 101 -o 102 -n 10

Where "-c" specifies the client is running and "-n" specifies the number of pings between the two nodes. If successfully executed, the client will display some information similar to the following snippet

root@node1-1:~# mfping -c -m 101 -o 102 -n 10
64 bytes received: seq_n=0, time=25.1470 msec
64 bytes received: seq_n=1, time=23.7070 msec
64 bytes received: seq_n=2, time=20.0559 msec
64 bytes received: seq_n=3, time=24.0371 msec
64 bytes received: seq_n=4, time=23.1831 msec
64 bytes received: seq_n=5, time=20.3069 msec
64 bytes received: seq_n=6, time=24.1379 msec
64 bytes received: seq_n=7, time=19.6230 msec
64 bytes received: seq_n=8, time=20.3931 msec
64 bytes received: seq_n=9, time=20.2239 msec

Finish

Once the application has successfully completed its task, interrupt the experiment from the orbit console, using the Ctrl-C key combination.

References

For more information regarding the MobilityFirst project, visit the project page: http://mobilityfirst.winlab.rutgers.edu/

For more information regarding the prototype design and updated status, visit the wiki page: https://mobilityfirst.orbit-lab.org/

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.