title: ns3-ntn-toolkit description: Open-source ns-3.49 distribution for 6G non-terrestrial network research: 14 integrated modules covering LEO constellations, 3GPP NR-NTN, O-RAN, sub-THz, Sionna, SAGIN, V2X, slicing, AI/ML, digital twin. hide: - navigation
ns3-ntn-toolkit¶
Watch: the NTN Control Center runs, visualizes and exports every module of the toolkit, end to end (5-minute video on YouTube).
Try it live: 6g-ntn.live runs the toolkit's examples in your browser, with open datasets, a scenario gallery and a research forum.
New on 6g-ntn.live: a live ns-3 console, 115 examples with editable parameters, a 3D globe of real constellations, open datasets (CC BY 4.0) and a validation page with 690 test cases in 41 suites. Every module now has its own project page and v3.0 release: ntn-rrc, ntn-cho-framework, oran-ntn, ns3-thz-ntn, ntn-sagin, ntn-constellation, ntn-v2x, ntn-sionna, ntn-slice, ntn-observability, ntn-digital-twin, ns3-ai. Follow the project on YouTube and LinkedIn.
An integrated ns-3.49 platform for 6G non-terrestrial networks: propagated LEO ephemerides, a measured 3GPP NR-NTN data plane, conditional handover, Space O-RAN control loops, sub-terahertz links and GPU ray tracing in one tree. Described in IEEE Open Journal of the Communications Society, 2026 (doi:10.1109/OJCOMS.2026.3745010).
Try it in the browser, no installation
The :material-satellite: Constellation demo on Hugging Face Spaces propagates real Starlink / OneWeb / Iridium NEXT / GPS TLEs in your browser using the same SGP4 backend the full toolkit uses. World map (Plotly · natural-earth), proper Earth-rotation-aware sub-satellite tracks, topocentric elevation/azimuth/range at any observer location.
# Python tooling, installable from PyPI
pip install ns3-ntn-toolkit # metapackage
ns3-ntn-toolkit info # version + module list
Publication¶
The toolkit is described and evaluated in the following open-access article:
M. Uzair, B. G. Aldahlan, A. A. Albar, H. Althumali and A. Alghammas, "ns3-ntn-toolkit: An Integrated ns-3 Platform for 6G Non-Terrestrial Networks," IEEE Open Journal of the Communications Society, vol. 7, pp. 13440–13467, 2026, doi: 10.1109/OJCOMS.2026.3745010.
Over ten seeds, the measured cell reproduces the TR 38.821 zenith-to-edge decay to within 0.49 ± 1.30 dB, and a nadir-fixed beam follows the TR 38.811 pattern to 2.71 ± 0.21 dB RMS across a 39 dB excursion. A closed O-RAN control loop measures 104 ms end to end, 26 µs of it computation. In an archived geometry-driven scenario, the time-to-exit trigger removes every ping-pong and cuts handovers by 71 % against A3. The release cited in the article is v2.6.1.
What is ns3-ntn-toolkit?¶
ns3-ntn-toolkit is an open-source ns-3 platform for 5G and 6G non-terrestrial network (NTN) research. Built on ns-3.49 with fourteen integrated modules, it models 3GPP Release-17/18/19 satellite networks end to end: propagated LEO ephemerides and TR 38.811 channels, Rel-17 conditional handover, an O-RAN near-RT RIC with xApps, NVIDIA Sionna ray tracing and sub-terahertz (100 GHz to 1 THz) propagation. Its KPIs (SINR, throughput, BLER, delay, jitter and loss) are measured from packets that cross the modeled radio rather than evaluated from closed-form expressions.
It is intended for research on LEO satellite networks, 5G NR-NTN, O-RAN over satellite, conditional handover, terahertz links, space-air-ground integrated networks, V2X over LEO, and AI/ML for satellite radio access networks.
The implementation follows 3GPP TR 38.811, TR 38.821, TS 38.213, TS 38.321, TS 38.331, TS 22.261 and TS 23.501; O-RAN E2AP, E2SM-KPM, E2SM-RC and A1; ITU-R P.676-13, P.618-13, P.838-3 and P.840; and SAE J2735 for vehicular messages.
What it does¶
-
:material-satellite-variant: Live constellations
Full Vallado SGP4 for real Starlink, OneWeb, Kuiper, IRIS², Iridium NEXT and Telesat two-line elements. Walker-Star and Walker-Delta presets generate shells from orbital elements, which propagate on a Kepler plus J2 secular model because a generated shell has no TLE; the model reports which path a run took.
-
:material-radio-tower: 3GPP NR-NTN protocol stack
TR 38.811 large-scale + small-scale fading. Rel-17 SIB19 + Timing Advance pre-compensation + UE GNSS location reporting + NTN-extended DRX + regenerative-vs-transparent payload. Conditional handover with TTE estimator.
-
:material-cogs: O-RAN Near-RT RIC + FlexRIC bridge
xApps spanning beam management, slice orchestration, anomaly detection and predictive handover, on three RIC placements whose E2 latency comes from live slant geometry. E2AP, KPM and RC procedures run in-simulator over an ns-3 header with toolkit-internal type values; that is not ASN.1 APER over SCTP, and the FlexRIC bridge is the start of a wire-level path (its listener exchanges frame types and does not decode payloads yet).
-
:material-wave: Sub-THz physics (100 GHz to 1 THz)
ITU-R P.676-13 line-by-line gaseous absorption over a layered atmosphere, P.618-13 scintillation, P.838-3 rain, P.840 fog. UM-MIMO, RIS quantisation sweep, ISAC CRB analysis.
-
:material-graph: AI/ML pipeline
Stable-Baselines3 + PyTorch Geometric + ns3-gym. Pre-built environments for handover, beam management, slice orchestration, power control. Multi-agent baselines are single-agent PPO/SAC over N independent environment copies, not MAPPO/MASAC: there is no centralized critic and no inter-agent coupling.
-
:material-cube-outline: GPU ray tracing (NVIDIA Sionna RT)
Optional GPU channel via Mitsuba 3 and TensorFlow, calibrated against the closed-form TR 38.811 reference. Every run prints whether its numbers were ray traced or fell back to free space, and a missing server can be made fatal rather than silent.
-
:material-airplane: SAGIN: HAPS + UAV + A2G
20 km HAPS station-keeping, UAV mobility patterns, 3GPP TR 36.777 air-to-ground channel. Multi-layer routing: ground → UAV → HAPS → LEO.
-
:material-car-traction-control: V2X over LEO
SUMO TraCI bridge for vehicular nodes consuming LEO connectivity in rural / oceanic / emergency scenarios.
-
:material-chart-line: Network slicing
eMBB, URLLC and mMTC across LEO and GEO with per-5QI dedicated bearers. SLA percentiles come from a delay histogram, so a p99 is a percentile rather than a restated mean.
-
:material-monitor-dashboard: Observability stack
InfluxDB + Grafana + NetSimulyzer 3D playback. Four pre-built Grafana dashboards. Per-slice / per-beam / per-cell KPI panels.
-
:material-earth: Live digital twin
FastAPI prediction service, TLE refresh and a CesiumJS 3D viewer. Prediction and actuation share one guard implementation, so the twin and the simulation cannot drift apart.
-
:material-server: Reproducible infrastructure
Docker compose for InfluxDB + Grafana, Docker compose for FlexRIC RIC + E2 Agent + xApps, every module with CMakeLists, every test gated.
See it run¶
The animations below are rendered from toolkit runs; each caption says what the clip shows and where it is not a live ns-3 radio.
ntn-cho).
oran-ntn).
oran-ntn).
ntn-constellation).
thz-ntn).
ns3-ai-ntn).Quickstart¶
# Clone the repo
git clone https://github.com/Muhammaduazir69/ns3-ntn-toolkit.git
cd ns3-ntn-toolkit/ns-3-dev
# Configure & build
./ns3 configure --enable-examples --enable-tests
./ns3 build
# Or pull the pre-built Docker image
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest
# Run the live-Starlink demo
ntn-fetch starlink --out data/starlink-now \
--max-sats 200 --czml --czml-duration-min 120 -v
Full installation instructions: Getting started.
Module map¶
| Module | Layer | What it does | Repository |
|---|---|---|---|
| ntn-constellation | Orbital | Vallado SGP4 from TLEs, Kepler+J2 for generated Walker shells, contact-graph routing over inter-satellite links | ntn-constellation |
| ntn-sagin | Orbital | Ground, UAV, HAPS and LEO layers with TR 36.777 air-to-ground and multi-layer routing | ntn-sagin |
| ntn-v2x | Orbital | NR sidelink PC5 Mode 2, SAE J2735 basic safety messages, SUMO traces | ntn-v2x |
| ntn-traffic | L1 to L3 | The real-stack spine: NR PHY, HARQ, RLC, PDCP, RRC and EPC under satellite mobility | toolkit only |
| ntn-cho | L1 to L3 | Time-to-exit conditional handover, the full TS 38.331 NTN trigger set | ntn-cho-framework |
| ntn-rrc | L1 to L3 | SIB19 consumed by the scheduler, payload-aware timing advance, gating DRX | ntn-rrc |
| ntn-fapi | L1 to L3 | SCF-222 FAPI MAC-PHY adapter on a live NR SAP | toolkit only |
| ntn-slice | L1 to L3 | eMBB, URLLC and mMTC with per-5QI bearers and histogram SLA percentiles | ntn-slice |
| thz-ntn | Physical | 100 GHz to 1 THz on ITU-R P.676-13, P.618-13, P.838-3 and P.840 | ns3-thz-ntn |
| ntn-sionna | Physical | NVIDIA Sionna RT GPU ray tracing with per-query provenance | ntn-sionna |
| oran-ntn | Control | Space O-RAN: E2, A1, three RIC placements, regenerative payloads, FlexRIC bridge | oran-ntn |
| ns3-ai-ntn | Control | Gymnasium 1.0 environments over a versioned shared-memory bridge | ns3-ai |
| ntn-observability | Operations | NetSimulyzer, Cesium CZML, InfluxDB and Grafana from one scene recorder | ntn-observability |
| ntn-digital-twin | Operations | FastAPI twin that predicts handovers and actuates them back into the run | ntn-digital-twin |
| satellite (SNS3) | Vendored | SGP4 mobility, DVB-S2 and RCS2, antenna patterns, TLE corpus | sns3-satellite |
Results at a glance¶
Each module page ends its overview with measured results, the data path they came from, the run and seed counts, and the script that draws the figure.
| Module | At a glance | |
|---|---|---|
| oran-ntn | An A1 intent lease cuts the time a cell falls short of its intent from 5.7 % to 3.3 % at one gateway; on-board near-RT control avoids the 19 % deadline misses ground-only control has with one or two gateways (240 runs, 10 seeds per point). | Results |
| ns3-ai-ntn | Gym transfers cost about 18x fewer CPU cycles than ns3-gym (upstream benchmark, 6 seeds); OranNtnGymHandover steps on a measured radio. |
Results |
| ntn-observability | A 60 s LEO pass read back from the exported line protocol: SINR about 25 dB, 4.7 Mb/s, elevation 89 to 51 degrees. | Results |
| ntn-digital-twin | A deterministic 66-satellite twin run exports 5 handovers in 45 min for ns-3 to actuate. | Results |
| ntn-cho | TTE-aware CHO: 134.6 handovers per run against 463.3 for A3, with 0 % ping-pong (10 seeds). | Module page |
| Other modules | Measured results on each module page. | All modules |
Frequently asked questions¶
Which open-source ns-3 tools simulate LEO satellite and non-terrestrial networks?
ns3-ntn-toolkit is designed for this purpose. Unlike a single channel model or a flow-level LEO simulator, it integrates orbit propagation, 3GPP TR 38.811 channels, a real 5G NR data plane, Rel-17 conditional handover, an O-RAN Near-RT RIC, and sub-THz physics in one ns-3.49 distribution, so the complete non-terrestrial stack is simulated rather than a single layer.
How do I simulate 5G NR-NTN conditional handover (CHO) in ns-3?
Use the ntn-cho module. It implements the full 3GPP Rel-17/18 NTN CHO trigger set (measurement A3, location-based condEventD1, time-based condEventT1, timing-advance, elevation, and Rel-18 condEventD2), selectable in one example and executed over SGP4-propagated orbits with handovers driven by measured serving SINR. ./ns3 run "ntn-cho-real-stack --trigger=tte-aware".
Is there an open-source O-RAN simulator for non-terrestrial networks?
Yes. The oran-ntn module provides an O-RAN near-RT RIC and an on-board Space RIC with xApps, E2AP, KPM and RC procedures carried in-simulator over an ns-3 header, a FlexRIC bridge toward a wire-level E2AP path, and TS 28.552 KPM metrics measured at the PHY.
Can ns-3 simulate terahertz / sub-THz (100 GHz to 1 THz) satellite links?
Yes. The thz-ntn module implements ITU-R P.676-13 line-by-line molecular absorption over a layered atmosphere, P.618-13 tropospheric scintillation, P.838-3 rain and P.840 fog, plus RIS, ISAC and EKF beam tracking, as real ns-3 propagation-loss models chained onto the radio, so THz physics attenuate actual packets and show up in the measured SINR.
Does it support real Starlink / OneWeb / Iridium constellations?
Yes. ntn-constellation propagates real CelesTrak TLEs (Starlink, OneWeb, Kuiper, Iridium NEXT, Telesat) with a full Vallado SGP4 backend, and generates Walker-Delta / Walker-Star shells at any scale (a 1,584-satellite scenario runs in ~32 seconds on a desktop).
How is it different from SNS3, Hypatia, or other LEO network simulators?
SNS3 is DVB-S2/RCS2 (no NR), and Hypatia models flow-level routing and latency. ns3-ntn-toolkit adds the 3GPP 5G NR-NTN protocol stack, O-RAN control, conditional handover, sub-THz physics, Sionna ray tracing, and AI/ML hooks on top of real orbital mobility, and reuses SNS3's satellite channel where it helps. It targets protocol-level fidelity at constellation scale.
Citation¶
If this toolkit helps your research, please cite the article (see also Cite):
@article{uzair2026ns3ntntoolkit,
author = {Uzair, Muhammad and Aldahlan, Bassma G. and Albar, Ali A. and
Althumali, Huda and Alghammas, Adnan},
title = {ns3-ntn-toolkit: An Integrated ns-3 Platform for 6G
Non-Terrestrial Networks},
journal = {IEEE Open Journal of the Communications Society},
volume = {7},
pages = {13440--13467},
year = {2026},
doi = {10.1109/OJCOMS.2026.3745010}
}
Maintainer¶
Muhammad Uzair · Independent Researcher · muhammaduzairr69@gmail.com · ORCID