Problems using INET v. 2.6.0 and parsim - broken links

7 views
Skip to first unread message

Jan Raddatz

unread,
Sep 9, 2015, 5:07:53 AM9/9/15
to OMNeT++ Users
Hi everyone,

there seems to be a problem with using INET and parallel simulation. I attached a screenshot of my simulation model. The simulation is divided into 4 partitions with three visible on the screenshot.
The link between the partitions is an DataRateChannel.

Those channels are not connected when running the simulation in parallel. I narrowed the problem down to class EtherMACBase.
It seems that the instances stay in disconnected state when in parallel simulation. 

Did anyone experience the same problem or knows how to solve it? 
Thanks a lot in advance!
Untitled.png

Jan Raddatz

unread,
Sep 9, 2015, 7:25:49 AM9/9/15
to OMNeT++ Users
I've digged into the sources and I think there is a problem with determining wether a gate is "connected" or not.
cGate::isConnected distinguishes between beeing embedded into simple and non simple modules.
 However, beeing embedded into a placeholder module is not treated properly. I changed the function as follows:
bool cGate::isConnected() const
{
    // for compound modules, both inside and outside must be non-NULL,
    // for simple modules, only check outside.
    if (getOwnerModule()->isSimple())
        return isConnectedOutside();
    else if (getOwnerModule()->isPlaceholder())
        return isConnectedOutside();
    else
        return prevgatep!=NULL && nextgatep!=NULL;


    /*
    // for compound modules, both inside and outside must be non-NULL,
    // for simple modules, only check outside.
    if (!getOwnerModule()->isSimple())
        return prevgatep!=NULL && nextgatep!=NULL;
    else
        return isConnectedOutside();
    */
}

Now it works! Might not be the best solution though. If someone more experienced might countercheck I would be glad.
Best Regards 

Jan Raddatz

unread,
Sep 9, 2015, 7:31:39 AM9/9/15
to OMNeT++ Users
Furthermore, EtherFrame.msg lacks the implementations for packing and unpacking.
In order to use it with parallel simulation, these functions should be added to EtherFrame.msg inside the cplusplus {{ }} marked area.

inline void doPacking(cCommBuffer *buffer, MACAddress& addr) {

buffer->pack(addr.getInt());

}



inline void doUnpacking(cCommBuffer *buffer, MACAddress& addr) {

uint64 value;

buffer->unpack(value);

addr = MACAddress(value);

}
Reply all
Reply to author
Forward
0 new messages