This section will explain the basic use of the MF. We assume that you are familiar with programming in OMNeT++. If not you should read the OMNeT++ manual (http://www.omnetpp.org/). After explaining how to install the MF we will give a guideline how to create an own simulation network and how to derive your own modules. For a description of the functionality of the different modules please read Section 4 and the API documentation.
You need a running OMNeT++ version 3.0a8 or higher (recommended is 3.0a9 or higher) to use the MF with all of its functionality. After downloading the most recent version of the MF from the download area of http://mobility-fw.sourceforge.net copy the file to the desired directory. cd to this directory and
The file doc/hp/index.html will link you to the documentation (API and Neddoc reference and this manual) for the MF. You can also find links to coding and documentation guidelines for your implementations on this page.
To be able to easily create a new simulation network we provide template files. They can be found in the template/ directory. Basically all you have to do is to copy the desired template files into your network directory and adapt them. The most important advises and rules are presented as comments in these files.
To create a new network you should create a new directory with the name of yourNetwork. Copy the files YourNetwork.ned, YourHost.ned and Makefile.gen (and YourNic.ned if needed) to the network directory. Give them names of your choice and also adapt the module names inside these files correspondingly. If you want to create own modules also copy the corresponding template files to the yourNetwork directory, give them proper names and fill them with functionality as described in Section 3.3.
You also have to set the MOBFW variable in the Makefile.gen to the path of your mobility-fw directory so that the Makefile can find the MF library header and ned files.
In the file YourHost.ned you have to declare what NIC and what modules you want to use as protocol layers. If you want to create an own Nic Module you also have to copy and modify the YourNic.ned file.
As soon as everything is ready you need to run make -f Makefile.gen to create a Makefile and then run make. If you did not make any mistakes ;-) an executable file yourNetwork is created. By running it the simulation is started.
The template files already contain the main structure and only have to be modified and filled with functionality. The most important hints, rules, advises and suggestions are given in the files as comments.
The YourMacLayer.ned file already contains the obligatory gates and the parameters needed by the BasicMacLayer module. Just add the additional parameters you need for your module and change the name of the module to the desired one. If you do not derive your module from a BasicMacLayer but an already existing protocol implementation (e.g. Mac802.11.ned) you have to add the additional parameters needed by this module as well.
The YourMacLayer.h file already contains the class definition with the correct derivation of the BasicMacLayer class and the Module_Class_Members() macro. If you want to derive your module from an already existing protocol implementation you have to replace BasicMacLayer (e.g. with Mac802.11). The next thing you should do is a ``search and replace'' of YourMacLayer with the desired name for your module. Then this file simply has to be extended with all the extra functions and variables you need. If you want to use the Blackboard you have to uncomment the blackboard* functions (see Sec. 6).
The YourMacLayer.cc file contains the basic structure to fill the module with functionality. The first thing you should do is a ``search and replace'' of YourMacLayer with the class name you chose in the header file. The Define_Module() macro is also included. If you do not use your own .ned file you have to replace this with the Define_Module_Like() macro.
The handleUpperMsg() and handleLowerMsg() functions contain the sendUp() and sendDown() functions with example parameters in the obligatory structure. If you want to use the Blackboard uncomment the blackboard* functions and fill them with code. They already contain the structure they should have so please do not change it (see Sec. 6).