UDP Broadcast

514 views
Skip to first unread message

neil mehta

unread,
Apr 12, 2010, 2:21:21 PM4/12/10
to omnetpp
Hello,

I am trying to use the BasicBurst UDP app on omnetpp 4.0. for
broadcasting to all neighbours in a wireless adhoc scenario. For this
I set the destAddresses ="Broadcast". I also tried "255.255.255.255"
and "10.0.0.1". Here, the network ip starts from 10.0.0.x.
Also, according to this thread
http://groups.google.com/group/omnetpp/browse_thread/thread/4dc2feef3ce53f85/2435092169557472?q=broadcast&lnk=ol&
I have set the ctrl->setInterfaceId(101); in the function
UDPBasicBurst::sendToUDPDelayed

Despite this I am not able to get the broadcast working. Is there some
other code as well that needs to be modified.

Thank you very much for your help,
Neil.

Alfonso Ariza

unread,
Apr 12, 2010, 3:41:06 PM4/12/10
to omn...@googlegroups.com
Are you working with the inet-framework or with the inetmanet?
the broadcast UDP is supported in inetmanet only

--------------------------------------------------
From: "neil mehta" <neilb...@gmail.com>
Sent: Monday, April 12, 2010 8:21 PM
To: "omnetpp" <omn...@googlegroups.com>
Subject: [Omnetpp-l] UDP Broadcast

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

neil mehta

unread,
Apr 12, 2010, 3:53:42 PM4/12/10
to omnetpp
Currently I am working with InetManet.

On Apr 12, 3:41 pm, "Alfonso Ariza" <aariza...@hotmail.com> wrote:
> Are you working with the inet-framework or with the inetmanet?
> the broadcast UDP is supported in inetmanet only
>
> --------------------------------------------------

> From: "neil mehta" <neilbme...@gmail.com>


> Sent: Monday, April 12, 2010 8:21 PM
> To: "omnetpp" <omn...@googlegroups.com>
> Subject: [Omnetpp-l] UDP Broadcast
>
> > Hello,
>
> >        I am trying to use the BasicBurst UDP app on omnetpp 4.0. for
> > broadcasting to all neighbours in a wireless adhoc scenario. For this
> > I set the destAddresses ="Broadcast".  I also tried "255.255.255.255"
> > and "10.0.0.1". Here, the network ip starts from 10.0.0.x.
> > Also, according to this thread

> >http://groups.google.com/group/omnetpp/browse_thread/thread/4dc2feef3...

neil mehta

unread,
Apr 12, 2010, 7:17:15 PM4/12/10
to omnetpp
Hello,

I tried the UDPBasicApp (modifying the code to allow broadcast
as above, i.e. setting interface ID to 101 in AppBase.cc) and found
that the broadcast works at the sender side. However, at the receiver
side there is partial work. The packet is received correctly but
dropped at the UDP layer (the packet is dropped due to wrong port). I
dont understand why this would happen. I set the
destPort=localPort=1234 in the UDPApp in my .ini file.

Thank you,
Neil.

neil mehta

unread,
Apr 12, 2010, 7:21:02 PM4/12/10
to omnetpp
For further debugging if host[4] has received a UDPBasicApp packet,
following is the debug message

IP UDP Helper. Allowing local delivery
** Event #56 T=1.001027516919 scenario.host[4].udp (UDP, id=82), on
`UDPBasicAppData-0' (UDPPacket, id=103)
Packet UDPBasicAppData-0 received from network, dest port 1234
No socket registered on port 1234
sending ICMP error ICMP-error-#1-type13-code3
** Event #57 T=1.001027516919
scenario.host[4].networkLayer.errorHandling (ErrorHandling, id=90), on
`ICMP-error-#1-type13-code3' (ICMPMessage, id=104)
Error Handler: ICMP message received:
Type: 13 Code: 3 Bytelength: 540 Src: <unspec> Dest: 255.255.255.255
Time: 1.001027516919

Neil.

Alfonso Ariza

unread,
Apr 13, 2010, 5:43:39 AM4/13/10
to omn...@googlegroups.com
See the message "No socket registered on port 1234"

The application haven't registered the socket

bindToPort(localPort);


--------------------------------------------------
From: "neil mehta" <neilb...@gmail.com>

Sent: Tuesday, April 13, 2010 1:21 AM
To: "omnetpp" <omn...@googlegroups.com>
Subject: [Omnetpp-l] Re: UDP Broadcast

neil mehta

unread,
Apr 14, 2010, 2:42:14 AM4/14/10
to omnetpp
Got it. It works.

Thanks,
Neil.

On Apr 13, 5:43 am, "Alfonso Ariza" <aariza...@hotmail.com> wrote:
> See the message  "No socket registered on port 1234"
>
> The application haven't registered the socket
>
>     bindToPort(localPort);
>
> --------------------------------------------------

> From: "neil mehta" <neilbme...@gmail.com>

Manel Seddiki

unread,
Nov 29, 2013, 1:21:11 PM11/29/13
to omn...@googlegroups.com
Hello,
Actually, i have the same issue :(
The broadcast works fine at the sender (port=1024, dest=255.255.255.255) but at the receiver, the packet is stopped on the UDP layer and not passed to the higher layer (My application). "No socket registered on port 1024" error appears in the debug and I have to mention that ll my nodes did BindToPort(localport) at the beginning so i don't understand why the packet is stopped. 
I have noticed also that in the simulation kernel , the udp Module becomes red when the broadcasted packet is recieved to udp , it seems like the BindToPort is cancelled at this moment. I don't know if i'm i right or wrong but i need some explanation about this.
Please help me to see clear on this and than you in advance


Alfonso Ariza Quintana

unread,
Nov 29, 2013, 1:36:41 PM11/29/13
to omn...@googlegroups.com

--

You received this message because you are subscribed to the Google Groups "omnetpp" group.

To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Manel Seddiki

unread,
Nov 29, 2013, 2:23:09 PM11/29/13
to omn...@googlegroups.com
socket.setBroadcast(true); was missed in my application code :)
thank you very much Alfonso for your help !
Reply all
Reply to author
Forward
0 new messages