Search code examples
c++omnet++inet

How can I find the implement .cc file in Omnet++ INET's examples


I'm a fresh newer studying INET in Omnet now. I try to find out how the INET's examples like tutorial wireless networks work, but there are only ned and ini file in that directory without cc file. So I am very confused how this network works. Anyone can tell me how can i find it ?


Solution

  • There are no C++ files in INET examples because the whole behaviour of every module, protocol, channel, packet etc. used by INET has already been defined in C++ files in src directory. The compiled and ready to use code is present in file src\libINET.dll (or src/libINET.so for Linux).
    To get to know how a protocol was modelled look inside a module and look for simple modules. (In OMNeT++ the behaviour is defined only for simple modules.)
    For example:

    1. In the examples\wireless\lan80211 there is Lan80211.ned. Open it in source (text) format. This network uses (between other things) WirelessHost.
    2. Go to declaration of WirelessHost (Hint: select this word and press F3 or click this word holding Ctrl). One can see that WirelessHost inherits from StandardHost and from NodeBase. Moreover: numRadios=1 and mgmtType = "Ieee80211MgmtSTASimplified".
    3. In NodeBase.ned one can see that it uses Ieee80211Nic wlan module by default. The module Ieee80211Nic is defined in src\inet\linklayer\ieee80211\Ieee80211Nic.ned.
    4. Looking inside Ieee80211Nic one can see that it uses Ieee80211Mac (between other things). This is a simple module defined in \src\inet\linklayer\ieee80211\mac\Ieee80211Mac.ned. And its behaviour is defined in \src\inet\linklayer\ieee80211\mac\Ieee80211Mac.cc.

    This way one can discover a simple module and its C++ code of every compound module. However, take into account that to understand how the compound module works the connections between simple modules should be considered too.