assert failed

217 views
Skip to first unread message

K' Dash

unread,
May 27, 2014, 9:41:19 AM5/27/14
to ns-3-...@googlegroups.com
dear fellows

i am not getting this error.

assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName: ns3::NqapWifiMac not found", file=../src/core/model/type-id.cc, line=540
terminate called without an active exception


Command ['/home/adnan/porting/ns-allinone-3.19/ns-3.19/build/scratch/IS-Based'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").



I used the below command but it is not telling me the exact line where the error exists.

thanks advance

regards
K'Dash

Konstantinos

unread,
May 27, 2014, 9:49:15 AM5/27/14
to ns-3-...@googlegroups.com
It will tell you IF you debug your code, i.e. use the GDB as mentioned in the red output.

There is no "NqapWifiMac" class. There is only the NqosWifiMacHelper.
Perhaps you are using source code from an earlier ns-3 release (ns-3.5?). 

What are you trying to do? How do you create the Wifi MAC?

K' Dash

unread,
May 27, 2014, 9:55:14 AM5/27/14
to ns-3-...@googlegroups.com
yes you are right. if you remember I did porting few months ago. well there was an old topology written in scratch folder. I remove some errors but this error still exists. and I dont know how to fix it now.





--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/z7y9wof_KIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


Konstantinos

unread,
May 27, 2014, 9:59:10 AM5/27/14
to ns-3-...@googlegroups.com
See current examples of wireless topologies, how they setup the Wifi MAC and adapt your code accordingly.


On Tuesday, May 27, 2014 3:55:14 PM UTC+2, K' Dash wrote:
yes you are right. if you remember I did porting few months ago. well there was an old topology written in scratch folder. I remove some errors but this error still exists. and I dont know how to fix it now.
On Tue, May 27, 2014 at 6:49 PM, Konstantinos <dinos.k...@gmail.com> wrote:
It will tell you IF you debug your code, i.e. use the GDB as mentioned in the red output.

There is no "NqapWifiMac" class. There is only the NqosWifiMacHelper.
Perhaps you are using source code from an earlier ns-3 release (ns-3.5?). 

What are you trying to do? How do you create the Wifi MAC?

On Tuesday, May 27, 2014 3:41:19 PM UTC+2, K' Dash wrote:
dear fellows

i am not getting this error.

assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName: ns3::NqapWifiMac not found", file=../src/core/model/type-id.cc, line=540
terminate called without an active exception


Command ['/home/adnan/porting/ns-allinone-3.19/ns-3.19/build/scratch/IS-Based'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").



I used the below command but it is not telling me the exact line where the error exists.

thanks advance

regards
K'Dash

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/z7y9wof_KIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


K' Dash

unread,
May 27, 2014, 10:58:13 AM5/27/14
to ns-3-...@googlegroups.com
Dear Konstantinos

I changed the code but same error exists. then I run the third.cc file with out any tweaking. but this error still exists.


To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


K' Dash

unread,
May 27, 2014, 3:18:57 PM5/27/14
to ns-3-...@googlegroups.com
I am still not getting the problem. :(
--
Regards,
ADNAN RASHID


Konstantinos

unread,
May 27, 2014, 5:40:33 PM5/27/14
to ns-3-...@googlegroups.com
Just post your scenario here or at least the part that sets up your WiFi to spot the error.

K' Dash

unread,
May 28, 2014, 4:59:04 AM5/28/14
to ns-3-...@googlegroups.com
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2005,2006,2007 INRIA
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Mathieu Lacage <mathieu...@sophia.inria.fr>
 */


#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "ns3/athstats-helper.h"

#include <iostream>

using namespace ns3;

static bool g_verbose = true;

void
DevTxTrace (std::string context, Ptr<const Packet> p)
{
  if (g_verbose)
    {
      std::cout << " TX p: " << *p << std::endl;
    }
}
void
DevRxTrace (std::string context, Ptr<const Packet> p)
{
  if (g_verbose)
    {
      std::cout << " RX p: " << *p << std::endl;
    }
}
void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
{
  if (g_verbose)
    {
      std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " << *packet << std::endl;
    }
}
void
PhyRxErrorTrace (std::string context, Ptr<const Packet> packet, double snr)
{
  if (g_verbose)
    {
      std::cout << "PHYRXERROR snr=" << snr << " " << *packet << std::endl;
    }
}
void
PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
{
  if (g_verbose)
    {
      std::cout << "PHYTX mode=" << mode << " " << *packet << std::endl;
    }
}
void
PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state)
{
  if (g_verbose)
    {
      std::cout << " state=" << state << " start=" << start << " duration=" << duration << std::endl;
    }
}

static void
SetPosition (Ptr<Node> node, Vector position)
{
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
  mobility->SetPosition (position);
}

static Vector
GetPosition (Ptr<Node> node)
{
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
  return mobility->GetPosition ();
}

static void
AdvancePosition (Ptr<Node> node)
{
  Vector pos = GetPosition (node);
  pos.x += 5.0;
  if (pos.x >= 210.0)
    {
      return;
    }
  SetPosition (node, pos);

  if (g_verbose)
    {
      //std::cout << "x="<<pos.x << std::endl;
    }
  Simulator::Schedule (Seconds (1.0), &AdvancePosition, node);
}

int main (int argc, char *argv[])
{
  CommandLine cmd;
  cmd.AddValue ("verbose", "Print trace information if true", g_verbose);

  cmd.Parse (argc, argv);

  Packet::EnablePrinting ();

  // enable rts cts all the time.
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
  // disable fragmentation
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));

  WifiHelper wifi = WifiHelper::Default ();
  MobilityHelper mobility;
  NodeContainer stas;
  NodeContainer ap;
  NetDeviceContainer staDevs;
  PacketSocketHelper packetSocket;

  stas.Create (2);
  ap.Create (1);

  // give packet socket powers to nodes.
  packetSocket.Install (stas);
  packetSocket.Install (ap);

  NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
  wifiPhy.SetChannel (wifiChannel.Create ());
  Ssid ssid = Ssid ("wifi-default");
  wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
  // setup stas.
  wifiMac.SetType ("ns3::StaWifiMac",
                   "Ssid", SsidValue (ssid),
                   "ActiveProbing", BooleanValue (false));
  staDevs = wifi.Install (wifiPhy, wifiMac, stas);
  // setup ap.
  wifiMac.SetType ("ns3::ApWifiMac",
                   "Ssid", SsidValue (ssid));
  wifi.Install (wifiPhy, wifiMac, ap);

  // mobility.
  mobility.Install (stas);
  mobility.Install (ap);

  Simulator::Schedule (Seconds (1.0), &AdvancePosition, ap.Get (0));

  PacketSocketAddress socket;
  socket.SetSingleDevice (staDevs.Get (0)->GetIfIndex ());
  socket.SetPhysicalAddress (staDevs.Get (1)->GetAddress ());
  socket.SetProtocol (1);

  OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
  onoff.SetConstantRate (DataRate ("500kb/s"));

  ApplicationContainer apps = onoff.Install (stas.Get (0));
  apps.Start (Seconds (0.5));
  apps.Stop (Seconds (43.0));

  Simulator::Stop (Seconds (44.0));

  Config::Connect ("/NodeList/*/DeviceList/*/Mac/MacTx", MakeCallback (&DevTxTrace));
  Config::Connect ("/NodeList/*/DeviceList/*/Mac/MacRx", MakeCallback (&DevRxTrace));
  Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxOk", MakeCallback (&PhyRxOkTrace));
  Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxError", MakeCallback (&PhyRxErrorTrace));
  Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/Tx", MakeCallback (&PhyTxTrace));
  Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace));

  AthstatsHelper athstats;
  athstats.EnableAthstats ("athstats-sta", stas);
  athstats.EnableAthstats ("athstats-ap", ap);

  Simulator::Run ();

  Simulator::Destroy ();

  return 0;
}



On Wed, May 28, 2014 at 2:40 AM, Konstantinos <dinos.k...@gmail.com> wrote:
Just post your scenario here or at least the part that sets up your WiFi to spot the error.
--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/z7y9wof_KIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


K' Dash

unread,
May 28, 2014, 5:01:03 AM5/28/14
to ns-3-...@googlegroups.com
Dear Kostantinos

this program will not run at your system. off-course you know the reason (NS3 files are ported)
.
--
Regards,
ADNAN RASHID


Konstantinos

unread,
May 28, 2014, 5:37:57 AM5/28/14
to ns-3-...@googlegroups.com
I just run the code you posted (next time please use attachments) on ns-3.19 and it run without any problem.
Unless you have done other modifications, we can not see your error.

Use the debugger to identify where the problem is.

K' Dash

unread,
May 28, 2014, 11:06:55 AM5/28/14
to ns-3-...@googlegroups.com
the sent file was wrong. I was in hurry. I apologize.

please find this file from attachment.


regards
K'dash


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/z7y9wof_KIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


wifiEID.cc

Konstantinos

unread,
May 28, 2014, 12:18:35 PM5/28/14
to ns-3-...@googlegroups.com
Again, I run your code without any problem in WiFi. 
I have commented out the application part since I do not have the EID client/server, but it did not complain.

So, the problem should be in those applications. Use the debugger!

On Wednesday, May 28, 2014 4:06:55 PM UTC+1, K' Dash wrote:
the sent file was wrong. I was in hurry. I apologize.

please find this file from attachment.


regards
K'dash
On Wed, May 28, 2014 at 2:37 PM, Konstantinos <dinos.k...@gmail.com> wrote:
I just run the code you posted (next time please use attachments) on ns-3.19 and it run without any problem.
Unless you have done other modifications, we can not see your error.

Use the debugger to identify where the problem is.


On Wednesday, May 28, 2014 10:01:03 AM UTC+1, K' Dash wrote:
Dear Kostantinos

this program will not run at your system. off-course you know the reason (NS3 files are ported)
.


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/z7y9wof_KIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


K' Dash

unread,
May 28, 2014, 3:18:50 PM5/28/14
to ns-3-...@googlegroups.com
At last I got it. I just use the grep command from terminal in src folder to find NqapWifiMac. In porting I changed the files name into new names (according to NS3.19) in wifi/model but forgot to change in "ipv4-l3-protocol.cc". so I fixed it. now my code works :)

void
Ipv4L3Protocol::ConnectToCatchAssocEvent (void)
{

  std::ostringstream oss;
  oss << "/NodeList/" << m_node->GetId () << "/DeviceList/*/Mac/$ns3::ApWifiMac/AssocNotif"; //Adnan: NqapWifiMac into ApWifiMac
  Config::Connect (oss.str (), MakeCallback (&Ipv4L3Protocol::ReceiveAssocNotif, this));

  std::ostringstream oss2;
  oss2 << "/NodeList/" << m_node->GetId () << "/DeviceList/*/Mac/$ns3::ApWifiMac/DisAssocNotif";
  Config::Connect (oss2.str (), MakeCallback (&Ipv4L3Protocol::ReceiveDisAssocNotif, this));
}



thanx bro

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
ADNAN RASHID


Reply all
Reply to author
Forward
0 new messages