Skip to content
Module · ntn-v2x

ntn-v2x: satellite-assisted V2X with NR sidelink in ns-3

ntn-v2x is an ns-3 module for satellite-assisted vehicle-to-everything communication that combines an NR PC5 sidelink Mode 2 model, SAE J2735 basic safety messages encoded as ns-3 headers, and direct-or-relay decisions that start and stop real uplink flows to LEO satellites. Vehicle motion comes from replayed floating-car data, and the satellite leg uses SGP4 orbits over an NR NTN cell or a point-to-point path.

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.

Street-canyon relaying over sidelink

Vehicles in an urban street canyon report status through LEO satellites; blocked vehicles relay over NR sidelink Mode 2 to a neighbor with line of sight. Compare policies.

~30 sntn-v2x-canyon-relay
Parameters
TLE file of the satellites
Output CSV file
Wave 7A: seconds of vehicle 0 on a packet-level NR-NTN cell with the facades on the radio path, after the study run (0 = off)
Directory of the NR check (default: <out stem>_nr_check)
Number of vehicles on the street
Simulated time (s)
Uplink policy: direct, multisat, relay, blind, blindfar, blindlb or random
Street width, wall to wall (m)
Simulated street length, wrapping (m)
Building length along the street (m)
Median facade height (m)
Log standard deviation of facade heights
Minimum satellite elevation (deg)
Largest sidelink distance for a relay (m)
Optional CSV of facade heights and per-tick link states of vehicles 0 to 7
Unused, kept for script compatibility (ms)
Uplink interruption at each change of uplink satellite (ms)
Status message period, equal to the sidelink reservation period (ms)
capacity of a satellite's uplink left for this street (kb/s); 0 = no limit
round trips from scheduling request to grant
largest wait for an uplink opportunity (s)
latency of a link to a relay the source did not name last (ms)
neighbor entries age out after this time (s)
anyp: expected number of forwards
relayk, relayrand, randk: neighbors named per message
own uplink messages before forwards
constant speed range, low (m/s)
constant speed range, high (m/s)
CSV: first line dt, then one line per vehicle: x0,dir,s(0),s(dt),...
CSV: side (0 left, 1 right),x0,x1,height
a cross street every this many meters (0 = none)
width of a cross street (m)
stress: share of vehicle pairs given the NLOS law
TR 37.885 urban sidelink channel
message arrivals on a fixed period with a random phase
Street latitude (deg)
Street longitude (deg)
Street azimuth from north (deg)
Gateway latitude (deg)
Gateway longitude (deg)
Simulation start time (Unix s)
Scene: Vehicular V2X
The interactive 3D globe loads here.

What this module models

The sidelink follows NR PC5 Mode 2 as described in 3GPP TS 38.321 Section 5.22, with an SL-ResourcePool of subchannels and slots (TS 38.331). NtnSlUeMac performs sensing-based autonomous selection: candidates in the T1 to T2 window, exclusion above an SL-RSRP threshold, the 20 percent rule with 3 dB steps, and periodic reservation with a reselection counter. NtnSlChannel applies the TR 37.885 highway LOS path loss with log-normal shadowing and NLOSv blockage, enforces half duplex, decodes on SINR with co-channel interference summed in linear power, and reports PRR by distance following TR 38.885. It is a MAC abstraction and does not decode PSCCH or PSSCH bits or combine HARQ.

Basic safety messages are SAE J2735 (2016) BSMcoreData, 21 octets on the wire with UPER offset-from-lower-bound integers and the standard's range clamps. SumoTraciBridge replays floating-car data offline and applies both position and velocity, so BSM speed and heading fields are real; live TraCI co-simulation is not implemented. V2xLeoRelay assigns each vehicle direct or relay service from a minimum direct SNR and a maximum V2V range, and a runtime transmit gate lets those decisions start and stop flows mid-run. The satellite leg uses SGP4 orbits over an NR NTN cell or a point-to-point path whose delay follows slant range, with TR 38.811 and TR 38.821 for its geometry and budget. V2xLeoDirect, a closed-form TR 38.821 Set-1 S-band budget, is kept as a reference. TS 23.287 is cited for the V2X architecture.

Outputs

  • PRR by distance bucket for highway BSM broadcast (ntn-v2x-pc5-sidelink-bsm)
  • BSM delay, jitter and loss measured at NtnOranSink (ntn-v2x-leo-relay-traffic)
  • Per-second direct, relay and orphan counts from a measured baseline SINR (ntn-v2x-rural-highway)
  • Age of information, delay and PDR at the server for canyon relaying (ntn-v2x-canyon-relay)
  • Per-vehicle FCD replay samples exported through a TracedCallback

Standards

SpecificationWhat the module takes from it
3GPP TS 38.321Section 5.22 sidelink Mode 2 resource selection
3GPP TS 38.331SL-ResourcePool configuration
3GPP TR 38.885V2X evaluation methodology and PRR (designation as written in the module docs)
3GPP TR 37.885Highway and urban sidelink channels, PRR evaluation
3GPP TS 23.287V2X architecture
SAE J2735Basic safety message core data and UPER encoding
3GPP TR 38.811Satellite leg
3GPP TR 38.821Satellite leg; Set-1 S-band defaults of V2xLeoDirect

Key numbers

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

Measured sidelink PRR within 50 m at 10 vehicles, and at 30 and 60 vehicles
1.000 and 0.997Shipped highway scenario at 23 dBm and 5.9 GHz with the TR 37.885 highway model; residual loss from half duplex and same-subchannel collisions
Traffic from terminals allowed on air against traffic from gated terminals under the relay transmit gate
14 792 packets on air, 0 gatedDefault run, re-measured on 2026-09-01 at 2.185 GHz and 20 MHz

Examples (7)

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-v2x-canyon-relay --PrintHelp".

  • Locally with Docker

    The public image has the whole toolkit prebuilt. This runs ntn-v2x-canyon-relay with its built-in defaults.

    shell
    docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ntn-v2x-canyon-relay"

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