Forwarding of Application Layer APP - UdpSink in OMNeT++ #983
-
In the aodv example of OMNeT++, I set the application layer app of a node to UdpSink, which is specifically used to receive external messages. But I want it to implement forwarding function after receiving the message. Forward the message to the application layer app of another node. This app is also UdpSink, what should I do. I hope to receive your help and would like to express my gratitude here I am trying to use the method of socket ->sendTo. But I don't know how to write the IP address of the node I want to receive as L3Address (assuming the IP address of the node is known to be 145.236.0.1). So, I hope to receive your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
(Just nitpicking: AODV is an INET example, not a base OMNeT++ example). You should write your own UDP application module for this. Use the |
Beta Was this translation helpful? Give feedback.
(Just nitpicking: AODV is an INET example, not a base OMNeT++ example).
You should write your own UDP application module for this. Use the
UdpEchoApp
as an example. The only difference is that you would forward the packet to a different destination and not back to the sender. If you add adestinationAddress
parameterL3AddressResolver().resolve(destinationAddress)
would resolve a string based IP address (or module name) to properL3Address
that can be used by thesendTo
call. (see also theUspBasicApp
for examples of sending to a specific address)