Qualnet Tutorial: DR - Narmada Alaparthi
Qualnet Tutorial: DR - Narmada Alaparthi
DR.NARMADA ALAPARTHI
Contents
1 Introduction
2 Using QualNet
4 Example
2
QualNet
Part I
Introduction
3
Introduction
What’s QualNet?
Commercial derivative of GlomoSim
Rapid prototyping of protocols
Comparative performance evaluation of alternative
protocols at each layer
Built-in measurements on each layer
Modular, layered stack design
Standard API for composition of protocols across
different layers
Scalability via support for parallel execution
GUI Tools for system/protocol modeling
4
Introduction
Installation
Make a local copy of QualNet in your home directory
• % mkdir ~/qualnet
• % cp –r /cs/local/packages/qualnet/4.0 ~/qualnet
Test installation
• % cd ~/qualnet/4.0/bin
• % qualnet default.config
5
Introduction
Directory Structure
addons Components developed as custom add-on modules
bin Executable and other runtime files
data Data files for the Wireless Model Library
documentation User’s Guide, Release Notes, etc.
gui Graphical components
include QualNet kernel header files
interfaces Code to interface QualNet with third party tools
kernel QualNet kernel objects used in the build process
lib Third party libraries used in the build process
libraries Source code for models in QualNet model libraries
license_dir License files required for the build process
main Kernel source files and Makefiles
scenarios Sample scenarios
6
Introduction
7
QualNet
Part II
Using QualNet
8
Configuration File (1)
Configuration files
Plain-text explanation for configuration file
• $QUALNET_HOME/scenarios/default/default.config
Global Parameters
• Experiment name
• Simulation time
• Coordinate system and terrain
• Random seed
Topology and subnets
Layer/Protocol related parameters
9
Configuration File (2)
EXPERIMENT-NAME default
Name of experiment. Results are written to default.stat.
SIMULATION-TIME 15M
SEED 1
Value used to seed the random number generator.
COORDINATE-SYSTEM CARTESIAN
TERRAIN-DIMENSIONS (1500, 1500)
Cartesian xy terrain dimensions in meters
SUBNET N16-1.0 { 1 thru 30 }
30 nodes whose IP addresses range from 0.0.1.1 to 0.0.1.30
Format: N<# host bits>-<address with front end 0’s omitted>
N16-1.0 allows hosts with IP address numbered from 0.0.1.1 through
0.0.1.65534, it is equivalent to N16-0.0.1.0
10
Configuration File (3)
NODE-PLACEMENT UNIFORM/GRID/RANDOM/FILE
MULTICASTGROUPFILE ./default.member
multicast membership file
See $QUALNET_HOME/scenarios/default/default.member for more details.
APPCONFIGFILE ./default.app
Specifies a file with a list of apps/traffic generators to run
CBR <src> <dest> <items to send> <size> <interval> <start time> <end time>
See $QUALNET_HOME/scenarios/default/default.app for more details.
11
Configuration File (4)
ROUTING-PROTOCOL AODV
Unicast routing protocol
MULTICAST-PROTOCOL SPTM
Multicast routing protocol
Layer Statistics
APPLICATION-STATISTICS (YES|NO)
TCP-STATISTICS (YES|NO)
UDP-STATISTICS (YES|NO)
ROUTING-STATISTICS (YES|NO)
NETWORK-LAYER-STATISTICS (YES|NO)
QUEUE-STATISTICS (YES|NO)
MAC-LAYER-STATISTICS (YES|NO)
PHY-LAYER-STATISTICS (YES|NO)
MOBILITY-STATISTICS (YES|NO)
12
Using QualNet
13
Using QualNet
14
Using QualNet
allows the user to start applications from one computer, and then
reconnect from a different computer and continue using the
same application without having to restart it.
15
Tip
More Information
16
QualNet
Part III
Writing protocols in QualNet
17
Writing Protocols
Message
A message is a unit defining an interaction between
protocols and between nodes.
18
Writing Protocols
MESSAGE_Alloc()
Allocate a message and provide it with standard event, layer,
protocol info
MESSAGE_PacketAlloc()
Allocate space for the packet within the message
MESSAGE_InfoAlloc()
Allocate additional user-specified space for optional information
about the event (info field)
MESSAGE_Send()
Send the message as an event to the specified layer
MESSAGE_Free()
Free the message, once it has reached its final destination
19
Writing Protocols
Implement five main functions in routing protocol
Initialization function
• Create an instance of the protocol
• Read configuration parameters
• Initialize the state variables
• register the router function
• Schedule a timer event
Packet/Event handling function
• Modify state variables
• Generate/forward packets
• Process packet/event based on packet/event type
Router function
• Determine the next hop and outgoing interface for the packet
Finalization function
• Print statistics
20
Writing Protocols
21
Writing Protocols
22
Writing Protocols
23
Writing Protocols
24
Writing Protocols
25
Writing Protocols
26
Writing Protocols
27
Writing Protocols
28
Writing Protocols
Rebuild QualNet
• cd $QUALNET_HOME/main
• make
29
QualNet
Part IV
Example: SRIP
30