The way of human follows the way of earth. The way of earth follows the way of heaven. The way of heaven follows the way of Tao. The way of Tao follows the way of Nature. --- Tao Teh Ching, Lao Tzu
| Models | Architecture | Home | Applications | Download |
Introduction:
Rmase is implemented as an application in Prowler, which provides a graphic user interface for setting parameters, displaying network topologies, and visualizing link activities. There are a set of global and local variables that Rmase uses and can be extended as well. Implemented in Matlab, there are utilities in graphics for on-line debugging and optimization toolboxes for off-line tuning. We will introduce these utilities and walk through the steps to write a new routing component or to compose a new routing algorithm in Rmase.
Graphical User Interface (click the GUI below to see a video):
The main Prowler GUI displays the node placement, provides choices for radio models and shows the event activities. Each application can have its own parameters. For Rmase, there are parameters for the topology model, the application model and routing components, as well as for the selection of routing layers.
Topology Specification Window:

Application Scenario Windows:
Source (Destination) Specification

Simulation Parameters

Routing Layers Selection Window:

For each routing component, one can set its own parameter window as well, for example:

Global and Local Variables:
Rmase uses a set of global and local variables, where global variables are shared by all routing components and local variables are for each component.
Some examples of global variables are:
|
Name |
Explanation |
Examples |
|
ATTRIBUTES |
ATTRIBUTES{ID} defines the structure of all the attributes in node ID. One can extend the structure with any user defined attribute. For example, ATTRIBUTES{ID}.QValue is the QValue at node ID. |
ATTRIBUTES{ID}.x
ATTRIBUTES{ID}.power ATTRIBUTES{ID}.strength |
|
NEIGHBORS |
NEIGHBORS{ID} holds the list of nodes that node ID can hear |
NEIGHBORS{5} = [1,4,7] |
| RNUMBERS | RNUMBERS{ID} holds the total received packets from each of its neighbors | RNUMBERS{5} = [10,20,5] |
| LTOTALS | LTOTALS{ID} holds the total number of lost packets to each of its neighbors | LTOTALS{5}=[0,1,3] |
| SOURCES | SOURCES(ID) if 1 if and only if node ID is a source node | SOURCES(2) = 1 |
| DESTINATIONS | DESTINATION(ID) is 1 if and only if node ID is a destination | DESTINATIONS(4) = 1 |
The attributes defined in ATTRIBUTES can be displayed over the node display window, for example, attribute usedPower is displayed below in which the "hot" spots are places where the energy consumption is high.

Each component can have its local variables stored in memory, where memory is a persistent variable holding the states of the component for each node. In addition, there are also parameters which are constants and can be initialized at the beginning in 'Init_Application'.
Batch Tests:
Using Prowler's off-line simulation, one can run a set of experiments in batch mode and display the performance metrics after the experiments. One can also perform off-line optimization to select the best routing algorithm or parameters. To do that one would write an evaluation function,
function cost = evaluate(choices)
%set Rmase as Prowler application
sim_params('set_default');
sim_params('set', 'APP_NAME', 'Rmase');
sim_params('set_app_default');
...
%set parameters about the application
...
%set parameters about the routing algorithm
...
%set parameters about the choices for evaluation
...
%start Prowler
prowler('Init');
prowler('StartSimulation');
%obtain performance statistics
sys_stat = permstats;
%get cost of interest
cost = calculate(sys_stat);
where the input to the function is a list of choices
and the output is the cost of interest, which can be a single
performance metric or a combination with trade-offs. If choices are discrete
and finite, one can simply run all the choices and find the minimum cost.
Otherwise, one may want to use Matlab's optimization toolbox to find the
minimum. One can write similar codes to run N random experiments on a
specific setting as well. Examples of batch tests can be found in the 'tests'
directory of Rmase.
Component Extensions:
To write a new routing component, a couple of files need to be modified. Assume that the new component is X, one would write a function, named X_layer.m. Then modify file all_app_layers.m to insert 'X' into the right layer. To add X into the selection in the parameter window, one should modify Rmase_params.m to add the following code:
i=i+1;
param(i).name = 'X';
param(i).default = default;
param(i).group = 7;
param(i).type='checkbox';
If X has parameters, one should write a function X_set_params.m, and then add code
gId = gId + 1;
[param, i] = X_set_params(param, i, gId);
into Rmase_params.m so that the parameters can be set from parameter windows.
To write a function X_layer.m, one would get a template from the existing components and modify the event handler for 'Init_Application', 'Send_Packet', 'Packet_Received', 'Clock_Tick' etc. For example the main part of the maximum hop component looks like:
case Packet_Received
if (data.maxhops > 0)
data.maxhops = data.maxhops-1;
else
pass = 0;
end
Function X_set_params.m has the following form:
function [param, i] = X_set_params(params, i, gId)
i=i+1;
param(i).name = name;
param(i).default = default;
param(i).group = gId;...
To get parameters, call function value = sim_params('get_app', name). To compose a routing algorithm, one can select layers in the routing layers selection window, or simply run function set_layers. For example,
set_layers({'mac', 'spantree', 'app', 'stats'});