assert failed

220 views
Skip to first unread message

ABDULJABBAR ALSHARIF

unread,
Sep 4, 2023, 4:46:39 PM9/4/23
to ns-3-...@googlegroups.com
hi anybody know how to solve this issue ...

NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0", +0.000000000s -1 file=../src/core/model/type-id.cc, line=459
NS_FATAL, terminating
terminate called without an active exception

Jabbar
" if you want the rainbow you have deal with rains"


Tom Henderson

unread,
Sep 4, 2023, 5:00:23 PM9/4/23
to ns-3-...@googlegroups.com, ABDULJABBAR ALSHARIF
Run your simulation with a debugger (e.g., gdb) enabled, and it will
stop at the point of the assert, and you can inspect the value of uid
or other values, and step up through a backtrace to deduce what may have
gone wrong.

https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors

On 9/4/23 13:46, ABDULJABBAR ALSHARIF wrote:
> hi anybody know how to solve this issue ...
>
> NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0",
> +0.000000000s -1 file=../src/core/model/type-id.cc, line=459
> NS_FATAL, terminating
> terminate called without an active exception
>
> Jabbar
> /
> /
> " if you want the rainbow you have deal with rains"
> /
> /
>
> /
> /
>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com <https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Tommaso Pecorella

unread,
Sep 4, 2023, 5:30:49 PM9/4/23
to ns-3-users
I kinda remember that kind of error happening with older ns-3 versions, so another suggestion is to heck if it does happen with ns-3-dev.

ABDULJABBAR ALSHARIF

unread,
Sep 5, 2023, 3:15:32 AM9/5/23
to ns-3-...@googlegroups.com
hi same output while  same error ...

" if you want the rainbow you have deal with rains"



To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/93e86ea1-82c8-4569-bb80-68f88208d6e5n%40googlegroups.com.
Screenshot 2023-09-05 12.40.28.png

ABDULJABBAR ALSHARIF

unread,
Sep 5, 2023, 3:29:01 AM9/5/23
to ns-3-...@googlegroups.com
this is my code 
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/lte-module.h"
#include "ns3/mobility-module.h"
#include "ns3/applications-module.h"

using namespace ns3;

// Callback function to trace throughput
static void TraceThroughput (std::string context, Ptr<const Packet> p, const Address &addr)
{
  NS_LOG_UNCOND ("Received one packet!");
}

int main (int argc, char *argv[])
{
  // Initialize ns-3
  LogComponentEnable ("LteEnbRrc", LOG_LEVEL_INFO);
  LogComponentEnable ("LteUeRrc", LOG_LEVEL_INFO);

  // Create nodes
  NodeContainer enbNodes;
  enbNodes.Create (1);  // Create an eNodeB
  NodeContainer ueNodes;
  ueNodes.Create (1);   // Create a User Equipment (UE)

  // Install LTE protocol stack on nodes
  LteHelper lte;
  NetDeviceContainer enbLteDevs = lte.InstallEnbDevice (enbNodes);
  NetDeviceContainer ueLteDevs = lte.InstallUeDevice (ueNodes);

  // Create a mobility model
  MobilityHelper mobility;
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  mobility.Install (ueNodes);
  mobility.Install (enbNodes);

  // Create an Internet stack
  InternetStackHelper internet;
  internet.Install (ueNodes);

  // Assign IP addresses
  Ipv4AddressHelper ipAddr;
  ipAddr.SetBase ("10.1.1.0", "255.255.255.0");
  Ipv4InterfaceContainer ueIpIface = ipAddr.Assign (ueLteDevs);

  // Install applications (e.g., FTP or CBR)
  ApplicationContainer apps;
  OnOffHelper onOffHelper ("ns3::UdpSocketFactory", InetSocketAddress (ueIpIface.GetAddress (0), 9));
  onOffHelper.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
  onOffHelper.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
  apps.Add (onOffHelper.Install (ueNodes.Get (0)));
  apps.Start (Seconds (1.0));
  apps.Stop (Seconds (10.0));

  // Connect the trace source for throughput
  Config::Connect ("/NodeList/0/DeviceList/0/$ns3::LteEnbNetDevice/Phy/State/TxEnd", MakeCallback (&TraceThroughput));

  // Configure and start the simulation
  lte.EnableTraces ();
  Simulator::Stop (Seconds (11.0));
  Simulator::Run ();
  Simulator::Destroy ();

  return 0;

}
" if you want the rainbow you have deal with rains"



Tommaso Pecorella

unread,
Sep 5, 2023, 4:28:36 AM9/5/23
to ns-3-users
I guess you need to study the examples in src/lte/examples - there are multiple errors and they must be fixed. Like: UEs are not attached to the eNB, the nodes shall not have the IP addressed manually (the LTE helper does that for you) and so on.

I'm sorry, but we aren't here to completely rewrite your code ... " if you want the rainbow you have deal with rains" <- that's your signature - not mine.

ABDULJABBAR ALSHARIF

unread,
Sep 5, 2023, 7:09:34 AM9/5/23
to ns-3-...@googlegroups.com
assigned ip address not issue while container enods creates erro

maybe receiving trace file path ...  i will change attach UE, EnodB reconnect it will see 

" if you want the rainbow you have deal with rains"



Tom Henderson

unread,
Sep 5, 2023, 12:50:27 PM9/5/23
to ns-3-...@googlegroups.com
There are multiple configuration problems; please see inline below.

In general, you will have more success if you start with an example
program in src/lte/examples/ directory and modify it in small steps to
configure it differently.

On 9/5/23 00:28, ABDULJABBAR ALSHARIF wrote:
> this is my code
> #include "ns3/core-module.h"
> #include "ns3/network-module.h"
> #include "ns3/internet-module.h"
> #include "ns3/lte-module.h"
> #include "ns3/mobility-module.h"
> #include "ns3/applications-module.h"
>
> using namespace ns3;
>
> // Callback function to trace throughput
> static void TraceThroughput (std::string context, Ptr<const Packet> p,
> const Address &addr)
> {
>   NS_LOG_UNCOND ("Received one packet!");
> }

The above callback target does not have a signature that matches the
callback function: Ptr< const PacketBurst > burst

it should be
static void TraceThroughput (std::string context, Ptr<const PacketBurst>
burst)

The Doxygen documentation provides information about the signatures of
trace sources.



>
> int main (int argc, char *argv[])
> {
>   // Initialize ns-3
>   LogComponentEnable ("LteEnbRrc", LOG_LEVEL_INFO);
>   LogComponentEnable ("LteUeRrc", LOG_LEVEL_INFO);
>
>   // Create nodes
>   NodeContainer enbNodes;
>   enbNodes.Create (1);  // Create an eNodeB
>   NodeContainer ueNodes;
>   ueNodes.Create (1);   // Create a User Equipment (UE)
>
>   // Install LTE protocol stack on nodes
>   LteHelper lte;

LteHelper is unlike other helpers in that it must be created as an ns-3
Object, and stored in a smart pointer class (Ptr).

You need to do:
Ptr<LteHelper> lte = CreateObject<LteHelper> ();

>   NetDeviceContainer enbLteDevs = lte.InstallEnbDevice (enbNodes);
>   NetDeviceContainer ueLteDevs = lte.InstallUeDevice (ueNodes);
>
>   // Create a mobility model
>   MobilityHelper mobility;
>   mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
>   mobility.Install (ueNodes);
>   mobility.Install (enbNodes);

LTE will not install properly unless mobility models are attached before
LTE is configured, so move the mobility configuration earlier in the
program.
>
>   // Create an Internet stack
>   InternetStackHelper internet;
>   internet.Install (ueNodes);
>
>   // Assign IP addresses
>   Ipv4AddressHelper ipAddr;
>   ipAddr.SetBase ("10.1.1.0", "255.255.255.0");
>   Ipv4InterfaceContainer ueIpIface = ipAddr.Assign (ueLteDevs);
>
>   // Install applications (e.g., FTP or CBR)
>   ApplicationContainer apps;
>   OnOffHelper onOffHelper ("ns3::UdpSocketFactory", InetSocketAddress
> (ueIpIface.GetAddress (0), 9));
>   onOffHelper.SetAttribute ("OnTime", StringValue
> ("ns3::ConstantRandomVariable[Constant=1]"));
>   onOffHelper.SetAttribute ("OffTime", StringValue
> ("ns3::ConstantRandomVariable[Constant=0]"));
>   apps.Add (onOffHelper.Install (ueNodes.Get (0)));
>   apps.Start (Seconds (1.0));
>   apps.Stop (Seconds (10.0));
>
>   // Connect the trace source for throughput
>   Config::Connect
> ("/NodeList/0/DeviceList/0/$ns3::LteEnbNetDevice/Phy/State/TxEnd",
> MakeCallback (&TraceThroughput));

The above trace source path is not correct. See the Doxygen
documentation for the options. Here is one that works:

Config::Connect
("/NodeList/0/DeviceList/0/$ns3::LteEnbNetDevice/ComponentCarrierMap/*/LteEnbPhy/DlSpectrumPhy/TxEnd",
MakeCallback (&TraceThroughput));


However, when you have made the above fixes, it still will not send
traffic over the air, because you have not configured an EPC and set one
of your application endpoints on a remote host. I do not think the LTE
code is set up for you to install applications directly on an eNB and
just send packets through the RAN without any EPC. At least, there are
no example programs that demonstrate this use case.

That is why I suggest that you start with a working example and start to
modify it, instead of writing one from scratch.

>
>   // Configure and start the simulation
>   lte.EnableTraces ();
>   Simulator::Stop (Seconds (11.0));
>   Simulator::Run ();
>   Simulator::Destroy ();
>
>   return 0;
> }
> /
> /
> " if you want the rainbow you have deal with rains"
> /
> /
>
> /
> /
>
>
> On Tue, Sep 5, 2023 at 12:45 PM ABDULJABBAR ALSHARIF
> <alsharifab...@gmail.com
> <mailto:alsharifab...@gmail.com>> wrote:
>
> hi same output while  same error ...
> /
> /
> " if you want the rainbow you have deal with rains"
> /
> /
>
> /
> /
>
>
> On Tue, Sep 5, 2023 at 3:00 AM Tommaso Pecorella <tomm...@gmail.com
> <mailto:tomm...@gmail.com>> wrote:
>
> I kinda remember that kind of error happening with older ns-3
> versions, so another suggestion is to heck if it does happen
> with ns-3-dev.
>
> On Monday, 4 September 2023 at 23:00:23 UTC+2 Tom Henderson wrote:
>
> Run your simulation with a debugger (e.g., gdb) enabled, and
> it will
> stop at the point of the assert, and you can inspect the
> value of uid
> or other values, and step up through a backtrace to deduce
> what may have
> gone wrong.
>
> https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors <https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors>
> https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com <https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com> <https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ns-3-users/CAEeUEEFeJLzuKvrLP9BtgC60bqvjV72XgZPk43s7EWAFkq9fEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the
> Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/93e86ea1-82c8-4569-bb80-68f88208d6e5n%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/93e86ea1-82c8-4569-bb80-68f88208d6e5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/CAEeUEEGFHqZHcT3uUZRk8XnODPaULuadmSQoQO-WHuKX3exP6Q%40mail.gmail.com <https://groups.google.com/d/msgid/ns-3-users/CAEeUEEGFHqZHcT3uUZRk8XnODPaULuadmSQoQO-WHuKX3exP6Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

ABDULJABBAR ALSHARIF

unread,
Sep 5, 2023, 1:40:09 PM9/5/23
to ns-3-...@googlegroups.com
thanks a lot, TOM I appreciate every single code comment I haven't used C++ for a longer  

Just last think about how to attach the endpoint code to some of the examples of applications.

Jabbar.

" if you want the rainbow you have deal with rains"



To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/20f59cef-7b4a-aedf-cc52-5d70017c5dda%40tomh.org.
Reply all
Reply to author
Forward
0 new messages