user3243499
user3243499

Reputation: 3151

getTransmissionChannel() is crashing omnet++ simulation

I have this getTransmissionChannel() defined in my simple module. For the following simulation connections it worked perfectly:

    CustomedNode1.Netport <--> LinkDefinedChannel <--> mySwitch.connectedToPort1;
    CustomedNode2.Netport <--> LinkDefinedChannel <--> mySwitch.connectedToPort2;
    CustomedNode3.Netport <--> LinkDefinedChannel <--> mySwitch.connectedToPort3;
    CustomedNode4.Netport <--> LinkDefinedChannel <--> mySwitch.connectedToPort4;
    CustomedNode5.Netport <--> LinkDefinedChannel <--> mySwitch.connectedToPort5;

Then I replaced node5 with another type of node but using the same port and the new connections generated are:

    CustomedNode1.Netport <--> LinkDefinedChannel <--> ibSwitch.connectedToPort1;
    CustomedNode2.Netport <--> LinkDefinedChannel <--> ibSwitch.connectedToPort2;
    CustomedNode3.Netport <--> LinkDefinedChannel <--> ibSwitch.connectedToPort3;
    CustomedNode4.Netport <--> LinkDefinedChannel <--> ibSwitch.connectedToPort4;
    mySwitch.connectedToPort5 <--> gatewayNode.Netport ;

Now the simulation crashes saying getTransmissionChannel() no transmission channel found.

I don't know what happened suddenly. I have just replaced with a new node with same type of net port.

Upvotes: 2

Views: 157

Answers (1)

Utkal Sinha
Utkal Sinha

Reputation: 1041

getTransmissionChannel() returns the transmission. If you don't specify any channels in your links the OMNet++ tranparently replaces with cIdealChannel which basically means no channel object has been assigned to the connection.

And in your case after the node replacement the new connection mySwitch.connectedToPort5 <--> gatewayNode.Netport ; does not have any channels defined. So IDE replaces with cIdealChannel and so getTransmissionChannel() cannot find any transmission channel since there is no channel object defined for this connection.

So instead replace

mySwitch.connectedToPort5 <--> gatewayNode.Netport ;

To

mySwitch.connectedToPort5 <--> LinkDefinedChannel <--> gatewayNode.Netport ;

Now getTransmissionChannel() should be able to get the transmission channel since you are defining one channel object to this connection.

Upvotes: 1

Related Questions