100% found this document useful (1 vote)
179 views

Mobile Ad Hoc Network Simulation Using NS2: ANUSHA REDDY (T150228560)

This document discusses simulating mobile ad hoc networks using the NS2 simulator. It covers creating scenarios, configuring simulation parameters like mobility models, programming languages used in NS2 like OTcl and C++, generating network traffic, and analyzing results. The purpose of the simulation is to evaluate protocol performance under different conditions before real-world deployment. Mobility and connectivity metrics are examined for various mobility models.

Uploaded by

Anusha Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
179 views

Mobile Ad Hoc Network Simulation Using NS2: ANUSHA REDDY (T150228560)

This document discusses simulating mobile ad hoc networks using the NS2 simulator. It covers creating scenarios, configuring simulation parameters like mobility models, programming languages used in NS2 like OTcl and C++, generating network traffic, and analyzing results. The purpose of the simulation is to evaluate protocol performance under different conditions before real-world deployment. Mobility and connectivity metrics are examined for various mobility models.

Uploaded by

Anusha Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Scenario Creation

Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

Mobile Ad hoc Network Simulation using NS2

ANUSHA REDDY (T150228560)

Project Guide
G. M. WALUNJKAR

April 11, 2019

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CONTENTS

1 Scenario Creation
2 Simulation Parameters
3 Mobility Models
4 Programming Languages
5 Traffic Generation
6 NS2 System
7 Conclusion
8 References

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

LITERATURE SURVEY

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

BUILDING SCENARIO
Scenario:-
To address networking issues like protocol interaction,
congestion control, effect of network dynamics,
scalability etc it is neccesssary to carry simulations on the
right kind of scenario.
It should not be limited to the topology size, density
distribution, traffic generation, network dynamics etc.
The NS Scenario Generator can be used to create random
scenarios for simulation.
It consists of:
Topology generator, Agent generator and Routing
generator
ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2
Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

SIMULATION

Simulation: Imitating how events may occur in a real


situation.
Need: To reproduce essential features for training.
In simulation, a mathematical model is created to reproduce
the characteristics of an incident system.
Examples of Network Simulators:
NS, OPNET and NetSim

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

PROGRAMMING A SIMULATION

A simulation program has following parameters:


simulated time: internal (to simulation program) variable
that keeps track of simulated time
system ”state”: variables maintained by simulation program
define system ”state” - track number (possibly order) of
packets in queue, current value of re-transmission timer
events: points in time when system changes state - arrival of
packet to queue, departure from queue

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

Simulator Block Diagram

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CONFIGURING PARAMETERS

Table 1 Simulation Parameters


Parameter Value Description
Simulation area 500mx500m Physical boundary of the network
No.of nodes 20 Nodes participating in simulation
Simulation time 300s Max execution time
Data payload 512 bytes Packet size
Movement model Random waypoint Network connection
Transmission range 100m Frequency of the nodes
Traffic type CBR (UDP) Defines type of traffic
Routing protocol AODV Routing protocol used

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

Mobility Models:-
The performance of a protocol for an ad-hoc network is
evaluated by testing them under reasonable conditions,
particularly including the group of the mobile nodes, the
data traffic and communication range.
The changes in speed and direction should occur within
reasonable time slots.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CLASSIFICATION

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

MOBILITY MODEL METRICS

Types:
Mobility metrics(spatial dependence, relative speed and
geographic restrictions)
Connectivity graph metrics(no. of link changes, link
duration, path duration and availability)
Protocol performance metrics (throughput and routing
overhead)

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

GRAPHICAL ANALYSIS

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CB Overhead Vs Speed

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

Routing Overhead under different Mobility Models

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

INTEGRATION OF OTcl,C++

Table 2 Programming Languages


Parameter C++ OTcl

Language System Language Scripting Language

Type Compiler Interpreter

Use Configuration, setup, or one time simulation quickly exploring no. of scenarios(Packets)

Feature1 TAT (run sim, find and fix bug, recompile)slower Iteration time (change model and re-run) is more important

Feature2 Fast and robust language Slow and not so robust

Feature3 High efficiency Low efficiency

Feature4 Slow to change Fast to change

Feature5 Code conversion into machine language No conversion

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

Features of Tcl:-
1. Every data types can be manipulated as strings.
2. Completely dynamic, class-based object structure 3. Tcl has
advanced features such as meta-classes etc filters.
4. All commands defined by Tcl will create error messages when
the usage is incorrect.
5. Extensibility using C, C++, Java, and Tcl and cross-platform
usage eg., Windows API; UNIX, Linux, Macintosh, etc.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CREATING CONNECTION

Procedure 1 TCP Agent Procedure 2 UDP Agent


1.set Src-agent [new Agent/TCP] 1.set Src-agent [new Agent/UDP]
*ns attach-agent *n0 *Src-agent *ns attach-agent *n0 *Src-agent
2.set Dest-agent [new 2.set Dest-agent [new
Agent/TCPSink] Agent/NULL]
*ns attach-agent *n1 *Dest-agent*ns attach-agent *n1 *Dest-agent
*ns connect *Src-agent *ns connect *Src-agent
*Dest-agent *Dest-agent

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

TRAFFIC GENERATION Continue

Traffic Creation
set src [new Application/FTP/Telnet/CBR]
*src attach-agent *Src-agent
Parameterize, Start and Stop a Traffic Source
set src [new Application/Traffic/CBR]
*src attach-agent *Src-agent
*src set interval 40ms
*src set packetSize 500
*ns at 10.0 “*src start”
*ns at 100.0 “*src stop”

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

ARCHITECTURE
The NS-2 architecture comprises of five parts:
Event scheduler, Network components, Tclcl, OTcl library,
Tcl 8.0 script language

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

NS2 FEATURES SUPPORTING MANET

Why NS2?
A network environment for Ad-Hoc Networks
Wireless channel modules (e.g.802.11)
Routing along multiple paths
Mobile hosts for wireless cellular networks
Features:
NS2 is an object-oriented Network Simulation tool
Discrete event driven network simulator
Works at packet level
Uses Tcl as its scripting language

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

WORKING OF NS2
1. Define Network topology, load, output files in Tcl Script
2.To run, $ ns simple network.tcl
3. Internally, NS2 instantiates C++ classes based on the tcl scripts
4. Output is in form of trace files
5. NAM :- NS2 Visualization Tool
6. Xgraph:- NS2 Analysis Tool

Table 3 Simulation Tools


Name Popularity License Programming Language
NS2 88.8% Open Source C++, Tcl
GloMoSim 4% Open Source parsec
OPNet 2.61 Commercial C

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CONCLUSION I

In this work, we plan to use the discrete event simulator NS2


(version 2.35). Network performance is tested using AWK script
with NAM and Xgraph tools.
For the evaluation of a particular factor we will consider the average
value of the performance results of say 3 random scenario patterns.
Routing overhead and End to End Delay factors are compared in
two environments (AODV and DSDV).

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

CONCLUSION II

Traffic patterns, node density area also affect the routing


performance and need to be investigated with various scenarios.
Hence above performances will be analyzed under following
scenarios:
(i) varying the number of nodes
(ii) varying the pause time
(iii) varying the network area.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

REFERENCES I

[1] N Baldo, F Maguolo, M Miozzo et al., ”ns2-MIRACLE: a modular


framework for multi-technology and cross-layer support in network
simulator[C]”, international Conference on PERFORMANCE
Evaluation Methodolgies and Tools Valuetools 2007, pp. 1-8,
October. 2007.
[2] B Liu, D R Figueiredo, Y Guo et al., ”A study of networks
simulation efficiency: fluid simulation vs. packet-level
simulation[C]// INFOCOM 2001”, Twentieth Joint Conference of
the IEEE Computer and Communications Societies. Proceedings.
IEEE, vol. 3, pp. 1244-1253, 2001.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

REFERENCES II

[3] The Network Simulator - ns-2, developed by L. Berkeley Network


Laboratory and University of California Berkeley,
http://www.isi.edulnsnamlns.

[4] XGraph:- http://jean-luc.ncsa.uiuc.edu/Codes/xgraph

[5] Network Animator (NAM):- http://www.isi.edu/nsnam/nam

[6] S. Corson, J. Macker, Mobile Ad hoc Networking (MANET):


Routing Protocol Performance Issues and Evaluation Considerations
[S], RFC2501, 1999.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

REFERENCES III

[7] Geetha Jayakumar and G. Gopinath, ”Performance comparison of


two on-demand routing protocols for Ad-hoc networks based on
random way point mobility model,” American Journal of Applied
Sciences, pp. 659- 664 , June 2008.

[8] Geetha Jayakumar and Gopinath Ganapathy, ”Performance


comparison of Mobile Ad-hoc Network Routing Protocol,”
International Journal of Computer Science and Network Security
(JJCSNS 2007), vol. VII, no. I I, pp. 77-84, November 2007

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

REFERENCES IV

[9] Jain A, Pruthi A, Thakur R C , Bhatia M P S, ”TCP analysis over


wireless mobile ad hoc networks”, Personal Wireless
Communications, 2002 IEEE International conference on Digital
Object Identifier, pp. 95-99, 2002.

[10] Buruhanudeen S, Othman M, Ali B M,”Existing MANET routing


protocols and metrics used towards the efficiency and reliability- an
overview ”, Telecommunications and Malaysia International
Conference on Communications, 2007. ICT-MICC 2007. IEEE
International Conference on, Page(s): 231 - 236, 2007.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2


Scenario Creation
Simulation Parameters
Mobility Models
Programming Languages
Traffic Generation
NS2 System
Conclusion
References

REFERENCES V

[11] Neha Singh, Prof. Rajeshwar Lal Dua, Vinita Mathur ”Net- work
Simulator NS2-2.35” International Journal of Advanced Research in
Computer Science and Software Engineering.

[12] Kelvin Fall, ”The ns manual (formerly ns Notes & Documen-


tation)”, US Berkerley LBL USC/ISI and Xerox PARC,2010.

[13] B. S. Gouda, D. Patro and R. K. Shial, ”Scenario-Based


Performance Evaluation of Proactive, Reactive and Hybrid Routing
Protocols in MANET Using Random Waypoint Model,” Information
Technology (ICIT), 2014 International Conference on, Bhubaneswar,
2014, pp. 47- 52.

ANUSHA REDDY (T150228560) Mobile Ad hoc Network Simulation using NS2

You might also like