Professional Documents
Culture Documents
By
Aditya Kathpalia
College roll no. - A2345916002
Date:
CERTIFICATE
This is to certify that the project entitled ― AD HOC NETWORKS which is submitted by
Aditya Kathpalia is a record of the candidate work carried out by him under Mr. Hari Mohan
Pandey. The matter embodied in this is original and had successfully done.
Date:
ACKNOWLEDGMENT
I express my sincere thanks and deep sense of gratitude to Mr. Hari Mohan Pandey, AMITY
UNIVERSITY, NOIDA SECTOR – 125 for his valuable motivation and guidance, without
him this project report would not have been possible. I consider myself fortunate for having
the opportunity to learn and work under his able supervision and guidance during the report.
He left no stone unturned during the completion of this project.
Date:
TABLE OF CONTENTS
2. Chapter 2. Design…
2.1 DSR route discovery…
2.3.1 Explanation…
2.4.1 Explanation…
3. Chapter 3. Implementation……
3.1 Network Simulator 2……
3.1.1 NS2 Installation….
3.1.2 The OTCL Linkage…
3.1.3 Event Schedulers…
3.1.4 Steps to set up the simulation for wireless script
3.1.5 Produce some node movements
3.1.6 Set Stop Time and Start Simulation
4. Testing and Evaluation …
4.1 Debugging by Backtracking….
5. Chapter 7 Conclusions……
6. References……
CHAPTER 1: INTRODUCTION
PROBLEMS IN MANET
Routing
Security and Reliability
Quality of Service
Internetworking
Power Consumption
SECURITY
A major issue in Mobile ad-hoc network is “SECURITY”.
Routing protocols in ad hoc networks are broadly divided into two categories:
Reactive approach and Proactive approach
1.2PROACTIVE (TABLE-DRIVEN)
. Attempts to prevent an attacker from launching attacks through various cryptographic techniques.The
main disadvantages of such algorithms are:
Seeks to detect security threats and react accordingly.One option is to uncast consecutively when forwarding
data while promoting a new link. The main disadvantages of such algorithms are:
1. It takes long time when exploring new routes without a prior knowledge.
May refer to existing traffic to compensate for missing knowledge on routes. Examples: DSR, AODV
1.4 DSR PROTOCOL
Self Organizing
It determines how best to move packets around
Self Configuring
It determines the routes available
w/o existing network structure
w/o administration
Advantages of DSR
This project focuses on detection of two types of malicious behaviour exhibited by the nodes, the first one is
the malicious topology change behaviour and the other one is the malicious packet drop behaviour in DSR
protocol. These attacks (or malicious behaviour) hinder the communication between nodes and makes the
routing process difficult. Hence, these need to be corrected as they are not handled by the standard Dynamic
Source Routing protocol (DSR).
CHAPTER 2: DESIGN
First the initiator transmits a “Route Request” as a single local broadcast packet
Each Route Request identifies the initiator and target of the Route Discovery, and also contains a
unique request identification
Contains all records of each listing in which the address of each intermediate node is stored and
through which this particular copy of the Route Request has been forwarded.
1. It has recently seen another Route Request message from this initiator bearing this same
request ID and target address, or
2. This node’s own address is already listed in the route record in the Route Request
Otherwise, this node appends its own address to the route record and propagates it by
transmitting it as a local broadcast packet
Route Request returns a “Route Reply” (unicast) to the initiator of the Route Discovery
When the initiator receives this Route Reply, it caches this route in its Route Cache for using in
sending subsequent packets
2.2 BASIC DSR ROUTE MAINTENANCE:
E.g. if a node “C” is unable to deliver the packet to the next node “D”, then “C” returns a “Route
Error” to the original sender of the packet (node A)
A B C D E
Then node “A” tries to remove this broken link from its cache; i.e.; any retransmission of the original
packet can be performed by upper layer protocols
1. “A” should have in its Route Cache another route to” E”, then only it can send the packet
using the new route immediately
2. Otherwise, node A should perform a new Route Discovery for this target
2.3 FLOWCHART FOR LEADER NODE SELECTION
START
NO
EXISTS? LEADER NODE
YES
YES
The algorithm first compute the node degree of all the wireless nodes then, it takes a particular node and
checks the circular links for that node, by the checking of circular links we mean that the node arranges its
neighbours in increasing order of their node ID‘s and checks if that particular set of nodes forms circular
links or not (either connected by 1 hop or 2 hops), if all the circular links are not present then the node is
straight away marked as the leader node, otherwise it then checks for the log links , and for that we take the
floor values of the node degree for that node, supposedly it comes ―n‖ then from we check the connectivity
of nodes (either connected by 1 hop or 2 hops) at a distance of n hops away from that node in the circular
fashion that was previously taken.
If all the log links are present then the node is marked as the non-leader node and if even one link is missing
then it is marked as the leader node.
2.4 FLOWCHART FOR MALICIOUS NODE DETECTION
START
CALCULATE MEAN
TIME DIFFERENCE OF
NODES LEAVING THE
NETWORK
NO
BELOW
THRESHOLD?
YES
MALICIOUS NODE
2.4.1 EXPLANATION OF FLOWCHART FOR THE MALICIOUS NODE
DETECTION
The task of malicious node detection is accomplished by running two algorithms in parallel. It calculates the
mean on the time difference of the nodes leaving the network, and this is achieved by storing the timestamp
values whenever the node goes out of the field of the leader node.
CHAPTER 3: IMPLEMENTATION
Network simulator is a discrete event simulator targeted at networking research. Ns provides substantial
support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite)
networks.
o Scheduler – maintains ordered data structure with the events to be executed and fires them
one by one, invoking the handler of the event.
3.1.1 NS2 INSTALLATION
NS2 can be installed on windows, Linux platform and MAC OS. For details refer the link
mentioned in [13]:
OUTPUT:
3.1.2 THE OTCL LINKAGE
NS uses two languages because simulator has two different kinds of task which it needs to do. On one hand,
a detailed simulation of protocols requires a systems programming language which can efficiently
manipulate bytes, packet headers, and implement algorithms that run over large data sets. For these tasks
run-time speed is important and turn-around time (run simulation, find bug, fix bug, recompile, re-run) is
less important.
On the other hand, a large part of network research involves slightly varying parameters or configurations,
or quickly exploring a number of scenarios. In these cases, iteration time (change the model and re-run) is
more important. Since configuration runs once (at the beginning of the simulation), run-time of this part of
the task is less important. Ns meets these needs with two languages, C++ and OTcl. C++ runs fast but can be
change slowly, making it suitable for detailed protocol implementation. OTcl runs much slower but can be
changed very quickly (and interactively), making it ideal for simulation configuration.
3.1.3 EVENT SCHEDULERS
Main users of an event scheduler are network components that simulate packet-handling delay or that need
time.
(Fig.5)
Setting Up Variables
Setting Up Variables
. Define NS simulator
• set ns_ [new Simulator]
Define trace file
• set tracefd [open simple.tr w]
• $ns_ trace-all $tracefd
Create topology object
• set topo [new Topography]
Topography object with (x=500, y=500)
• $topo load_flatgrid 500 500
God (General Operations Director) Object
Configuring Movement
Create two nodes
for {set i 0} {$i < $val(nn) } {incr i}
{ set node_($i) [$ns_ node ]
$node_($i) random-motion 0 ;# disable random motion }
Explanation:
$ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0" means at time
50.0s, node1 starts to move towards the destination (x=25,y=20) at
a speed of 15m/s
4.1 DEBUGGING
Debugging is a two-step process that begins when we find an error as a result of a successful test case.
Step 1 is the determination of the exact nature and location of the suspected error within the program.
This approach has been used extensively in the making of the project and is defined as an effective method
for locating errors in programs is to backtrack the incorrect results through the logic of the program until you
find the point where the logic went astray. In other words, start at the point where the program gives the
incorrect result—such as where incorrect data were printed. At this point we deduce from the observed
output what the values of the program's variables must have been. By performing a mental reverse execution
of the program from this point and repeatedly using the process of "if this was the state of the program at
this point, then this must have been the state of the program up here," we can quickly pinpoint the error.
With this process we are looking for the location in the program between the point where the state of the
program was what was expected and the first point where the state of the program was what was not
expected.
4.3DEBUGGING BY INDUCTION
This is the second approach which has been used while making of the project. It should be obvious that
careful thought will find most errors without the debugger even going near the computer. One particular
thought process is induction, where we move from the particulars of a situation to the whole. That is, start
with the clues (the symptoms of the error, possibly the results of one or more test cases) and look for
relationships among the clues.
(Debugging by Induction)
CHAPTER 5: CONCLUSION
In this project work I have proposed a novel method for the detection of malicious nodes in DSR protocol
this method is named as MD-DSR (Malicious Detection In Dynamic Source Routing) which detects
malicious nodes. The detection of malicious nodes is done by leader nodes these leader nodes monitor all the
nodes in its neighbourhood.
Through simulations done in NS2 the results show that the proposed method MD-DSR is better than the
standard DSR in terms of packet delivery ratio, throughput, etc. The modified version of it detects malicious
nodes which was previously not there, moreover it detects the malicious nodes based on the two different
and exclusive criteria first is the mobility factor and the other one is the forward packet ratio.