jolyon white gec9 2 nd november 2010 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
A Tutorial Introduction to OML PowerPoint Presentation
Download Presentation
A Tutorial Introduction to OML

Loading in 2 Seconds...

play fullscreen
1 / 47

A Tutorial Introduction to OML - PowerPoint PPT Presentation


  • 102 Views
  • Uploaded on

Jolyon White GEC9 2 nd November 2010. A Tutorial Introduction to OML. Introduction, Aims. What is OML? The Orbit Measurement Library Most current version: OML v2.4.0 (but v2.5.0 is due out in a few days) A client library (liboml2) for instrumenting your applications; plus

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'A Tutorial Introduction to OML' - noble-myers


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
introduction aims
Introduction, Aims
  • What is OML?
    • The Orbit Measurement Library
    • Most current version: OML v2.4.0
      • (but v2.5.0 is due out in a few days)
    • A client library (liboml2) for instrumenting your applications; plus
    • A measurement server for collecting and storing measurements, remotely.

By the end of this tutorial you should be able to:

  • Understand the OML system architecture
  • Understand how to run OML applications
    • How to configure your app’s measurements
    • How to interpret the stored results
  • How to use OML to instrument your experiment applications
oml the orbit measurement library
OML – the Orbit Measurement Library
  • Open Source, under active development
    • Started at WINLAB, work continuing at NICTA (Sydney)
    • *NIX target (currently Linux, Mac OS X, on i386, amd64, and ARM)
  • Network research generates lots of data
  • Need a way to get data to a central location for storage & analysis
    • Need a better option than local files + scp
  • Main design aim: Hit the “power vs. simplicity” sweet spot:

(Too) Complex

OML

Simple + Powerful

By Design

Robust

Simple

Expensive OAM

Limited

Lots of features

Labour-intensive,

error-prone

oml deployments
OML Deployments

Rutgers University,

New Jersey

Parking Discovery

Rutgers

Marco Gruteser

Deutsche Telekom Labs

@ TU Berlin

BOWL Testbed

National Broadband Network

100Mbs FTTH

VoD Trial

Rail Bridge

Monitoring Sensors

NSW Road Traffic Authority

IREEL

Network Education

Teaching Platform

NICTA, Sydney

separation of concerns
Separation of Concerns
  • Instrumentation
    • Adding measurement points to an application
  • Collection
    • Running an experiment, collecting measurements
  • OML makes a clean distinction between these two activities
  • Application writer and application user might be different people
  • OML supports users to do both activities effectively
  • An application’s measurement collection is configurable at run-time
    • By the experimenter (application user)
oml architecture types
OML Architecture – Types
  • All measured values in OML are typed
    • True for the whole measurement pipeline
  • Supported types:
  • OML_STRING_VALUE is for short strings (<255 bytes)
  • OML_BLOB_VALUE is for long blobs (max ~ 232 bytes)
  • … more types planned (e.g. IP addresses)
  • Numeric:
    • OML_INT32_VALUE
    • OML_UINT32_VALUE
    • OML_INT64_VALUE
    • OML_UINT64_VALUE
    • OML_DOUBLE_VALUE
  • String/arbitrary data:
    • OML_STRING_VALUE
    • OML_BLOB_VALUE
oml architecture measurement points
OML Architecture – Measurement Points
  • Data enters the OML measurement system via a Measurement Point (MP)
    • Group related measurements
  • Each MP has a name to identify it
  • Every time the application wants to record a measurement, it injects a value into the MP
  • “value” == typed tuple with named fields
  • E.g.

MP udp_in = (

ts : OML_DOUBLE_VALUE,

flow_id : OML_INT32_VALUE,

seq_no : OML_UINT32_VALUE,

pkt_length : OML_UINT32_VALUE,

src_host : OML_STRING_VALUE,

src_port : OML_STRING_VALUE )

oml architecture client server
OML Architecture – Client + Server

Measurement points

Filters

Measurement streams

Database tables

OML Server

Database

(SQL)

Application or Service

File

OML client library

oml architecture measurement collection
OML Architecture – Measurement Collection

Application

Application

Application

Application

Experiment Node

Experiment Node

Experiment Node

Measurements

Destination for each stream configured at run time

(XML config file)

OML Server

OML Server

10

so far so good
So far, so good
  • OML’s client/server architecture is simple

but

  • Most complicated part of OML comes from
    • Filtering
    • Measurement streams
    • Schemas
oml architecture filters
OML Architecture – Filters
  • Filters are for:
    • Selection
    • Transformation
  • Filters are executed by liboml2, i.e. within the same process as the application
  • Take input from an MP
    • Can SELECT one field or multiple fields
  • Compute a new value based on the input
    • TRANSFORM to a new value
  • Input can be multiple fields from one MP
  • Output can have multiple fields – tuple
oml architecture filters1
OML Architecture – Filters
  • OML has numerous standard filters built-in
  • Example: averaging filter (avg)
  • Each filter has an output schema
  • Types in the output schema can be either:
    • A specific type (e.g. OML_UINT32_VALUE); or
    • “whatever type you gave me as input”
  • Some filters are picky (e.g. avg only accepts numeric types)

MP udp_in:

ts : DOUBLE

flow_id : INT32

seq_no : UINT32

pkt_length : UINT32

src_host : STRING

src_port : STRING

avg : DOUBLE

max : DOUBLE

min : DOUBLE

avg

oml architecture measurement streams
OML Architecture – Measurement Streams
  • Each filter takes input from one MP
  • Filters are grouped based on destination (more later)
  • A Measurement Stream (MS) groups all the filter outputs from one MP to one destination
  • Each MS has a schema
    • Combination of schema of filter outputs

A

(S, T)

MS Schema

MP (A, B, C)

B

(U, V, W)

(S, T, U, V, W, X, Y)

C

(X, Y)

oml architecture schemas and the db
OML Architecture – Schemas and the DB
  • An OML app declares schemas for each MS to the remote server
    • Handled automatically by liboml2
  • Each application has a name
  • Each MS schema has a name
  • Each schema field has a name and a type
  • Names are derived from:
    • App name
    • MP name
    • MP field name
    • Filter output field name
  • One MS  One database table
oml architecture schemas and the db1
OML Architecture – Schemas and the DB
  • Example: app name is “otr2”
  • Schema:
  • SQL issued to the database:

MP udp_in:

avg : DOUBLE

max : DOUBLE

min : DOUBLE

avg

ts : DOUBLE

flow_id : INT32

seq_no : UINT32

pkt_length : UINT32

src_host : STRING

src_port : STRING

otr2_udp_in : pkt_length_avg:doublepkt_length_max:doublepkt_length_min:double

CREATE TABLE otr2_udp_in ([other stuff], pkt_length_avg REAL,

pkt_length_max REAL,

pkt_length_min REAL);

oml architecture filters again
OML Architecture – Filters (again)
  • Filters operate in either count- or interval-sampling mode
  • Filter can accumulate state over the sampling period
  • Filter generates an output at end of sampling period
  • E.g. 1) every 10 samples
  • E.g. 2) every 3.5 seconds
  • For instance, if count=10, avg filter outputs the average of the last 10 samples, then resets its internal state.
  • See ‘—oml-samples’ and ‘—oml-interval’ command line options
slide18
Collection:

Using and Configuring OML Applications

configuring client applications
Configuring Client Applications
  • Two options
    • Command line
    • XML config file
  • Mandatory configuration items:
    • Node ID (--oml-id) – identify source of a measurement
    • Experiment ID (--oml-exp-id) – group related measurements in one database
    • Destination address (local file name or remote host:port)
      • --oml-file <file_name>
      • --oml-server <hostname>:<port>
  • Experiment ID == Database Name
configuring client applications1
Configuring Client Applications

E1

App1, ID B, E1

App2, ID B, E1

App1, ID A, E2

App3, ID A, E2

App1, ID A, E1

App2, ID A, E1

Node A’

Node B

Node A

E2

OML Server

command line configuration
Command Line Configuration

$ nmetrics_oml2 --oml-id node1 \

--oml-exp-id monitor \

--oml-file cpu.txt \

--cpu --ram

OML

options

Nmetrics

options

$ nmetrics_oml2 --oml-id node1 \

--oml-exp-id monitor \

--oml-server 10.0.0.200:3003

--cpu --ram

sampling policy
Sampling policy
  • Count-based sampling: --oml-samples <n>
  • Interval-based: --oml-interval <seconds>

$ nmetrics_oml2 --oml-id node1 \

--oml-exp-id monitor \

--oml-server 10.0.0.200:3003 \

--oml-interval 2.5

--cpu --ram

sampling policy and filter configuration
Sampling policy and filter configuration
  • Command line config establishes default filters
  • One filter for each field of each MP
  • Default filter type depends on field type:
    • Numeric MP field  Averaging filter
    • Other types (e.g. string)  ‘First’ filter
  • The ‘first’ filter outputs the first value in the sampling period
  • Throws away the rest
  • BUT: for ‘--oml-samples 1’, numeric fields get a first filter instead
custom configuration config file
Custom configuration – config file
  • XML
  • First: establish destinations – <collect …/>
  • Second: select MP – <mp … />
  • Third: create filters for each MP – <f … />
  • Example: one destination, one MP, one filter

<omlcexp_id=‘monitor’ id=‘node1’>

<collect url=“tcp://10.0.0.200:3004”>

<mp name=“memory” interval=“2”>

<fpname=“rx_packets” fname=“avg”/>

</mp>

</collect>

</omlc>

config file longer example
Config file – longer example

<omlcexp_id=‘monitor’ id=‘node1’>

<collect url=“tcp://10.0.0.200:3004”>

<mp name=“memory” interval=“2”>

<fpname=“free” fname=“avg”/>

</mp>

</collect>

<collect url=“tcp://localhost:3003”>

<mp name=“network” interval=“0.5”>

<fpname=“name” />

<fpname=“rx_packets” fname=“avg”/>

<fpname=“rx_bytes” fname=“avg”/>

<fpname=“rx_dropped” fname=“avg”/>

</mp>

</collect>

<collect url=“file:cpu.txt”>

<mp name=“memory” samples=“1” />

</collect>

</omlc>

packaged applications
Packaged applications
  • oml2-nmetrics – libsigar wrapper (node monitoring)
  • oml2-trace – libtrace wrapper (including radiotap)
  • oml2-wlanconfig – wrapper around wlanconfig(1)
  • oml2-gps – interface to gpsd(1) for GPS location data
  • oml2-iperf – instrumented version of iperf
    • Currently iperf version 1.7
    • Version 2.0 (and maybe 3.0) under development
  • otg2 / otr2 – Orbit traffic generator & receiver
    • Background traffic generator
  • Open to contributions!
omf integration
OMF Integration
  • OMF provides support for OML applications
  • Launching on remote nodes
  • Automatically set node ID
  • Automatically set experiment ID
  • Configure measurement collection from OMF experiment script
  • Access and visualize results
    • Through OMF Aggregate Manager
slide29
Instrumentation:

Writing/Modifying Applications to Use OML

writing oml applications
Writing OML Applications
  • OML applications link against liboml2
  • Liboml2 provides API for:
    • Defining Measurement Points;
    • Injecting measurement samples into MP’s
  • Liboml2 also executes filters
  • API consists of 5 main functions:
    • omlc_init() – initialize library
    • omlc_add_mp() – define measurement points
    • omlc_start() – start measurement sampling + filtering system
    • omlc_inject() – inject a sample into a measurement point
    • omlc_close() – shut down the OML client library
oml application phases
OML Application Phases

Initialize

omlc_init()

Establish MP’s

omlc_add_mp()

Main application

loop

omlc_inject()

Record measurements

omlc_close()

End application

oml initialization
OML Initialization
  • omlc_init() processes command line vector
    • Parses and removes all ‘—oml-’ options
    • Sets up internal library configuration
  • Must call omlc_init() before other OML functions
  • Example:

#include <oml2/omlc.h>

int main (intargc, const char **argv)

{

int result = omlc_init(“myapp”, &argc, argv, NULL);

/* . . . */

/* Process application’s own options */

/* Do the application */

return 0;

}

establishing measurement points
Establishing Measurement Points
  • After initialization, call omlc_add_mp() to create MP’s
  • MP is defined as a C array:
  • Final element is a sentinel to terminate the array (important!)
  • OmlMPDef array is an input to omlc_add_mp()

OmlMPDefmpdef [] = {

{ “label”, OML_STRING_VALUE },

{ “pkt_count”, OML_UINT32_VALUE },

{ “throughput”, OML_DOUBLE_VALUE },

{ NULL, (OmlValueT)0 } /* Terminator */

}

establishing measurement points1
Establishing Measurement Points
  • Example call omlc_add_mp():

#include <oml2/omlc.h>

int main (intargc, const char **argv)

{

int result = omlc_init(“myapp”, &argc, argv, NULL);

OmlMPDefmpdef [] = {

{ “label”, OML_STRING_VALUE },

{ “pkt_count”, OML_UINT32_VALUE },

{ “throughput”, OML_DOUBLE_VALUE },

{ NULL, (OmlValueT)0 } /* Terminator */

};

OmlMP *mp = omlc_add_mp(“packets”, mpdef);

/* Define more MP’s (no limit on calls to omlc_add_mp() */

return 0;

}

starting measurement and the main loop
Starting measurement and the main loop
  • After all MP’s are initialized, call omlc_start() to kick off measurement sampling
  • Can’t call omlc_add_mp() again after calling omlc_start()
  • Can’t call omlc_inject() until after calling omlc_start()
application main loop
Application main loop

int main (intargc, const char **argv)

{

int result = omlc_init(“myapp”, &argc, argv, NULL);

OmlMPDefmpdef [] = { ... };

OmlMP *mp = omlc_add_mp(“packets”, mpdef);

omlc_start() /* Enable measurement system */

while (1) {

char *label;

uint32_t pkt_count;

double throughput;

OmlValueU v[3]; // same size as MP

/* do some application logic;

compute values for the 3 variables above */

omlc_set_string(v[0], label);

omlc_set_uint32(v[1], pkt_count);

omlc_set_double(v[2], throughput);

omlc_inject (mp, v);

}

return 0;

}

rules on naming
Rules on naming
  • Application name, MP names, and MP field names must be valid C identifiers
  • i.e. start with an underscore or letter, followed by alpha-numeric + underscore characters
  • No spaces allowed
  • Reason 1: spaces in names make schemas harder to parse
  • Reason 2: these names appear in database table + column names
  • Reason 3: we do code generation
easier app definition with oml2 scaffold
Easier app definition with oml2_scaffold
  • oml2_scaffold(1)
    • Generate C-code for MP definitions from declarative spec
    • Can also declare command line options for your app

defApplication('app:myapp', ’myapp') do |a|

a.version(1, 0, 0)

a.shortDescription = 'Application to count packets'

a.description = %{

This application counts packets and measures throughput

}

a.defProperty('address', 'address to bind to', ?a, :type => :string)

a.defProperty('port', 'port to bind to', ?p, :type => :int, :default => 2947)

# Define one MP

a.defMeasurement(”packets") do |m|

m.defMetric('label', 'string', 'Packet label')

m.defMetric('packets', 'uint32', 'Number of packets received')

m.defMetric('throughput', 'double', 'Packet throughput')

end

end

oml2 scaffold 1
oml2_scaffold(1)
  • oml2_scaffold automatically generates:
    • OmlMPDef arrays
    • A global struct of OmlMP pointers, g_oml_mps
    • A function to register all MP’s, oml_register_mps()
  • oml2_scaffold can also generate:
    • A libpopt compatible command line arguments specification
    • A skeleton main.c
    • A Makefile
  • The skeleton can actually be built and run using the Makefile
  • Application description can be used by OMF
oml2 scaffold 11
oml2_scaffold(1)
  • More information:
    • man oml2_scaffold – Unix man page
    • http://omf.mytestbed.net/doc/oml/html/oml2_scaffold.html
  • Tutorial
    • http://omf.mytestbed.net/projects/oml/wiki/OML2_scaffold_Tutorial
instrumentation general strategies
Instrumentation – General Strategies
  • Write from scratch
    • Easy: build application around oml2_scaffold description
  • Existing application – with source code
    • Moderate: Analyze code:
    • Find where to initialize OML – before app processes its command line
    • Find out what you want to measure
      • Create MP’s
      • Insert omlc_inject() statements where needed
    • E.g. iperf, see tutorial:
      • http://omf.mytestbed.net/projects/oml/wiki/Quick_Start_Tutorial
  • Existing application – no source code
    • Use fork(2) & pipe(2), then parse the app’s stdout
    • Same, but use oml4r.rb – Ruby implementation of text protocol
slide42
The OML Proxy Server:

Handling disconnection

measurement with mobile nodes
Measurement with Mobile Nodes
  • Sometimes only one wireless interface
  • No dedicated control network
    • Measurement traffic affects experiment outcome
  • Sporadic connectivity
    • What do we do with measurement traffic when disconnected?
  • Sometimes fixed network experiments suffer similar problems
    • E.g. if measurement traffic > measurement network BW
    • Fixed nodes with only one interface
measurement with mobile nodes1
Measurement with Mobile Nodes

Measurement server

Experiment network(s)

Control/measurement network

Fixed Testbed

proxy server
Proxy Server
  • Buffer measurements on command
    • Don’t transmit to remote server
  • Same protocol as oml2-server
    • Transparent to client applications

PAUSE

RESUME

Application

OML Server

Proxy server

future directions
Future directions
  • Refactor server into a library (in progress)
    • Clients can also be endpoints
    • Servers can also be clients
    • Hierarchy of measurement generators & collectors
  • Streaming queries
  • Alternative transports: IPFIX main priority
  • Alternative database backends: PostgreSQL in v2.6.0
  • Make oml2_scaffold more betterer
    • Generate injection function for each MP  no need for OmlValueU array
    • Generate OMF application descriptions
    • Make coffee
  • Bindings to other languages: Ruby, Python, Java (Android!)
get it now links
Get it now! – Links
  • Project pages
    • OML: http://omf.mytestbed.net/projects/oml
    • OML Applications: http://omf.mytestbed.net/projects/omlapp
  • Debian/Ubuntu packages
    • http://omf.mytestbed.net/projects/oml/wiki/Installing_OML_packages
    • http://omf.mytestbed.net/projects/omlapp/wiki/Installing_packages
  • Packages for Fedora Core 8 known to exist (PlanetLab)
  • Source tarballs
    • http://omf.mytestbed.net/projects/oml/files
    • http://omf.mytestbed.net/projects/omlapp/files
  • From the source repo:
    • git clone git://mytestbed.net/oml.git
    • git clone git://mytestbed.net/oml-apps.git