Cannot Recv Packet in new routing protocol

79 views
Skip to first unread message

Nicholas Loulloudes

unread,
Jul 3, 2011, 2:35:09 PM7/3/11
to ns-3-...@googlegroups.com
Hello all,

I am trying to develop a new routing protocol for Ad-Hoc networks, following the OLSR model. 

I have implemented my own protocol's packet headers, and started working on the implementation of a HELLO msg. I see that nodes installed with my protocol can send HELLO msgs, but nodes cannot RECV them. Specifically, I see that the Send() function is invoked, but the Recv() function is not. 

My test scenario are 5 Nodes with Ad-Hoc Wifi which statically placed 10m apart.

Any suggestions on where to start looking to find a solution to this?

Best,
Nicholas.

Lalith Suresh

unread,
Jul 3, 2011, 5:13:05 PM7/3/11
to ns-3-...@googlegroups.com
Are you sure you created the socket correctly for your protocol? Try to NS_LOG the Ipv4L3Protocol and the Mac layer as well to follow the travel path of the packets that your protocol is generating.
 
Best,
Nicholas.

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/0eXFUoTAtbQJ.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Nicholas Loulloudes

unread,
Jul 4, 2011, 11:37:12 AM7/4/11
to ns-3-...@googlegroups.com
Hi, thanks for the reply.

How do i log the Mac? Is there a specific directive only for the Mac?

Thnx,
Nicolas

Lalith Suresh

unread,
Jul 4, 2011, 2:51:35 PM7/4/11
to ns-3-...@googlegroups.com
On Mon, Jul 4, 2011 at 4:37 PM, Nicholas Loulloudes <loullo...@gmail.com> wrote:
Hi, thanks for the reply.

How do i log the Mac? Is there a specific directive only for the Mac?


If you're on Wifi, you can do something like:

NS_LOG=WifiNetDevice ./waf --run yourscript

Then go further down with the kind of mac you're using (AdhocWifiMac for instance). You can even try probing MacLow.
 
Thnx,
Nicolas


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/brlpLLCIfu8J.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Nicholas Loulloudes

unread,
Jul 5, 2011, 3:08:44 AM7/5/11
to ns-3-...@googlegroups.com
Hi Lalith,

I enabled the following LOG in my test application cpp.

LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL);
LogComponentEnable("AdhocWifiMac", LOG_LEVEL_ALL);

And the I get something like the following for every node that broadcasts:

Ipv4L3Protocol:Send(0x98e1fa8, 0x98ee290, 10.0.0.3, 10.255.255.255, 17, 0)
Testing address 127.0.0.1 with mask 255.0.0.0
Testing address 10.0.0.3 with mask 255.0.0.0
Ipv4L3Protocol::Send case 2:  subnet directed bcast to 10.0.0.3
Ipv4L3Protocol:BuildHeader(0x98e1fa8, 10.0.0.3, 10.255.255.255, 17, 32, 64, 1)


However, I do not see any Recv() function being invoked.
Any suggestions?

Nicholas Loulloudes

unread,
Jul 5, 2011, 11:23:57 AM7/5/11
to ns-3-...@googlegroups.com
Btw,

I forgot to mention that AdHocWiFi log reports the following:

AdHocWiFi::Enqueue(....)


Nicholas Loulloudes

unread,
Jul 6, 2011, 2:52:01 AM7/6/11
to ns-3-...@googlegroups.com
Hi Lalith, all

Any suggestions?

Thanks.

Hemanth

unread,
Jul 6, 2011, 1:45:25 PM7/6/11
to ns-3-users
Print the packet PID in the debug statements and try to log
Ipv4L3Protocol:AdhocWifiMac:MacLow. See if your packet is being sent
by all layers.

Lalith Suresh

unread,
Jul 10, 2011, 7:53:05 AM7/10/11
to ns-3-...@googlegroups.com
On Wed, Jul 6, 2011 at 12:22 PM, Nicholas Loulloudes <loullo...@gmail.com> wrote:
Hi Lalith, all

Any suggestions?


Sorry for the delay. Been travelling.

To add to what Hemanth said, see if the ::Receive() methods of all the layers are being called as well. This will tell you if the packet is dropped at any layer for some reason.
 
Thanks.

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/y3aVsQGbZCsJ.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Sérgio Vieira

unread,
Jul 11, 2011, 3:46:19 PM7/11/11
to ns-3-...@googlegroups.com
hi, which socket port are you using?

2011/7/10 Lalith Suresh <suresh...@gmail.com>



--
Sérgio Vieira
Master program in Computer Networks
State University of Ceará (UECE)

Nicholas Loulloudes

unread,
Jul 12, 2011, 2:17:31 AM7/12/11
to ns-3-...@googlegroups.com
Hi all, 

Thanks for the replies. I enabled the debug log for all the stack as suggested above. It seems that the problem was packet collision, therefore the recv() method was not invoked.

To solve this, I applied a random jitter before sending the packets to the mac layer and that sorted everything. I can now receive broadcasted packets from all other neighboring nodes.

Thank you for all the help and suggestions.

Best,
Nicholas.
Reply all
Reply to author
Forward
0 new messages