0% found this document useful (0 votes)
12 views7 pages

NS2 Network Simulator for Windows Users

Network Simulator (NS2) is an open-source, discrete event-driven simulator developed at UC Berkeley for networking research and education, supporting protocol design and evaluation. It utilizes C++ and OTcl for its architecture, allowing users to create and manage simulations through OTcl scripts while providing various configuration options for network components. Additionally, the Network Animator (NAM) and Xgraph tools enhance visualization and analysis of simulation results, making NS2 a comprehensive platform for network simulation.

Uploaded by

nandhini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

NS2 Network Simulator for Windows Users

Network Simulator (NS2) is an open-source, discrete event-driven simulator developed at UC Berkeley for networking research and education, supporting protocol design and evaluation. It utilizes C++ and OTcl for its architecture, allowing users to create and manage simulations through OTcl scripts while providing various configuration options for network components. Additionally, the Network Animator (NAM) and Xgraph tools enhance visualization and analysis of simulation results, making NS2 a comprehensive platform for network simulation.

Uploaded by

nandhini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Network Simulator (NS2) is a discrete event driven simulator developed at

UC Berkeley. It is part of the VINT project. The goal of NS2 is to support


networking research and education. It is suitable for designing new protocols,
comparing different protocols and traffic evaluations. NS2 is developed as a
collaborative environment. It is distributed freely and open source. A large amount
of institutes and people in development and research use, maintain and develop
NS2. This increases the confidence in it. Versions are available for FreeBSD,
Linux, Solaris, Windows and Mac OS X.
Structure of Ns2
NS2 is built using object oriented methods in C++ and OTcl (object oriented
variant of Tcl.

Figure 4.1 Simplified User’s View of Ns

NS2 interprets the simulation scripts written in OTcl. A user has to set the
different components (e.g. event scheduler objects, network components libraries
and setup module libraries) up in the simulation environment. The user writes his
simulation as an OTcl script, plumbs the network components together to the
complete simulation. If he needs new network components, he is free to implement
them and to set them up in his simulation as well. The event scheduler as the other
major component besides network components triggers the events of the
simulation (e.g. sends packets, starts and stops tracing). Some parts of NS2 are
written in C++ for efficiency reasons. The data path (written in C++) is separated
from the control path (written in OTcl). Data path object are compiled and then
made available to the OTcl interpreter through an OTcl linkage (tclcl) which maps
methods and member variables of the C++ object to methods and variables of the
linked OTcl object. The C++ objects are controlled by OTcl objects. It is possible
to add methods and member variables to a C++ linked OTcl object.

Figure 4.2 OTcl and C++: the duality

Table 5.1 Available Options for Node Configuration


Option Available Values Default
General
Address type Flat, Hierarchical Flat
MPLS ON,OFF OFF
Both Satellite and Wireless Oriented
Wired Routing ON,OFF OFF
II Type LL,LL/sat OFF
Mac Type Mac/802_11,Mac/Csma/Ca, OFF
Mac/Sat/Unslotted/Aloha,Mac/Tdma
if Type Queue/Drop Tail, Queue/Drop OFF
tail/PriQueue
Phy Type Phy/wirelessPhy,Physat OFF

Option Available Values Default


Satellite Oriented
satNodeType Polar,Geo,Terminal,Geo-repeater OFF
downlinkBW <bandwidth value, e.g. “2MB”> OFF
Wireless Oriented
Adhoc Routing DIFFUSION/RATE,DIFFUSION/PROB, OFF
DSDV,FLOODING,OMNICAST,AODV,TORA
prop Type Propagation/2RayGround,Propagation Shadowing OFF
prop Instance Propagation/2RayGround,Propagation Shadowing OFF
antType Antenna/Omni Antenna OFF
Channel Channel/Wireless Channel, Channel/sat OFF
topoInstance <toplogy file> OFF
MobileIP ON,OFF OFF
Energy model Energy model OFF
Initial Energy <value in joules> OFF
rxPower <value in W> OFF
txPower <value in W> OFF
Idle Power <value in W> OFF
Agent Trace ON,OFF OFF
router Trace ON,OFF OFF
macTrace ON,OFF OFF
movement Trace ON,OFF OFF
Errproc UniformErrorProc OFF
FECProc ? ?
toraDebug ON,OFF OFF

5.1.2 NETWORK ANIMATOR (NAM)

NAM is a Tcl/TK based animation tool for viewing network simulation


traces and real world packet traces. It supports topology layout, packet level
animation, and various data inspection tools. NAM began at LBL. It has evolved
substantially over the past few [Link]-2 is the second major iteration of a
discrete-event network simulation platform programmed in C++and Object Tcl
(OTcl). Ns-2 was first released in 1996, and derives from earlier work on the
REAL and ns-1 simulators. ns-2 is a major architectural change from ns-1-- the
simulator became entirely based on the blend of OTcl and C++. The network
animator NAM began in 1990 as a simple tool for animating packet trace data.
This trace data is typically derived as output from a network simulator like ns or
from real network measurements, e.g., using tcpdump. Steven McCanne wrote the
original version as a member of the Network Research Group at the Lawrence
Berkeley National Laboratory, and has occasionally improved the design as he's
needed it in his research. Marylou Orayani improved it further and used it for her
Master's research over summer 1995 and into spring 1996. The NAM development
effort was an ongoing collaboration with the VINT project. Currently, it is being
developed at ISI by the SAMAN and Censer projects.
Figure 4.3 animation layout

ANIMATION OBJECTS
NAM does animation using the following building blocks which are defined
below:
Node
Nodes are created from ’n’ trace event in trace file. It represents a source,
host, or router. NAM will skip over any duplicate definitions for the same node. A
node may have three shapes, (circle, square, and hexagon), but once created it
cannot change its shape. Nodes can change its color during animation. Nodes can
be labeled.
Link
Links are created between nodes to form a network topology. Internally
NAM links are consisting of 2 simplex links. The trace event ’l’ creates two
simplex links and does other necessary setup. Therefore, for a user’s perspective
all links are duplex links. Links can be labeled and also can change color during
the animation.
Queue
Queues need to be constructed in NAM between two nodes. A NAM queue
is associated to only one edge of a duplex link. Queues are visualized as stacked
packets. Packets are stacked along a line, the angle between the line and the
Horizontal line can be specified in the queue trace event.
Packet
Packets are visualized as a block with an arrow. The direction of the arrow
shows the flow direction of the packet. Queued packets are shown as little squares.
A packet may be dropped from a queue or a link. Dropped packets are shown as
falling rotating squares, and disappear at the end of the screen. Unfortunately, due
to NAM’s design dropped packets are not visible during backward animation.
Agent
Agents are used to separate protocol states from nodes. They are always
associated with nodes. An agent has a name, which is a unique identifier of the
agent. It is shown as a square with its name inside, and is drawn next to its
associated node

Current Release
Current ns-2.35 released Nov 4 2011. Current NAM release (v1.15) is now
available. A daily snapshot is also available. Information on generating traces in
the NAM format can be found in the ns man page included in the ns distribution. In
case, an old version of NAM (v0.8) is available.

5.1.3 Xgraph

One part of the ns-allinone package is 'xgraph', a plotting program which can be
used to create graphic representations of simulation results. In this section, I will
show you a simple way how you can create output files in your Tcl scripts which
can be used as data sets for xgraph. On the way there, I will also show you how to
use traffic generators.

5.2 FEATURES
Using Network Simulator (ns2) minute changes such as packet drop block
hole, compromised node, mobility and topology can be obtained. Also it can easily
identify all possible paths between source and destination and also forward the data
through the identified paths.
Multiple Agents in one PC
 Integrated Network Designer wizard designs and creates a network
simulation with multiple SNMP/TL1/CLI/TFTP/FTP devices at one shot.
 Each device in the network supports its own MIB/TCS file, read/write
community, unique IP address, port number combination and unique values.
The number of agents that can be run simultaneously on a single PC is 10000 in
Windows, 100000 in Linux and 8192 per NIC (Network Interface Card) in Solaris.
This enables simulation of large enterprise networks

You might also like