Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Newpage

Newpage

How to send and store your own data in Emulab

This page introduces how to send data to a central machine with OML, which is developed by Winlab at Rutgers University. OML is composed of oml-server and oml-client. In an experiment, oml-clients are instanced to send measurement data to oml-server. Oml-server is responsible for receving data from oml-clients and store into a database(*.sq3).

To help users to send data distributed at experimental machines to a central machine, Emulab uses OML to provide such a service. We have done some efforts to facilitate users to use OML in Emulab.

The steps to use OML in Emulab is as following.

1. Define the name of the machine to run omlserver in ns files.

  tb-set-oml-server <servername>

usage:

It defines the name for the omlserver. This command will allocate another machine from Emulab to run omlserver process. Users can choose to use control network to transfer data to omlserver, which is the way we suggest. Users can also specify to use a new lan between omlserver and experimental nodes, by specify 0 to tb-set-oml-control-transfer. But it will take one Ethernet interface of each participated machine to do that.

For example:

tb-set-oml-server omlserver

2. Define measurement points in ns files.

  tb-set-oml-mp <mp_name> (<metric_id> <metric_type>)+

usage:

It defines a new measurement point. A measurement point is a set of data, which has the same set of properties or metrics. The first parameter defines the name for this measurement point. The following pairs define pairs of <id,type> for metrics in this measurement point. You can define metrics as many as you want.

For example:

tb-set-oml-mp udp ip_str string ip_des string port_src int port_des int

3. Use the functions to send data to omlserver.

3.1 After the experiment is swapped in, you will find two files generated for you: MP.c and MP.h, at /proj/pid/exp/eid at ops.emulab.net.

(eg. /proj/utahstud/exp/emulab)

3.2 Copy your source code to omlserver. Include MP.h in your applications and call initialize_oml() before you call other oml functions.The suggested place is to call this function immediately after main().

3.3 Call functions in your source codes where you have the corresponding data.

For example:

...
char* ip_src = pkt->get_src_ip();
char* ip_des = pkt->get_des_ip();
int port_src = pkt->get_src_port();
int port_des = pkt->get_des_port(); 
oml_udp(ip_src,ip_des, port_src, port_des); 
...

4. Compile your source code against oml library at omlserver.

For example:

  gcc -o app app.c MP.h MP.c -loml2 

That's all you need to do. You will find a database file, named as exp_id.sq3 at /tmp/ at omlserver, which contains data your application sends.

External links:

http://omf.mytestbed.net/wiki/oml/

http://www.orbit-lab.org/wiki/Documentation/OML