0

The goal is to create a routing table, so each node can send from wherever it is, a message to the node with the most neighbors.

Let's say i have this network

enter image description here So every node's mission is to send a message to node4. To accomplish, there has to be a routing table to give guidance on routing process for all nodes.

I want to know how to send a message containing information about the senders and the receivers id and gate. So I can combine the information from all nodes with a multihop process into one routeTable which every node is aware of. Also it is vital for perfomance issues, to not send a message to a node twice.

After all nodes knows the routeTable they have to start sending messages to node4. This will stop when a certain time (t), passes.

I know that i can find the size of neighbor for each node with gateSize(). But other than that I don't know how to send a message containing all this information that I want. I know the algorithm Dijkstra, but I don't know how to implement it into omnet. Can you help me?

Thanos Sakis
  • 91
  • 13

1 Answers1

1

The information you are looking for are implemented in the cMessage class.

int senderModuleId;        // sender module ID -- set internally
int senderGateId;          // source gate ID -- set internally
int targetModuleId;        // destination module ID -- set internally
int targetGateId;          // destination gate ID -- set internally

You can find the Class Reference here.

000102
  • 120
  • 1
  • 8
  • This is the way I send a message `int n = gateSize("gate$o"); int k = intuniform(0, n-1); send(msg,"gate$o", k);` If the k is supposed to be the gateId then the getArrivalGateId() has to be equal. Instead of that i get a big integer like 1572865.. How to use this integers to create the routeTable and also send messages? – Thanos Sakis Jun 05 '19 at 16:53