Вы находитесь на странице: 1из 18

A

Tutorial
On

By

Thomas Nilsson

Department of Computing Science


Umeå University
901 87 Umeå
Sweden
Phone: +46 (0)90 786 71 76
Fax: +46 (0)90 786 61 26
E-mail: nilsson@cs.umu.se
Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

Table of Contents
1 Introduction ......................................................................................................................... 3
2 System architecture ............................................................................................................. 4
3 Installation ............................................................................................................................ 5
4 Using GloMoSim................................................................................................................. 5
4.1 Configuration file ................................................................................................. 5
4.2 Application file settings ....................................................................................... 7
4.3 Output file ............................................................................................................. 7
4.4 Calculating the Radio Range............................................................................... 8
5 Extracting and displaying data........................................................................................... 9
6 Case Study: ODMRP and mobility................................................................................. 10
7 Conclusion.......................................................................................................................... 12
8 Appendix............................................................................................................................. 13
8.1 Configuration file ............................................................................................... 13
8.2 The column script .............................................................................................. 17
9 References........................................................................................................................... 18

GloMoSim Tutorial ver. 1 2 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

1 Introduction
This is a short tutorial describing some features of GloMoSim and how it can be used to
simulate simple ad-hoc network scenarios. GloMoSim stands for Global Mobile
Information System Simulator and is a scalable network simulation environment for
mobile ad-hoc networks, developed at UCLA Parallel Computing Laboratory.
GloMoSim achieves scalability by utilizing parallel execution to reduce the simulation
time. GloMoSim has the capabilities to simulate thousands of mobile nodes without
disregarding the details in the lower layer protocols. GloMoSim simulation library is built
using the PARSEC simulation environment [3] developed by the Parallel Computing
Laboratory at UCLA. This tutorial will not explain the parallel features of GloMoSim
and as default the simulator is using sequential execution.

GloMoSim can be used to simulate a variety of wireless networks including multi-hop ad


hoc networks, asymmetric communication using direct satellite broadcast and traditionall
Internet protocols. Most network systems are currently built using a layered approach
that is similar to the OSI seven layer network architecture. GloMoSim is built using a
similar layered approach and standard APIs is used between the different simulation
layers. This will allow for rapid integration of models developed at different layers by
different people. The protocols currently supported by the different simulation layers are
shown in Table 1.

Layers Protocols
Mobility Random waypoint, Random drunken, Trace based
Radio Propagation Two ray and Free space
Radio Model Noise Accumulating
SNR bounded, BER based with BPSK/QPSK
Packet Reception Models
modulation
Data Link (MAC) CSMA, IEEE 802.11 and MACA
IP with AODV, Bellman-Ford, DSR, Fisheye, LAR
Network (Routing)
scheme 1, ODMRP, WRP
Transport TCP and UDP
Application CBR, FTP, HTTP and Telnet
Table 1: Models currently supported by
GloMoSim.

There are two mobility models supported by GloMoSim, Random waypoint [1,2] and
Random drunken [1,2]. The mobility models are used to model the movement of the
nodes within the simulation area. The two models mentioned here are based on random
movement with specific parameters for maximum and minimum speed, target
destination and pause time. The radio model is used to model the radio transmission,
signal attenuation and interference caused by neighbouring nodes on the same channel.
The Packet Reception Model is needed to determine if a node can receive a packet and it
considers parameters such as signal attenuation and interference.

GloMoSim Tutorial ver. 1 3 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

2 System architecture
The GloMoSim simulation library is developed using a layered approach with simple
standard APIs between every layer (See Figure 1). This system architecture facilitates the
development and incorporation of new models at different layers. By using the standard
API function individual layers can be replaced or modified by different people without
affecting the other layers, which is a very good quality in large software systems.

Figure 1: The layered architecture of


GloMoSim.

GloMoSim is written in C and utilizes PARSEC (PARallel Simulation Environment for


Complex systems) [3], which is a parallel programming language for sequential and
parallel execution of discrete-event simulation models. The version of GloMoSim
available for academic institutions, the so-called academic version, is only shipped with
the sequential version of the PARSEC library. This means that parallel simulations are
not possible unless the parallel version of PARSEC is installed. People developing new
models for GloMosim do not need to have any knowledge of PARSEC since it is made
entirely transparent to the programmer. The programmer does not need to consider that
the simulation may execute in parallel since this is handled by PARSEC. For more
information about developing new models in GloMoSim se [10].

GloMoSim is a so-called discrete event driven simulator meaning that the simulation
model consists of different events controlling the course of action throughout the
simulation. An event is defined as an incident, which causes the system to change it state
in some way. A specific event or a combination of events may trigger other events and
so on and this is how the simulation progresses. Discrete events can only occur during a
distinct unit of time during the simulation and events are not permitted to occur in
between time units. An event can be something a simple as a packet reception or a
movement of a node.

GloMoSim Tutorial ver. 1 4 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

3 Installation
The Academic Research Version of GloMoSim can be obtained from UCLA
http://pcl.cs.ucla.edu/projects/glomosim/obtaining_glomosim.html

The installation of GloMoSim can be somewhat cumbersome since PARSEC is used as


the compiler of the simulation library. A manual for installing GloMoSim can be found
at [4]. Problems related to the installation of GloMoSim can also be submitted to the
IETF MANET mailing list [6]. Answers to known problems can also be found in the
IETF MANET mailing list archive [5]. NOTE: GloMoSim is already installed under
Solaris at the CS dept.

4 Using GloMoSim
The GloMoSim simulator is configured by a number of predefined parameters supplied
in a configuration file. There are specific parameters for every layer and available model
in GloMoSim, a total of roughly 80 parameters in all. The configuration file can be
somewhat difficult to overlook when starting to use the simulator, but as a help to the
user there are a short description for every parameter in the configuration file.

4.1 Configuration file


The configuration file is supplied as an argument when starting the simulator. The syntax
below should be used to start the simulation.

%/glomosim config.in

All lines starting with ‘#’ are considered to be comments in the configuration file. In
Figure 2 a section of the configuration file describing the node placement is shown.
Parameters describing a specific function are grouped together.

#The following parameter represents the node placement strategy.


#- RANDOM: Nodes are placed randomly within the physical terrain.
#- UNIFORM: Based on the number of nodes in the simulation, the physical
# terrain is divided into a number of cells. Within each cell, a node is
# placed randomly.
#- GRID: Node placement starts at (0, 0) and are placed in grid format with
# each node GRID-UNIT away from its neighbors. The number of nodes has to be
# square of an integer.
#- FILE: Position of nodes is read from NODE-PLACEMENT-FILE. On each line
of
# the file, the x and y position of a single node is separated by a space.

#NODE-PLACEMENT-FILE ./nodes.input
# NODE-PLACEMENT GRID
# GRID-UNIT 30
# NODE-PLACEMENT RANDOM
NODE-PLACEMENT UNIFORM
Figure 2: A section of the configuration
file describing the placement of the
node.

GloMoSim Tutorial ver. 1 5 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

Users with some experience in wireless networking and ad hoc networks should be able
to understand the majority of the parameters in the configuration file. However the
parameters describing the physical layer may require a greater understanding in radio
transmissions, encoding schemes etc. For this reason a more detailed description of the
radio parameters has been added to this tutorial

PROPAGATION-LIMIT
A radio signal attenuates as it propagates further a way from its origin. In free space the
signal attenuates in relation to the square of the distance travelled. The propagation limit
tells the simulator how weak a signal may become before it is ignored in the simulation.
The value is expressed in dBm.

PROPAGATION-PATHLOSS
The attenuation of the radio signal depends on many factors in the surrounding
environment and different propagation pathloss models are needed to capture
characteristics in specific environments. Factors like frequency, obstacles, indoor or
outdoor environment, long and short-term fading etc affects the attenuation of a radio
signal. For instance the free space model is describing the attenuation in an open
environments with no obstacles.

NOISE-FIGURE
The noise figure represents the background noise found in the simulated environment.
Noise exists everywhere and origins from electronic devices like microwave oven and
transmitters. Cosmic background radiation and thermal noise are other sources of
interference.

TEMPARATURE
Thermal noise is due to the agitation of electrons and is a function of the temperature.
Thermal noise is present in all electronic devices and transmission medias and cannot be
eliminated.
RADIO-TYPE
The signal must maintain a level sufficiently higher than the interference (noise) to be
received without error. The radio type RADIO-ACCNOISE considers interference from
other transmitters in the simulation when deriving the received SNR (Signal to Noise
Ratio). The RADIO-NONOISE is an abstract model and does not consider interference
at all.
RADIO-FREQUENCY
The radio frequency used to transmit and receive packets. The frequency value is in
hertz. (Hz)

RADIO-BANDWIDTH
The bandwidth (in bits per second) supported by the radio interfaces.

RADIO-RX-TYPE
This parameter represents the packet reception model. SNR (Signal to Noise Ratio)
expresses a ratio in dB between the received signal strength and the interference. A high
SNR value represents a strong signal and little interference or noise. A higher SNR value
increases the probability for a successful packet reception. When the parameter is set to
BER-BASED an SNR to BER table will be used to derive the packer reception
probability. In the table SNR values are mapped to BER (Bit Error Rate) values. For a
specific SNR value there is a certain Bit Error Rate.

RADIO-TX-POWER
The radio interface transmission power (in dBm). The power is sometimes expressed in
milliwatt (mW) but in this simulator dBm is used. The dBm stands for Decibel milli and
expresses a ratio between the expressed power in milliwat and one milliwatt.

GloMoSim Tutorial ver. 1 6 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

RADIO-ANTENNA-GAIN
The antenna gain or directivity of an antenna (in dB) represents the ratio of the radiation
intensity in a given direction to the radiation intensity averaged over all directions.

RADIO-RX-SENSITIVITY
Sensitivity is the ability of a radio interface to respond to weak signals. It is measured in
milli dB (dΒm). The lower the measurement in dBm, the fainter the signal the radio can
receive.
RADIO-RX-THRESHOLD
The minimum power for a received packet (in dBm). The receiver will not receive a
packet transmission with a lower dBm than this threshold.

MAC-PROTOCOL
The Medium Access Protocol used by the MAC layer to access the medium.

4.2 Application file settings


To be able to run a simulation the user must first define a traffic scenario and the types
of applications used by the nodes. This information is supplied to the simulator by a so-
called application file. The name and path of the application file is defined in the
configuration file. The following key word should be used to define the application file:

APP-CONFIG-FILE ./app.conf

There are three types of traffic that can be generated by a node, FTP, TELNET and
CBR (Constant Bit Rate). The Below syntax is used in the application file to generate
different types of traffic.
FTP <source node><dest node> <amount sent> <start time>
TELNET <source node> <dest node> <duration> <start time>
CBR <source node> <dest node> <items to send> <item size>
<interval> <start time> <end time>

If the <items to send> is set to zero when using CBR the interval, start and end time will
be used to calculate the number of items that should be sent. The following CBR
example will create a CBR stream from node 0 to node 23 with a packet size of 512kB,
start time 10s, end time 400s and interval time of 100ms.

CBR 0 23 0 512 100MS 10S 400S

4.3 Output file


The result from a simulation is written to an output file called glomo.stat. In GloMoSim
statistics for every node and layer are available, the statistics are collected from the whole
simulation and there is no information available from specific events. A parameter
section in the configuration file is used to set the desired type of statistics, as shown in
Figure 3.
APPLICATION-STATISTICS YES
TCP-STATISTICSYES YES
UDP-STATISTICS YES
ROUTING-STATISTICS YES
NETWORK-LAYER-STATISTICS YES
MAC-LAYER-STATISTICS YES
RADIO-LAYER-STATISTICS YES
CHANNEL-LAYER-STATISTICS YES
MOBILITY-STATISTICS YES

GloMoSim Tutorial ver. 1 7 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

Figure 3: The parameter section


controlling simulation statistics.

The statistics in the output file belonging to a specific node is grouped together, starting
with the lower layers. Every layer or function has a number of predefined result
variables. Figure 4 shows statistics from three layers, MAC layer, network layer and
application layer belonging to node zero.

Node: 0, Layer: 802.11, pkts from network: 0


Node: 0, Layer: 802.11, UCAST (non-frag) pkts sent to chanl: 0
Node: 0, Layer: 802.11, BCAST pkts sent to chanl: 3900
Node: 0, Layer: 802.11, UCAST pkts rcvd clearly: 0
Node: 0, Layer: 802.11, BCAST pkts rcvd clearly: 14714
Node: 0, Layer: 802.11, retx pkts due to CTS timeout: 0
Node: 0, Layer: 802.11, retx pkts due to ACK timeout: 0
Node: 0, Layer: 802.11, pkt drops due to retx limit: 0
Node: 0, Layer: 802.11, RTS Packets ignored due to Busy Channel 0
Node: 0, Layer: 802.11, RTS Packets ignored due to NAV 0
Node: 0, Layer: NetworkIp, Number of Packet Attepted to be Sent to MAC: 3900
Node: 0, Layer: NetworkIp, Number of Packets Routed For Another Node: 0
Node: 0, Layer: NetworkIp, Number of Packets Delivered To this Node: 14714
Node: 0, Layer: NetworkIp, Total of the TTL's of Delivered Packets: 912265
Node: 0, Layer: NetworkIp, Average Hop Count Assuming 64 Inital TTL 2.000000
Node: 0, Layer: NetworkIp, Number Fragments dropped because Node was Unreachable:
0
Node: 0, Layer: NetworkIp, Number Fragments dropped because TTL expired: 0
Node: 0, Layer: AppCbrServer, (0) Client address: 0
Node: 0, Layer: AppCbrServer, (0) First packet received at [s]: 10.005807573
Node: 0, Layer: AppCbrServer, (0) Last packet received at [s]: 399.905787670
Node: 0, Layer: AppCbrServer, (0) Average end-to-end delay [s]: 0.006189137
Node: 0, Layer: AppCbrServer, (0) Session status: Closed
Node: 0, Layer: AppCbrServer, (0) Total number of bytes received: 1989632
Node: 0, Layer: AppCbrServer, (0) Total number of packets received: 3886
Node: 0, Layer: AppCbrServer, (0) Throughput (bits per second): 40823
Figure 4: The result statistics for node
with address zero.

The first column in the output file represents the node id, the second represents the layer
or the function and the third represents the result variable as shown by Figure 4. In the
figure the first ten lines represents statistics from the 802.11 interface which is part of the
MAC layer. The last 8 lines are statistics from the application layer. For a full description
of every result variable see [4].

4.4 Calculating the Radio Range


The transmission power is expressed in dBm in the configuration file. This makes it
somewhat difficult to get an idea of the transmission range in meters. Therefore a
program called radio_range is shipped with the GloMoSim environment. Use the syntax
below to calulate the transmission range. The configuration file contains the radio
transmission power in dBm and therefore it needs to be included as an argument to the
program.

%/radio_range config.in

GloMoSim Tutorial ver. 1 8 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

The result from the command is shown below. The first line is expressing the radio
range in meters. The rest of the lines can be ignored.

./radio_range config.in
radio range: 893.493m
Execution time : 0.0148 sec
Number of messages processed : 0
Number of context switches occurred : 6
Number of Local NULL messages sent : 0
Number of Remote NULL messages sent : 0
Total Number of NULL messages sent : 0

5 Extracting and displaying data


The output file may contain a large amount of information and it can be difficult to
extract the desired information. There are a number of useful Unix commands that can
be used to filter information from the output file. The command line below will extract
the number of packets received by every node and print the node id along with the
number of packets.

cat glomo.stat | grep ‘packets received’ | column 1 10


column [7] is script that prints fields of indicated columns supplied as arguments. In the
above example the script will print column one and ten from the text redirected by grep.
Below is an example how the output might look.
Node ID Packets received
0 3872
1 3900
2 3900
Another powerful tool is the unix command awk. awk is a programming language
designed to search for, match patterns, and perform actions on files. The command
below will print column one and ten. For more information about awk se [14].

cat glomo.stat | grep ‘packets received’ | awk ‘{print $1,$10}’

In most cases the best way to extract the right information is to create a script capable of
filtering the desired information. Excel can also be used to select which columns that
should be imported from a file. When opening a plain text file in Excel the Text Import
Wizard will be started to help the user import the right data.

When it comes to displaying the data there are many alternatives. A good unix graph tool
is the GnuPlot which can be use to plot experimental data. GnuPlot is a command-line
driven program for producing 2D and 3D plots and has many nice features for
customizing the plots. GnuPlot can be used to plot user-defined mathematical functions
and other predefined functions. The GloMoSim user should not have much use of these
features but instead that of plotting data from a file. GnuPlot recognizes three different
data formats, 2-dimensional data, 3-dimensional data and Matrix. The different formats
are described in [8]. For more information how to use GnuPlot see [9].

Excel and Matlab can also be used for plotting scientific data and both programs have a
wizard for importing data in text files. Matlab can also import data from text files with a
special format by using a specific command. The command “load” imports numeric data
from a text file and creates a variable in the workspace with the same name as the
filename. See [12] for more information how to import data to Matlab.

GloMoSim Tutorial ver. 1 9 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

6 Case Study: ODMRP and mobility


A case study is added to this tutorial to show how GloMoSim can be used to study a
specific scenario. In this case study the multicast ad-hoc algorithm called On Demand
Multicast Routing Protocol [11] (ODMRP) is simulated when facing different node
mobility speeds. Nodes in an ad hoc network are free to move around causing the
network topology to change in time resulting in route uppdates in the network. The
topology change depends on the different factors such as mobility model, node speed
etc. When old routes are broken and new are established there will always be a risk of
packet losses, which is of interest in this case study. The mobility speed of the nodes is
varied in the simulation to se how this affects the packet reception. This simulation
scenario requires some modification in the configuration file, first the routing protocol
must be set to ODMRP and second, a member configuration file must be defined.

ROUTING-PROTOCOL ODMRP
MCAST-CONFIG-FILE member.conf

The member configuration file is needed to define the multicast group members and
when they join and leave the group.

15 3758096386 0S 800S
18 3758096386 0S 800S
29 3758096386 0S 800S
23 3758096386 0S 800S
3 3758096389 0S 800S
6 3758096389 0S 800S
11 3758096389 0S 800S
13 3758096389 0S 800S

Figure 5: The multicast member


configuration file

In Figure 5 there are eight members of the multicast group with the multicast address
3758096386. All the nodes join the group from the start of the simulation (indicated by
time 0S) and leave the group after 800 seconds. The node id is found in the first column.
In the application file one multicast source is specified with the destination address of
the multicast group (See below). Note that the multicast source also must be a member
of the multicast group.

CBR 29 3758096386 0 512 100MS 1S 800S

The mobility model used in this simulation is the random waypoint model with a pause
time of 250 milliseconds, minimum speed of one meter per second. The maximum speed
should initially by set to 1 meter per second and then be increased up to 20 meters per
second in steps of two units. The simulation must be carried out ten times with an
increasing value of the maximum speed. When completing a simulation the output file
should be copied to another location before starting a new simulation and this is because
the output file will otherwise be overwritten when starting a new simulation. It is
important to save all the output files in case new studies are to be done later.

The entire configuration file for this simulation can be found in Appendix A. In this
scenario the same simulation (from mobility speed one to 20 meter a second) has been
repeated ten times with a different value of the seed. The seed value can be changed in
the configuration file. Note: when using the same seed value for a simulation the output

GloMoSim Tutorial ver. 1 10 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

results will be identical. The reason for repeating the simulation several times is to obtain
enough data for a more accurate result. There are a total of 100 individual simulations
performed in this case study.

MOBILITY RANDOM-WAYPOINT
MOBILITY-WP-PAUSE 250MS
MOBILITY-WP-MIN-SPEED 1
MOBILITY-WP-MAX-SPEED 1

To extract the number of packets received use the command line below.

cat glomo.stat | grep ‘packets received’ | ./column 10

The command will produce something similar to the output below, the number of
packets received by every node in the multicast group.

7135
5378
6563
6185
7152
7260
6659
4959
6771
7477

Import all the data to Matlab or Excel by using a text file. Calculate the average packet
delivery ratio for the nodes in the multicast group. Then derive the mean packet delivery
ratio for every mobility speed by using the ten simulations performed with different
values of the seed. Finally plot the packet delivery ratio as a function of the mobility
speed. Hopefully you will end up with a diagram similar to the one in figure 6.
0,92

0,91

0,9
Packet Delivery Ratio

0,89

0,88

0,87

0,86

0,85

0,84
1 2 4 6 8 10 12 14 16 18 20

Mobility Speed (m/s)

Figure 6: Packet delivery ratio as a


function of mobility speed.

From Figure 6 a descending trend in packet delivery ratio can be seen as a result of the
increased mobility speed. More packets are lost when the nodes are moving with a higher

GloMoSim Tutorial ver. 1 11 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

velocity and one reason to this trend is that nodes are leaving their neighbours
transmission ranges more frequently. If only performing this simulation once there might
not be enough data to conclude any relationship between Packet Delivery Ration and
Mobility Speed.

By using “grep ‘end-to-end’” in the previous command line the average packet delay for
the multicast group members can be studied. Follow the same procedure as for the
packet delivery ratio. There is no need for more simulation since the statistics can be
found in the existing output files.

0,002935

0,002915
Average end-to-end delay (s)

0,002895

0,002875

0,002855

0,002835

0,002815
1 2 4 6 8 10 12 14 16 18 20
Mobility Speed (m/s)

Figure 7: Average end-to-end delay


when increasing mobility speed.

Figure 7 shows the average end-to-end delay experienced by the multicast group
member. There is not a very distinct trend in the end-to-end delay, however a very small
decrease may be seen when mobility speed is increased. It is possible that there is no
obvious relation between end-to-end delay and mobility speed, or there is a need for
more simulation data to conclude any relationship.

7 Conclusion
GloMoSim is a very powerful simulator with capabilities of simulating a wide variety of
wireless networks. GloMoSim is build using a layered architecture with very detailed
models of ever layer. There are many wireless protocols and models available in
GloMoSim and due to the standard api calls between the layers, integration of new
models should be fairly easy. GloMoSim simulation library is built using the PARSEC
simulation environment for parallel and sequential simulations, however only the
sequential binary of PARSEC is shipped with the academic version of the simulator
limiting its ability to simulate large networks efficiently. Another shortage with
GloMoSim is the scarcity of documentation to guide GloMoSim users how to perform
simulations and to develop new models. This is probably the main reason why
GloMoSim is not the de facto simulator in the ad-hoc research community, but instead
more people tend to use the NS-2 simulator library [13].

GloMoSim Tutorial ver. 1 12 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

8 Appendix
8.1 Configuration file
# ***** GloMoSim Configuration File *****

# Glomosim is COPYRIGHTED software. It is freely available without fee for


# education, or research, or to non-profit agencies. No cost evaluation
# licenses are available for commercial users. By obtaining copies of this
# and other files that comprise GloMoSim, you, the Licensee, agree to abide
# by the following conditions and understandings with respect to the
# copyrighted software:
#
# 1.Permission to use, copy, and modify this software and its documentation
# for education, research, and non-profit purposes is hereby granted to
# Licensee, provided that the copyright notice, the original author's names
# and unit identification, and this permission notice appear on all such
# copies, and that no charge be made for such copies. Any entity desiring
# permission to incorporate this software into commercial products or to use
# it for commercial purposes should contact:
#
# Professor Rajive Bagrodia
# University of California, Los Angeles
# Department of Computer Science
# Box 951596
# 3532 Boelter Hall
# Los Angeles, CA 90095-1596
# rajive@cs.ucla.edu
#
# 2.NO REPRESENTATIONS ARE MADE ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY
# PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
#
# 3.Neither the software developers, the Parallel Computing Lab, UCLA, or any
# affiliate of the UC system shall be liable for any damages suffered by
# Licensee from the use of this software.
#
# $Id: config.in,v 1.32 2001/04/12 18:35:00 jmartin Exp $
#
# Anything following a "#" is treated as a comment.
#
###############################################################################
#
# The folowing parameter represents the maximum simulation time. The numberd
# portion can be followed by optional letters to modify the simulation time.
# For example:
# 100NS - 100 nano-seconds
# 100MS - 100 milli-seconds
# 100S - 100 seconds
# 100 - 100 seconds (default case)
# 100M - 100 minutes
# 100H - 100 hours
# 100D - 100 days
#

SIMULATION-TIME 820S

#
# The following is a random number seed used to initialize part of the seed of
# various randomly generated numbers in the simulation. This can be used to
vary
# the seed of the simulation to see the consistency of the results of the
# simulation.
#

SEED 34

#
# The following two parameters stand for the physical terrain in which the
nodes
# are being simulated. For example, the following represents an area of size
100
# meters by 100 meters. All range parameters are in terms of meters.
#

GloMoSim Tutorial ver. 1 13 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

# Terrain Area we are simulating.


#

TERRAIN-DIMENSIONS (1000, 1000)

#
# The following parameter represents the number of nodes being simulated.
#

NUMBER-OF-NODES 50

#
#
#The following parameter represents the node placement strategy.
#- RANDOM: Nodes are placed randomly within the physical terrain.
#- UNIFORM: Based on the number of nodes in the simulation, the physical
# terrain is divided into a number of cells. Within each cell, a node is
# placed randomly.
#- GRID: Node placement starts at (0, 0) and are placed in grid format with
# each node GRID-UNIT away from its neighbors. The number of nodes has to be
# square of an integer.
#- FILE: Position of nodes is read from NODE-PLACEMENT-FILE. On each line of
# the file, the x and y position of a single node is separated by a space.
#

#NODE-PLACEMENT FILE
#NODE-PLACEMENT-FILE ./nodes.input
# NODE-PLACEMENT GRID
# GRID-UNIT 30
NODE-PLACEMENT RANDOM
#NODE-PLACEMENT UNIFORM

#
# The following represent parameters for mobility. If MOBILITY is set to NO,
# than there is no movement of nodes in the model. For the RANDOM-DRUNKEN
model,
# if a node is currently at position (x, y), it can possibly move to (x-1, y),
# (x+1, y), (x, y-1), and (x, y+1); as long as the new position is within the
# physical terrain. For random waypoint, a node randomly selects a destination
# from the physical terrain. It moves in the direction of the destination in
# a speed uniformly chosen between MOBILITY-WP-MIN-SPEED and
# MOBILITY-WP-MAX-SPEED (meter/sec). After it reaches its
# destination, the node stays there for MOBILITY-WP-PAUSE time period.
# The MOBILITY-INTERVAL is used in some models that a node updates its position
# every MOBILITY-INTERVAL time period. The MOBILITY-D-UPDATE is used that a
node
# updates its position based on the distance (in meters).
#

#MOBILITY NONE

# Random Waypoint and its required parameters.

MOBILITY RANDOM-WAYPOINT
MOBILITY-WP-PAUSE 250MS
MOBILITY-WP-MIN-SPEED 1
MOBILITY-WP-MAX-SPEED 18

#MOBILITY TRACE
#MOBILITY-TRACE-FILE ./mobility.in

#MOBILITY PATHLOSS-MATRIX

# The following parameters are necessary for all the mobility models

MOBILITY-POSITION-GRANULARITY 0.5

#####################################################################
#
# PROPAGATION-LIMIT:
# Signals with powers below PROPAGATION-LIMIT (in dBm)
# are not delivered. This value must be smaller than
# RADIO-RX-SENSITIVITY + RADIO-ANTENNA-GAIN of any node
# in the model. Otherwise, simulation results may be
# incorrect. Lower value should make the simulation more
# precise, but it also make the execution time longer.

GloMoSim Tutorial ver. 1 14 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

#
PROPAGATION-LIMIT -111.0

#
# PROPAGATION-PATHLOSS: pathloss model
# FREE-SPACE:
# Friss free space model.
# (path loss exponent, sigma) = (2.0, 0.0)
# TWO-RAY:
# Two ray model. It uses free space path loss
# (2.0, 0.0) for near sight and plane earth
# path loss (4.0, 0.0) for far sight. The antenna
# height is hard-coded in the model (1.5m).
# PATHLOSS-MATRIX:
#
#PROPAGATION-PATHLOSS FREE-SPACE
PROPAGATION-PATHLOSS TWO-RAY
#PROPAGATION-PATHLOSS PATHLOSS-MATRIX

#
# NOISE-FIGURE: noise figure
#
NOISE-FIGURE 10.0

#
# TEMPARATURE: temparature of the environment (in K)
#
TEMPARATURE 290.0

#########################################
#
# RADIO-TYPE: radio model to transmit and receive packets
# RADIO-ACCNOISE: standard radio model
# RADIO-NONOISE: abstract radio model
# (RADIO-NONOISE is compatible with the current version (2.1b5)
# of ns-2 radio model)
#
RADIO-TYPE RADIO-ACCNOISE
#RADIO-TYPE RADIO-NONOISE

#
# RADIO-FREQUENCY: frequency (in heltz) (Identifying variable for multiple
# radios)
#
RADIO-FREQUENCY 2.4e9

#
# RADIO-BANDWIDTH: bandwidth (in bits per second)
#
RADIO-BANDWIDTH 2000000

#
# RADIO-RX-TYPE: packet reception model
# SNR-BOUNDED:
# If the Signal to Noise Ratio (SNR) is more than
# RADIO-RX-SNR-THRESHOLD (in dB), it receives the signal
# without error. Otherwise the packet is dropped.
# RADIO-RX-SNR-THRESHOLD needs to be specified.
# BER-BASED:
# It looks up Bit Error Rate (BER) in the SNR - BER table
# specified by BER-TABLE-FILE.
#
RADIO-RX-TYPE SNR-BOUNDED
RADIO-RX-SNR-THRESHOLD 10.0
#RADIO-RX-SNR-THRESHOLD 8.49583

#RADIO-RX-TYPE BER-BASED
#BER-TABLE-FILE ./ber_bpsk.in

#
# RADIO-TX-POWER: radio transmition power (in dBm)
#
RADIO-TX-POWER 25.0

GloMoSim Tutorial ver. 1 15 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

# RADIO-ANTENNA-GAIN: antenna gain (in dB)


#
RADIO-ANTENNA-GAIN 0.0

#
# RADIO-RX-SENSITIVITY: sensitivity of the radio (in dBm)
#
RADIO-RX-SENSITIVITY -91.0

#
# RADIO-RX-THRESHOLD: Minimum power for received packet (in dBm)
#
RADIO-RX-THRESHOLD -81.0

#
##############################
#

MAC-PROTOCOL 802.11
#MAC-PROTOCOL CSMA
#MAC-PROTOCOL MACA

#MAC-PROTOCOL TSMA
#TSMA-MAX-NODE-DEGREE 8

#MAC-PROPAGATION-DELAY 1000NS

#
# PROMISCUOUS-MODE defaults to YES and is necessary if nodes want
# to overhear packets destined to the neighboring node.
# Currently this option needs to be set to YES only for DSR is selected
# as routing protocol. Setting it to "NO" may save a trivial amount
# of time for other protocols.

#PROMISCUOUS-MODE NO

##############################
#
# Currently the only choice.

NETWORK-PROTOCOL IP
NETWORK-OUTPUT-QUEUE-SIZE-PER-PRIORITY 100

#RED-MIN-QUEUE-THRESHOLD 150
#RED-MAX-QUEUE-THRESHOLD 200
#RED-MAX-MARKING-PROBABILITY 0.1
#RED-QUEUE-WEIGHT .0001
#RED-TYPICAL-PACKET-TRANSMISSION-TIME 64000NS

##############################
#

#ROUTING-PROTOCOL BELLMANFORD
ROUTING-PROTOCOL ODMRP
#ROUTING-PROTOCOL USER-DEFINED-PROTOCOL
MCAST-CONFIG-FILE member.conf
#ROUTING-PROTOCOL AODV
#ROUTING-PROTOCOL DSR
#ROUTING-PROTOCOL LAR1
#ROUTING-PROTOCOL WRP
#ROUTING-PROTOCOL FISHEYE

#ROUTING-PROTOCOL ZRP
#ZONE-RADIUS 2

#ROUTING-PROTOCOL STATIC
#STATIC-ROUTE-FILE ROUTES.IN

#
# The following is used to setup applications such as FTP and Telnet.
# The file will need to contain parameters that will be use to
# determine connections and other characteristics of the particular
# application.

GloMoSim Tutorial ver. 1 16 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

APP-CONFIG-FILE ./app.conf

#
# The following parameters determine if you are interested in the statistics of
# a a single or multiple layer. By specifying the following parameters as YES,
# the simulation will provide you with statistics for that particular layer.
All
# the statistics are compiled together into a file called "GLOMO.STAT" that is
# produced at the end of the simulation. If you need the statistics for a
# particular node or particular protocol, it is easy to do the filtering. Every
# single line in the file is of the following format:
# Node: 9, Layer: RadioNoCapture, Total number of collisions is 0
#

APPLICATION-STATISTICS YES
TCP-STATISTICS YES
UDP-STATISTICS YES
ROUTING-STATISTICS YES
NETWORK-LAYER-STATISTICS YES
MAC-LAYER-STATISTICS YES
RADIO-LAYER-STATISTICS YES
CHANNEL-LAYER-STATISTICS YES
MOBILITY-STATISTICS YES

#
#
# GUI-OPTION: YES allows GloMoSim to communicate with the Java Gui Vis Tool
# NO does not

GUI-OPTION NO
GUI-RADIO NO
GUI-ROUTING NO

8.2 The column script


#!/usr/bin/perl

# This program prints out fields of an indicated column.


# The columns are numbered 1, 2, 3 ...

&ParseCommandLine;
$line = <STDIN>;
while ($line) {
$line =~ s/^\s+//; # remove initial white-space
$line =~ s/\s+/ /g; # turn double-space into single
space
@word = split('\s+',$line); # columns will then be $1, $2, $3
...
$i =0; #
while ($i <= $#col) {
print "@word[@col[$i]]\t";
$i += 1;
}
print "\n";
$line = <STDIN>;
}
exit;

# ParseCommandLine
# check for the right number of command line arguments
# print usage message and quit if there is an error
# global variables are @col
sub ParseCommandLine
{
while ($#ARGV >= 0) {
$arg = shift(@ARGV);
if ($arg =~ /^(\d+)/) {

GloMoSim Tutorial ver. 1 17 13 June 2002


Department of Computing Science Thomas Nilsson nilsson@cs.umu.se
University of Umeå

push(@col, $1);
} else {
&usage;
}
}
if ($#col < 0) {
&usage;
}

# usage
# print a usage maessage and quit
sub usage
{
print STDERR "column: print fields from an indicated column\n";
print STDERR "Usage: column <flags>, where flags are:\n";
print STDERR " {# [#...]}\tcolumn(s) to print, numbered
0,1,2...\n";
exit;

9 References

[1] T. Camp, J. Boleng, and V. Davies, “Mobility Models for Ad Hoc Network
Simulations”, Submitted 2001
[2] X. Hong, T.J. Kwon, M. Gerla, D.L. Gu and G. Pei ,"A Mobility Framework for
Ad Hoc Wireless Networks", In Proceedings of ACM MDM '2001, Hong Kong,
Jan. 2001
[3] R. Bagrodia, R. Meyer, M. Takai, Y. Chen, X. Zeng, J. Martin, B. Park, H. Song,
"Parsec: A Parallel Simulation Environment for Complex Systems", Computer,
Vol. 31(10), October 1998, pp. 77-85.
[4] http://pcl.cs.ucla.edu/projects/glomosim/GloMoSimManual.html, visited
Monday, 03 June 2002
[5] http://www1.ietf.org/html.charters/manet-charter.html, visited Monday, 03
June 2002
[6] http://www1.ietf.org/mail-archive/working-
groups/manet/current/maillist.html, visited, Monday, 03 June 2002
[7] ~nilsson/column
[8] Plotting Numerical Data in a Data File, http://art.aees.kyushu-
u.ac.jp/members/kawano/gnuplot/datafile-e.html#2dim, visited Tuesday, 11
June 2002
[9] “Introduction to GnuPlo”, College of Natural Sciences,
http://www.cs.uni.edu/Help/gnuplot/, visited Tuesday, 11 June 2002
[10] GloMoSim Tutorial, http://pcl.cs.ucla.edu/slides/workshop99/Jaytut-
pw99/index.htm, Jay Martin, 11/18/99
[11] Sung-Ju Lee, William Su, and Mario Gerla, “On-Demand Multicast Routing
Protocol (ODMRP) for Ad Hoc Networks”, http://www.ietf.org/internet-
drafts/draft-ietf-manet-odmrp-02.txt, January 2000
[12] Using Import Functions with Text Data,
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/imp
ort_4.shtml, visited Tuesday, 11 June 2002
[13] The Network Simulator - ns-2 , http://www.isi.edu/nsnam/ns/, visited
Thursday, 13 June 2002.
[14] http://www.udel.edu/johnmack/frec682/682awk.html, visited 04/09/2002.§

GloMoSim Tutorial ver. 1 18 13 June 2002

Вам также может понравиться