Skip to content
Module · ntn-sagin

ntn-sagin: space-air-ground integrated networks in ns-3

ntn-sagin is an ns-3 module for space-air-ground integrated networks that gives ground, UAV, HAPS and LEO layers their own mobility, a 3GPP TR 36.777 air-to-ground channel, and a router that chooses among candidates from all layers. Its custody queue holds traffic across contact gaps and can carry BPv7 bundles with RFC 5050 custody transfer.

Run it in the browser

Choose an example, set its parameters and run the real ns-3 binary on this server. The scene shows the configured geometry before the run and the results after it.

HAPS, vessel and train mobility

A 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.

~60 sntn-sagin-orphan-mobility-showcase
Parameters
Simulation duration (s)
NetSimulyzer 3D JSON output (empty=off)
Cesium CZML 3D output (empty=off)
Scene: SAGIN
The interactive 3D globe loads here.

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

SpecificationWhat the module takes from it
3GPP TR 36.777UAV air-to-ground path loss, LOS probability and shadow fading for UMa-AV, RMa-AV and UMi-AV
3GPP TR 38.811NTN layers and geometry
3GPP TR 38.821NTN layers and geometry; Set-1 link budget in the store-and-forward and routed examples
3GPP TS 23.501QFI and S-NSSAI for slice routing
3GPP TS 28.552KPM names
3GPP TS 38.300Section 9.2.3 Xn handover
IETF RFC 9171BPv7 bundle encoding and primary block; deletion status report reason
IETF RFC 5050Custody transfer and custody signal record
IETF RFC 8949CBOR 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 mssagin-slice-traffic example, URLLC, eMBB and mMTC flows steered onto HAPS, LEO and GEO legs
Share of shadow-fading draws removed by clamping the A2G excess loss at zero, the reason the module keeps it signed
about 35 %TR 36.777 channel at 1 km

Examples (14)

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-showcase with its built-in defaults.

    shell
    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.

BibTeX
@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}
}