Bug in tracing drops with ns-3-dev

66 views
Skip to first unread message

Mahesh

unread,
Apr 24, 2018, 1:55:24 AM4/24/18
to ns-3-users
Hi all,

So I am running a very simple script with 2 nodes (one sending packets to another). I traced the values of MacTxDrop, PhyTxDrop, PhyRxDrop, and MacRxDrop using 2 methods:

Method 1: Config::ConnectWithoutContext
Method 2: Config::Connect

These are the overall results obtained:
WITHOUT CONTEXT STATS
Time: 4 MacTxDropCount: 1163 PhyTxDropCount: 0 PhyRxDropCount: 46 MacRxDropCount: 0

WITH CONTEXT STATS
Time: 4 Node: 0 MacTxDropCount: 784 PhyTxDropCount: 0 PhyRxDropCount: 0 MacRxDropCount: 0
Time: 4 Node: 1 MacTxDropCount: 379 PhyTxDropCount: 0 PhyRxDropCount: 0 MacRxDropCount: 0


MacTxDropCount adds up alright in both the methods, but PhyRxDropCount is not traced at all with Config::Connect. Isn't this a bug? I guess it was already fixed (https://groups.google.com/d/msg/ns-3-users/kh_z-1bowsw/u5DArI_SAAAJ). Please look into it.

Also, I want to know the exhaustive list of functions in which the following 4 traces are called: MacTxDrop, PhyTxDrop, PhyRxDrop, MacRxDrop

For example, when I run a script I see MacTxDrop and PhyRxDrop values, I want to be able to tell which functions are being called underneath which increase those values. How to do that? Could you please provide me with the functions for all the 4 traces so that I can test.

Thanks,
Mahesh

Konstantinos

unread,
Apr 24, 2018, 9:32:37 AM4/24/18
to ns-3-users
Could you provide the config paths for both ?

Mahesh

unread,
Apr 24, 2018, 9:50:55 AM4/24/18
to ns-3-users
There are 2 nodes. Could you please provide me with the functions for all the 4 traces so that I can test? I want to be able to monitor each trace down to the function level.

 
  // Trace Collisions Without Context
 
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTxDrop", MakeCallback(&MacTxDropWithoutContext));
 
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxDrop", MakeCallback(&PhyTxDropWithoutContext));
 
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxDrop", MakeCallback(&PhyRxDropWithoutContext));
 
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/MacRxDrop", MakeCallback(&MacRxDropWithoutContext));


 
// Trace Collisions With Context
 
Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/MacTxDrop", MakeCallback(&MacTxDropWithContext));
 
Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/PhyTxDrop", MakeCallback(&PhyTxDropWithContext));
 
Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/PhyRxDrop", MakeCallback(&PhyRxDropWithContext));
 
Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/MacRxDrop", MakeCallback(&MacRxDropWithContext));

 
Config::Connect ("/NodeList/1/DeviceList/0/$ns3::WifiNetDevice/Mac/MacTxDrop", MakeCallback(&MacTxDropWithContext));
 
Config::Connect ("/NodeList/1/DeviceList/0/$ns3::WifiNetDevice/Mac/PhyTxDrop", MakeCallback(&PhyTxDropWithContext));
 
Config::Connect ("/NodeList/1/DeviceList/0/$ns3::WifiNetDevice/Mac/PhyRxDrop", MakeCallback(&PhyRxDropWithContext));
 
Config::Connect ("/NodeList/1/DeviceList/0/$ns3::WifiNetDevice/Mac/MacRxDrop", MakeCallback(&MacRxDropWithContext));

Thanks,
Mahesh

Konstantinos

unread,
Apr 25, 2018, 4:31:09 AM4/25/18
to ns-3-users
And how many nodes you have in the network? 

If you have more than two, then the results you presented are plausible. 
The reason is that in the ConnectWithoutContext you have used the wildcard to trace ALL nodes while in the simple Connect you have specified the nodes. 
Hence, the dropped packets you see in the first instance was not from nodes you capture in the second.

There is nothing stopping you from using (or not using) the wildcard in either cases (Connect and ConnectWithoutContext). It is just a matter of what you want to trace and how you analyse your results.

Regards
K

Mahesh

unread,
Apr 25, 2018, 6:57:25 AM4/25/18
to ns-3-users
Hi Konstantinos,

I have 2 nodes in the network. For a 2 node network and the above config paths, the numbers should add up right?

Also, could you please provide me with the functions for all the 4 traces so that I can test? I want to be able to monitor each trace down to the function level.

Thanks,
Mahesh
Reply all
Reply to author
Forward
0 new messages