Skip to content
Module · ntn-rrc

NR-NTN SIB19, timing advance and DRX in ns-3

ntn-rrc is an ns-3 module that adds the NR-NTN control-plane timing mechanisms: a SIB19 (NTN-Config-r17) broadcaster driven by a live orbit, a UE-side uplink timing pre-compensator that decodes it, and a timing advance that includes the feeder leg for transparent payloads. It also provides K_offset derivation, RAR window checks, quantized measurement reports, GNSS location reporting and a connected-mode DRX state machine that gates a real flow.

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.

Connected-mode DRX with data traffic

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

~60 sntn-rrc-drx-data-traffic
Parameters
Simulation duration (s)
Number of UEs on the serving cell
Satellite altitude (km)
Carrier frequency (GHz)
-1 = TR 38.821 Set-1 S-band EIRP density (34 dBW/MHz); otherwise conducted power at the array input (dBm) Leave at -1 for the TR 38.821 Set-1 S-band EIRP density (34 dBW/MHz, about 77 dBm EIRP over 20 MHz; the conducted power is derived from it and the array gain). Any other value is the conducted power at the array input in dBm (the array adds about 18 dB); values below about 40 dBm leave the link without usable throughput.
Radio backend: nr (FR1) or mmwave
Enable connected-mode DRX gating
DRX long cycle (ms)
DRX on-duration (ms)
Scene: NR-NTN RRC
The interactive 3D globe loads here.

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

SpecificationWhat the module takes from it
3GPP TS 38.331SIB19, NTN-Config-r17 field steps, MeasurementReport
3GPP TS 38.213 Section 4.2Timing advance and K_offset
3GPP TS 38.213 Section 8.1RAR window
3GPP TS 38.211 Section 4.3.1Frame and slot timing
3GPP TS 38.321DRX and random access
3GPP TS 38.133Timing error limits and measurement quantization
3GPP TR 38.821NTN 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 msShipped test geometry, twice a 1200 km feeder leg over c
Total timing advance over the run
3669 to 3847 usntn-rrc-real-stack with default arguments, single seed, 48 samples over 24 s of a 550 km pass, slant range 550.1 to 576.8 km
Median measured SINR (range 18.6 to 21.9 dB after the first sample)
19.8 dBntn-rrc-real-stack with default arguments, single seed, 24 s of a 550 km pass
Measured goodput with DRX disabled (awake fraction 1)
17.66 Mb/sntn-rrc-drx-data-traffic --drxOn=false, single seed
Size of the ntn-rrc unit test suite
28 test cases./test.py -s ntn-rrc (Type::UNIT)

Examples (6)

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

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

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