Skip to content
Example · Vehicular (V2X)

Safety messages relayed by a peer vehicle

A shadowed vehicle sends BSMs through a nearby vehicle and a LEO satellite to a server. The default hops are point-to-point links gated by a closed-form link check; v2v=pc5 with uplink=nr runs PC5 Mode 2 and the relay uplink on the measured NR cell (at the Set-1 23 dBm the uplink barely closes).

ntn-v2x-leo-relay-traffic about 60 s on the server

Parameters (16)

Defaults are the values the browser run form starts from. Pass any of them on the command line as --name=value.

ParameterDefaultUnitDescription
Simulation duration
--simSeconds
60sSimulation duration (s)
Basic-safety-message rate
--bsmHz
10HzBasic-safety-message rate (Hz)
BSM payload size
--bsmBytes
300bytesBSM payload size (bytes)
LEO altitude
--leoAltKm
550kmLEO altitude (km)
Sat Speed
--satSpeed
7500-IGNORED: the SGP4 orbit at --leoAltKm sets the satellite speed
Relay Drift Mps
--relayDriftMps
25-IGNORED: vehicle motion comes from the FCD trace (--fcdTrace)
Max V2V range for relay
--maxV2vRange
1500mMax V2V range for relay (m)
Min direct SNR before relaying
--minDirectSnr
6dBMin direct SNR before relaying (dB)
NLOS blockage
--veh0BlockageDb
14dBNLOS blockage (dB) on veh0's direct LEO link (3GPP-style shadowing) so the relay engine selects the V2V->peer->LEO path
Per-hop P2P capacity
--linkCapacityMbps
20Mbit/sPer-hop P2P capacity (Mbps)
Path to an FCD-format CSV trace
--fcdTrace
contrib/ntn-v2x/traces/leo-relay-fcd.csv-Path to an FCD-format CSV trace (time,vehid,x,y,z,speed) with rows for veh0 and veh1. REQUIRED. The shipped trace is a synthetic constant-speed CSV fixture; a CSV converted from SUMO fcd-export also works (loader reads a CSV dialect, not native fcd-output XML).
V2V hop
--v2v
p2p-V2V hop: p2p (gated point-to-point link, default) or pc5 (NR sidelink Mode 2)
Relay uplink
--uplink
p2p-Relay uplink: p2p (default) or nr (measured NR uplink on the cell)
Other PC5 vehicles sending BSMs
--pc5Background
20-Other PC5 vehicles sending BSMs (pc5 mode)
Relay UE Tx power
--relayUeTxDbm
-1dBmRelay UE Tx power (dBm); <= 0 keeps Set-1 23 dBm
Relay UE antenna element gain
--relayUeGainDbi
0dBiRelay UE antenna element gain (dBi)

Reproduce it locally

With the example's built-in defaults, in the public Docker image:

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

With the same parameters the browser run form starts from:

shell
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ntn-v2x-leo-relay-traffic --simSeconds=60 --bsmHz=10 --bsmBytes=300 --leoAltKm=550 --satSpeed=7500 --relayDriftMps=25 --maxV2vRange=1500 --minDirectSnr=6 --veh0BlockageDb=14 --linkCapacityMbps=20 --fcdTrace=contrib/ntn-v2x/traces/leo-relay-fcd.csv --v2v=p2p --uplink=p2p --pc5Background=20 --relayUeTxDbm=-1 --relayUeGainDbi=0"

List every argument with ./ns3 run "ntn-v2x-leo-relay-traffic --PrintHelp".

More Vehicular (V2X) examples

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