how to send the packet using the destination address

85 views
Skip to first unread message

Abhilasha Dadhich

unread,
Jul 29, 2015, 2:59:36 AM7/29/15
to OMNeT++ Users
to send the packet there is the syntax :
send(msg, "gate$o", gateindex);
in every type of "send()"....in the syntax its mentioned the gate id....how can i send the msg to the destination using the destination address??
suppose i have a network of 10 nodes ..and i want to send the packet by traversing in the network..i donn wannn to send it directly to the destination....for traversing m gonna need the destination address.... so how to send using destination add....if not then watzz the logic behind the usage of gateID..how to route using that...becuz every node is provided by the set of 2 or 4 gates only....m toooo confused...plsss guide me

Ester Lopez

unread,
Jul 29, 2015, 4:53:21 AM7/29/15
to omn...@googlegroups.com
Are you using INET? If so, then you can send a packet with the proper IP info to the IP module, and the IP module + routing protocols will do the rest.

You could even use a traffic generation module, so you only need to configure the destination on the *.ini file, without any need of coding.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Michael Kirsche

unread,
Jul 29, 2015, 4:54:37 AM7/29/15
to omn...@googlegroups.com, abhilash...@gmail.com
Gates just denote the local connectivity between modules and possible interconnections via wired channels.
Say you have a node with two output gates, because he is connected to two nodes via channels.
You would have to specify in the send method, which gate the packet should be sent over.

Traversing a network now is a different thing. Here, we use higher layer addresses (like MAC or IP addresses in real life). Those are used, exchanged and compared via routing protocols to map a certain path through the network.
For example, you have three nodes A, B and C, connected in a line (A <-> B <-> C). When gets a packet from A that has the higher layer destination address C, he needs to find out, to which output gate he must forward this packet. This is often done with an interface and routing table. The interface table collects the available interfaces and their higher layer addresses, the routing tables collects other known nodes and addresses and their associated interface.
When B reads the higher layer destination address from the packet, he sees that it is addresses to C. He then looks in his routing table, finds out over which interface he needs to forward the packet and (at the end) uses the send method with the correct gate index / ID / name to send the packet over the correct output gate to C.

That's the basic approach, a bit simplified of course. The send method with the gate index is used on the lowest layer to actually send the module over a gate. The send methods of higher layers (like IP) have a different syntax, where destination addresses might be passed directly via the send command or indirectly (included in the actual message/packet that is passed along with the send command).
Reply all
Reply to author
Forward
0 new messages