
1
CS603 โ Mobile Computing
ns2 Simulation
Assignment #2
By Mark Terwilliger
October 2, 2003
Extension of MANET
ns2 simulation
My scenario
Imagine an airport with users walking down a long
terminal with their mobile device
Users are accessing a single server (retrieving
email, checking weather forecast, news, sports
scores, etc.) as they are walking
Other mobile devices must forward the data to the
user when the device is not within range of the
server
Poisson distribution
A Poisson distribution was used to determine
the arrival times of the mobile devices
With a Poisson distribution, you can specify
the mean value for a sequence of numbers
For example, if the mean value is 3, you may
obtain a sequence such as 0, 2, 6, 1, 1, 4, 3,
0, 5, 5, 2, 1, 3, โฆ
Implementation: A C program was written to
dynamically generate the scen ario and traf fic
data files
The function
int poisson(double mean) {
double limit = exp(-mea n);
double product = random_real();
int count = 0;
while (produ ct > limit) {
count++;
product *= random_real();
}
return count ;
}
Kruse, "Data Structures and Program Design in ++", P rentice Hall, 1999.