Simple OMF Example

1.Basics

This simple example introduces you to OMF6. It presents all the basic steps to develop, run, and access the results of an experiment executed with OMF 6.

Experiment Senario

This simple experiment involves a single resource, which has an active network interface. In this experiment, we will instruct that resource to start an instance of the ‘ping-oml2’ application to probe another host on the network attached to that interface (e.g. another host in the Internet, the LAN, or the resource’s itself).

The ‘ping-oml2’ application is a wrapper around the traditional ping application. It captures the ping outputs and sends them as measurement streams to an OML2 collection point (an OML2 server in this case), which then stores them in a database available to the experimenter.

2.Prerequisties

Accessing/Provisioning Resources*

Accessing a Resource at NITOS

Firstly, you have to reserve a node at NITOS: 2.Getting a Slice and Reserving Resources

Provisioning a Resource at NITOS

You can use the method described in 1.Loading an image for instructions on how to load disk images on resources at NITOS. Load your resource with a disk image that contains OMF6 RC. For example load the image “baseline_omf6.ndz”. More baseline images available here.

3.Developing the Experiment

In order to run an experiment using OMF, you first need to describe it with an Experiment Description (ED). An ED is a file/script that is supplied as an input to the Experiment Controller (EC). It contains a detailed description of the resources involved in the experiment and the sets of actions to perform in order to realize that experiment. An ED is written using the OMF Experiment Description Language (OEDL).

The ED for our experiment:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# 1. Define an OMF Application Definition for the ping-oml2 application
# The OMF entities are using this definition to know where to find the
# application, what are its configurable parameters, and what are the
# OML2 measurement points that it provides.
# This ping-oml2 application will be known by OMF entities as 'ping_oml2'
#
defApplication('ping_oml2') do |app|
  app.description = 'Simple Definition for the ping-oml2 application'
  # Define the path to the binary executable for this application
  app.binary_path = '/usr/bin/ping-oml2'
  # Define the configurable parameters for this application
  # For example if target is set to foo.com and count is set to 2, then the
  # application will be started with the command line:
  # /usr/bin/ping-oml2 -a foo.com -c 2
  app.defProperty('target', 'Address to ping', '', {:type => :string})
  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
  # Define the OML2 measurement point that this application provides.
  # Here we have only one measurement point (MP) named 'ping'. Each measurement
  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
  app.defMeasurement('ping') do |m|
    m.defMetric('dest_addr',:string)
    m.defMetric('ttl',:uint32)
    m.defMetric('rtt',:double)
    m.defMetric('rtt_unit',:string)
  end
end

# 2. Define a group of resources which will run the ping-oml2 application
# Here we define only one group (Sender), which has only one resource in it
# (omf.nicta.node8)
#
defGroup('Sender', 'node016') do |g|
  # Associate the application ping_oml2 defined above to each resources
  # in this group
  g.addApplication("ping_oml2") do |app|
    # Configure the parameters for the ping_oml2 application
    app.setProperty('target', '8.8.8.8')
    app.setProperty('count', 3)
    # Request the ping_oml2 application to collect measurement samples
    # from the 'ping' measuremnt point (as defined above), and send them
    # to an OML2 collection point
    app.measure('ping', :samples => 1)
  end
end

# 3. Define the sequence of tasks to perform when the event
# "all resources are up and all applications are install" is being triggered
#
onEvent(:ALL_UP_AND_INSTALLED) do |event|
  # Print some information message
  info "This is my first OMF experiment"
  # Start all the Applications associated to all the Groups
  allGroups.startApplications
  # Wait for 5 sec
  # Stop all the Applications associated to all the Groups
  after 15 do
    allGroups.stopApplications
   end
  # Tell the Experiment Controller to terminate the experiment now
  after 10 do
    Experiment.done
  end
end

You can see here more about (OMF6-OEDL)

4.Running Experiment

a) How do you run it?

To run your experiment you have to:

  • save its description in a file in NITOS server, thus either
    • cut-and-paste the above ED listing into a new file named ‘tutorial000.rb’
    • download the ED directly: ED_script
  • open a terminal in NITOS and navigate to the folder/directory where you saved that file

  • start the EC software and tell it to execute the experiment described in your ED file, using the command line:

    omf_ec -u xmpp://usr:pwd@my_xmpp.com exec --oml_uri tcp:srv:port tutorial000.rb
    
  • So for our example, xmpp server and OML server run at nitlab.inf.uth.gr. Then you would use the command:

    omf_ec -u xmpp://nitlab.inf.uth.gr exec --oml_uri tcp:nitlab.inf.uth.gr:3003 tutorial000.rb
    

Note

There is one XMPP server deployed in each of the NITOS testbeds. Although, you can use the nitlab.inf.uth.gr for the whole NITOS Facility, even if you are using nodes from nitlab2.inf.uth.gr or nitlab3.inf.uth.gr. In case you want to use another domain as your XMPP server, you should also configure accordingly the yaml file of the OMF RC of each of the involved nodes.

If you would like to know more about the other options of the OMF EC software please run the commands:

omf_ec help
omf_ec help exec

b) What will happen next?

When running the EC with the above command, you should see an output similar to this :

OMF Experiment Controller - Copyright (c) 2012-13 National ICT Australia Limited (NICTA)
{:type=>:xml, :authenticate=>nil}
21:27:18 INFO  XMPP::Communicator: Connecting to 'nitlab.inf.uth.gr' ...
INFO OML4R Client 2.10.4 [OMSPv4; Ruby 1.9.3] Copyright 2009-2014, NICTA
INFO Collection URI is tcp:nitlab.inf.uth.gr:3003
21:27:20 INFO  XMPP::Communicator: Connected
21:27:20 INFO  Object: OMF Experiment Controller 6.1.1 - Start
21:27:20 INFO  Object: Connected using {:proto=>:xmpp, :user=>simos-aspire-5739g-2891, :domain=>nitlab.inf.uth.gr}
21:27:20 INFO  Object: Execute: /home/simos/Eidiko/tutorial000.rb
21:27:20 INFO  Object: Properties: {}
21:27:20 INFO  OmfEc::Experiment: Experiment: 2014-05-28T18:27:18.121Z starts
21:27:20 INFO  OmfEc::Experiment: Configure 'node016' to join 'Sender'
21:27:20 INFO  OmfEc::Experiment: Newly discovered resource >> xmpp://node016@nitlab.inf.uth.gr
21:27:20 INFO  OmfEc::Experiment: Event triggered: 'ALL_NODES_UP, ALL_UP'
21:27:20 INFO  OmfEc::Experiment: Config xmpp://node016@nitlab.inf.uth.gr to join Sender
21:27:21 INFO  OmfEc::Experiment: Newly discovered resource >> xmpp://4980cefe-0117-442f-b743-49e57614fbcf@nitlab.inf.uth.gr
21:27:21 INFO  OmfEc::Experiment: Event triggered: 'ALL_UP_AND_INSTALLED'
21:27:21 INFO  Object: This is my first OMF experiment-simos
21:27:21 INFO  OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - msg: env -i /usr/bin/ping-oml2  8.8.8.8 -c 3 --oml-config tmp/4980cefe-0117-442f-b743-49e57614fbcf-1401301641.xml
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg:  INFO ping-oml2: V2.10.4
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg: INFO  OML4R Client 2.10.4 [OMSPv4; Ruby 1.9.3] Copyright2009-2014, NICTA
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg: INFO  Collection URI is tcp:nitlab.inf.uth.gr:3003
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=1 ttl=45 time=58.6 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=3 ttl=45 time=58.7 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=2 ttl=45 time=58.6 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg:
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: --- 8.8.8.8 ping statistics ---
21:27:25 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 3 packets transmitted, 3 received, 0% packet loss, time 2002ms
21:27:25 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: rtt min/avg/max/mdev = 58.657/58.676/58.712/0.199 ms
21:27:25 INFO  OmfEc: APP_EVENT EXIT from app ping_oml2_cxt_0 - msg: 0
21:27:31 INFO  OmfEc::Experiment: Experiment: 2014-05-28T18:27:18.121Z finished
21:27:31 INFO  OmfEc::Experiment: Release applications and network interfaces
21:27:31 INFO  OmfEc::Experiment: Exit in 15 seconds...
21:27:45 INFO  OmfEc::Experiment: OMF Experiment Controller 6.1.1 - Exit.
21:27:46 INFO  XMPP::Communicator: Disconnecting...

c) What does that screen output mean?

First the EC provides us with some information about the parameters of this experiment:

OMF Experiment Controller - Copyright (c) 2012-13 National ICT Australia Limited (NICTA)
{:type=>:xml, :authenticate=>nil}
21:27:18 INFO  XMPP::Communicator: Connecting to 'nitlab.inf.uth.gr' ...
INFO OML4R Client 2.10.4 [OMSPv4; Ruby 1.9.3] Copyright 2009-2014, NICTA
INFO Collection URI is tcp:nitlab.inf.uth.gr:3003
21:27:20 INFO  XMPP::Communicator: Connected
21:27:20 INFO  Object: OMF Experiment Controller 6.1.1 - Start
21:27:20 INFO  Object: Connected using {:proto=>:xmpp, :user=>"simos-aspire-5739g-2891", :domain=>"nitlab.inf.uth.gr"}
21:27:20 INFO  Object: Execute: /home/simos/Eidiko/tutorial000.rb
21:27:20 INFO  Object: Properties: {}
21:27:20 INFO  OmfEc::Experiment: Experiment: 2014-05-28T18:27:18.121Z starts
21:27:20 INFO  OmfEc::Experiment: Configure 'node016' to join 'Sender'

It provides us some feedback about its communication with the xmpp server and other OMF entities.It also informs us when a defined event has been triggered:

21:27:20 INFO  OmfEc::Experiment: Newly discovered resource >> xmpp://node016@nitlab.inf.uth.gr
21:27:20 INFO  OmfEc::Experiment: Event triggered: 'ALL_NODES_UP, ALL_UP'
21:27:20 INFO  OmfEc::Experiment: Config xmpp://node016@nitlab.inf.uth.gr to join Sender
21:27:21 INFO  OmfEc::Experiment: Newly discovered resource >> xmpp://4980cefe-0117-442f-b743-49e57614fbcf@nitlab.inf.uth.gr
...
21:27:46 INFO  XMPP::Communicator: Disconnecting...

Finally, when an event is triggered (such as ALL_UP_AND_INSTALLED), it informs us about the tasks executed for that event, and their results/outputs:

21:27:21 INFO  OmfEc::Experiment: Event triggered: 'ALL_UP_AND_INSTALLED'
21:27:21 INFO  Object: This is my first OMF experiment-simos
21:27:21 INFO  OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - msg: env -i /usr/bin/ping-oml2  8.8.8.8 -c 3 --oml-config tmp/4980cefe-0117-442f-b743-49e57614fbcf-1401301641.xml
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg:  INFO ping-oml2: V2.10.4
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg: INFO  OML4R Client 2.10.4 [OMSPv4; Ruby 1.9.3] Copyright 2009-2014, NICTA
21:27:21 INFO  OmfEc: APP_EVENT STDERR from app ping_oml2_cxt_0 - msg: INFO  Collection URI is tcp:nitlab.inf.uth.gr:3003
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=1 ttl=45 time=58.6 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=3 ttl=45 time=58.7 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=2 ttl=45 time=58.6 ms
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg:
21:27:24 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: --- 8.8.8.8 ping statistics ---
21:27:25 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: 3 packets transmitted, 3 received, 0% packet loss, time 2002ms
21:27:25 INFO  OmfEc: APP_EVENT STDOUT from app ping_oml2_cxt_0 - msg: rtt min/avg/max/mdev = 58.657/58.676/58.712/0.199 ms
21:27:25 INFO  OmfEc: APP_EVENT EXIT from app ping_oml2_cxt_0 - msg: 0
21:27:31 INFO  OmfEc::Experiment: Experiment: 2014-05-28T18:27:18.121Z finished
21:27:31 INFO  OmfEc::Experiment: Release applications and network interfaces
21:27:31 INFO  OmfEc::Experiment: Exit in 15 seconds...
21:27:45 INFO  OmfEc::Experiment: OMF Experiment Controller 6.1.1 - Exit.

5.Accesing Results

You can access your results here More information about accessing the results of your experiment: Accessing the measurements gathered from your OMF experiment