You are on page 1of 31

GloMoSim

INTRODUCTION
 GloMoSim is the Global Mobile Information
Systems Simulation Library from UCLA.
– Specially oriented to simulate wireless, ad-hoc
networks.
 It can be obtained from
http://pcl.cs.ucla.edu/projects/glomosim/
Outline
 Running a basic simulation.
 Observing the results
 Few case studies
 Installation on a Windows NT-kernel
system.
 Running GLOMOSIM using C compiler
GlomoSim Model
 Follows a layered approach for a network
protocol architecture
FTP, TELNET, HTTP, CBR
Application TCP, UDP
Transport AODV, DSR, LAR, ODMRP, ZRP
Network MACA, CSMA, 802.11, TSMA
Link(MAC)
Free space, Two ray, Rayleigh, Ricean
Physical
Uses one entity for all the communication layers for ease of inter-
layer communication
Basic Structure
/application contains code for the application layer
/bin for executable and input/output files
/doc contains the documentation
/include contains common include files
/mac contains the code for the mac layer
/main contains the basic framework design
/network contains the code for the network layer
/radio contains the code for the physical layer
/transport contains the code for the transport layer
/scenarios contains directories of various sample
configuration topologies
Small Ad hoc Network

D
c
Files to be modified
 Config.in file
 App.config file

 // These two files can be found in


glomosim/bin.
Setting parameters in config.in file
Setting parameters in app.conf file
Results of Simulation – glomo.stat file
GloMoSim

Editing the Code for our wish


In the Directory
 All Code is in C
 Find the protocol you want to edit
– For Example: AODV
 Network Layer
- AODV.H and AODV.PC
- Header File
- Basic Definition of all your functions and data objects
- PC File
- Actual Function
Layers
 Code is very layered
 Pass messages between layers
 In between layer communication done by
– Glomo_**** Functions
Sample code

typedef struct{
unsigned BroadcastId;
NODE_ADDR lastAddr;
unsigned char seqNumber;
unsigned char hopCount;
} AODVRREQ;
 Read code along with IETF Documentation
 Do a google search for protocol specific that
you are studying
Add your counter

 Go through Header and search for Stat


/* Total number of control packets txed. */
int numcp Txed;
 Edit the initialize function in the code
– Search for InitStats in .PC
– Initialize newly defined counter to zero
 Add code to increment your counter
Ex:aodv->stats.numcpTxed++;
 Edit the “Finalize” function
Add a print statement in there.
– sprintf(buf, "Number of control packets Txed = %d",
aodv->stats.numRerrSent);
– GLOMO_PrintStat(node, "RoutingAodv", buf);
Commands to Run a Program

 Go to comman prompt
 go to glomosim/main do makent
 Go to glomosim/bin and do glomosim
config.in (i.e run the CONFIG.IN FILE with
the mentioned parameters in config.in)
 To observe the results do edit glomo.stat
Continued..
Creating a new table
 Create a new structure with required variables in
.h file
 Include the pointer of the new structure in the
glomorouting structure in .h file.
 Make a call to the newly defined structure in .pc
file appropriately
AODV.h file
Modifications in AODV.pc
Continue….
Glomo.stat
Defining new functions
 Include the prototype of the functions in .h file

 Define the functionality of the required functions


in .pc file and make a call appropriately
Continue……….
Results of Simulation
Executing glomosim using Gcc
Executing glomosim using Gcc
Installation on a Windows NT-
kernel System
 Beforehand:
– Visual Studio 6.0 w/ sp4
– Java SDK 1.2+
JRE (Java Runtime Environment) is INSUFFICIENT

 Un-zip the distribution package.


 copy the glomosim and parsec folders into any
drive
(Ex. C, D, E…)
CONTINUED….

 Set path environments.


– PCC_DIRECTORY
C:\glomosim\parsec

– PATH
C:\glomosim\parsec\bin

 Check if pcc works


 In command promt do pcc
 (it must display “no input file”
This implies the parsec
installation is successful )
 Install Visual Studio
(Register env variables during
installation automatically)
COMPILING GLOMOSIM

 Go to glomosim/main
and do makent.
 Once the makent is
complete, GloMoSim
is ready to use.
Thank You

You might also like