[BUG] PacketSink trace does not fire

139 views
Skip to first unread message

Konstantinos

unread,
Aug 7, 2013, 11:32:14 AM8/7/13
to ns-3-...@googlegroups.com
Hi all,

I have a simple WiFi scenario that I try to modify in order to make it as generic as possible (for dynamic source/dst selection etc).
I have used the PacketSink Rx trace source to capture the received packets.
I notice that this trace is not always fired when I install the packet sink application on selected nodes (the sinks), but when I install it on ALL nodes, it fires.

This is how I capture the PacketSink trace which should work for ALL nodes. 

   Config::ConnectWithoutContext("/NodeList/*/ApplicationList/*/$ns3::PacketSink/Rx",MakeCallback (&ReceivePacket));

In both cases, FlowMonitor gives the same results, meaning that the packets are received by the sinks.

When I enable the Logs for PacketSink, I see the applications are created, started but no packet received.

I attach the code and I have identified the position of the 'bug' (lines 208-209). That's where the two options to install the packetSink on all nodes or only the sinks is located. 

Any ideas why this problem occurs?

Best Regards,
Konstantinos
test_nodecontainer_bug.cc

Daniel

unread,
Aug 7, 2013, 12:39:22 PM8/7/13
to ns-3-...@googlegroups.com
Hi Konstantinos,

I tried running your test case. When I switched between lines 208 and 209, the Average PDR are different. Did you also see this?

Thanks,
Daniel

Konstantinos

unread,
Aug 7, 2013, 4:32:41 PM8/7/13
to ns-3-...@googlegroups.com
The change is very small (only 1 packet not received) and should be related to the probabilities of Backoff/Collisions.
If you take an average over large number of independent iterations, it should be the same (or very close). Or if you use same RGN/RUN numbers.

But the bug remains, no PacketSink/Rx is fired and I can't understand it.

Daniel

unread,
Aug 7, 2013, 11:49:33 PM8/7/13
to ns-3-...@googlegroups.com
Yeah, I just want to confirm that before I proceed.

I think it's not that the trace is not fired, but somehow PacketSink is not getting the packet? As you already noticed, PacketSink::HandleRead is never called when the code installs PacketSink on sinks instead of all_nodes.

I traced the flow and I think the packet got to UdpSocket at the least. But transitioning from UdpSocket to PacketSink did not happen for some reason.

Konstantinos

unread,
Aug 8, 2013, 5:03:20 AM8/8/13
to ns-3-...@googlegroups.com
Now that you mention it and I look at the code, I have installed PacketSink like this
line 204:   PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), sinkPort));
While I have created the sink socket like this:

line 200     Address m_sinkAddress (InetSocketAddress (wifi_if.GetAddress (i+(sink_cluster-1)*nodes_per_group), sinkPort));

But this does not explain why if I install it on ALL nodes, the packetSink fires.

Konstantinos

unread,
Aug 8, 2013, 7:39:55 AM8/8/13
to ns-3-...@googlegroups.com
Solved.... It was related to the interface assignment for the sink socket.

wifi_if.GetAddress (i+(sink_cluster-1)*nodes_per_group

I should not remove that 1 from the sink_cluster. I don't know why I have it like that.

And BTW, PDR is now the same...
Reply all
Reply to author
Forward
0 new messages