OMNeT++ and MiXiM… and putting our own code in a separate place!

This entry was posted by on Tuesday, 1 February, 2011 at

OMNeT++ is a powerfull discrete event simulation platform. With MiXiM’s wireless communication framework the combination becomes a versatile simulation setup for wireless simulations of any type. We use a modification of MiXiM for simulating Vehicular Ad hoc Networks (VANETs). Read more for some philosophy of use.

It started out in 2008, when I modified the Mobility Framework (MFw) to integrate the IEEE 802.11p MAC and do experiments (Publications: Vehicle-to-vehicle communication for driver support systems, Providing over-the-horizon awareness to driver support systems, more info at TrafficFilter homepage).

This work was done with a modified copy of the MFw, and later as MFw was merged into MiXiM, I simply applied the same modifications there, copied my own classes and continued work on beaconing in VANETs (Publications: microSlotted 1-Persistent Flooding in VANETs, Exploring the Solution Space of Beaconing in VANETs and some upcoming papers).

At some point, up to five people were working with my modified copy of MiXiM 1.1. Then MiXiM 1.2 arrived and… well, you can guess what happens: VERSION MANAGEMENT FAIL!!

So now with MiXiM 2.1 out, it was time to quickly refactor. Just like MiXiM is linked against OMNeT’s shared libraries, it is possible to make your own project linked against MiXiM’s miximbase and miximmodules libraries. In fact, it is not even that hard. A post on the OMNeT wiki explains how.

The philosophy behind this is, in fact, quite simple: separation of concerns. As developers of MiXiM add new features, fix bugs etc. I want to be able to quickly upgrade the underlying MiXiM, without having to modify it with custom code. As long as the interfaces remain the same, you’re good to go!

Further reading:

Additional help: if you mess around with packages and namespaces, you may get this error:

Error in module (cCompoundModule) sim (id=1) during network setup:
Class "org.dacs_mixim::WorldConnectionManager" not found -- perhaps
its code was not linked in, or the class wasn't registered with
Register_Class(), or in the case of modules and channels, with

Though it could also mean you have your ned-path, NEDPATH or -n [nedpath] not correctly. In the case of this error, I was cramming all my own code in my own namespace “org.dacs_mixim”. Apparently, it is significantly difficult for two namespaces to be merged at the ‘org’ so this caused trouble. A solution was to implicitly use the “default namespace”; just no package.ned in the root. In the base and modules folder simple package.ned files with “package base;” etc.

Further reading: OMNeTpp Google group

2 Responses to “OMNeT++ and MiXiM… and putting our own code in a separate place!”

  1. Sandra

    Dear Skidder

    Are you sharing your 802.11p MAC implementation somewhere? I am starting to using the one that comes with inetmanet, but I am more familiar with MiXiM, so I was hoping to find an implementation for me to build on top of it (I work at network layer). Thanks!

  2. MiXiM’s documentation is quite ok, as are the examples that come with it. That’s what I used to get started – and ofcourse some googling around. Haven’t found any really good introductions or howtos on websites yet. Good luck & have fun using MiXiM!

Leave a Reply