Search code examples
omnet++inet

Omnet++ Simple Wireless Host (antenna.mobilityModule error)


I am new to OMNET++ and I have the following problem:

  1. I am trying to create a network with 3 nodes that communicate wirelessly.
  2. My project contains these files -> Network.ned, CustNetworkNode.ned, Maclayer.ned, Maclayer.cc, Maclayer.h and omnetpp.ini
  3. The code of the CustNetworkNode.ned file :
package customproject;

import inet.queueing.queue.DropTailQueue;
import inet.applications.common.SinkApp;
import inet.applications.common.SourceApp;
import inet.physicallayer.wireless.common.contract.packetlevel.IRadio;
import inet.mobility.contract.IMobility;

module CustNetworkNode
{
    parameters:
        radio.antenna.mobilityModule = default("^.^.^.mobility");

    gates:
        input radioIn @directIn;

    submodules:
        radio: <default("UnitDiskRadio")> like IRadio {
            @display("p=199.42,621.92");
        }
        mac: Maclayer {
            @display("p=199.42,441.09");
        }
        queue: DropTailQueue {
            @display("p=200,300");
        }
        traffic_gen: SourceApp {
            @display("p=199.42,104.78");
        }
        consumer: SinkApp {
            @display("p=332.93,104.78");
        }
        mobility: <default("StationaryMobility")> like IMobility {

            @display("p=58.5,117");
        }
    connections allowunconnected:
        radioIn --> { @display("m=s"); } --> radio.radioIn;
        radio.upperLayerOut --> mac.lowerLayerIn;
        radio.upperLayerIn <-- mac.lowerLayerOut;
        queue.out --> mac.upperLayerIn;
        queue.in <-- traffic_gen.socketOut;
        mac.upperLayerOut --> consumer.socketIn;
}
  1. When I run the omnetpp.ini file I'am getting this

#Error

  1. Then I go back to the CustomNetwork.ned file and I comment the line:
//radio.antenna.mobilityModule = default("^.^.^.mobility");
  1. After running the omnetpp.ini file again I'm getting this Unassigned Parameter

  2. I don't sign any parameter and I get the following #Error

I have read a relevant topic with someone that faced the same issues but I cannot find any solid answer that solves these problems. Omnet++ simple wireless node

Any recommendations?


Solution

  • By default the mobility module is a submodule of the network node and the antenna module is a submodule of the radio module which is a submodule of the network node. You have arranged your modules differently, so the mobility module is not found by the antenna. You should either arrange modules in a similar way how it's done by default or set the mobilityModule parameter of the antenna module such that it correctly references the mobility module relative to the antenna module.