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
| Specification | What the module takes from it |
|---|---|
| Small Cell Forum FAPI 222.10.02 | P5 configuration and P7 slot message vocabulary |
| Small Cell Forum FAPI 222.10.04 addendum | Addendum message definitions |
| 3GPP TS 38.211 | Slot and frame timing; numerology to subcarrier spacing (Table 4.2-1) |
| 3GPP TS 38.213 | Slot timing and the Section 4.2 TA command index in RACH.indication |
| 3GPP TR 38.821 | NTN 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 us
- Mean scheduler pipeline latency, DL_TTI.request to SLOT.indication
- 552.2 us
- One-way propagation floor derived from the link geometry
- 1834.6 us
- TX_DATA.request count, equal to the PHY's own transport block count
- 19094
- Measured TBLER (SINR 23.99 dB; 4645 CRC pass and 114 HARQ retransmissions out of 4759 data slots)
- 0.010
- Size of the ntn-fapi unit test suite
- 9 test cases
Examples (3)
- Downlink FAPI slot loopFAPI 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.
- FAPI slot loop over an SGP4 passThe FAPI L1/L2 data messages for one UE (UE 0) driven over a real SGP4 LEO pass. Per-slot CRC results follow the measured TBLER, so FAPI goodput (UE 0 application bytes) tracks the pass geometry.
- FAPI on the live MAC/PHY interfaceFAPI messages from the real MAC/PHY interface of an NR NTN cell (CONFIG, SLOT, DL_TTI, RX_DATA, CRC for every RNTI, so the CRC count equals the PHY TBs). RACH.indication carries the TA residual left after the UE's SIB19 pre-compensation. FAPI observes the MAC/PHY interface; it does not drive it.
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-slotloopwith its built-in defaults.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.
@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}
}