Request for ns-3 installation guide and enable 5G-LENA NR module

38 views
Skip to first unread message

Lawal Sulaiman

unread,
Dec 1, 2025, 3:02:10 AMDec 1
to 5g-len...@googlegroups.com
Good evening all,

I am carrying out a research project titled:
“An Adaptive Handover Strategy for 5G Ultra-Dense Networks under Stochastic Mobility and Fading Conditions.”

This work requires the integration of three key layers of the ns-3 simulation framework:

  1. Mobility Layer – to implement a stochastic movement model for mobile users.

  2. Measurement and Channel Layer – to model realistic radio conditions including RSRP, SINR, path loss, shadowing, and interference.

  3. Handover Decision Layer – to override the default 3GPP A3/A5 event-based mechanism and implement a custom adaptive handover algorithm.

Since I am new to ns-3, I require clear and complete documentation on:

  • How to correctly install ns-3.41

  • How to enable and integrate the 5G-LENA NR module

  • How to verify that the installation is successful

  • How to run initial NR examples to confirm proper setup

Kindly assist me with the step-by-step installation guide and configuration instructions.


Lawal Sulaiman
HOD Network Services
Usmanu Danfodiyo University Network (UDUNet)
Usmanu Danfodiyo University, Sokoto
lawal.s...@udusok.edu.ng
08064861567

Gabriel Ferreira

unread,
Dec 1, 2025, 3:07:33 AMDec 1
to 5G-LENA-users
ns-3.41 is pretty old. 

Instructions on how to install NR are available on the readme file in nr's repo gitlab.com/cttc-lena/nr
Or directly in our doxygen documentation: https://cttc-lena.gitlab.io/nr/html/

Example instructions are available in the manual: https://cttc-lena.gitlab.io/nr/manual/nr-module.html


Lawal Sulaiman

unread,
Dec 19, 2025, 7:41:37 AM (6 days ago) Dec 19
to Gabriel Ferreira, 5G-LENA-users
Thank you very much for the documentation. I was able to successfully install and test the ns3 with 5G Lenna.

After the installation of ns-3 with 5G Lena. I wanted to implement my research work on ns-3 using the following steps:


Step 1: Setting Up Mobility and Placement

A. Topology & Conditions: scratch/ahs-5gudn-smfc-sim.cc (New Simulation Script)

1. Create a new file in the scratch directory.

2. Implement the UDN topology: Deploy 5G gNBs and the UE using nr-helper.

3. Configure the channel model: Use nr-channel and add propagation loss (e.g., LogNormalShadowingModel and 3gppPropagationLossModel).

4. Apply the RandomWaypointMobilityModel to the UE.


B. Metric Collection: contrib/nr/model/nr-ue-net-device.cc

1. Locate where RSRP/SINR measurements are processed (often in the Measurement Report generation).

2. Add custom tracing mechanisms (e.g., ns3::TraceSource) to log RSRP/SINR to a file or a custom data structure accessible by your logic.

B. Handover Logic Hook: contrib/nr/model/nr-rrc-protocol-real.cc

1. Identify the function that processes the Measurement Report (MR) and triggers the RRC state machine decision. This is your primary hook point.

2. Modify the MR handling to pass the relevant metrics to your custom TOPSIS/Dwell Time class instead of the standard A3/A5 event handling logic.


Step 2: Algorithm Implementation (The Core Research)

A. Implement the Stochastic Mobility and Fading-aware Dwell Time Prediction (SMFDTP) algorithm

SMFDTP Algorithm Functions:

1. RSS Stability Factor Calculation ($\sigma^2$)

2. Geometric Dwell Time Calculation ($T_{geom}$)

3. Composite Score (SMFDTP)

B. TOPSIS and Self-Adaptive Weight Allocation Mechanism (TOPSIS/SAWAM)

TOPSIS/SAWAM Class

TOPSIS/SAWAM Implementation

Decision & Trigger

Step 3: Validation and Analysis

During the compilation (build) proc process I encounter so many errors. Some of the errors are shown below:

/home/alibawa/nrRepo/ns-3-dev/contrib/nr/model/nr-rrc-protocol-ideal.h:75:18: error: ‘ns3::ns3::NrUeRrcSapUser::SetupParameters’ has not been declared

75 | void DoSetup(NrUeRrcSapUser::SetupParameters params);

| ^~~~~~~~~~~~~~

/home/alibawa/nrRepo/ns-3-dev/contrib/nr/model/nr-ue-net-device.h:138:9: error: ‘NrEpcUeNas’ was not declared in this scope; did you mean ‘ns3::ns3::NrEpcUeNas’?

138 | Ptr<NrEpcUeNas> GetNas() const;

| ^~~~~~~~~~

| ns3::ns3::NrEpcUeNas


/home/alibawa/nrRepo/ns-3-dev/contrib/nr/model/nr-ue-net-device.h:150:27: error: ‘NrInitialAssociation’ was not declared in this scope; did you mean ‘ns3::ns3::NrInitialAssociation’?

150 | void SetInitAssoc(Ptr<NrInitialAssociation> initAssoc);

| ^~~~~~~~~~~~~~~~~~~~

| ns3::ns3::NrInitialAssociation

/home/alibawa/nrRepo/ns-3-dev/contrib/nr/model/nr-ue-net-device.h:170:51: error: ‘BandwidthPartUe’ is not a member of ‘ns3::ns3’; did you mean ‘BandwidthPartUe’?

170 | void SetCcMap(std::map<uint8_t, ns3::Ptr<ns3::BandwidthPartUe>> ccm);

/home/alibawa/nrRepo/ns-3-dev/contrib/nr/model/nr-ue-net-device.h:175:37: error: template argument 2 is invalid

175 | std::map<uint8_t, ns3::Ptr<ns3::BandwidthPartUe>> GetCcMap(); // Use ns3::Ptr and ns3::BPUe

| ^~~~~~~~~~~~~~~

Kindly assist me with some procedures or guidelines on how to successfully implement my work on ns3 5G Lena.

Thanks.


Lawal Sulaiman
HOD Network Services
Usmanu Danfodiyo University Network (UDUNet)
Usmanu Danfodiyo University, Sokoto
lawal.s...@udusok.edu.ng
08064861567

--
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/5g-lena-users/2d82e24b-192c-49ed-ad15-2c8a23d2c2f5n%40googlegroups.com.

Gabriel Ferreira

unread,
Dec 20, 2025, 4:52:39 PM (5 days ago) Dec 20
to 5G-LENA-users
These errors means you are including things that are already inside ns3 namespace into ns3 namespace.
Then failing to find them. Chatgpt can help you with that. 

Lawal Sulaiman

unread,
Dec 22, 2025, 5:01:33 PM (3 days ago) Dec 22
to Gabriel Ferreira, 5G-LENA-users

 I am running ns3 with 5G Lena. I build successfully as you can see below:


alibawa@alibawa:~/nrRepo/ns-3-dev$ ./ns3 build

[0/2] Re-checking globbed directories...

ninja: no work to do.

Finished executing the following commands:

/usr/bin/cmake --build /home/alibawa/nrRepo/ns-3-dev/cmake-cache -j 7


Bu when I attept to conpile I got the error below:


alibawa@alibawa:~/nrRepo/ns-3-dev$ ./ns3 run scratch/ahs-test.cc

[0/2] Re-checking globbed directories...

ninja: no work to do.

NS_ASSERT failed, cond="m_ptr", msg="Attempted to dereference zero pointer", +0.000000000s -1 file=/home/alibawa/nrRepo/ns-3-dev/src/core/model/ptr.h, line=712

NS_FATAL, terminating

terminate called without an active exception

Command 'build/scratch/ns3.46-ahs-test-default' died with <Signals.SIGABRT: 6>.


I googled the error through chatgpt and google gemini several times but there are no results. Kindly assist me on how to fix the error. Thank you very much for the support


Lawal Sulaiman
HOD Network Services
Usmanu Danfodiyo University Network (UDUNet)
Usmanu Danfodiyo University, Sokoto
lawal.s...@udusok.edu.ng
08064861567

Gabriel Ferreira

unread,
Dec 23, 2025, 8:42:59 AM (2 days ago) Dec 23
to 5G-LENA-users
This is not a compilation error, it is an execution error. You need to debug your program to figure out what went wrong.
But the assert tells you tried to dereference a null pointer. This is usually due to bad simulation setup.
Reply all
Reply to author
Forward
0 new messages