UDP broadcast in OMNET

830 views
Skip to first unread message

Chakkaphong St.

unread,
Dec 6, 2010, 6:05:30 AM12/6/10
to omn...@googlegroups.com

Hello,

I have followed suggestions on how to do UDP broadcast in OMNET on this link http://groups.google.com/group/omnetpp/browse_thread/thread/4dc2feef3ce53f85/2435092169557472?q=broadcast&lnk=ol& . However, it still does not work even I put only 3 host one is brocast host (host[0]) and the other two (host[1], host[2]) as receivers. The below is my code, but I am not sure whether there is something wrong or not. Could you give me a hint? One more doubt is when I am runing this code, what is the value of *.host[0].udpApp[0].destAddresses I should set in .ini file? I cannot leave it either blank or "255.255.255.255". Thus, I set it to "host[1]". Consequently, host[0] only unicast UDP packet to host[1] only. Pakcets arriving to host[2] are considered as noise. Could anyone give me suggestions?

void UDPBasicApp::sendPacket()
{
    cPacket *payload = createPacket();
    IPvXAddress destAddr = IPAddress::ALLONES_ADDRESS;
    sendToUDP(payload, localPort, destAddr, destPort);
    numSent++;
}
void UDPAppBase::sendToUDP(cPacket *msg, int srcPort, const IPvXAddress& destAddr, int destPort)
{
    msg->setKind(UDP_C_DATA);
    UDPControlInfo *ctrl = new UDPControlInfo();
    ctrl->setSrcPort(srcPort);
    ctrl->setDestAddr(destAddr);
    ctrl->setDestPort(destPort);
    ctrl->setInterfaceId(101);
    msg->setControlInfo(ctrl);
    EV << "***tor*** Sending packet: ";
    printPacket(msg);
    send(msg, "udpOut");
}

I will really appreciate your help.

Regards,
Chakky

 

Alfonso Ariza Quintana

unread,
Dec 7, 2010, 1:23:52 PM12/7/10
to omn...@googlegroups.com
What framework are you using? the broadcast is avalaible in inetmanet but not in inet-farmework


Date: Mon, 6 Dec 2010 11:05:30 +0000
Subject: [Omnetpp-l] UDP broadcast in OMNET
From: nog...@gmail.com
To: omn...@googlegroups.com
--
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.

ferra adelinna

unread,
May 20, 2017, 1:34:43 AM5/20/17
to OMNeT++ Users
dear, mr. Alfonso, i would like to simulating use veinslte framework, i will make vehicle simulation only by use lte network. what should i do to choose the suitable broadcast application to send messages to the vehicles as the UE?

thankyou very much.

Alfonso Ariza Quintana

unread,
May 22, 2017, 4:02:12 AM5/22/17
to omn...@googlegroups.com
I don't know how works veins LTE, but, if you want to implement an application that could broadcast messages, it should be UDP, with TCP it is impossible to send broadcast messages.

-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de ferra adelinna
Enviado el: sábado, 20 de mayo de 2017 7:35
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: RE: [Omnetpp-l] UDP broadcast in OMNET

dear, mr. Alfonso, i would like to simulating use veinslte framework, i will make vehicle simulation only by use lte network. what should i do to choose the suitable broadcast application to send messages to the vehicles as the UE?

thankyou very much.

--
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 https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

ferra adelinna

unread,
Jun 5, 2017, 2:41:41 AM6/5/17
to OMNeT++ Users
i've been using ipv4addrees allones and allmcast host but it doesnt work. server send message to ip 255.255.255.255 but the car cannt receive the broadcast message. please help me.

Alfonso Ariza Quintana

unread,
Jun 6, 2017, 3:25:16 AM6/6/17
to omn...@googlegroups.com
Include in the configuration this

**.forceBroadcast = true

In other case the IP module implements limited broadcast (it is not enough to set the address to the address broadcast, it is necessary also to include the ports that the broadcast must be emitted).


-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de ferra adelinna
Enviado el: lunes, 05 de junio de 2017 8:42
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: RE: [Omnetpp-l] UDP broadcast in OMNET

i've been using ipv4addrees allones and allmcast host but it doesnt work. server send message to ip 255.255.255.255 but the car cannt receive the broadcast message. please help me.

Bruno Ferreira

unread,
Feb 13, 2020, 7:45:10 AM2/13/20
to OMNeT++ Users
Hi!

Has the broadcast been implemented by now in the inet framework? Or is it still only available in the inetmanet?

Best Regards,
Bruno

On Tuesday, June 6, 2017 at 9:25:16 AM UTC+2, Alfonso Ariza Quintana wrote:
Include in the configuration this

**.forceBroadcast = true

In other case the IP module implements limited broadcast (it is not enough to set the address to the address broadcast, it is necessary also to include the ports that the broadcast must be emitted).


-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de ferra adelinna
Enviado el: lunes, 05 de junio de 2017 8:42
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: RE: [Omnetpp-l] UDP broadcast in OMNET

i've been using ipv4addrees allones and allmcast host but it doesnt work. server send message to ip 255.255.255.255 but the car cannt receive the broadcast message. please help me.

--
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 omn...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages