What this module models
Each layer has its own mobility: HAPS figure-8 station keeping and loiter trajectories, UAV waypoint, patrol and lawnmower search patterns, aircraft cruise and OpenSky ADS-B replay, vessels replayed from AIS records, high-speed trains, and SGP4 satellites from ntn-constellation. The air-to-ground channel follows 3GPP TR 36.777 v15.0.0 for UMa-AV, RMa-AV and UMi-AV path loss, LOS probability and shadow fading; calls above the validated 300 m aerial height are recorded rather than silently extrapolated. As a PropagationLossModel chained onto a real NR spectrum channel it returns a signed excess over free space, to avoid double counting.
MultiLayerRouter computes greedy maximum-elevation paths over ground, UAV, HAPS and LEO candidates with a pluggable score and optional congestion awareness; SaginSliceRouter maps QFI to S-NSSAI (TS 23.501) and biases the layer choice by latency budget and a GEO allowance. The routers return hop vectors and install no forwarding table; sagin-multihop-traffic is the example where the route is actuated. SaginCustodyQueue stores packets while the next hop is out of contact, with FCFS, LCFS, keep-newest-per-source, lifetimes and byte capacity. With custody transfer enabled it carries BPv7 primary blocks (RFC 9171, CBOR per RFC 8949) and RFC 5050 custody signals. Block CRCs, extension blocks, fragmentation, BPSec and a convergence layer are not implemented. TR 38.811 and TR 38.821 cover the NTN layers, TS 28.552 the KPM names, and TS 38.300 Section 9.2.3 the Xn handover messages used with regenerative payloads.
Outputs
- Per-received-update lines from the store-and-forward server (sagin-store-forward-iot)
- Custody counters: forwarded immediately, forwarded from custody, expired, dropped for space, largest custody delay
- Measured SINR, TBLER and throughput from the NR PHY trace plus sim_health.csv for real-cell examples
- Delay, jitter, loss and goodput at NtnOranSink for point-to-point data-plane examples
- Per-hop elevation and range route trace (sagin-haps-leo-relay); optional NetSimulyzer JSON and Cesium CZML
Standards
| Specification | What the module takes from it |
|---|---|
| 3GPP TR 36.777 | UAV air-to-ground path loss, LOS probability and shadow fading for UMa-AV, RMa-AV and UMi-AV |
| 3GPP TR 38.811 | NTN layers and geometry |
| 3GPP TR 38.821 | NTN layers and geometry; Set-1 link budget in the store-and-forward and routed examples |
| 3GPP TS 23.501 | QFI and S-NSSAI for slice routing |
| 3GPP TS 28.552 | KPM names |
| 3GPP TS 38.300 | Section 9.2.3 Xn handover |
| IETF RFC 9171 | BPv7 bundle encoding and primary block; deletion status report reason |
| IETF RFC 5050 | Custody transfer and custody signal record |
| IETF RFC 8949 | CBOR encoding |
Key numbers
Stated in the module documentation, each with the conditions it was measured under.
- Measured one-way delay of the mMTC flow on the GEO leg (the 35 786 km propagation time)
- about 119 ms
- Share of shadow-fading draws removed by clamping the A2G excess loss at zero, the reason the module keeps it signed
- about 35 %
Examples (14)
- HAPS, vessel and train mobilityA HAPS on a racetrack, a vessel and a high-speed train move together while a slice-aware router picks the ground, HAPS, LEO route for real packets. Exports a 3D scene.
- Remote coverage with shared infrastructureFour rural households, two per operator, with only operator A's satellite overhead. Toggle infrastructure sharing to measure the coverage gain and per-operator traffic.
- UAV air-to-ground link (TR 36.777)A UAV or HAPS gNB serves ground UEs over a measured NR cell with the TR 36.777 air-to-ground path loss. Compare the LOS and NLOS branches across scenarios.
- Aircraft replayed from an ADS-B traceAn in-flight terminal replayed from an ADS-B trace is served by a passing LEO satellite on a measured NR cell. Reports SINR, TBLER and throughput along the flight.
- Passenger broadband on a flightAn aircraft at cruise is served by a passing LEO satellite on a measured NR cell. A multi-layer router also logs which layer it would pick (not applied to traffic).
- Flight with E2 KPM reportingA long-haul flight served by a LEO satellite on a measured NR cell, with E2 KPM reports to a Near-RT RIC. A release occurs when SINR drops below the service threshold.
- UAV, HAPS and LEO relay pathGround UE to UAV relay access on a measured NR cell with the TR 36.777 channel, while a multi-layer router logs the UAV, HAPS and LEO path geometry each second.
- High-speed train under a LEO passA high-speed train terminal on a TR 38.901-style track is served by a passing LEO satellite on a measured NR cell. Vary train speed and watch SINR, TBLER and throughput.
- Vessel replayed from an AIS traceA vessel replayed from an AIS trace is served by a passing LEO satellite on a measured NR cell. Reports downlink SINR, TBLER and throughput as the ship sails.
- Router-steered multi-hop pathUDP traffic from ground through a UAV and a HAPS to one of two LEO satellites and a gateway. The router's choice switches the live path, so throughput moves between satellites.
- Shortest-path routing on the contact graphGround, UAV, HAPS and two SGP4 satellites joined by an ISL. Each hop has a graded BLER from live geometry on a declared Set-1, VSAT and ISL payload (linkModel=gate for the old binary budget), and ns-3 global routing reroutes the UDP flow on contact events. Reports loss, one-way delay p95 and route changes.
- Slice steering across HAPS, LEO and GEOURLLC, eMBB and mMTC flows are steered each second to HAPS, LEO or GEO by a slice router on live geometry. Per-slice delay, jitter and loss are measured.
- Store-and-forward IoT over sparse LEOOcean buoys report through a sparse LEO fleet to gateways: bent pipe against store-and-forward custody on delivery delay and loss over days. Links default to a 0/1 visibility gate with no radio; linkModel=satlink adds a declared Set-1 link budget, contacts=cgr uses the contact graph router and dtn=bpv7 sends BPv7 bundles with custody transfer (a partial RFC 9171 subset).
- UAV swarm served by a ground gNBEight UAVs on waypoint, patrol and search patterns served by a ground gNB over a measured NR cell with the TR 36.777 rural air-to-ground channel. Per-UAV SINR and throughput.
Run it
In the browser
Pick an example in the run panel above, set its parameters and press Run. The console streams live and the result opens with KPI charts.
In the ns-3 console
The browser console accepts ns-3 style commands, for example
ns3 run "ntn-sagin-orphan-mobility-showcase --PrintHelp".Locally with Docker
The public image has the whole toolkit prebuilt. This runs
ntn-sagin-orphan-mobility-showcasewith its built-in defaults.docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ntn-sagin-orphan-mobility-showcase"
Cite this
If you use this module, please cite the article that describes the toolkit: doi:10.1109/OJCOMS.2026.3745010.
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.
@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}
}