INETMANET UDP broadcast messages not received!!

119 views
Skip to first unread message

Coronel

unread,
Jun 28, 2010, 2:31:07 PM6/28/10
to omnetpp
Hello,

I am just starting working with INETMANET. I am trying to simply
broadcast a UDP message on one node and receive it in others. I follow
the BasicApp example, the node broadcast the messages but when
received they are not passed up to my UDP application.

*****************This is my code*******************

void TrickleApp::initialize(int stage)
{
// because of IPAddressResolver, we need to wait until interfaces
are registered,
// address auto-assignment takes place etc.
if (stage!=3)
return;

counter =0;
numSent = 0;
numReceived = 0;

WATCH(numSent);
WATCH(numReceived);

bindToPort(1234);

cMessage *timer = new cMessage("sendTimer");
scheduleAt((double)0.2, timer);
}


cPacket *TrickleApp::createPacket()
{
char msgName[32];
sprintf(msgName,"UDPBasicAppData-%d", counter++);

cPacket *payload = new cPacket(msgName);
payload->setByteLength(512);
return payload;
}

void TrickleApp::sendPacket()
{
cPacket *payload = createPacket();
IPvXAddress destAddr = IPvXAddress(IPAddress::ALLONES_ADDRESS);

sendToUDP(payload, 1235, destAddr, 1234);

numSent++;
}

void TrickleApp::handleMessage(cMessage *msg)
{
if (msg->isSelfMessage())
{
// send, then reschedule next sending
sendPacket();
scheduleAt(simTime()+(double)0.2, msg);
}
else
{
// process incoming packet
processPacket(PK(msg));
}

if (ev.isGUI())
{
char buf[40];
sprintf(buf, "rcvd: %d pks\nsent: %d pks",numReceived,
numSent);
getDisplayString().setTagArg("t",0,buf);
}
}


void TrickleApp::processPacket(cPacket *msg)
{
EV << "Received packet: ";
printPacket(msg);
delete msg;

numReceived++;
}


*********This is my node************

module TrickleNode
{
parameters:
@node();
int numTcpApps = default(0);
int numUdpApps = default(0);
string tcpAppType = default("");
string udpAppType = default("");
bool IPForward = default(false);
string routingFile = default("");
string mobilityType = default("NullMobility");
@display("i=device/pocketpc_s");
gates:
input radioIn @directIn;
submodules:
notificationBoard: NotificationBoard {
parameters:
@display("p=60,70");
}
interfaceTable: InterfaceTable {
parameters:
@display("p=60,150");
}
routingTable: RoutingTable {
parameters:
IPForward = IPForward;
routerId = "";
routingFile = routingFile;
@display("p=60,230");
}
tcpApp[numTcpApps]: <tcpAppType> like TCPApp {
parameters:
@display("p=163,67");
}
tcp: TCP {
parameters:
@display("p=163,154");
}
udpApp[numUdpApps]: <udpAppType> like UDPApp {
parameters:
@display("p=343,60");
}
udp: UDP {
parameters:
@display("p=272,154");
}
networkLayer: NetworkLayer {
parameters:
proxyARP = false;
@display("p=248,247;q=queue");
gates:
ifIn[1];
ifOut[1];
}
wlan: Ieee80211NicAdhoc {
parameters:
@display("p=248,349;q=queue");
}
mobility: <mobilityType> like BasicMobility {
parameters:
@display("p=149,307");
}
trickleApp: TrickleApp {
@display("p=243,47");
}
connections allowunconnected:
for i=0..numTcpApps-1 {
tcpApp[i].tcpOut --> tcp.appIn++;
tcpApp[i].tcpIn <-- tcp.appOut++;
}

tcp.ipOut --> networkLayer.tcpIn;
tcp.ipIn <-- networkLayer.TCPOut;

for i=0..numUdpApps-1 {
udpApp[i].udpOut --> udp.appIn++;
udpApp[i].udpIn <-- udp.appOut++;
}

udp.ipOut --> networkLayer.udpIn;
udp.ipIn <-- networkLayer.udpOut;

// connections to network outside
radioIn --> wlan.radioIn;
wlan.uppergateOut --> networkLayer.ifIn[0];
wlan.uppergateIn <-- networkLayer.ifOut[0];
trickleApp.udpOut --> udp.appIn++;
udp.appOut++ --> trickleApp.udpIn;
}

*******This is my network***************
network TrickleNetwork
{
submodules:
trickleNode: TrickleNode {
@display("p=193,72");
}
trickleNode1: TrickleNode {
@display("p=84,152");
}
channelControl: ChannelControl {
@display("p=72,71");
}
flatNetworkConfigurator: FlatNetworkConfigurator {
@display("p=125,33");
}
}

**********This is my omnetpp.ini**********

[General]
network = TrickleNetwork
**.mac.maxQueueSize = 14
**.mac.bitrate = 54Mbps
**.radio.bitrate = 54Mbps
**.radio.sensitivity = -90dBm
*.channelControl.pMax = 0.002mW
**.wlan.radio.transmitterPower=0.002mW

I have been struggling with this for several days so any help will be
much appreciated

Regards!

Alfonso Ariza Quintana

unread,
Jun 28, 2010, 5:14:32 PM6/28/10
to omn...@googlegroups.com
The IP layer in inetmanet implement a limited broadcast forwarding, it's necessary to set the interface by which the packet will be send, you can find more information about this in old messages


Dime cómo viajas y te diré qué famoso eres ¿Cuál es tu estilo, chic y deslumbrante o mundano y familiar? Descubre quién eres viajando.

Coronel

unread,
Jun 29, 2010, 10:26:29 AM6/29/10
to omnetpp
I had a look to old messages and what I found is that I need to set
the interface (i.e. ctrl->setInterfaceId(101)) and make sure I am
binding to the right port (i.e. bindToPort(1234)). Still I am not able
of receiving the messages. Here is my simulation output:

Initializing module TrickleNetwork.trickleNode1.networkLayer.arp,
stage 4
** Event #1 T=0 TrickleNetwork.trickleNode.udp (UDP, id=9), on
`UDP_C_BIND' (cMessage, id=14)
Binding socket: sockId=0 appGateIndex=0 userId=-1 localPort=1234
** Event #2 T=0 TrickleNetwork.trickleNode1.udp (UDP, id=25), on
`UDP_C_BIND' (cMessage, id=16)
Binding socket: sockId=1 appGateIndex=0 userId=-1 localPort=1234
** Event #3 T=0.2 TrickleNetwork.trickleNode.trickleApp (TrickleApp,
id=13), on selfmsg `sendTimer' (cMessage, id=15)
Sending packet: (cPacket)UDPBasicAppData-0 (512 bytes)
<unspec> :1235 --> 255.255.255.255:1234
** Event #4 T=0.2 TrickleNetwork.trickleNode1.trickleApp
(TrickleApp, id=29), on selfmsg `sendTimer' (cMessage, id=17)
Sending packet: (cPacket)UDPBasicAppData-0 (512 bytes)
<unspec> :1235 --> 255.255.255.255:1234
** Event #5 T=0.2 TrickleNetwork.trickleNode.udp (UDP, id=9), on
`UDPBasicAppData-0' (cPacket, id=18)
Sending app packet UDPBasicAppData-0 over IPv4.
** Event #6 T=0.2 TrickleNetwork.trickleNode1.udp (UDP, id=25), on
`UDPBasicAppData-0' (cPacket, id=19)
Sending app packet UDPBasicAppData-0 over IPv4.
** Event #7 T=0.2 TrickleNetwork.trickleNode.networkLayer.ip (IP,
id=14), on `UDPBasicAppData-0' (UDPPacket, id=20)
Routing datagram `UDPBasicAppData-0' with dest=255.255.255.255:
** Event #8 T=0.2 TrickleNetwork.trickleNode1.networkLayer.ip (IP,
id=30), on `UDPBasicAppData-0' (UDPPacket, id=21)
Routing datagram `UDPBasicAppData-0' with dest=255.255.255.255:
** Event #9 T=0.2 TrickleNetwork.trickleNode.networkLayer.arp (ARP,
id=15), on `UDPBasicAppData-0' (IPDatagram, id=22)
Packet (IPDatagram)UDPBasicAppData-0 arrived from higher layer, using
next-hop address 255.255.255.255
destination address is multicast, sending packet to broadcast MAC
address
** Event #10 T=0.2 TrickleNetwork.trickleNode1.networkLayer.arp
(ARP, id=31), on `UDPBasicAppData-0' (IPDatagram, id=23)
Packet (IPDatagram)UDPBasicAppData-0 arrived from higher layer, using
next-hop address 255.255.255.255
destination address is multicast, sending packet to broadcast MAC
address
** Event #11 T=0.2 TrickleNetwork.trickleNode.wlan.mgmt
(Ieee80211MgmtAdhoc, id=19), on `UDPBasicAppData-0' (IPDatagram,
id=22)
Packet arrived from upper layers: (IPDatagram)UDPBasicAppData-0
** Event #12 T=0.2 TrickleNetwork.trickleNode1.wlan.mgmt
(Ieee80211MgmtAdhoc, id=35), on `UDPBasicAppData-0' (IPDatagram,
id=23)
Packet arrived from upper layers: (IPDatagram)UDPBasicAppData-0
** Event #13 T=0.2 TrickleNetwork.trickleNode.wlan.mac
(Ieee80211Mac, id=20), on `UDPBasicAppData-0' (Ieee80211DataFrame,
id=24)
frame (Ieee80211DataFrame)UDPBasicAppData-0 received from higher
layer, receiver = FF-FF-FF-FF-FF-FF
New frame arrived while backing-off with noFrame
state information: mode = DCF, state = INIT, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
processing event in state machine Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: leaving state INIT
firing Data-Ready transition for Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: entering state DEFER
FSM Ieee80211Mac State Machine: leaving state DEFER
firing Immediate-Wait-DIFS transition for Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: entering state WAITDIFS
scheduling DIFS period
state information: mode = DCF, state = WAITDIFS, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
** Event #14 T=0.2 TrickleNetwork.trickleNode1.wlan.mac
(Ieee80211Mac, id=36), on `UDPBasicAppData-0' (Ieee80211DataFrame,
id=25)
frame (Ieee80211DataFrame)UDPBasicAppData-0 received from higher
layer, receiver = FF-FF-FF-FF-FF-FF
New frame arrived while backing-off with noFrame
state information: mode = DCF, state = INIT, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
processing event in state machine Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: leaving state INIT
firing Data-Ready transition for Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: entering state DEFER
FSM Ieee80211Mac State Machine: leaving state DEFER
firing Immediate-Wait-DIFS transition for Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: entering state WAITDIFS
scheduling DIFS period
state information: mode = DCF, state = WAITDIFS, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
** Event #15 T=0.20005 TrickleNetwork.trickleNode.wlan.mac
(Ieee80211Mac, id=20), on selfmsg `DIFS' (cMessage, id=2)
received self message: (cMessage)DIFS
state information: mode = DCF, state = WAITDIFS, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
processing event in state machine Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: leaving state WAITDIFS
firing Immediate-Transmit-Broadcast transition for Ieee80211Mac State
Machine
sending Broadcast frame
sending down (Ieee80211DataFrame)UDPBasicAppData-0
cancelling DIFS period
FSM Ieee80211Mac State Machine: entering state WAITBROADCAST
scheduling broadcast timeout period
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
** Event #16 T=0.20005 TrickleNetwork.trickleNode1.wlan.mac
(Ieee80211Mac, id=36), on selfmsg `DIFS' (cMessage, id=9)
received self message: (cMessage)DIFS
state information: mode = DCF, state = WAITDIFS, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
processing event in state machine Ieee80211Mac State Machine
FSM Ieee80211Mac State Machine: leaving state WAITDIFS
firing Immediate-Transmit-Broadcast transition for Ieee80211Mac State
Machine
sending Broadcast frame
sending down (Ieee80211DataFrame)UDPBasicAppData-0
cancelling DIFS period
FSM Ieee80211Mac State Machine: entering state WAITBROADCAST
scheduling broadcast timeout period
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 0, nav = 0
** Event #17 T=0.20005 TrickleNetwork.trickleNode.wlan.radio
(Ieee80211Radio, id=21), on `UDPBasicAppData-0' (Ieee80211DataFrame,
id=26)
Frame (Ieee80211DataFrame)UDPBasicAppData-0 will be transmitted at
54Mbps
sending, changing RadioState to TRANSMIT
** Notification at T=0.20005 to TrickleNetwork.trickleNode.wlan.mac:
RADIO-STATE TRANSMIT, channel #0, 54Mbps
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 2, nav = 0
processing event in state machine Ieee80211Mac State Machine
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 2, nav = 0
** Event #18 T=0.20005 TrickleNetwork.trickleNode1.wlan.radio
(Ieee80211Radio, id=37), on `UDPBasicAppData-0' (Ieee80211DataFrame,
id=30)
Frame (Ieee80211DataFrame)UDPBasicAppData-0 will be transmitted at
54Mbps
sending, changing RadioState to TRANSMIT
** Notification at T=0.20005 to TrickleNetwork.trickleNode1.wlan.mac:
RADIO-STATE TRANSMIT, channel #0, 54Mbps
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 2, nav = 0
processing event in state machine Ieee80211Mac State Machine
state information: mode = DCF, state = WAITBROADCAST, backoff = 0,
backoffPeriod = -1, retryCounter = 0, radioState = 2, nav = 0


On 28 jun, 16:14, Alfonso Ariza Quintana <aariza...@hotmail.com>
wrote:
> The IP layer in inetmanet implement a limited broadcast forwarding, it's necessary to set the interface by which the packet will be send, you can find more information about this in old messages
>
> _________________________________________________________________
> Citas sin compromiso por Internet Te damos las claves para encontrar pareja en la redhttp://contactos.es.msn.com/?mtcmk=015352

Alfonso Ariza Quintana

unread,
Jun 30, 2010, 12:07:15 PM6/30/10
to omn...@googlegroups.com
But, the are messages arriving to the destination nodes? It's possible that the messages arrive to the destination but with very low S/N

> Date: Tue, 29 Jun 2010 07:26:29 -0700
> Subject: [Omnetpp-l] Re: INETMANET UDP broadcast messages not received!!
> From: cfco...@ucol.mx
> 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.
>


Noticias, servicios, tendencias. Haz de MSN.ES tu pág. de inicio

Coronel

unread,
Jul 1, 2010, 12:27:31 PM7/1/10
to omnetpp
Yes, messages are arriving to destination nodes. They are received by
the wlan (Ieee80211NicAdhoc) and then a notification is sent to the
notification board, however the packer is not passed to the
networkLayer and consequently to the udp module.

I set the power transmision parameters as follows:

network = TrickleNetwork
**.mac.maxQueueSize = 14
**.mac.bitrate = 54Mbps
**.radio.bitrate = 54Mbps
**.radio.sensitivity = -90dBm
*.channelControl.pMax = 2.002mW
**.wlan.radio.transmitterPower=2.002mW



On 30 jun, 11:07, Alfonso Ariza Quintana <aariza...@hotmail.com>
wrote:
> But, the are messages arriving to the destination nodes? It's possible that the messages arrive to the destination but with very low S/N
>
>
>
> > Date: Tue, 29 Jun 2010 07:26:29 -0700
> > Subject: [Omnetpp-l] Re: INETMANET UDP broadcast messages not received!!
> > From: cfcor...@ucol.mx
> _________________________________________________________________
> Los cochazos de los famosos Patrick Dempsey, Tom Cruise o Michael Douglas presumen de automóvilhttp://motor.es.msn.com/coches/galeria.aspx?cp-documentid=152634169
Reply all
Reply to author
Forward
0 new messages