Monday 20 March 2017

Introduction to ns2

Network Simulator (Version 2), widely known as NS2, is simply an event-driven
simulation tool that has proved useful in studying the dynamic nature of commu-
nication networks. Simulation of wired as well as wireless network functions and
protocols (e.g., routing algorithms, TCP, UDP) can be done using NS2. In general,
NS2 provides users with a way of specifying such network protocols and simulating
their corresponding behaviors.
     NS2 provides users with an
executable command “ns” which takes one input argument, the name of a Tcl
simulation scripting file. In most cases, a simulation trace file is created and is used
to plot graph and/or to create animation.
NS2 consists of two key languages: CCC and Object-oriented Tool Command
Language (OTcl). While the CCC defines the internal mechanism (i.e., a backend)
of the simulation, the OTcl sets up simulation by assembling and configuring the
objects as well as scheduling discrete events (i.e., a frontend). The CCC and the
OTcl are linked together using TclCL. Mapped to a CCC object, variables in
the OTcl domains are sometimes referred to as handles. Conceptually, a handle
is just a string (e.g., “_o10”) in the OTcl domain and does not contain any
functionality. Instead, the functionality (e.g., receiving a packet) is defined in the
mapped CCC object (e.g., of class Connector). In the OTcl domain, a handle
acts as a frontend which interacts with users and other OTcl objects. It may
define its own procedures and variables to facilitate the interaction. Note that the
member procedures and variables in the OTcl domain are called instance procedures
(instprocs) and instance variables (instvars), respectively

      After simulation, NS2 outputs either text-based simulation results. To interpret
these results graphically and interactively, tools such as NAM (Network AniMator)
and XGraph are used. To analyze a particular behavior of the network, users can
extract a relevant subset of text-based data and transform it to a more conceivable
presentation.

No comments:

Post a Comment