next up previous contents index
Next: 4 Building Own Simulations Up: A Mobility Framework for Previous: 2 Overview   Contents   Index


3 Getting the Mobility Framework started

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 ( 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.

3.1 Installation

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 copy the file to the desired directory. cd to this directory and

where version is the version number of the file you downloaded. You should run the example simulations in the core/basicNetworks directory to see if everything was built properly.

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.

3.2 Creating an own network

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.

3.3 Creating a new module

For every simple module three files have to be created, a .ned, a .h and a .cc file. The best choice is to put all your own modules into the yourNetwork directory (see Sec. 3.2). As an example we will assume to create a new MAC module from the YourMacLayer template in this section. However the procedure for all other modules is more or less the same.

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 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).

next up previous contents index
Next: 4 Building Own Simulations Up: A Mobility Framework for Previous: 2 Overview   Contents   Index
Daniel Willkomm 2007-01-12