Mobilyzer

From ResiliNetsWiki
Jump to: navigation, search

Contents

Introduction

NS3 does not have animation support...not yet anyways. We wrote a Matlab code to analyze as well as visualize the mobility based on the processed output of ns3 mobility module. This tools lets you evaluate the average and instantaneous connectivity and produces a avi file of the mobility pattern.

Installation

mobilyzer is a Matlab program and requires Matlab either in graphic or text mode. mobilyzer has been developed and tested with Matlab 7.7.0.471 R2008 b. Download the latest version of the mobilyzer from SVN. The current version of mobilyzer (version 3) is also available here.

Usage

The syntax to use mobilyzer with a filtered trace file:

mobilyzer_v3(fname,tx_range,tstep,xmin,xmax,ymin,ymax,display_flag,video_flag)

Arguments

  • fname - name of the input file
  • tx_range - transmit range to be used for the analysis
  • xmin, xmax,ymin,ymax - Range over which the mobility is displayed
  • display_flag - <on/off> sets the visual display to on or off (Note: you need to run natively on linux for display to work. If you are remotely logging in, set this to off and use the avi video option)
  • video_flag - <1/0> option to save the mobility visualization to an avi file

Here are the steps to use mobilyzer with ns3 simulations:

  • You need to add this one line to the simulation script to get the ns3 to trace mobility.
MobilityHelper::EnableAsciiAll (ascii);
  • You need to filter the the trace file just to get the mobility trace lines (lines that start with "now")
cat tracefile.tr | grep ^now > mobilityout.txt
  • You need to delete any strings (Text) from this file using the mobility-tracer.pl (this is added to the svn repository)
./mobility-tracer.pl mobilityout.txt

This will out put a file with a .out extension. In this example, it will be mobilityout.txt.out

  • Lastly, you need to open matlab and run the mobilyzer_v3.m (which is on the svn now). This is what you would run from the command prompt in matlab
[conn, pos]=mobilyzer('mobilityout.txt.out', 250, 1, 0, 1200, 0, 1200, 'off',1);

This will both analyze the mobility over the duration of the simulation, and displays both the animation and statistics.

Examples

Here are sample videos that can be generated

sample 1

sample 2

sample 3

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox