SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Downloaden Sie, um offline zu lesen
Evaluation of resource discovery protocol in ad-hoc-sharing networks
Submitted to
Dr. Kavitha Ranganathan
Associate Professor at IIM Ahmedabad
By
Ines Khandelwal
ines.khandelwal@gmail.com
Swayam Tibrewal
swayam2607@gmail.com
Objective:
Implementation of Scalable Broadcast Algorithm for file sharing in a Mobile Ad Hoc Network.  
Software Used
Omnet++​​https://omnetpp.org/
Version : ​OMNeT++ 5.0b3 released Wednesday, 09 December 2015 15:09
Omnet++ is a discrete event simulator, which is an extensible modular component based C++
Simulation library and framework for building network simulators.
We chose Omnet because it is one of the most popular Open Source Open Source Network
Simulators used for MANETs and VANETs related simulations. As a trend we found that most
papers before 2008 used ns-2 (no longer under active development) as the simulator and after
that most of the papers preferred Omnet++ or the simulators built on top of it or the ones such
as MIXIM and MANET-INET which were later deprecated and became part of INET Framework.
Oment's biggest advantage is the presence of libraries such as INET which is built on top of
Omnet++ especially for wireless and mobile Networks.
INET​​https://inet.omnetpp.org/
Version: ​INET 3.2 Released Thursday, 17 December 2015 15:03
 
Operating System: 
Ubuntu 14.04 LTS 
Windows 10 
 
However for debugging, only Ubuntu was used due to trouble with debugging on Windows. The 
final implementation was however tested on both Machines 
Installation Directions and Guidelines can be found in the respective sites. However if the
supplied zip is used, it will not be needed.
Scalable Broadcasting Algorithm
Source: On the Reduction of Broadcast Redundancy in Mobile Ad Hoc Networks (Wei Peng
Xi-Cheng Lu)
1) For source s, it just broadcasts messages to all its neighbors and ignores duplicate messages
received later.
2) For any other node, say u, when it receives a broadcast message m from node r, it performs
the following operations:
a) If N(u) is a subset of N(r) U {r}, then no rebroadcast need be performed and the duplications
received later will be dropped.
b) Or else, if the message is received firstly, then let C(u,m)=N(r) U {r}, and schedule a
rebroadcast by delaying the rebroadcast operation for a random period. In this period,
any successive duplicates will be discarded, and at the mean time the information of the nodes
covered by the transmissions will be recorded in the broadcast cover set. That is, if m is a
duplicate, then let C(u, m)=C(u, m) U N(r) U{ r}, and discard m.
c) After the delay period is expired, if N(u) is a subset of C(u, m), then cancel the rebroadcast; or
else, rebroadcast the message m. The duplicate messages received later will be ignored.
File Sharing Network
The aim is to simulate a Mobile Ad Hoc Network where a node needs a particular file, not
available to it.
In this process, it first searches for the file in the network and must first tabulate the routes to
all possible replicas. The route to these replicas must then be stored in a certain data structure
which must be a property of only that node and then depending on the calculation of stability
metric, we must decide on the route from where the node should receive the file.
Note: The implemented module is henceforth referred to as IIM Model.
Implementation
The IIM Model has been built on top of AODV.
In Spite of our primary work being that of broadcasting protocol, which was successfully
implemented using SBA; since routes back to a node must be stored, the routing protocols had
to be considered.
These ideas were borrowed from the AODV Routing Protocol which is already implemented in
the INET Framework.
The entire code has been written on top of AODV Framework. The original AODV Files were
taken renamed to IIM and then they were modified. Also by making changes in linkings in the
INET Namespace, we were able to ensure that IIM was registered as a proper protocol in the
INET Codebase.
INET Usage
INET maintains a separate structure for all layers as per the OSI Framework. For easy
references, all commands to be typed in the Terminal are in Bold Letters.
Building Source Files
Since IIM is implemented as a part of main INET Framework , the files must be built again and
again whenever a change is made to the files.
For this navigate to inet root Directory and in Terminal type
make makefiles
This command generates the makefile corresponding to the source files.
Then type
make
This command builds the source and if the files are built for the first time, it takes 20-25
minutes. In this scenario, it generates a libINET.so (library INET), a library which the simulations
will use. This library is created in the “inet/src” directory
Also do not try to modify the makefile after it has been created.
src Directory
The src Directory (“inet/src”) has the library and all the major sources.
Navigate to (“inet/src/inet/routing/iim”) to look at the source files for IIM Protocol
1. IIM.ned  which defines the IIM simple module with its gates and 
parameters,  and contains its documentation as a comment (so that it can later 
be  extracted into HTML by the ​opp_neddoc  tool) 
2. IIMControlPacket.msg which defines the architeture of messages taht will besent 
to nodes in IIM 
3. IIMRouting.h  which contains the simple module class (class IIMRouting : public 
cSimpleModule) with its corresponding changes. 
4. IIMRouting.cc which contains the implementation (member functions) of the 
IIMRouting class 
5. IIMRouteData.h and IIMRouteData.cc which define a few parameters for the 
Route taken by a packet.  
Navigate to (“inet/src/inet/node/iim”) to look at the Router used in the IIM Simulation.
examples Directory
Navigate to (“inet/examples/iim”) to look at the files used in the simulation
There are two major files in this directory:
1. IIMNetwork.ned This file defines the simulation variables and parameters
2. omnetpp.ini : This file defines all the simulation parameters
Debugging
Using debuggers in INET has no proper documentation available. However the following trick
works. Instead of generating the library which occurs by default, an EXE file corresponding to
INET sources can be generated by tweaking the process of making makefiles. However for using
that the simulations need to be done differently
Tweak for makefiles:
For this navigate to inet root Directory and in Terminal type
make makefiles-exe
This command generates the makefile corresponding to the source files.
Then type
make
This command builds the source and if the files are built for the first time, it takes 20-25
minutes. In this scenario, it generates a INET (executable file).
For a few errors, this executable can then be tested using gdb and valgrind to analyze what is
happening. However it works only for segmentation faults and not for any other kind of faults
which may be causing the simulation to crash. In case of certain other faults, the log files of
simulation must be analyzed.
To run the executable all files in the example directory must either be given as a parameter or
shifted to the src directory.
File Matching Function 
 
We need to simulate a decision criteria which helps to determine which file is being searched for 
Assumptions: 
1. In a given simulation run, only one node is specified as “demander” and only this 
node can demand files. 
2. In a given simulation run, the demander can only ask for one file 
Clearly for the simulation to work, a matching function must exist which decides whether the 
node has that file or not. 
 For this the function takes Node ID’s of the given node and compares its modulo from a 
pre­specified divisor with a pre­specified modulo value. If these are equal, the node has the file 
else it doesn’t 
Say divisor =5 
       modulo = one of {4,3,2,1,0} 
Let’s assume modulo is 4 
then all nodes with Node ID’s 4 modulo 5 are assumed to have the file 
Say we start with a modulus of 4, divisor 5 and 20 nodes 
So as per our matching function 
if n modulo 5 is same nodes have that file, where n is node ID 
So Node 1,6,11,16 have a file. 
 
If the request for a file reaches a node for which this file matching condition holds, it must create 
a route for the path using AODV Protocol’s Parameters. 
  
Neighbor Table and Stability Metric
The original idea was to implement the neighbor table for each node separately. However since
a routing table for routes must also be maintained for the routes, the two tables were merged
and now there is only one data structure which each node has, the routing table.
The routing table in AODV can be used to determine the neighbors. All nodes for which
hop-count is just one, are neighbors of the given node. Also AODV has an in built
implementation of Hello Messages that periodically updates the corresponding nodes. This
implementation is as per the following RFC 3561 specification :
https://tools.ietf.org/html/rfc3561.html
In order to achieve the objectives, a node’s routing table must store routes to all neighbours. In
intelligent AODV, only those nodes get updated periodically which are used in processing of
requests. This feature is removed in the IIM Model by forcing the node to send periodic Hello
messages to all its neighbours and the node now keeps tracks of all its neighbours by
generating new HELLO Messages after a certain fixed interval.
These two aspects ensure that the Routing table of RFC 3561 Specification is tweaked to act as
Neighbour Table too.
The stability metric was to be calculated on the basis of time at which nodes are created and
the routing table allows us to specify the time at which the route is created. This is inbuilt in
AODV as the routes become invalid if the Current SimTime- Time of Last Update rises above a
certain limit. These times which are a property of “route” stored in the Routing Table can be
used to determine using the same “Current SimTime- Time of Last Update” parameter the
stability of the route.
The IIM Model is extensible in this direction but this feature has not been implemented.
SBA Algorithm 
Implementation Strategy: 
1. We have a global variable of nodes the message has passed through.  This is implemnted 
as a set of visited Nodes which is available to all the nodes and is updated when the 
broadcast message looking for files reaches them.  
2. Most  algorithms try to ensure that we are able to prevent duplicates by maintaining a 
copy of which message was received or broadcasted. For instance if a neighbor of the 
source broadcasts, it is natural that the source node will receive the message as well and 
must handle it as well.  
3. Once a node has broadcasted, all its neighbours and the node itself have already 
been accounted for in the global set of visited nodes. Hence for the same simulation 
run, that node cannot broadcast again. ​However there could be time complexities 
associated in the process of comparing the list of visited nodes with the neighbour set 
which could not been taken into account if the algorithm is scaled up.   
4. Alternately a strategy of marking nodes as visited and setting them to stop or ignore all 
messages after they have broadcasted or decided not to broadcast received subsequently 
also poses problems if the simulation needs to be extended beyond resource discovery. 
There can be more messages than those for resource allocation which cannot be ignored 
5. Now if the node is the originator it’s neighbors are added and it always broadcasts.
6. Now we reach a ​Node A, and B and C are its neighbours. 
7.
1. B and C are already covered. Then this node simply deletes the packet 
in question and won’t rebroadcast. 
2. At  least one of B and C is not there. There has to be a random delay. 
After the delay there, are only two possibilities, A broadcasts or not. During the 
delay, new nodes are covered accounted for. 
i. To implement the delay, the ​node schedules a self message called 
RADTimer​ which is scheduled after a certain random delay.  
ii. This self message instructs the node to, after a certain delay proceed as it 
did before, compare the global covered set and see if it should rebroadcast 
or not.   
 
Expanding Ring SBA 
Here you first restrict yourself to say n hops and then n+m, n+2m hops and so on. Say each hop 
takes one unit of time. We use the parameter TTL or Time to live as a measure of the number of 
hops for which a message should survive. 
Then the TTL or Time to Live of a message can be changed accordingly. 
Initially TTL = m 
On encountering a new node, decrease TTL by one, Omnet does this automatically 
When TTL =0 and no reply has been sent back TTL = n. 
Terminating Condition: Either all nodes are covered or a reply was received. 
So if you are the originator send TTL of m and decrement it. If the TTL value becomes 0 then 
increase it by n in subsequent runs. 
 
Simulation Working 
Hello messages occur throughout the simulation as per certain parameters defined in the .NED 
file. 
Broadcast Messages are generated by the node which wants to find the file.  
Even though these are broadcast messages yet when they go back to their originator, they must 
take back two things, the stability metric of the route and the route to that node in the routing 
table 
Eventually multiple routes will come and the protocol must choose the one with least hops as the 
most optimal route. 
So some of these messages are also requests for route assuming they find the node which obeys 
the file matching Question in which case they must create a route. 
Because the nodes maintained neighbors, this route already exists but has to be formally inserted 
in the routing table. 
eg: 
A was the originator 
A’s neighbor is B 
B’s neighbor is C 
 
C has the file. Then the route from Cto A exists via B. Upon generating a route request, this route 
is found and stored in the Routing Table as per AODV Specifications. 
 
However the random delay procedure could ensure that the most optimal route is not found when 
the number of hops the node must go through increases. For instance, it is possible that the 3 hop 
timer finishes before the 2 hop one.  
So upon termination of simulation, the originator node as defined in simulation will have 
knowledge of a few nodes which have a replica as per the file matching function and the route to 
them from which the stability can be calculated. 
 
Evaluation of Results 
To analyze the results, in the same directory as Omnet++ a folder named Result is created which 
has the Log Files of the Routing Table which can be analyzed to see if the node successfully 
found the files it was looking for or the existence of IIM­RREQ messages during the Simulation.  
 
Modifying Parameters 
All parameters are defined in the Omnet++ IIM.ned file  
(inet/src/inet/routing/iim/IIMRouting.ned) 
In this file the values can be changed for the following parameters 
 
1. Parameters of Expanding Ring SBA Implementation 
a. n // Starting TTL 
b. m // Incremental TTL 
c. RAD Delay , the maximum Random delay . Delay will be among these values 
2. Parameters of File Discovery Function 
a. modulus 
b. divisor 
c. originator // Index of the host node from host0 to host 19 given as 1 to 20  
3. Parameters of Hello Message 
a. allowed Hello Loss 
b. Hello Interval 
All other corresponding documentation is available in the Code  
Instructions for using the Zip File
Extract the contents. Change directory to src
cd inet/src
Now run the executable
./INET
Alternately navigate to examples
cd inet/examples/iim
Now run the file
./run

Weitere ähnliche Inhalte

Was ist angesagt?

Interprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.SInterprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.SHussain Ala'a Alkabi
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Network infrastructure - TCP/IP
Network infrastructure - TCP/IPNetwork infrastructure - TCP/IP
Network infrastructure - TCP/IPraymondkao
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Pradeep Kumar TS
 
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...Andrea Tino
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifiSalah Amean
 
Lecture 3
Lecture 3Lecture 3
Lecture 3Mr SMAK
 
ITFT_Inter process communication
ITFT_Inter process communicationITFT_Inter process communication
ITFT_Inter process communicationSneh Prabha
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelIntel® Software
 
ECET 375 Entire Course NEW
ECET 375 Entire Course NEWECET 375 Entire Course NEW
ECET 375 Entire Course NEWshyamuopuop
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building andcseij
 

Was ist angesagt? (20)

loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Ipc
IpcIpc
Ipc
 
Interprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.SInterprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.S
 
Ipc
IpcIpc
Ipc
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
4.129 tybsc it
4.129 tybsc it4.129 tybsc it
4.129 tybsc it
 
project_531
project_531project_531
project_531
 
Network infrastructure - TCP/IP
Network infrastructure - TCP/IPNetwork infrastructure - TCP/IP
Network infrastructure - TCP/IP
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...
Implementation of a Deadline Monotonic algorithm for aperiodic traffic schedu...
 
IPC
IPCIPC
IPC
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifi
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
TensorRT survey
TensorRT surveyTensorRT survey
TensorRT survey
 
ITFT_Inter process communication
ITFT_Inter process communicationITFT_Inter process communication
ITFT_Inter process communication
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next Level
 
ECET 375 Entire Course NEW
ECET 375 Entire Course NEWECET 375 Entire Course NEW
ECET 375 Entire Course NEW
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
 

Ähnlich wie Report_Ines_Swayam

parallel programming models
 parallel programming models parallel programming models
parallel programming modelsSwetha S
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxPratik Joshi
 
Wireless Communication Network Communication
Wireless Communication Network CommunicationWireless Communication Network Communication
Wireless Communication Network CommunicationVrushali Lanjewar
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptxSimRelokasi2
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net frameworkFaisal Aziz
 
How to write shared libraries!
How to write shared libraries!How to write shared libraries!
How to write shared libraries!Stanley Ho
 
Chapter 1 introduction to .net
Chapter 1 introduction to .netChapter 1 introduction to .net
Chapter 1 introduction to .netRahul Bhoge
 
1-Information sharing 2-Computation speedup3-Modularity4-.docx
1-Information sharing 2-Computation speedup3-Modularity4-.docx1-Information sharing 2-Computation speedup3-Modularity4-.docx
1-Information sharing 2-Computation speedup3-Modularity4-.docxSONU61709
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qaabcxyzqaz
 
PThreads Vs Win32 Threads
PThreads  Vs  Win32 ThreadsPThreads  Vs  Win32 Threads
PThreads Vs Win32 ThreadsRobert Sayegh
 

Ähnlich wie Report_Ines_Swayam (20)

An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4
 
parallel programming models
 parallel programming models parallel programming models
parallel programming models
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linux
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Wireless Communication Network Communication
Wireless Communication Network CommunicationWireless Communication Network Communication
Wireless Communication Network Communication
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
 
How to write shared libraries!
How to write shared libraries!How to write shared libraries!
How to write shared libraries!
 
Multicore
MulticoreMulticore
Multicore
 
Chapter 1 introduction to .net
Chapter 1 introduction to .netChapter 1 introduction to .net
Chapter 1 introduction to .net
 
Virtual lab - Routing in Mobile Adhoc Networks
Virtual lab - Routing in Mobile Adhoc NetworksVirtual lab - Routing in Mobile Adhoc Networks
Virtual lab - Routing in Mobile Adhoc Networks
 
Cc module 3.pptx
Cc module 3.pptxCc module 3.pptx
Cc module 3.pptx
 
1-Information sharing 2-Computation speedup3-Modularity4-.docx
1-Information sharing 2-Computation speedup3-Modularity4-.docx1-Information sharing 2-Computation speedup3-Modularity4-.docx
1-Information sharing 2-Computation speedup3-Modularity4-.docx
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Wissbi osdc pdf
Wissbi osdc pdfWissbi osdc pdf
Wissbi osdc pdf
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
PThreads Vs Win32 Threads
PThreads  Vs  Win32 ThreadsPThreads  Vs  Win32 Threads
PThreads Vs Win32 Threads
 

Report_Ines_Swayam