You are on page 1of 51

Simulation of Mobile Ad hoc Network Routing Protocol

Project Guide: Prof. Pravin Malviya Team members : 1. Amey Bhangale 2. Pooja Chitrakar 3. Sanket Dhokte
4/17/12

(071070007) (071071012) (071070017) (071071030)

4. Dhanashree Kitukale

Background and Motivation

4/17/12

Mobile Ad hoc Network

Collection of autonomous nodes or terminals that communicate with each other by maintaining a connectivity in a decentralized manner. Network Topology is Dynamic. Hence need for efficient routing Click to edit Master subtitle style protocols.

Wireless Ad hoc Network:

4/17/12

Motivation

Various routing protocols behave differently in different enviornments. They are used for transmission of data packets in wireless network. So the aim is Study protocols AODV,DSDV on the basis of different parameters Evaluate their performance Study broadcasting mechanism in MANET Try to modify the code of AODV to reduce

1.

2.

3.

4.

4/17/12

Objective

Generate understanding of ad-hoc networks Generate Simulation Enviornment for study of protocols. Implement some proposed routing protocols. Analyse protocols by simulation. Analyse protocols in different wireless topologies.
4/17/12

Purpose

To standardize IP routing protocol functionality suitable for wireless routing application within both static and dynamic topologies with increased dynamics due to node motion and other factors. To compare AODV and DSDV protocols To study broadcasting mechanism using connected dominating set problem.

4/17/12

Scope

To allow users to study different routing protocols on various parameters To allow users to re vise the graphs and simulation results of the existing protocols To improve the broadcasting mechanism by reducing number of relay nodes To allow users to study this new mechanism and compare with the existing one 4/17/12

Literature Survey

4/17/12

Introduction

MANET : Type of a mobile network in which


Nodes act as router Permit multihop communication Military Applications Bluetooth

Applications:

4/17/12

Characteristics

Characteristics of MANET:

Dynamic Topology Limited CPU and storage capacity of host/node Limited battery power and bandwidth of host/node

4/17/12

Network
Network:

Group of interconnected computers Allows computers to communicate with others and share information and resources Signifies the way in which devices in the network see their logical relations to another. Independent 4/17/12 of physical layout of network.

Network Topology:

Types of Networks

Wired Networks:

Nodes are connected physically with the help of cable wires Eg. LAN Nodes are known to each other Data transfer and connectivity are never lost Data always reaches desired destination

4/17/12

Mobile Wireless Networks

Topolgy of network changes dynamically Types Of Network: Infrastructured Networks:


1.

Consist of fixed and wired gateways Bridge is known as Base Station A mobile unit communicates with nearest base station within communication radius Application- WLAN

4/17/12

Mobile Wireless Networks(Contd)


2.Infrastructureless Networks:

Nodes are mobile and connected dynamically in arbitrary manner Nodes behave as routers All nodes take part in discovery and maintenance of routesto other networks Applications- used in emergency search and rescue operation

4/17/12

Routing

Two main functions: Selection of routes for various sourcedestination pairs Delivery of message to correct destination A routing protocol is needed to find out the route of packet to its destination

1.

2.

4/17/12

Types of Routing Protocols

Centralized vs Decentralized

Centralized- All route choices are made at central node Decentralized- Computation of route is distributed or shared among network nodes

Static vs Adaptive

Static- Route used by source-destination pair is fixed

- can only change in response to node/link failure


4/17/12

Dynamic-Routes between source-destination

Types of Routing Protocols(Contd..)

Proactive vsReactive
Proactive-

4/17/12

Attempt to continuously evaluate the routes within the network When a packet needs to be forwarded, the route

Routing Protocol Properties

Distributed Operation
Loop free Demand Based Operation Short Control Message Security Less Power Consumption Multiple Disjoint Routes Quality Service Support
4/17/12

DSDV Protocol

Proactive Protocol Uses Bellman-Ford Algorithm

Each node maintains a hop count for each destination Nodes periodically send their routing tables to neighbours Nodes recalculate shortest path upon receipt of routing table update

Routes maintained through periodic and event triggered routing table exchanges 4/17/12

DSDV Protocol(Contd..)

Two types of Broadcasting:

Full Dump-Carry all the Routing Information Increamental Dump-Carry only information that has changed since last full dump

Incremental dumps and settling time used to reduce control overhead. Proactive protocols tend to perform best in networks with low to moderate mobility, 4/17/12 fewer nodes, and many data sessions

DSDV Protocol(Contd..)

AdvantagesSuitable for creating ad hoc networks with small number of nodes Gurantess loop free paths Can avoid extra traffic with increamental updates Amount of space in routing table is reduced as it maintains only best path

1.

2.

3.

4.

4/17/12

DSDV Protocol(Contd..)

Disadvantages Requires regular update of routing table and hence large battery power Not sutable for highly dynamic networks Does not support Multi path Routing Difficult to determine time delay

1.

2.

3.

4.

4/17/12

AODV Protocol

Reactive Protocol Aims to minimize the system wide broadcasts Does not maintain route from every node Key steps of algorithm

4/17/12

Route Discovery Expanding Ring Search Technique Setting up of Forward Path Route Maintenance

AODV Protocol(Contd..)

Advantages: Favours least congested route than shortest route Supports both unicast and multicast packet transmission Responds quickly to topological changes Does not put any additional overhead on data packets

1.

2.

3.

4.

4/17/12

AODV Protocol(Contd..)

Requires that nodes in the broadcast medium should detect each others broadcast As nodes are mobile,their sending rates may differ Vulnerable to various kinds of attacks Route cant be established without cooperation among nodes.
4/17/12

Network Simulator 2

4/17/12

Overview of NS2

Discrete Event Simulator Packet level Modeling Network protocols

Collection of Various protocols at multiple layers


TCP(reno, tahoe, vegas, sack) MAC(802.11, 802.3, TDMA) Ad-hoc Routing (DSDV, DSR, AODV, TORA) Sensor Network (diffusion, gaf) Multicast protocols, Satellite protocols, and many others

4/17/12

Overview of NS2

Maintained through VINT project NS2 :collaborative simulation environment

Freely distributed and open source Supports NT research and education

Protocol design , traffic analysis etc.

Provides common reference

4/17/12

NS2 Components

NS Simulator NAM Network AniMator

visual demonstration of NS output Handwritten TCL or Topology generator

Preprocessing

Post analysis

Trace analysis using Perl/TCL/AWK/MATLAB

4/17/12

Users Perspective

From the users perspective, NS2 is an OTcl interpreter that takes an OTcl script as input and produces a trace file as output.

4/17/12

Discrete Event Simulator

ns-2 is an discrete event driven simulation

Physical activities are translated to events Events are queued and processed in the order of their scheduled occurrences Time progresses as the events are processed
Time: 1.5 sec Time: 1.7 sec

1
Time: 2.0 sec

2
Time: 2.0 sec

4/17/12

Basic use of an event scheduler:

schedule simulation events, such as when to start an FTP application, when to finish a simulation, or for simulation scenario generation prior to a simulation run.

4/17/12

NS2 Environment
Simulation Scenario
1 2

set ns_ [new Simulator] set node_(0) [$ns_ node]

Tcl Script

set node_(1) [$ns_ node]

C++ Implementation

class MobileNode : public Node { friend class PositionHandler; public: MobileNode(); }

4/17/12

IMPLEMENTATION

4/17/12

Code for simple wireless topology

Creating a Simulator Object

set ns [new Simulator]

Setting up files for trace & NAM

set trace_nam [open out.nam w] set trace_all [open all.tr w]

Tracing files using their commands

$ns namtrace-all-wireless $trace_nam 500 500 $ns trace-all $trace_all

4/17/12

Set up topography object

Code for simple wireless topology

Defining options :

set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/TwoRayGround ;# radiopropagation model set val(netif) Phy/WirelessPhy interface type set val(mac) ;# network

4/17/12

Code for simple wireless topology

Configuring node
$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) \
4/17/12

Code for simple wireless topology

Closing trace file and starting NAM

proc finish { } {

global ns trace_nam trace_all $ns flush-trace close $trace_nam close $trace_all exec nam out.nam & exit 0 }

4/17/12

Creating nodes

Code for simple wireless topology

Setting initial positions of the nodes

$node_(0) set X_ 5.0 $node_(0) set Y_ 2.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 390.0 $node_(1) set Y_ 385.0 $node_(1) set Z_ 0.0 $ns at 50.0 "$node_(1) setdest 25.0 20.0

Giving motion to the nodes


4/17/12

Code for simple wireless topology


Setup traffic flow between nodes TCP connections between node_(0) and node_(1)

set tcp [new Agent/TCP] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp $ns attach-agent $node_(1) $sink

4/17/12

Code for simple wireless topology

Tell nodes when the simulation ends

for {set i 0} {$i < $val(nn) } {incr i} { $ns at 150.0 "$node_($i) reset"; } $ns at 150.0 finish" $ns at 150.01 "puts \"NS EXITING...\" ; $ns_ halt puts "Starting Simulation..." run

$ns 4/17/12

Simulation visible on NAM

4/17/12

Broadcasting

4/17/12

Use of Broadcasting

To send information to all nodes in network To transfer routing tables To get network topology

4/17/12

4/17/12

Screenshot 4.1 How node gets neighbors information through HELLO packets

Results And Analysis

4/17/12

Result And Analysis

Average packet size vs. Number of Nodes

For AODV- The average packet size goes on increasing as the number of nodes increases. For DSDV- The average packet size goes on decreasing as the number of nodes increases.

4/17/12

Average throughput vs. Number of Nodes

For AODV- The average throughput decreases with increasing number of nodes. For DSDV- The average throughput decreases with increasing number of nodes.

4/17/12

Average Delay vs. Number of

Packet Delivery Ratio vs. Number of Nodes

For AODV- Packet Delivery Ratio increases as the number of nodes increases. For DSDV- Packet Delivery Ratio decreases as the number of nodes increases.

4/17/12

Conclusion

4/17/12

Conclusion

Thus on comparison, we found that, DSDV being proactive, it shows constrained behavior. Here as the route is already known to the routers, they follow the same path. Therefore it cant give its best behavior in some areas of performance. AODV being reactive, it shows better performance in most of the cases. As the route between the protocols is on 4/17/12

You might also like