ns-2 Code for Random Trip Mobility Model
This page describes the ns-2 tool to use for random trip mobility model. The
main page for this work is here.
This tool can generate perfect simulations for the random trip mobility model and outputs in a format, which is the input format for ns-2. Thus, this tool can be directly used as a front-end mobility model generator for ns-2. The mobility models currently supported include: random waypoint on general connected domain, restricted random waypoint, and random walk models with either wrap-around or reflection.
This work was done when I was visiting Prof. Jean-Yves Le Boudec at EPFL, Switzerland in summer 2004, and collaborated with Milan Vojnovic at Microsoft Research, Cambridge.
Publications
Full details of the tool, and experiments with it are present in:
-
"Perfect Simulations for Random Trip Mobility Models",
Santashil PalChaudhuri, Jean-Yves Le Boudec, and Milan Vojnovic
Published at 38th Annual Simulation Symposium, San Diego, California, April 2005
[paper]
Download and installation
- The code can be downloaded from here
- Unzip and untar the code: tar -zxvf code.tar.gz
- Compile all the code: ./compile
- The code is present in 3 sub-directories. palm-rw, palm-graph and palm-general.palm-rw contains the random waypoint, random walk with wrapping, and random walk with reflections. palm-graph contains the restricted random waypoint on a city section. palm-general contains random waypoint on a generalized domain.
Using the tool
- all.bash is used to run the whole code in the format: ./all.bash model [parameters]
- ./all.bash will give all the options available. Output is:
./all.bash n [parameters]
- n=1, for Random Waypoint, Random Walk with Wrapping or Random Walk with Reflection
- n=2, for Restricted Random Waypoint on a City Section
- n=3, Random Wapoint on a generalized domain
-
Random Waypoint, and Random Walk with wrapping and reflection
./all.bash 1 gives:
Usage: ./all.bash 1 <Output File> <model> 1=RW, 2=RW_WRAP,3=RW_REFLECT
<number of nodes> <max-x> <max-y> <end time> <speed mean> <speed delta>
<pause time> <pause time delta> [ <travel time> <travel time delta> ]
Definition of delta: delta is defined as half of the complete range.
So for speed for example, speed_low = speed_mean - speed_delta & speed_high = speed_mean + speed_delta
Travel Time and Travel Time Delta are necessary only for wrapping and reflection.
Example usage: ./all.bash 1 1 100 1500 300 900 10 0 10 0 Out
-
Restricted Random waypoint on a City Section
./all.bash 2 gives:
Usage: ./all.bash 2 <input file> <number of lines in input file>
<pause time mean> <pause time delta> <number of nodes> <simulation time (sec)> <output file>
The input file describes the road segments in the graph, in the following format. Example:
| RoadId |
Average Speed |
X_1 |
Y_1 |
X_2 |
Y_2 |
| 96062880 |
5.0 |
1793.49 |
2038.06 |
1793.49 |
1915.56 |
RoadID is not used. (X_1,Y_1) and (X_2,Y_2) are
the 2 end points of a road segment in the graph.
The graphs that were used in the simulation were real maps of US cities maintained in the U.S. Census Bureau's TIGER database. It was converted to the above format from the TIGER database using shell scripts
(Details of this database and tools are available this webpage).
palm-graph/common.h has a parameter called SPEED_LIMIT_LEEWAY, which specifies how much above and below the average speed a node can be while on a specific road segment.
Example usage: ./all.bash 2 westUnivPlace.dat 594 10 0 100 900 Out
-
Random Waypoint on generalized domain
./all.bash 3 gives:
Usage: ./all.bash 3 <No. of subdomains> <Subdomain file> <Probability file>
<No. of nodes> <speed mean> <speed delta> <pause mean> <pause delta>
<simulation time (sec)> <output file>
An example subdomain file, with 2 subdomains is of the following format:
r 100 100 400 400 5
c 800 250 100 5
r= rectangle, (100,100) = lower left corner, (400,400) = upper right corner, 5 =
number of visits within subdomain.
c = circle, (800,250) = coordinate of centre, 100 = radius, 5 = number of visits within subdomain.
The probability file, describes the probability of going from one subdomain to another, after completing the specified number of visits within the subdomain. Example for 3 subdomains:
| 0.0 |
0.5 |
0.5 |
| 1.0 |
0.0 |
0.0 |
| 0.8 |
0.2 |
0.0 |
Example usage: ./all.bash 3 3 Data/domain.1 Data/prob.1 100 10 0 10 0 900 Out
Page maintained by Santashil PalChaudhuri santaATcs.rice.edu