wiki:Tutorial/HowToAppPrototype

Version 1 (modified by thierry, 17 years ago) ( diff )

Go back —> Tutorials

Tutorial TOC

    Error: Page Tutorial does not exist

How to use execute an Application via a Prototype

Prerequisite

This feature is only available in NodeHandler v4 and above.

Before going through this tutorial, you should know the basics of writing and running an experiment script (see here and here).

You should also have installed a disk image with Node Agent v4 on the nodes of the testbed you are using (e.g. "baseline.ndz"). See How to install a disk image.

Goal

In this tutorial, you will learn a method to execute an application using a prototype. This method is complementary to the two previous methods presented here and here. It is the recommended method if you have an application, which you would like to use in the long term with different (possibly dynamic) parameters.

For example, this would be the case of a traffic generator that can generate multiple type of traffic depending on the parameters given by the experiment script. Using a prototype to execute this generator within your experiment allows you to:

  • run the application with different initial parameters without having to re-write any modified "wrapper" code,
  • change any eventual dynamic parameters during the application execution (e.g. change the rate of the generated traffic after 60sec)

This method involves three steps:

  • the definition of a "wrapper" around your original application. This step would correspond to the creation of a generic Node Handler-compatible version of your application.
  • the definition of a so-called prototype. This step would correspond to the creation of a specific type or instance of your application.
  • the definition of an experiment script, which would use your application via its prototype.

In the context of the above traffic generator example:

  • first step: you create an Node Handler-compatible application definition, which is a "wrapper" around your original application. This application definition will provide an interface to all the available parameters of your original application.
  • second step: you specialize the previous application definition in a prototype definition. For example you decide to define an instance of your application (i.e. a prototype) which will only generate a given traffic model (e.g. pareto) but which still accepts different parameter (e.g. packet size, rate, etc…). You may also decide to define a second prototype, which will generate another type of traffic.
  • third step: you define an experiment which will use this specialized application.

The remainder of this tutorial describes these three steps and the execution of the related experiment script

Step 1: Application Definition

Step 2: Prototype Definition

Step 3: The Experiment Script

This experiment is given in the attached script a.

This file contains extensive comments that should help you understand the different steps involved in running an application on the nodes of a testbed.

To run this example script, use the following command:

 orbit exec tut_app_1

The Results

The experiment screen output should then look like this. And the experiment log file should look like this.

More…

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.