0% found this document useful (0 votes)
148 views4 pages

Simulation of Wireless Networks Using NS2 Simulator

This document discusses simulating wireless networks using the NS2 network simulator. It provides an example of simulating a simple 2 node wireless network within a defined area. It also discusses factors that influence the NS2 simulation tool such as its open source nature but also limitations around complexity, documentation and scalability to larger networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views4 pages

Simulation of Wireless Networks Using NS2 Simulator

This document discusses simulating wireless networks using the NS2 network simulator. It provides an example of simulating a simple 2 node wireless network within a defined area. It also discusses factors that influence the NS2 simulation tool such as its open source nature but also limitations around complexity, documentation and scalability to larger networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Simulation of wireless networks using NS2 simulator

Abstract: this paper presents a clear picture of how a wireless network is


constructed using NS2 simulator .this simulator is used to provide different pattern
and congestion in information flow in various mobile networks in many situations.
Firstly it presents a simple 2 node mobile network system with in geographic area
was nodes are at opposite ends of the boundary. TCP connection is used between the
two nodes as medium for packets transfer. Simulating multi-hop environment with in
mobile systems. Different software used in network configuration and results
showing congestion pattern with in network and critical analysis of ns2 development
tool including the factors depending on cost , user friendly ness , support material
available and demerits of simulation packages in wireless mobile systems.

Introduction:
NS2 simulator is a tool used to simulate wireless networks for developing a mobile
network used analyse different patterns in the systems .we can observe the network
and generate results showing patterns in networks. simulator can be used to analyse
various problems in network elated to traffic control, congestion and other
issuses.this tool is built up on the principles of object oriented principles. since this
tool is user friendly we don’t need to write code for simulating a network we just
have to specify the values for a geographic area .ns 2 tool is based on c++ language
were the parameters are defined as objects that can be instantiated depending on
the method .Ns2 simulator can also be used to analyse different traffic problems and
also to simulate complex networks like multi-hop environment with in geographical
area . this paper presents a example for two node network with in area of 500 by
600 using TCP as medium for information transfer . packets are transferred as they
move apart and 3 mobile node to simulate a multi hop network .the analysis and
results of this network is provided .

1. Implementation of NS2 simulator in 2 node mobile system.

Here is network which simulates two simple node wireless environment . any
wireless network as following criteria they are 1)Node Configuration 2)basic
simulation 3)Movement Definition 4) Results for trace file analysis. The network
design consists of two mobile nodes, nod 0 and node 1. The mobile nodes revolve
among an area which is specified in the boundary of 600mX500m. Mobile node
consists of components which specifies channel type, propagation model used for
communication, antenna type ,link layer type ,interface queue type, maximum number
of packets allowed ,interface type used , MAC type , Adhoc protocol and number
nodes. The nodes commence at two inverse sides of the boundary. Then it comes to
each other in the first half of the simulation and goes away in the second half. A TCP
connection is used as medium two mobile nodes. Packets are transferred between the
nodes as they come close to the range of one another. When the packets move away,
packets start getting dangled.
A mobile node comprises of network variables such as Link Layer (LL), “Interface
Queue (IfQ), MAC layer, the wireless channel nodes are used for transmitting signals
from each other. Before simulating a wireless network, we have to specify the type for
network components. we also need to mention other variables like antenna, the radio-
propagation model, the type of ad-hoc routing protocol used by mobile nodes etc.

set val(chan) Channel/ Wireless Channel;# channel type


set val(prop) Propagation/ TwoRayGround ;# radio-propagation model
set val(ant) Antenna/Omni Antenna ;# Antenna type
set val(ll) LL;# Link layer type
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen) 50;# max packet in ifq
set val(netif) Phy/WirelessPhy;# network interface type
set val(mac) Mac/802_11;# MAC type
set val(rp) DSDV;# ad-hoc routing protocol
set val(nn) 2 ;# number of mobile nodes

Code for creating simulator instance:


Set ns_ [new Simulator]
Open trace file and activate it:
set tracefd [open wireless.tr w]
$ns_ trace-all $tracefd

Code for creating topography and channel:


set topo [new Topography]
$topo load_flatgrid 600 500
set chan [new $val(chan)]

Code for Create the GOD objects (General Operations Director):


create-god $val(nn)

God object is used to data which as all-knowing commentator would have number of
nodes connectivity information which else would have to be calculated on-the-fly One
single” GOD object per simulation involved by the MAC layer gives the hypothesis to
assess.

Mobile node configuration for the network

# configure nodes

“ $ns_ node-config -adhocRouting $val(rp) \


-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-topoInstance $topo \
After that we create the 2 mobile nodes as follows:

for {set i 0} {$i < $val(nn) } {incr i} {


set node_($i) [$ns_ node ]
$node_($i) random-motion 0 ;# disable random motion
}

3. Factors that influence NS2 simulation tools and its drawbacks.

NS-2 simulation tools is widely used in the research work of mobile ad hoc networks.
NS-2 comes fully outfitted of protocols, prototypes, methods, tools, and is for free.
hence, in terms of scientific credence, number of tools/modules and cost, NS-2 would
be a sort of ideal choice.

The NS network simulator [15], from U.C. Berkeley/LBNL, is a “object-oriented


discrete event simulator targeted at networking research and available as public
domain. Its first version (NS-1) began in 1989 as a variant of the REAL network
simulator [22] and was developed by the Network Research Group at the Lawrence
Berkeley National Laboratory (LBNL), USA. Its development was then part of the
VINT project [26], supported by DARPA, at LBNL, Xerox PARC, and UCB, under
which NS version 2.0 (NS-2) was released, evolving substantially from the first
version. The aim of the VINT was not to design a new network simulator, but to unify
the effort of all people working in the research held of network simulation. The result
is that NS-2 is widely used in the networking research community and has found large
acceptance as a tool to experiment new ideas, protocols and distributed algorithms.
Currently NS-2 development is still supported through DARPA. NS has always
included substantial contributions from other researchers, including wireless code for
both mobile ad hoc networks and wireless LANs from the UCB Deedless and CMU
Monarch projects and Sun Microsystems. At the time being, NS-2 is well-suited for
packets switched networks and wireless networks (ad hoc, local and satellite), and is
used mostly for small scale simulations of queuing and routing algorithms, transport
protocols, congestion control, and some multicast related work.
It provides substantial support for simulation of TCP, routing, and multicast protocols
over wired and wireless networks. NS-2 is suitable not only for simulation but also for
emulation, that is, it is possible to introduce the simulator” with in practical network.
peculiar methods in the simulator are able to held live traffic into the simulator and
interjecting traffic from the simulator into the live network.
NS-2 plays a key role in the research profession of mobile ad hoc networks,”NS-2 is
the most used simulator for studies on mobile ad hoc networks, and it comes with a
rich suite of algorithms and models. In this view, NS-2 would be the innate candidate
to be used in BISON too. Unfortunately, its software architecture is such that adding
new components and/or modifying existing ones is not a straightforward process. That
is, in terms of user friendliness it is easy to implement and test new algorithms, NS-2
scores poorly with respect to other candidates. but, NS-2 does not surmount good in
terms” of number of nodes and it is reported to be in general quite slow from a
computational point of view. enhancements to support handovers in NS-2.”This
includes:
- Integration of multiple technologies (UMTS, Bluetooth, 802.16) to allow for
heterogeneous handovers.
- Modification of default implementation (802.11) to support handovers.
- Define a generic design for nodes with multiple interfaces”.

Demerits in NS simulation :

1) The Mobile Node is a massive and inadequate variable


2) The design of the wireless and mobile networking support is not cosistant:
3) The Mobile Node configuration API requires an ad-hoc routing protocol:
4) The Mobile Node configuration API is flat:
5) The current implementation lacks a common basis for routing
Protocols for wireless and mobile networks:
5) The use of agents for routing and forwarding bends basic design principles
6) it is very complex and difficult to handle because there is no proper documentation
available .

A.M.Law and W.D.Kelton, Simulation Modeling & Analysis, McGraw Hill


Publications, 1991.

J. Banks, editor. Handbook of Simulation : Principles, Methodology, Advances,


Applications, and Practice. Engineering and Management Press, 1998.

J. Banks. Introduction to simulation. In P. A. Farrington, H. B. Nembhard, D. T.


Sturrock,and G.W. Evans, editors, Proceedings of the Winter Simulation Conference,
1999.

ISO/IEC and IEEE draft international standards, Part 11: Wireless LAN Medium
Access Control (MAC) and Physical Layer (PHY) specifications, ISO/IEC 8802-11,
IEEE P802.11/D10, Jan 1999.
IEEE Std 802.11b-1999 (Supplement to ANSI/IEEE Std 802.11, 1999 Edition).

K. Tang and M. Gerla, MAC Reliable Broadcast in Ad Hoc Networks, Proceedings of


IEEE MILCOM 2001, McLean, Virginia, Oct. 2001.

NS-2 Newtork simulator. http://www.isi.edu/nsnam/ns/.

REAL Newtork simulator. 1997. http://www.cs.cornell.edu/skeshav/real/


overview.html.

You might also like