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"
> /
> /
>
> /
> /
>
>
> /
> /
> " 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>>.
>
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>.
>
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>.