################################################################ Author: Ajith Kumar (Admar Ajith Kumar Somappa) Homepage: www.hib.no/ansatte/aaks Title : Tutorial for creating own MAC Layer and creating a simulation in MiXiM - Omnet++ ################################################################ ##In MiXiM 2.3 version there is an issue. Error report would show: Mac80211Pkt_m.h: No such file or directory One way to solve this: https://groups.google.com/forum/#!msg/omnetpp/-64IaJhkAT4/wfdJwYVBRtwJ Other way is mentioned in the same thread: Browse to MiXiM/src/base/messages Run: opp_msgc -I ./ *.msg Also Run the same in MiXiM/src/modules/messages This should create the necessary files. These files are removed when the project is cleaned(Re-built). Next possible error is: BaseMobility.h not found, this appears when you build MyTestMac To clear this: Add MIXIM_INET,value 1, add to all configurations, add to all languages Do to this in: Project->Properties->C/C++ General->Paths and Symbols->Symbols->GNU C++ This should all errors. First step is to create your own Mac layer Tutorial and files for this can be found here. http://sourceforge.net/apps/trac/mixim/wiki/HowToWriteOwnMacLayer The aim of this tutorial is to use this MAC tutorial and create an actual simulation in MiXiM 2.2.1 over Omnet 4.2.1, which is not a straight forward process. This tutorial deals with only MAC layer and we use previously written modules for other layers. Using those files in the tutorial in file MyMacLayer.cc add this include line #include In MiXiM Create a omnet++ project with a given name eg. MyTestMac Place the files in this directory. After this you need a network file and then some network descriptor files. 1. MyNetwork.ned is the network file, the file code in detail below ################################################################ package mytestmac; import org.mixim.base.modules.BaseNetwork; network MyNetwork extends BaseNetwork { parameters: int numNodes; // total number of hosts in the network submodules: node[numNodes]: MyMacNode; //MyMacNode is a user defined node with the custom written MAC connections allowunconnected: //All connections and gates are to be generated dynamically } ################################################################# For details about various base source modules in mixim refer to: http://mixim.sourceforge.net/doc/MiXiM/doc/neddoc/index.html?p=org.mixim.modules.node-package.html ################################################################# 2. MyMacNode.ned is the node description file for the node ################################################################# package mytestmac; import org.mixim.modules.node.WirelessNodeBattery; module MyMacNode extends WirelessNodeBattery { parameters: nicType = default("mytestmac.MyTestNic"); //mytestmac is the package name substitute with appropriate //package name of your project //MyTestNic is user defined Network Interface Card ned file //With custom defined MAC arpType = default("org.mixim.modules.netw.ArpHost"); //This uses previously defined modules @display("i2=status/battery"); } ################################################################# 3. MyTestNic.ned Network Interface Card descriptor ################################################################# package mytestmac; import org.mixim.modules.nic.WirelessNicBattery; module MyTestNic extends WirelessNicBattery { parameters: macType = default("MyTestMac"); //MyTestMac is the custom defined MAC, here refered to is a network //description file } ################################################################# 4. MyTestMac.ned Mac descriptor file ################################################################# package mytestmac; import org.mixim.base.modules.BaseMacLayer; simple MyTestMac extends BaseMacLayer { parameters: @class("MyTestMac"); //Finally this is the direct referece to the class MyTestMac //Which has the MAC layer implementation details } ################################################################# 5. package.ned The package file which describes the package used in this project ################################################################# package mytestmac; ################################################################# To compile the project you will need a make file, incase it is not created yet Right click on the project->properties->Omnet++->makemake and check makemake for the option available. Secondly if you had created a new empty project to start this. You have to add project->project references->Select Mixim folder since lot of files referenced here are base files in the mixim folder All the files of the project exported as a zip can also be found in my homepage. Any mistakes or further suggestions if you want me to add to this pls email me a.ajith.kumar.s at gmail