Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

A Study of Comparison of Network Simulator - 3 and Network Simulator - 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol.

3 (1) , 2012, 3085 - 3092

A study of comparison of Network Simulator -3 and


Network Simulator -2
Rachna Chaudhary#1, Shweta Sethi*2, Rita Keshari#3, Sakshi Goel#4
#1,2,4
B.Tech.(CS), IIMT Engineering College, Meerut
*3
M.Tech(cs), ABES Engineering College

ABSTRACT - Network simulation is undoubtedly one of test any network there is a need of real system or tools
the most prevalent evaluation methodologies in the area of or simulators, but installing a real network is unfeasible
computer networks. While simulation is not the only tool due to several reasons such as – high implementation
used for data networking research, it is extremely useful cost, expensive field tests etc. Moreover experiments
because it often allows research questions and prototypes
to be explored at relatively lesser cost and time than that
(especially wireless) can be hard to reproduce. A
required to experiment with real implementations and typical network simulator can provide the programmer
networks. The network simulators allow one to model an with the abstraction of multiple threads of control and
arbitrary computer network by specifying both the inter-thread communication. Functions and protocols
behavior of the network nodes and the communication are described either by finite-state machine, native
channels. It provides a virtual environment for an programming code, or a combination of the two. A
assortment of desirable features such as modeling a simulator typically comes with a set of predefined
network based on a specific criteria and analyzing its modules and user-friendly GUI. Some network
performance under different scenarios. The newly simulators even provide extensive support for
proposed network simulator NS-3 supports coupling,
visualization and animations. There are lots of good
interoperability, good memory management, debugging of
split language objects, coding in C++ and object oriented things about simulation:
concepts, as well as supports models supported by NS-2
and most suitable for wireless networks. The primary  Reproducibility
purpose of this paper is to review this new simulator, as  Easier to setup, deploy, instrument
well as find its advantages in the field of research and how
it is different from others mainly Ns2.  Investigate non-existent systems
 Scalability
KEYWORDS - Ns-2, TCl, Simulation, Network Simulator, Most available network simulation toolkits are based
on the paradigm of discrete event-based simulation [5]
I. INTRODUCTION (DES). Here, the simulated network nodes trigger
events, for instance, when a packet is sent to another
Simulation is a key component of network research node. The simulator maintains an event queue sorted by
which requires debuggability, reproducibility, the scheduled event execution time. The simulation
parameter exploration and no dependency on existing itself is performed by successively processing the
hardware or software [3]. Simulation is the imitation of events in the queue. Section 2 will discuss about
some real thing, state of affairs, or process. It is widely network simulators and their roll and will compare ns-2
used for the development of new communication and ns-3. The overview of NS-3 is given in section-3
architectures and network protocols. Due to growth of with its features and advantages. Section 4 reviews the
computer networks and complex scenarios the role of basic models, fundamental Objects and Code
Network simulators in research field cannot be ignored. architecture. Emulation support and the Tracing Model
Simulators are useful tools when one wants to consider are also given in this section. Conclusion and future
time and resources, implementation of new security work is discussed next.
solutions, performance estimation etc. Key issues in
simulation include acquisition of valid source II. NETWORK SIMULATOR
information about the relevant selection of key
characteristics and behaviors, the use of simplifying NS or the network simulator is a discrete event
approximations and assumptions within the simulation, network simulator. It is popular in academia for its
and fidelity and validity of the simulation outcomes. To extensibility (due to its open source model) and

3085
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

plentiful online documentation. Ns is popularly used in technology.NS-3 contains an abundance of modules,


the simulation of routing and multicast protocols, almost relating to all the aspects of network technology.
among others, and is heavily used in ad-hoc networking
research. Ns supports an array of popular network C. Difference between Ns 2 and Ns 3
protocols, offering simulation results for wired and
wireless networks alike. It can be also used as limited- The most visible difference between NS-3 and NS-3 is
functionality network emulator. the choice of scripting language. Ns-2 is scripted in
NS began development in 1989 as a variant of the OTcl and results of simulations can be visualized using
REAL network simulator. By 1995, ns had gained the Network Animator nam[10]. It is not possible to run
support from DARPA, the VINT (Virtual Inter Network a simulation in ns-2 purely from C++ (i.e., as a main ()
Testbed) project. at LBL, Xerox PARC, UCB, and program without any OTcl). Moreover, some
USC/ISI. components of ns-2 are written in C++ and others in
OTcl. In NS-3, the simulator is written entirely in C++,
A. Ns 2
with optional Python bindings. User code protocols and
scenarios also in C++ . Simulation scripts can therefore
The ns-2 simulator [1] has long been a widely used be written in C++ or in Python. Furthermore, NS-3
simulator for research and education on Internet and generates pcap packet trace files; other utilities such as
other network Systems. Network simulations for ns-2 Wireshark can be used to analyze traces as well. NS-3
are composed of C++ code, which is used to model the does not have all of the models that ns-2 currently has,
behavior of the simulation nodes, and OTcl scripts that but on the other hand, NS-3 does have new capabilities.
control the simulation and specify further aspects, for Some models from ns-2 have already been ported from
instance the network topology. ns-2 to ns-3.
Problems with Ns 2
TABLE 1: NS2 VS. NS
There are a lot many problems found with NS2, such
as: it has Split object model (OTcl and C++) and use of
Tcl. There is a large amount of abstraction at the NS-2 NS-3
network layer and below leads to big discontinuities
when transitioning from simulation to experiment .It First Release 1996 2008
has Lack of support for creating methodologically
Based on NS-1 & REAL NS-2, GTNets, YANS
sound simulations. Furthermore, documentation is simulators
outdated. One of the biggest problem is that the Tracing Architecture OTcl & C++ C++ & optional Python
system is difficult to use and there is a need to parse Scripting
trace files to extract results. Funded by DARPA NSF CISE & INRIA
VINT
SAMAN &
B. Ns 3 NSF
CONSER
The NS-3 Project started around mid 2006 which is still Current Volunteers, NSF, INRIA, GT, WashU
under heavy development NS-3[2, 3,5 7] is a discrete- Support USC ISI & & Volunteers
event network simulator written in C++ with an Sourceforge
optional Python scripting API. It allows researchers to Scripting OTcl Python
study Internet protocols and large-scale systems in a
Visualization NAM NS-3-viz, pyviz, nam,
controlled environment. NS-3 is a new simulator (not
iNSpect (all under
backwards-compatible with NS-2). It is a free, open development)
source software project organized around research Scalability Sequential Distributed Simulation
community development and maintenance. The target Simulation
user community is networking researchers and
educators [3]. NS-3 is not an extension of ns-2. It is a
new simulator, written from scratch. The project will D. Ns-3 Project Goals[12]
continue to maintain ns-2 while NS-3 is being built, and
will study transition and integration mechanisms. NS-3 The main goals for developing Ns-3 Project are as
is a free software simulation platform which aims at follows :
network technology and whose source code is open.
Researchers can use it easily to develop network

3086
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

1) To develop a preferred, open simulation environment and Georgia Tech University (Atlanta) George Riley
for networking research (main author of GTNetS) and Raj Bhattacharjea[5].

2) A tool aligned with the simulation needs of modern A. NS-3 version release[6]:
networking research

3) An open-source project that encourages community


contribution, peer review, and validation of the
software

III. NS-3 OVERVIEW

The brief overview of simulator is discussed in this Fig 2: An open source project building a new network simulator [4]
section with its features [4]. Ns 3 I is basically a
synthesis of:
B. Ns-3 Features[7,8,9]
 YANS( Yet Another Network Simulator),
The ns-2 simulator has long been a widely used
 Ns-2, simulator for research and education on Internet and
other network systems. However, work is progressing
on a replacement for ns-2. The features of NS3 are as
 GTNetS simulators, and under:

 New software. 1. New software core: Designed to improve


scalability, modularity, coding style, and
documentation, the core is written in C++ but
with an optional Python scripting interface
(instead of OTcl). Several C++ design patterns
such as smart pointers, templates, callbacks,
and copy-on-write are leveraged. Object
aggregation capabilities enable easier model
and packet extensions.

2. Attention to realism: The Internet nodes are


designed to be a more faithful representation
of real computers, including the support for
key interfaces such as sockets and network
devices, multiple interfaces per nodes, use of
IP addresses, and other similarities.

Fig 1: Software organization of NS-3[2] 3. Software integration: Architecture to support


NS-3 is a discrete-event network simulator in which the incorporation of more open-source
the simulation core and models are implemented in networking software such as kernel protocol
C++. NS-3 is built as a library which may be statically stacks, routing daemons, and packet trace
or dynamically linked to a C++ main program that analyzers, reducing the need to port or rewrite
defines the simulation topology and starts the simulator. models and tools for simulation.
NS-3 also exports nearly its entire API to Python,
allowing Python programs to import an "ns3" module in Support for virtualization: Lightweight virtual machines
much the same way as in C++. The NS-3 Project started running over a (possibly wireless) simulation network
around mid 2006 which is still under heavy are an attractive combination for current research; ns-3
development. The official funded partners are: plans to support a few modes of such operation
University of Washington (Tom Henderson, Craig including a native “process” environment where Posix-
Dowell), INRIA, Sophia Antipolis (Mathieu Lacage), compliant applications can be easily ported to run in
simulation space with their own private stack, and

3087
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

including support for tying together virtual machines of reliability results under a network environment of high
various types. degree of complexity.

1. Testbed integration: Ns-3 will enable the b) Forecast function of network simulation is
testbed-based researcher to experiment with unmatched by any other method.
novel protocol stacks and emit/consume
network packets over real device drivers or c) Wide range of use, both optimization and expansion
VLANs. The internal representation of packets of the existing networks and design of the new network
is network-byte order to facilitate serialization. can be used, and particularly applicable for design and
optimization of Medium and large network.
2. Attribute system: Researchers require a means
to identify and possibly reassign all values d) Low initial application cost, only very few funds will
used to configure parameters in the simulator. be able to provide practical network design and
Ns-3 provides an attribute system that operating environment for large number of students,
integrates the handling and documentation of furthermore, the constructed network model can
default and configured values. continue to use so that the latter investment will still
decline continuously.
3. Tracing architecture: Ns-3 is building a tracing
and statistics gathering framework using a e) It is flexible, vivid and visual to use simulator for
callback-based design that decouples trace teaching. To teach via NS-3, students can visually see
sources from trace sinks, enabling the dealing of the network protocol and understand the
customization of the tracing or statistics output effect of various environmental or other factors on the
without rebuilding the simulation core network, can also demonstrate the advantages and
disadvantages of various strategies through comparison.
4. Topology: For ease of use, a number of stock
topology objects should be predefined. These f) The simulation results can be reproduced and easily
stock objects can be instantiated by a single analysis. In this platform, the experimenter can obtain
line of C++ code constructing the object, with "ideal" network environment via configuring
configurable arguments. Stock objects should environmental parameters and can real-time track and
include trees, meshes, stars, and random record important information of key node so as to gain
topologies of arbitrary size. the first-hand information about network performance
evaluation. Moreover, certain special circumstances can
be reproduced at any time, which is difficult to do in the
real network.

IV. NS 3 CORE CONCEPTS


A. NS 3 Basic Model[8]
Key objects in the simulator are Nodes, Packets, and
Channels. Nodes contain Applications, “stacks”, and
NetDevices.

Fig 3: Overview of Ns3 features[8]

C. The Advantages of NS-3 as a simulation means:

Network simulation-3 technology has the following


characteristics [6]:
Fig 4: NS-3 Basic Architecture [8]
a) The entirely new simulation experiment mechanism
makes it have the characteristics of gaining high
 

3088
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

B. The Fundamental Objects[5] class provides methods for managing communication


subnetwork objects and connecting nodes to them.
1. Node: the motherboard of a computer with RAM,
CPU, and, IO interfaces.In NS-3 the basic computing
device abstraction is called the node. This abstraction is
represented in C++ by the class Node. The Node class
provides methods for managing the representations of
computing devices in simulations.

Fig 6 NetDevices connected to a channel [9]

5. Packet: each network packet contains a byte buffer, a


list of tags, and metadata

– buffer: bit-by-bit (serialized) representation of


headers and trailers
Fig 5: High-level Node Architecture [7]
– tags: set of arbitrary, user-provided data structures
2. Application: a packet generator and consumer which (e.g., per-packet cross-layer messages, or flow
can run on a Node and talk to a set of network stacks. In identifiers)
NS-3 the basic abstraction for a user program that
generates some activity to be simulated is the
–metadata: describes types of headers and trailers that
application. This abstraction is represented in C++ by
have been serialized.
the class Application. The Application class provides
methods for managing the representations of our
6. Socket: the interface between an application and a
version of user-level applications in simulations. For
network stack. Ns-3 provides two types of sockets
example, some specializations of class Application
APIs, and it is important to understand the differences
called “UdpEchoClientApplication “&
between them. The first is a native ns-3 API, while the
“UdpEchoServer Application”. These applications
second uses the services of the native API to provide a
compose a client/server application set used to generate
POSIX-like API as part of an overall application
and echo simulated network packets.
process.
3. NetDevice: a network card which can be plugged in
7. Typical containers and helpers: There are different
an IO interface of a Node. In NS-3 the net device
container and helper classes in ns-3. NodeContainer,
abstraction covers both the software driver and the
NetDeviceContainer, Ipv4AddressContainer are some
simulated hardware. A net device is “installed” in a
of the container classes and InternetStackHelper,
Node in order to enable the Node to communicate with
WifiHelper, MobilityHelper, OlsrHelper are some of
other Nodes in the simulation via Channels. Just as in a
the helper classes in ns3.
real computer, a Node may be connected to more than
one Channel via multiple NetDevices. The net device C. Ns-3 Code Architecture
abstraction is represented in C++ by the class
NetDevice. The NetDevice class provides methods for NS-3 code is divided into different parts. Here we start
managing connections to Node and Channel objects. with topology definition and then we define models to
NetDevices are strongly bound to Channels of a use, after that we configure over model by giving them
matching type. some addresses and setting other parameters, and
finally we executed the code. The output which is
4. Channel: a physical connector between a set of generated in trace format will be analyzed with some
NetDevice Objects. In the simulated world of NS-3, one tools like Wireshark. The procedure of code creation is
connects a Node to an object representing a shown in the fig. :
communication channel. Here the basic communication
subnetwork abstraction is called the channel and is
represented in C++ by the class Channel. The Channel

3089
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

time scheduler. The purpose of the Real-time scheduler


is to cause the progression of the simulation clock to
occur synchronously with respect to some external time
base. Without the presence of an external time base
(wall clock), simulation time jumps instantly from one
simulated time to the next.

F. Ns-3 Models
Fig 7 The NS-3 source code
The simulators must be updated for the rapid growth in
D. The WAF Build System[4] wireless networking, including the many variants of
The build system used on the ns-3 project is Waf. It is IEEE 802.11 networking, emerging IEEE standards
one of the new generation of Python-based build such as WiMax (802.16), and cellular data services
systems.Ns-3 uses the waf build system i.e., instead of (GPRS, CDMA). Table 2 summarizes the models used
“./configure; make” ,” ./waf” is used . in the current ns-2, as well as models planned for ns-3.
Many of the planned models may already exist in some
Waf is a Python-based framework for configuring, form as contributed code; for a new model to be
compiling and installing applications. It is a incorporated into the main branch of ns-3, it will need
replacement for other tools such as Autotools, Scons, to be validated, conform as appropriate to the coding
CMake or Ant. style, be licensed in a compatible way, and be
maintained going forward. Table 3 lists the Models
Example[6]: built so far for ns3 project.

TABLE 2: MODELS PLANNED FOR NS-3 PROJECT.[12]


configure -> ./waf -d [optimized|debug] configure
Existing core ns-2 Planned additions
make -> ./waf capability for ns-3
Application ping, vat, telnet, FTP, Sockets-like API
make test -> ./waf check (run unit tests) Layer multicast FTP, HTTP, (to allow
probabilistic and trace- porting of existing
driven traffic applications to ns
Programs can run through a special waf shell; e.g. generators, webcache environment), peer-
to-peer (e.g.
./waf --run simple-point-to-point BitTorrent)
Transport TCP (many variants), TCP stack
./waf—shell Layer UDP, SCTP, XCP, emulation (Linux,
TFRC, BSD), DCCP,
E. Emulation support in Ns 3[5] RAP, RTP additional high-
Multicast: PGM, speed TCP variants
SRM, RLM, PLM
Ns-3 has been designed for integration into testbed and Network Unicast: IP, Mobile IP, full IPv4 support,
virtual machine environments. This need has been Layer generic dist. vector and full IPv6 support,
addressed by providing two kinds of net devices. The link state, IPinIP, NAT
first kind, which is called an Emu NetDevice, allows source routing, XORP/Click
ns-3 simulations to send data on a “real” network. The Nixvector ,Multicast: Routing support:
second kind, called a Tap NetDevice allows a “real” SRM, generic BGP, OSPF, RIP,
centralized, MANET: IS-IS, PIM-SM,
host to participate in an ns-3 simulation as if it were one AODV, DSR, DSDV, IGMP/MLD
of the simulated nodes. An ns-3 simulation may be TORA, IMEP
constructed with any combination of simulated, Emu, Link Layer Queueing: Diffserv, new 802.11 model,
or Tap devices. DropTail, RED, RIO, 802.11 variants
WFQ SRR, Semantic (mesh,
Real-Time Scheduler[5] Packet Queue, REM, QoS), 802.16
Priority, VQ ping, vat, (WiMax), TDMA,
Ns-3 has been designed for integration into testbed and telnet, FTP, multicast CDMA, GPRS
FTP, HTTP,
virtual machine environments. To integrate with real
probabilistic and trace-
network stacks and emit/consume packets, a real-time driven traffic
scheduler is needed to try to lock the simulation clock generators, webcache,
with the hardware clock. A new component is the Real-
 

3090
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

ARP, HDLC, GAF, Multiple levels of tracing [5]


satellite Aloha
NS-3 provides multiple tracing levels- High, Mid and
Low

• High-level: use a helper to hook a predefined trace


Physical TwoWay, Shadowing, IEEE 802 physical sink to a trace source and generate simple tracing
Layer OmniAntennas, layers, Rayleigh output (ascii, pcap). Use built-in trace sources and sinks
EnergyModel, Satellite and Rician and hook a trace file to them
Repeater fading channels,
GSM • Mid-level: hook a special trace sink to an existing
G. Tracing Model in NS 3[5,8,10] trace source to generate ad hoc tracing. Customize trace
source/sink behavior using the tracing namespace.
The ns-3 tracing system is built on the concepts of
independent tracing sources and tracing sinks; along • Low-level: add a new trace source and connect it to a
with a uniform mechanism for connecting sources to special trace sink. Add trace sources to the tracing
sinks. The Ns3 Simulator provides a set of pre- namespace or expose trace source explicitly.
configured trace sources. Users may edit the core to add
their own trace sources and sinks. Users provide trace
V. FUTURE WORK
sinks and attach to the trace source. Multiple trace
sources can connect to a trace sink. There are so many challenges faced by simulator field.
Not a single simulator satisfies current user’s need.
There are so many researches, comparisons and surveys
are needed before designing any simulator. Here we
have compared two simulators which are open source,
where ns-3 is in development phase and needed more
support from its users and researchers. Ns-3 overcomes
certain problems but there is need of some
improvement like, network animator tool for wireless
scenarios, user friendliness and ease of use as well as
good tutorial and wider community support, so that a
Fig 8:The NS-3 tracing model[10]
naive user can easily get comfortable with it. And most
important that before release the stable version it should
Trace sources are entities that can signal events that be well tested, so that it is free of any bugs and errors.
happen in a simulation and provide access to interesting
underlying data. For example, a trace source could VI. CONCLUSION
indicate when a packet is received by a net device and
provide access to the packet contents for interested
There are many simulators like Opnet, QualNet, but
trace sinks. Trace sources are not useful by themselves;
because of terms of use and high cost for industrial
they must be connected to other pieces of code that
partners or publicly-funded research these cannot get
actually do something useful with the information
education licenses. Despite ns-2’s popularity, there is a
provided by the source. The entities that consume trace
critical need for a new project to perform core
information are called trace sinks. Trace sources are
refactoring, integration, software maintenance, and
generators of events and trace sinks are consumers.
extension of the simulator.
Despite all these NS-3 is an active open-source project
and open-source development model, several simulator
features designed to aid current Internet research,
community-based development and maintenance
model, trying to avoid some problems with ns-2, such
as interoperability and coupling between models, lack
of memory management, debugging of split language
objects.
An emerging question now-a-days is to still use Ns-2 or
move to ns-3. The answer is that it depends [9]. NS-3
Figure 9: The Configurable Trace Sinks [4,5] does not have all of the models that NS-2 currently has,
 

3091
Rachna Chaudhary et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 3 (1) , 2012, 3085 - 3092

on the other hand, NS-3 does have new capabilities


(such as handling multiple interfaces on nodes
correctly, use of IP addressing and more alignment with
Internet protocols and designs, more detailed 802.11
models etc). Some of the Ns-2 models can usually be
ported to Ns-3.

REFERENCES

[1.] S. M. Metev and V. P. Veiko, Laser Assisted Microtechnology,


2nd ed., R. M. Osgood, Jr., Ed. Berlin, Germany: Springer-
Verlag, 1998.
[2.] J. Breckling, Ed., The Analysis of Directional Time Series:
Applications to Wind Speed and Direction, ser. Lecture Notes in
Statistics. Berlin, Germany: Springer, 1989, vol. 61.
[3.] S. Zhang, C. Zhu, J. K. O. Sin, and P. K. T. Mok, “A novel
ultrathin elevated channel low-temperature poly-Si TFT,” IEEE
Electron Device Lett., vol. 20, pp. 569–571, Nov. 1999.
[4.] M. Wegmuller, J. P. von der Weid, P. Oberson, and N. Gisin,
“High resolution fiber distributed measurements with coherent
OFDR,” in Proc. ECOC’00, 2000, paper 11.3.4, p. 109.
[5.] R. E. Sorace, V. S. Reinhardt, and S. A. Vaughn, “High-speed
digital-to-RF converter,” U.S. Patent 5 668 842, Sept. 16, 1997.
[6.] (2002) The IEEE website. [Online]. Available:
http://www.ieee.org/
[7.] M. Shell. (2002) IEEEtran homepage on CTAN. [Online].
Available: http://www.ctan.org/tex-
archive/macros/latex/contrib/supported/IEEEtran/
[8.] FLEXChip Signal Processor (MC68175/D), Motorola, 1996.
[9.] “PDCA12-70 data sheet,” Opto Speed SA, Mezzovico,
Switzerland.
[10.] A. Karnik, “Performance of TCP congestion control with rate
feedback: TCP/ABR and rate adaptive TCP/IP,” M. Eng. thesis,
Indian Institute of Science, Bangalore, India, Jan. 1999.
[11.] J. Padhye, V. Firoiu, and D. Towsley, “A stochastic model of
TCP Reno congestion avoidance and control,” Univ. of
Massachusetts, Amherst, MA, CMPSCI Tech. Rep. 99-02, 1999.
[12.] Wireless LAN Medium Access Control (MAC) and Physical
Layer (PHY) Specification, IEEE Std. 802.11, 1997.

3092

You might also like