OMNET++ Ad-Hoc Routing protocols-PART 1

165 downloads 4707 Views 1MB Size Report
Jan 1, 2015 - All host are to generate udp traffic toward the server. Question: What is the effect of the traffic generation density on the network performance?
1/1/2015

OMNET++ Ad-Hoc Routing protocols-PART 1 OMNET++ Workshop

Mohamed Elshaikh SCHOOL OF COMPUTER AND COMMUNICATION ENGINEERING, UNIMAP

Objectives Create an Ad-hoc network Comparison between routing protocols on inet3.2 Example 1 In this example we are going to create a simple ad-hoc network with N hosts and a server placed randomly in 500mx500m area. All host are to generate udp traffic toward the server. Question: What is the effect of the traffic generation density on the network performance? Solution: Firstly install omnet++, and import inet3.2 to a new work space:

Download inet3.2 from omnet++ website and extract the file to a known directory, then import inet3.2 to the work space:

Once inte is imported build the workspace by (Ctrl+B), you should be waiting for a while here…… Once done: Create a new folder under example directory for this example (adhocExample)

First we create our network .ned file. Under the same directory create a new ned file and name it adhocnet.ned

The next step is to add the components to the network: IdealRadioMedium IPv4NetowrkConfigurator AODVRouter

Rename the added components as follow: IdealRadioMedium to radioMedium IPv4NetworkConfigurator to configurator AODVRouter to host[n_hosts]

Switch to source mode and add a parameters section to the network and create an int n_hosts

Up to this we done with the network file, now we should strat create our ini file. Under this example directory create a new omnetpp.ini file for the network in this example:

Firstly lets setup the mobility configurations for all hosts: In this example all host are not moving (static), and hence the mobility module is stationary mobility in inet..

[General] network = inet.examples.adhocExample.Adhocnet **.n_hosts = 10 # mobility **.host[*].mobilityType = "StationaryMobility" **.mobility.constraintAreaMinZ = 0m **.mobility.constraintAreaMaxZ = 0m **.mobility.constraintAreaMinX = 0m **.mobility.constraintAreaMinY = 0m **.mobility.constraintAreaMaxX = 500m **.mobility.constraintAreaMaxY = 500m # set an intial postion for the server host[0] **.mobility.initFromDisplayString = false **.host[0].mobility.initialX = 1m **.host[0].mobility.initialY = 1m

# channel physical parameters **.wlan[*].typename = "IdealWirelessNic" **.wlan[*].bitrate = 2Mbps **.wlan[*].mac.address = "auto" **.wlan[*].mac.headerLength = 20B **.wlan[*].radioType = "IdealRadio" **.wlan[*].radio.transmitter.headerBitLength = 0b **.wlan[*].radio.transmitter.maxCommunicationRange = 200m **.wlan[*].radio.transmitter.maxInterferenceRange = 0m **.wlan[*].radio.transmitter.maxDetectionRange = 0m **.wlan[*].radio.receiver.ignoreInterference = true

now run the simulation and see the arrangement in the network, however no traffic generated yet…

Now close the run and move to the omnetpp.ini file to add some traffic to this network. All hosts have a UDPBasicBurst application, but host[0] is a sink. All host are to generate a traffic toward host[0] as 2 packets per second and each packet is 512Byte in size.

Now lets run the simulation for 100 seconds and see the results

Once simulation is closed an auto generated results folder will be created under the example directory:

Now open the .sca file and observe the results

We can see that no data is received by host[0], and that’s is due to short communication range as all hosts are out of range.

Suggest Documents