Adhoc network simulation in OMNET++

680 views
Skip to first unread message

bilge

unread,
May 17, 2015, 6:02:04 PM5/17/15
to omn...@googlegroups.com
Hi

I'm new in omnet++ and i study in omnet++ scalability. I want to simulate adhoc network.

Please anybody can help me or to tell me how to start with this project.

Thanks in advance.

Hamed Taheri

unread,
May 22, 2015, 7:47:52 AM5/22/15
to omn...@googlegroups.com
hi. you need to install INET.2.99.1 and build it. then in subfolder of inet create your Owne folder. then add package.ned file in it and write your package path like >
 package inet.myFolderProject;

then right-Click on inet project in property > in omnet++>in NED Resource Folder > Check box your myFolderProject.
then in your folder >
make your .ned file in it you need some like this :

package inet.myFolderProject;

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.INode;
import inet.physicallayer.contract.packetlevel.IRadioMedium;


// - create a network and specify the size to 500x500
// - drop an IPv4NetworkConfigurator and rename it to "configurator"
// - drop an IdealRadioMedium module and rename to "radioMedium"
// - make vector WirelessHost Submodule

network Wireless
{
    @display("bgb=500,500");
    @figure[thruputInstrument](type=gauge; pos=370,90; size=120,120; maxValue=2500; tickSize=500; colorStrip=green 0.75 yellow 0.9 red;label=Number of packets received; moduleName=hostB.udpApp[0]; signalName=rcvdPk);
    string hostType = default("WirelessHost");
    string radioMediumType = default("IdealRadioMedium");
    int hostNumber=default(2);
    submodules:
        configurator: IPv4NetworkConfigurator {
             config = xml("<config><interface hosts='*' address='192.168.1.x' netmask='255.255.255.0'/></config>");
            @display("p=149,29");
        }
        radioMedium: <radioMediumType> like IRadioMedium {
            @display("p=309,24");
        }
        host[hostNumber]: <hostType> like INode {
            @display("p=50,250");
        }
}

// in omnetpp.ini
*.hostType = "WirelessHost"
*.hostNumber = 3
*.host[0].numUdpApps = 1
*.host[0].udpApp[0].typename = "UDPBasicApp"
*.host[0].udpApp[0].destAddresses = "host[1]"
*.host[0].udpApp[0].destPort = 5000
*.host[0].udpApp[0].messageLength = 2000B
*.host[0].udpApp[0].sendInterval = exponential(10ms)

*.host[1].numUdpApps = 1
*.host[1].udpApp[0].typename = "UDPSink"
*.host[1].udpApp[0].localPort = 5000

#=================================== wlan[NIC] & RadioMediumType Config
#Ieee80211Mac [NIC]
*.host[*].wlan[*].typename = "Ieee80211Nic"
*.host[*].wlan[*].mgmtType = "Ieee80211MgmtAdhoc" 
**.wlan[*].opMode = "b"

#Radio Type Ideal
*.radioMediumType = "IdealRadioMedium"
*.host[*].wlan[*].radioType = "IdealRadio"
*.host[*].wlan[*].radio.transmitter.bitrate = 2Mbps
*.host[*].wlan[*].radio.transmitter.headerBitLength = 100b
*.host[*].wlan[*].radio.transmitter.maxCommunicationRange = 250m

//--------------------------------------------------------------

I hope this work and help for you.

bilge

unread,
May 31, 2015, 10:03:09 AM5/31/15
to omn...@googlegroups.com
   Thank you for your answer.I did it as you said and they worked. But simulation is very slow. Can they move more fast?

22 Mayıs 2015 Cuma 14:47:52 UTC+3 tarihinde Hamed Taheri yazdı:
hi. you need to install INET.2.99.1 abd build it. then in subfolder of inet create your Owne folder. then add package.ned file in it and write your package path like >
 package inet.myFolderProject;

then right-Click on inet project in property > in omnet++>in NED Resource Folder > Check box your myFolderProject.
then in your folder >
make your .net file in it you need some like this :

package inet.myFolderProject;

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.INode;
import inet.physicallayer.contract.packetlevel.IRadioMedium;


// - create a network and specify the size to 500x500
// - drop an IPv4NetworkConfigurator and rename it to "configurator"
// - drop an IdealRadioMedium module and rename to "radioMedium"
// - make vector WirelessHost Submodule

network WirelessCoopMAC

Michael Kirsche

unread,
Jun 1, 2015, 8:01:01 AM6/1/15
to omn...@googlegroups.com
Run the simulation in express mode or even under the command environment.
OMNeT manual has all the necessary infos: https://omnetpp.org/doc/omnetpp/manual/usman.html#sec355

Hamed Taheri

unread,
Jun 1, 2015, 9:36:34 AM6/1/15
to omn...@googlegroups.com
Run it on Express Mode. in Tkenv Windows of simulation

bilge bektaş

unread,
Jun 1, 2015, 4:58:18 PM6/1/15
to omn...@googlegroups.com
I already run it in express mode. I did "sim-time-limit = 60s" and when i increase number of nodes for example 200 nodes, the simulation is stopped in 30 minutes. I don't know that is it normal. But it is not a problem for me now. I have another question. Do you know any document for result analysis of simulation? I have graphics but I don't understand what is the meaning of this graphics.One graphic is attached.

Thank you in advance.

--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/sW3CXyp40CI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

100nodesgraphic.png
Reply all
Reply to author
Forward
0 new messages