2Outline What is OMNeT++? Installing OMNeT++ OMNeT++ Main Components Simple ExampleWSN Routing Algorithms (ex: LEACH, PEGASIS)WSN Example
3What is OMNeT++?OMNeT++ is a C++-based discrete event simulator for modeling communication networks, multiprocessors and other distributed systems.A new simulator for wireless sensor networks.Its results are very close to real world results.
4Installing OMNeT++ To install OMNeT++: Install Microsoft Visual C++. Install OMNeT (binary release) for windows.OMNET++ version 4, released in November 2008.OMNET++ Mailing List; you can send a message to the mailing list
6OMNET++ Main Components Your simulation must have 4 files:omnetpp.ini Specify: network, simulation speed, output-scalar-file, network area (x,y),number of nodes, other parameters, module. ned Defines the network and the modules in side it, and each module ( its gates and other parameters). module.cc , module.h Define the functionality of each module, mainly include:initialize()handleMessage(cMessage * msg)finish()
7Simple ExampleAfter creating the files ( .ned, .cc, .h, and omnetpp.ini)Open cmd console and go to your algorithm folder:Important: make sure that your path doesn’t contain any spaces. OR it will not run.Write these :opp_nmakemake -fnmake -f makefile.vc dependnmake -f makefile.vcAlgo.exe will resultAlgo. lets go to TicToc example
8WSN Routing Algorithms Wireless Sensor Network- WSN: a collection of a large number of sensors without the support of pre-existing infrastructure, distributed to be close to the phenomena being monitored.WSN main drawback is limited energy supported in sensors. (limited rechargeable, un-replaceable batteries)Main factor of energy consumption is communication: Transmitting, Receiving (consumes less).Routing algorithms control communication.
9WSN Routing Algorithms Cluster based routing algorithms: routing algorithms based on the idea of creating clusters to collect the data and route it from the sensors to the sink (BS).It is efficient because it:Reduces energy consumption within the cluster,Performs data aggregation, which:reduces the amount of data.reduces the number of packets to send to the sink.
10WSN Routing Algorithms LEACH - Low Energy Adaptive Clustering HierarchyPEGASIS - Power–Efficient Gathering in Sensor Information System
11Low Energy Adaptive Clustering Hierarchy LEACH Random < p/(1- p*(r mod 1/p) )?Steady-state PhaseabSetup Phase1. Advertisement Phase2. Cluster Setup Phase3. Schedule creationdcBSabcd
12LEACHAdvantages:Energy savings due to combining lossy compression with the data routing.It distributes energy-usage among the nodes; nodes die randomly and at the same rate.DisadvantageDoesn’t ensure that CH’s are uniformly placed across the whole sensor field,CH’s transmit data directly to the distant BS, while members sends to a close CH.
13Power–Efficient Gathering in Sensor IS PEGASIS Chain Construction PhaseData Aggregation PhaseBSId= Round/N
14PEGASIS Advantages: Saving energy by minimizing: The transmission distanceThe number of transmissions and receives for each nodeEach node will be the leader once every 100 rounds (for 100 nodes network).DisadvantagesMain: long chain and the very high delay probability;Nodes may have distant neighbours along the chain.Increasing neighbour distances will have a significant effect on PEGASIS performance
15WSN Example Lets see Solar Leach Example ( you can download it from
16Statistics - ScalarsTo test a value through the simulation and create a graph of its behavior.Use this in the .cpp files:recordScalar(“ValName", Value);ex:recordScalar("Rounds", this->rdone);recordScalar(" Dead Nodes", this->deadnodes);In omnetpp.sca file :The recorded values.Creating the graphs for values