Skip to content
Module · ntn-fapi

Small Cell Forum FAPI MAC-PHY adapter for NTN in ns-3

ntn-fapi is an ns-3 module that gives the simulator the Small Cell Forum FAPI 222.10.02 and 222.10.04 message vocabulary and a bridge that decorates the live mmwave NR MAC-PHY service access point. Its messages come from a real scheduler at real slot timing, so SLOT.indication, DL_TTI.request and CRC.indication reflect what the radio actually did.

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.

Downlink FAPI slot loop

FAPI DL_TTI, TX_DATA, RX_DATA and CRC.indication exchanged every slot for one UE (UE 0) over a measured NR NTN cell. CRC and HARQ follow the measured TBLER as the elevation falls; goodput counts UE 0 application bytes.

~60 sntn-fapi-dl-data-slotloop
Parameters
Simulation duration (s)
Number of UEs on the serving cell
Sub-carrier spacing (kHz): 15/30/60/120
FAPI transport-block size (bytes)
Satellite altitude (km)
-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: mmwave (FR2, per-TB FAPI loop) or nr (FR1)
Scene: FAPI L1/L2
The interactive 3D globe loads here.

What this module models

FAPI is the MAC-PHY interface that real base stations are built on. ntn-fapi interposes two forwarding decorators between an already-wired mmwave gNB MAC and PHY. Every SAP call passes through unchanged and the matching FAPI struct is recorded as a side effect: SLOT.indication at the radio's own cadence (once per slot), DL_TTI.request from real downlink allocations, UL_TTI.request from real uplink grants, and TX_DATA.request carrying the transport block bytes. The reverse path builds RX_DATA.indication and CRC.indication from the PHY reception trace, after the mmwave error model has decided each transport block. HARQ state is keyed by frame, subframe, slot and RNTI. A timing-advance residual can be placed in RACH.indication as a 3GPP TS 38.213 Section 4.2 TA command index, and numerology maps to subcarrier spacing following TS 38.211 Table 4.2-1.

The struct library covers message IDs and names, carrier, cell, BWP and DMRS configuration, and PDU descriptors with SCF field names (PDCCH, PDSCH, CSI-RS, PUSCH, PUCCH, SRS, PRACH). The structs are a source-level C++ model without a fixed byte layout, so they are not a drop-in ABI for external PHY stacks. The bridge also measures SAP latency and labels its provenance. Because the decorated channel has no propagation delay model, the measured request-to-indication interval is a slot-pipeline turnaround, which the module labels measured-no-air-propagation and checks against the geometric one-way floor anchored to the 3GPP TR 38.821 NTN delay budget.

Outputs

  • fapi_sap.csv with message counts, SAP latency and its provenance label
  • sim_health.csv with measured SINR and TBLER
  • Per-example KPM flow series (<example>_kpm_series.csv)
  • Printed counts of TX_DATA, RX_DATA and CRC.indication next to the PHY's transport block count

Standards

SpecificationWhat the module takes from it
Small Cell Forum FAPI 222.10.02P5 configuration and P7 slot message vocabulary
Small Cell Forum FAPI 222.10.04 addendumAddendum message definitions
3GPP TS 38.211Slot and frame timing; numerology to subcarrier spacing (Table 4.2-1)
3GPP TS 38.213Slot timing and the Section 4.2 TA command index in RACH.indication
3GPP TR 38.821NTN delay budget that anchors the latency gate

Key numbers

Stated in the module documentation, each with the conditions it was measured under.

Mean SAP turnaround, DL_TTI.request to CRC.indication (min 535.7 us, max 732.1 us)
643.8 usntn-fapi-real-stack, 4948 SFN/slot-matched pairs, 5 simulated seconds, 4 UEs, 2.185 GHz 20 MHz mmwave NTN cell, single run from the 6 October 2026 audit; excludes air propagation
Mean scheduler pipeline latency, DL_TTI.request to SLOT.indication
552.2 usSame ntn-fapi-real-stack run as above
One-way propagation floor derived from the link geometry
1834.6 usSame ntn-fapi-real-stack run; the measured latencies sit below it, showing no air propagation is included
TX_DATA.request count, equal to the PHY's own transport block count
19094ntn-fapi-dl-data-slotloop, seed 1, 5 s, 4 UEs (measured SINR 19.78 dB, TBLER 0.031)
Measured TBLER (SINR 23.99 dB; 4645 CRC pass and 114 HARQ retransmissions out of 4759 data slots)
0.010ntn-fapi-leo-pass-slotloop with the ISS TLE, 5 s, 4 UEs, single run
Size of the ntn-fapi unit test suite
9 test cases./test.py -s ntn-fapi (Type::UNIT); all 9 passed in the 6 October 2026 audit run

Examples (3)

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-fapi-dl-data-slotloop --PrintHelp".

  • Locally with Docker

    The public image has the whole toolkit prebuilt. This runs ntn-fapi-dl-data-slotloop with its built-in defaults.

    shell
    docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ntn-fapi-dl-data-slotloop"

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