Skip to content
Example · O-RAN over NTN

RL handover environment (Gym)

RL handover environment on the measured NR stack: observations from measured KPM (RRC RSRP margin to the best neighbor, SINR, PRB use), a goodput reward, and handover actions actuated through the RIC. The dashboard runs it with gym=1 and a paired Python agent (greedy A3-margin policy); gym=0 steps an in-process policy instead.

oran-ntn-gym-handover-example about 80 s on the server

Parameters (8)

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

ParameterDefaultUnitDescription
Simulation duration
--duration
60sSimulation duration (s) (set for the paired Python agent; binary default 30.0)
Number of ground UEs
--numUes
2-Number of ground UEs
Number of satellites
--numSats
3-Number of satellites (serving plus candidates)
Wait for a Python RL agent over ns3-ai
--gym
true-Wait for a Python RL agent over ns3-ai (the dashboard starts the paired agent); 0 = step the in-process policy (set for the paired Python agent; binary default false)
Allowed: true, false
Kpm
--kpm
measured-measured (KPM from the NR stack, default) or legacy (injected reports, derived candidates)
Allowed: measured, legacy
In-process policy when gym=0
--policy
greedy-In-process policy when gym=0: stay, greedy (measured A3 margin) or forceHo
Time of the single commanded handover
--forceHoAt
10sforceHo: time of the single commanded handover (s)
RSRP margin that triggers a handover
--a3OffsetDb
3dBgreedy policy: RSRP margin that triggers a handover (dB)

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 "oran-ntn-gym-handover-example"

With the same parameters the browser run form starts from:

shell
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "oran-ntn-gym-handover-example --duration=60 --numUes=2 --numSats=3 --gym=true --kpm=measured --policy=greedy --forceHoAt=10 --a3OffsetDb=3"

List every argument with ./ns3 run "oran-ntn-gym-handover-example --PrintHelp".

More O-RAN over NTN 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}
}