MonitorSnifferRx and MonitorSnifferTx Trace error : "Incompatible types. (feed to "c++filt -t" if needed)

814 views
Skip to first unread message

saumil shah

unread,
Jan 30, 2018, 6:20:19 AM1/30/18
to ns-3-users
Dear All,

I am trying to use MonitorSnifferRx and MonitorSnifferTx trace sources in my implementation. I have configured callback signature as showed below.

void DevMonitorSnifferRx (std::string context,Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
{

      std::stringstream ss;
      ss << "MonitorSnifferRx.log";
      static std::fstream f (ss.str ().c_str (), std::ios::out);
      f <<  "SIGNAL_POWER = " <<  signalNoise.signal << "    NOISE_POER = " << signalNoise.noise << "   AMPDU_REFNUM = " << aMpdu.mpduRefNumber  << "  PKT_SIZE = "<<packet->GetSize() << "  "<<  "   = MonitorSnifferRx" << std::endl;

}
void DevMonitorSnifferTx (std::string context, Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
{

      std::stringstream ss;
      ss << "MonitorSnifferTx.log";
      static std::fstream f (ss.str ().c_str (), std::ios::out);
      f << "SIGNAL_POWER = " <<  signalNoise.signal << "    NOISE_POER = " << signalNoise.noise   << "  PKT_SIZE = "<<packet->GetSize() << "  "<<  "   = MonitorSnifferRx" << std::endl;

}

Config::ConnectWithoutContext ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/MonitorSnifferRx", MakeCallback(&DevMonitorSnifferRx));

Config::ConnectWithoutContext ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/MonitorSnifferTx", MakeCallback (&DevMonitorSnifferTx));


But i am getting below error while running the simulation.
msg="Incompatible types. (feed to "c++filt -t" if needed)
got=CallbackImpl<void,std::string,ns3::Ptr<ns3::Packet const>,unsigned short,unsigned short,unsigned int,ns3::WifiPreamble,ns3::WifiTxVector,ns3::mpduInfo,ns3::signalNoiseDbm>

expected=CallbackImpl<void,ns3::Ptr<ns3::Packet const>,unsigned short,unsigned short,unsigned int,ns3::WifiPreamble,ns3::WifiTxVector,ns3::mpduInfo,ns3::signalNoiseDbm>", file=./ns3/callback.h, line=1449
file=./ns3/traced-callback.h, line=268
terminate called without an active exception

I have checked many threads but it seems signature is correct and i am not able to figure out the problem here. Can anyone please help me with it?

PS: I am using ns-3-lbt module.

Best Regards
Saumil Shah

Tommaso Pecorella

unread,
Jan 30, 2018, 11:49:17 PM1/30/18
to ns-3-users
Remove form your functions the first argument (std::string context) or use Config::Connect instead of Config::ConnectWithoutContext.

T.

saumil shah

unread,
Jan 31, 2018, 5:29:52 AM1/31/18
to ns-3-users
Dear Tommaso,

Thank you for your suggestion. I have used Config::Connect and there is no more error but still trace is not triggered.

But when i tried to out print statement in wifi-phy.cc file for same trace source, values are getting printed. See the below modification.

void
WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
{

  std::cout << "signal_power = " << signalNoise.signal << "  noise_power = "<< signalNoise.noise << "   packet_size = " << packet->GetSize() << std::endl;
  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, preamble, txVector, aMpdu, signalNoise);
}

signal_power = -40.8201  noise_power = -100.966   packet_size = 100
signal_power = -40.8201  noise_power = -100.966   packet_size = 98
signal_power = -40.8201  noise_power = -100.966   packet_size = 134

What can be the reason behind it or how can we fix it ?

Best Regards
Saumil Shah

Tommaso Pecorella

unread,
Jan 31, 2018, 3:22:35 PM1/31/18
to ns-3-users
Hi,

maybe you called the connect too early in the code, when the full Wi-Fi stack isn't yet built.
Try delaying the call to a later point in the code.

T.

saumil shah

unread,
Feb 1, 2018, 5:06:55 AM2/1/18
to ns-3-users
Dear Tommaso,

I am calling the connect at later in the code just before Simulator::Run ();

Also i am triggering some other WifiPhy traces like PhyTxBegin,PhyRxBegin,PhyEndBegin, which are working properly. Even there are many other traces in the file and i am calling this particular trace after those just to be sure.

Check the below implementation in src/laa-wifi-coexistance/helper/scenario-helper.cc.

GlobalValue::GetValueByName ("logCtrlSignals", booleanValue);
if (booleanValue.Get () == true)
{
Simulator::Schedule (clientStartTime, &ScheduleCtrlSignalLogConnect);
//Simulator::Schedule (clientStopTime, &ScheduleCtrlSignalLogDisconnect);
}

  Simulator::Schedule(clientStartTime, &PhyTxBegin);
  Simulator::Schedule(clientStartTime, &PhyTxDrop);
  Simulator::Schedule(clientStartTime, &PhyRxBegin);
  Simulator::Schedule(clientStartTime, &PhyRxDrop);
  Simulator::Schedule(clientStartTime, &PhyTxEnd);
  Simulator::Schedule(clientStartTime, &PhyRxEnd)
  Simulator::Schedule(clientStartTime, &MonitorSnifferRx);
  Simulator::Schedule(clientStartTime, &MonitorSnifferTx);


lteHelper->EnableTraces();

//
// Running the simulation
//
Simulator::Run ();

Best Regards
Saumil

Tommaso Pecorella

unread,
Feb 1, 2018, 11:28:59 PM2/1/18
to ns-3-users
Attach a sample script please.

T.

saumil shah

unread,
Feb 2, 2018, 4:48:11 AM2/2/18
to ns-3-users
Dear Tommaso,

Kindly find attached files to test the scenario.

Steps to Run script:
1) Put attached bs_A_labels_1200.csv, bs_B_labels_1200.csv, ue_A_labels_1200.csv, ue_A_labels_1200.csv files into /ns-3-lbt directory.

2) Put attached ss_laa_wifi_indoor.cc file into /ns-3-lbt/src/laa-wifi-coexistence/examples directory and add this file into wscript too.

3) Put attached scenario-helper.cc file into /ns-3-lbt/src/laa-wifi-coexistence/helper directory.

4) Run the simulation with script : ../waf --run "ss_laa_wifi_indoor --logPhyArrivals=true --run=1200 --duration=10"

Best Regards
Saumil Shah
scenario-helper.cc
ss_laa_wifi_indoor.cc
ue_B_labels_1200.csv
ue_A_labels_1200.csv
bs_B_labels_1200.csv
bs_A_labels_1200.csv

Tommaso Pecorella

unread,
Feb 4, 2018, 12:29:11 AM2/4/18
to ns-3-users
Hi,

to be honest I have no idea. I checked but I haven't found why it's not fired. I'll ask Tom, perhaps he's more awake than me on this area.

Cheers,

T.

saumil shah

unread,
Feb 4, 2018, 4:56:54 AM2/4/18
to ns-3-users
Dear Tommaso,

Thank you for looking into this issue. I will wait for Tom's suggestion on this.

Best Regards
Saumil Shah 
Reply all
Reply to author
Forward
0 new messages