What this module models
NR over a satellite relies on three timing mechanisms that terrestrial ns-3 does not have: a broadcast K_offset that shifts the uplink grant, a timing advance that pre-compensates propagation, and a validity duration after which the terminal must read SIB19 again. ntn-rrc computes the total timing advance as 2(d_service + d_feeder)/c, split into common and UE-specific parts with drift rate and drift variation, so a transparent payload carries the feeder leg. The SIB19 broadcaster fills NTN-Config-r17 from a real orbit (ECEF state vector, ta-Common, drift terms, ul-SyncValidityDuration, K_offset, kMac) and quantizes it to the 3GPP TS 38.331 field steps. It supports a gateway or satellite uplink sync reference point, Taylor, economized or window-fit coefficients, and slot-over-drift, error-budget or fixed validity rules, and derives K_offset = ceil(RTT / slot) + 1 following 3GPP TS 38.213 Section 4.2.
On the UE side, a pre-compensator decodes SIB19, propagates the satellite from the last GNSS fix with a linear, gravity-ECEF, Kepler or Kepler-J2 model and forms its own timing advance. Further classes check whether ra-ResponseWindow can express the RAR window a round trip demands (TS 38.213 Section 8.1, TR 38.821 Section 7.3), quantize MeasurementReport content to TS 38.133 level indices, report GNSS location periodically, on events or on demand, and run connected-mode DRX (TS 38.321) with an extra AwaitingPass state between visibility windows. SIB19 is decoded from a trace and buffer rather than carried on BCCH, and K_offset reaches the scheduler only where the ntn-traffic helper enables it.
Outputs
- ntn-rrc-real-stack-ta.csv with the timing-advance decomposition over the pass
- Per-sample uplink timing error against the true two-way delay every 100 ms from ntn-rrc-ul-timing
- drx_metrics.csv with the awake fraction from the DRX state machine and the measured goodput
- *-ta.csv and *-sib19.csv per run
- sim_health.csv with the provenance of each measured KPI
Standards
| Specification | What the module takes from it |
|---|---|
| 3GPP TS 38.331 | SIB19, NTN-Config-r17 field steps, MeasurementReport |
| 3GPP TS 38.213 Section 4.2 | Timing advance and K_offset |
| 3GPP TS 38.213 Section 8.1 | RAR window |
| 3GPP TS 38.211 Section 4.3.1 | Frame and slot timing |
| 3GPP TS 38.321 | DRX and random access |
| 3GPP TS 38.133 | Timing error limits and measurement quantization |
| 3GPP TR 38.821 | NTN timing budgets and RAR window (Section 7.3) |
Key numbers
Stated in the module documentation, each with the conditions it was measured under.
- Extra timing advance of a transparent payload compared with a regenerative one
- 8.0 ms
- Total timing advance over the run
- 3669 to 3847 us
- Median measured SINR (range 18.6 to 21.9 dB after the first sample)
- 19.8 dB
- Measured goodput with DRX disabled (awake fraction 1)
- 17.66 Mb/s
- Size of the ntn-rrc unit test suite
- 28 test cases
Examples (6)
- Connected-mode DRX with data trafficUDP downlink on a measured NR NTN cell with SIB19, timing advance and connected-mode DRX. Compare DRX on and off to see power saving against delivered throughput.
- Timing advance from a real TLEReads a TLE, propagates it with SGP4 and runs an NR NTN cell under the pass. Logs network-side timing advance, drift, slant range and measured SINR at every sample (no SIB19 and no UE-side timing).
- All RRC procedures on one LEO passTiming advance pre-compensation, SIB19 broadcast with UE-side consumption (in-process wire image, TA error columns), UE GNSS reporting and NTN DRX together on a measured NR cell. Writes TA, SIB19, UE and DRX CSV traces.
- Timing advance and SIB19 over a passEphemeris-driven timing advance and SIB19 (TS 38.331 NTN-Config) on a measured NR cell. The UE consumes SIB19 (in-process wire image) and K_offset, and TA error columns sit next to the TA curve and its drift over the pass.
- Timing advance and SIB19 with 3D exportTiming advance and SIB19 over a LEO pass on a measured NR cell. UE 0 computes its TA from the SIB19 it decoded over the radio (carried on a data bearer, not yet as system information; 16 ns maximum error), the gateway is the uplink sync reference and the scheduler consumes the broadcast K_offset. Optional NetSimulyzer and Cesium CZML 3D export.
- Uplink timing pre-compensationSIB19 ephemeris and common-delay polynomial against the true two-way delay over an SGP4 pass, every 100 ms. Compare UE propagators, fits and validity rules against Te.
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-rrc-drx-data-traffic --PrintHelp".Locally with Docker
The public image has the whole toolkit prebuilt. This runs
ntn-rrc-drx-data-trafficwith its built-in defaults.docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ntn-rrc-drx-data-traffic"
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}
}