420 likes | 995 Views
Introduction to OMNeT++. Nailah Shokre Al Madi nsalmadi06@cit.just.edu.jo. Outline. What is OMNeT++? Installing OMNeT++ OMNeT++ Main Components Simple Example WSN Routing Algorithms (ex: LEACH, PEGASIS) WSN Example. What is OMNeT++?.
E N D
Introduction to OMNeT++ NailahShokre Al Madi nsalmadi06@cit.just.edu.jo
Outline What is OMNeT++? Installing OMNeT++ OMNeT++ Main Components Simple Example WSN Routing Algorithms (ex: LEACH, PEGASIS) WSN Example nsalmadi06@cit.just.edu.jo
What 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. www.Omnetpp.org nsalmadi06@cit.just.edu.jo
Installing OMNeT++ To install OMNeT++: Install Microsoft Visual C++. Install OMNeT++ 3.3 (binary release) for windows. OMNET++ version 4, released in November 2008. OMNET++ Mailing List; you can send a message to the mailing list nsalmadi06@cit.just.edu.jo
OMNET++ 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() nsalmadi06@cit.just.edu.jo
Simple Example After 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 -f nmake -f makefile.vc depend nmake -f makefile.vc Algo.exe will result Algo. lets go toTicTocexample nsalmadi06@cit.just.edu.jo
WSN 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. nsalmadi06@cit.just.edu.jo
WSN 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. nsalmadi06@cit.just.edu.jo
WSN Routing Algorithms LEACH - Low Energy Adaptive Clustering Hierarchy PEGASIS - Power–Efficient Gathering in Sensor Information System nsalmadi06@cit.just.edu.jo
Low Energy Adaptive Clustering Hierarchy LEACH Random < p/(1- p*(r mod 1/p) )? Steady-state Phase b a Setup Phase 1. Advertisement Phase 2. Cluster Setup Phase 3. Schedule creation d c BS nsalmadi06@cit.just.edu.jo
LEACH Advantages: • 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. Disadvantage • Doesn’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. nsalmadi06@cit.just.edu.jo
Power–Efficient Gathering in Sensor IS PEGASIS Chain Construction Phase Data Aggregation Phase BS Id= Round/N nsalmadi06@cit.just.edu.jo
PEGASIS Advantages: • Saving energy by minimizing: • The transmission distance • The number of transmissions and receives for each node • Each node will be the leader once every 100 rounds (for 100 nodes network). Disadvantages • Main: 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 nsalmadi06@cit.just.edu.jo
WSN Example Lets see Solar Leach Example ( you can download it from www.omnetpp.org) nsalmadi06@cit.just.edu.jo
Statistics - Scalars To 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 nsalmadi06@cit.just.edu.jo
Resources OMNeT++ Folder Documentation Tutorial Samples OMNeT++ website: omnetpp.org Other WSN simulators: Castalia, NesCT, Jsim, NS2. nsalmadi06@cit.just.edu.jo