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


Ignore:
Timestamp:
Sep 25, 2014, 6:21:42 PM (10 years ago)
Author:
seskar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/oMF/tut1

    v1 v1  
     1== Exercise 1: Simple MobilityFirst Network Deployment and Test ==
     2
     3[[TOC(../oMF*)]]
     4
     5=== Objective ===
     6
     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 a end-to-end 'ping' application.
     8
     9=== Topology ===
     10
     11In 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:
     12
     13{{{
     14#!sh
     15Host1 ---- MFR1 ---- MFR2 ---- Host2
     16}}}
     17
     18=== MobilityFirst ORBIT Image ===
     19
     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'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
     25omf load -i 'mf-release-latest.ndz' -t 'node1-1.sb9.orbit-lab.org'
     26}}}
     27
     28where the above assumes you are attempting to image node1-1 in the 'sb9.orbit-lab.org' domain (Sandbox 9). You could also just use 'node1-1' without the domain part - assumed from the console you issue the command from. So for installing the image across 4 nodes - node1-1, node1-2, node1-3, node1-4 - the following can be used:
     29
     30{{{
     31#!sh
     32omf load -i 'mf-release-latest.ndz' -t 'node1-1,node1-2,node1-3,node1-4'
     33}}}
     34
     35The imaging should be done for each node to be used in our network deployment, and can be done in a single shot by providing multiple comma separated hostnames within the '-t' topology argument above.
     36
     37=== Deploy Network ===
     38
     39Software 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
     44Software         mfapi lib     gnrs      gnrs         mfapi lib
     45                 mfstack       click     click        mfstack
     46                                 
     47Topology         Host1 ------- MFR1 ---- MFR2 ------- Host2
     48
     49ORBIT Node       node1-1       node1-2   node1-3      node1-4
     50}}}
     51
     52The entire script is available as part of the tutorial package as orbit/tutorial/scripts/exercise1.rb
     53
     54The following sub-sections dissect the key parts of this script:
     55
     56==== Software Component Specification ====
     57
     58The following snippet shows the specification of the MobilityFirst router along with the required arguments:
     59
     60{{{
     61#!ruby
     62
     63defApplication('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}
     85}}}
     86
     87As seen above, the router is configured with both 'core' and 'edge' interfaces. The core interfaces connect routers towards the core of the network, while the edge interface enables hosts to connect and access the MobilityFirst network.
     88
     89Also seen above is the GNRS service related arguments that specify which server (IP and port) the router should use for in-network name resolution purpose, both for sending requests and to receive responses. By default it will listen on all interfaces and port 10001.
     90
     91==== Setting up the Software Node Groups ====
     92
     93The 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 and execute commands across all nodes in the group.
     94
     95{{{
     96#!ruby
     97for 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        }
     120end
     121}}}
     122
     123==== Configuring the Network Interfaces ====
     124
     125{{{
     126#!ruby
     127    # clean up and initialize networking for routers
     128    for i in 1..num_routers
     129        # click router cleanup
     130        group("router_#{i}").exec("killall -9 click")
     131        # gnrsd cleanup
     132        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                   
     142    #clean up and initialize networking for hosts
     143    for i in 1..num_hosts
     144        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
     154The 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"
     160    for i in 1..num_routers
     161        group("router_#{i}").startApplications
     162    end
     163}}}
     164
     165=== Test The Network ===
     166
     167Once 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.
     168
     169Run the mfping 'server' specifying the application GUID:
     170
     171{{{
     172#!sh
     173mfping -S <my-GUID>
     174}}}
     175
     176To run the mfping 'client'
     177
     178{{{
     179#!sh
     180mfping -C <my-GUID> <server-GUID> -i <interval_secs> -c <count>
     181}}}
     182
     183You should see an out at the client similar to below:
     184
     185{{{
     186#!sh
     187
     188}}}