What ntn-sagin does
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.
Accompanying studyTimer Values and Custody Costs for Release 19 Store-and-Forward IoT Over Sparse LEO Constellations. Code and data are in this repository.
What it 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.
Measured numbers
Share of buoys served by bent pipe for the Orbcomm, Kinéis and Sateliot fleets; store and forward served all buoys
sagin-store-forward-iot study: real element sets through Vallado SGP4, 60 ocean buoys, 5 gateways, one 40-byte update per buoy every 15 min, 1 Mb/s gated point-to-point links, four simulated days (three with traffic), radio access not modeled; mean with 95 % half-width over 5 replicationsMean age of information on the buoys bent pipe serves, bent pipe against store and forward, Orbcomm fleet
Same study, 5 gateways, 5 replications, paired by buoyFactor by which keep-newest cut the 99th-percentile on-board backlog relative to FCFS across fleets
Same study, 5 gateways, per replication, 5 replicationsMeasured one-way delay of the mMTC flow on the GEO leg (the 35 786 km propagation time)
sagin-slice-traffic example, URLLC, eMBB and mMTC flows steered onto HAPS, LEO and GEO legsShare of shadow-fading draws removed by clamping the A2G excess loss at zero, the reason the module keeps it signed
TR 36.777 channel at 1 kmEach number states the run it comes from; the README of the module lists the command that reproduces it.
Standards it follows
| 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 |
New on 6g-ntn.live
The toolkit now runs in the browser at 6g-ntn.live: pick an example of ntn-sagin or any other module, change its parameters, and the real ns-3 binary runs on the server.
Type ./ns3 run with your own arguments; the real binary runs on the server and streams its output.
Open →115 runnable examplesEvery example of the 14 modules, each with a typed parameter form and its measured KPIs.
Open →Live 3D globeReal constellations from CelesTrak elements, propagated with SGP4, with their service and feeder links.
Open →Open datasetsEvery finished run becomes a dataset under CC BY 4.0, with its provenance and configuration.
Open →Validation690 test cases in 41 toolkit suites, and a health check on every example.
Open →Shared scenariosResearchers post a configuration with its parameters and results; anyone can rerun it.
Open →Watch
Watch on YouTube: the NTN Control Center running and visualizing the toolkit examples, in five minutes.
Install
Every module ships in the ready-built container image of the toolkit (version 3.0.1):
docker pull uzairdocker69/ns3-ntn-toolkit:latest
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest bash
To build from source, clone ns3-ntn-toolkit, which vendors this module under contrib/, or follow the README of this repository (branch ntn-sagin-v4).
Cite
If you use ntn-sagin, please cite the toolkit article (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}
}