6G NTN
ns3-ntn-toolkit module

ntn-constellation

LEO constellation, contact graph and ISL routing in ns-3

ns-3 module that builds LEO shells from TLEs or Walker parameters, propagates them in the simulation and routes over a time-varying contact graph.

Fig. 1 of the accompanying study: the system model. Click to zoom.
Fig. 1 of the accompanying study: the system model. Click to zoom.

What ntn-constellation does

ntn-constellation is an ns-3 module that builds LEO satellite shells from two-line element sets or Walker-Delta and Walker-Star parameters and propagates them during Simulator::Run(). It adds a contact graph over ground and inter-satellite links, with limb clearance and range caps, and computes routes over that time-varying graph from shortest delay to a lifetime-aware search.

Accompanying studyRoute Breaks and Lifetime-Aware Routing in Low Earth Orbit Constellations With Range-Limited +Grid Laser Links. Code and data are in this repository.

What it models

The module gives every layer of a simulation one shared ephemeris. Shells come from TLE files (parsed with checksums) or from Walker configurations with planes, satellites per plane, phasing, altitude and inclination. Each satellite is an ns-3 MobilityModel. By default it propagates analytic Kepler orbits with secular J2 drift on RAAN and argument of perigee; a TLE-sourced satellite can switch to full Vallado SGP4 with the drag term. ECEF, ECI and geodetic accessors and a common simulation epoch let the radio, handover, routing and visualization code read the same positions. An exact argmax-elevation index returns the satellite a brute-force scan would choose without looping over every satellite and terminal.

On top of the geometry, a contact-graph scheduler tracks ground-to-satellite and satellite-to-satellite visibility with limb clearance and range caps and raises link up, down and update events. A router computes paths by BFS, weighted Dijkstra, a caller-supplied edge cost, a lifetime-aware search, or a regenerative-only transit filter; examples install the result as IPv4 host routes on point-to-point links whose delay follows the live range. A per-packet error model maps Es/N0 from the slant range through a DVB-S2 MODCOD waterfall. The module also carries the 3GPP TS 38.300 Section 9.2.3 Xn handover sequence between regenerative satellites over the ISL, and a calibration harness that compares the free-space link budget with the 3GPP TR 38.821 Set-1 and Set-2 reference budgets. Contact-graph routing follows CCSDS concepts, without a bundle protocol.

Measured numbers

23.5 us

Largest error of the Python companion's SGP4 propagation against an independent Skyfield reference

1800 s STARLINK-1008 pass (tests/ of the Python companion)
0 NaN

Invalid propagated states in the Python companion against Skyfield

24 h, 66 satellites, 1440 samples
36 test cases

Size of the ntn-constellation test suite

test/ntn-constellation-test-suite.cc, run with ./test.py -s ntn-constellation

Each number states the run it comes from; the README of the module lists the command that reproduces it.

Standards it follows

3GPP TR 38.821Set-1 and Set-2 reference constellations and link budgets used by the calibration harness
3GPP TR 38.811Geometry and elevation dependence
3GPP TS 38.300 Section 9.2.3Xn handover sequence between two regenerative satellites over the ISL
CCSDS contact-graph routing conceptsBasis of the contact-graph routing (no bundle protocol)

New on 6g-ntn.live

The toolkit now runs in the browser at 6g-ntn.live: pick an example of ntn-constellation or any other module, change its parameters, and the real ns-3 binary runs on the server.

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-constellation-v4).

Cite

If you use ntn-constellation, 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}
}

Links