problem with UdpApp

95 views
Skip to first unread message

Elaheh V

unread,
Apr 25, 2011, 4:46:38 AM4/25/11
to omnetpp
Dear all,
I am using UDPBasicApp. I try to send a packet from host1 to host3.
Host1 has registered the port in the UDP layer at first but other
hosts haven't.

** Event #1 T=0 Network.mobileHost1.udp (UDP, id=13), on
`UDP_C_BIND' (cMessage, id=117)
Binding socket: sockId=0 appGateIndex=0 userId=-1 localPort=100

when host3 gets the UdpPacket:

** Event #113 T=0.901268068587 Network.mobileHost3.udp (UDP, id=61),
on `UDPBasicAppData-0' (UDPPacket, id=212)
Packet UDPBasicAppData-0 received from network, dest port 100
No socket registered on port 100

In the omnetpp.ini, I just set the destination address of host1:

**.mobileHost1.udpApp[0].destAddresses = "mobileHost3"

Udp just register the port of the sender (the one which I set the
destAddresses for) and leave the others.
I don't know how to solve this problem.
Any help would be appreciated.

Thanks.

Elaheh V

unread,
Apr 26, 2011, 1:56:09 AM4/26/11
to omnetpp
I have searched the group for similar problem but I couldn't find any
explicit solution.

Alfonso Ariza Quintana

unread,
Apr 26, 2011, 5:12:10 AM4/26/11
to omn...@googlegroups.com
The receiver udp application is not correctely configured in the omnetpp.ini
file

-----Mensaje original-----
From: Elaheh V
Sent: Tuesday, April 26, 2011 7:56 AM
To: omnetpp
Subject: [Omnetpp-l] Re: problem with UdpApp

--
You received this message because you are subscribed to the Google Groups
"omnetpp" group.
To post to this group, send email to omn...@googlegroups.com.
To unsubscribe from this group, send email to
omnetpp+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/omnetpp?hl=en.

Elaheh V

unread,
Apr 26, 2011, 7:18:35 AM4/26/11
to omnetpp
thank you for your reply.
I have these settings for udp application in my omnetpp.ini file:

# application settings
**.numUdpApps = 1
**.udpAppType = "UDPBasicApp"
**.udpApp[0].localPort = 100
**.udpApp[0].destPort = 100
**.udpApp[0].messageLength = 1250 bytes
**.udpApp[0].messageFreq = 0.9s
**.mobileHost1.udpApp[0].destAddresses = "mobileHost3"

which configuration should I add to these?



On Apr 26, 1:12 pm, Alfonso Ariza Quintana <aariza...@hotmail.com>
wrote:

behnam ahmadi

unread,
Apr 26, 2011, 8:34:18 AM4/26/11
to omn...@googlegroups.com
hi

what is mobilehost?
did you have bindToPort(localPort) in mobilehost initialize?

Regards,

Alfonso Ariza Quintana

unread,
Apr 26, 2011, 10:19:50 AM4/26/11
to omn...@googlegroups.com
The actual code of UDPBasicApp can not work like sink.

two alternatives, change in the receiver UDPBasicApp by UDPSink
or
modify in the UDPBasicApp.cc code this

if (destAddresses.empty())
return;

bindToPort(localPort);


for this

bindToPort(localPort);

if (destAddresses.empty())
return;

-----Mensaje original-----
From: behnam ahmadi
Sent: Tuesday, April 26, 2011 2:34 PM
To: omn...@googlegroups.com
Subject: Re: [Omnetpp-l] Re: problem with UdpApp

Shaikha Al-Khuder

unread,
Nov 22, 2015, 12:37:33 PM11/22/15
to OMNeT++ Users, aari...@hotmail.com
Is there a way to refer to source address of the host in udpBasicApp other than hooking? I'm not really familiar with the mechanism and I did not find any useful clear way on the internet that explains it in a good way...

thanks. 

Alfonso Ariza Quintana

unread,
Nov 24, 2015, 3:14:46 AM11/24/15
to omn...@googlegroups.com

If you are speaking about the address of the sender, the information is in the controlInfo field

--
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.

Shaikha Al-Khuder

unread,
Dec 30, 2015, 10:03:05 AM12/30/15
to OMNeT++ Users, aari...@hotmail.com
I found the answer to my question. The below fetches the host (node) index for you:

getParentModule()->getIndex()

Reply all
Reply to author
Forward
0 new messages