Example · AI / MARL
Wi-Fi rate control, Thompson sampling
Wi-Fi stations behind a CSMA and point-to-point backbone, with the rate chosen by a Python Thompson-sampling agent through ns3-ai (raa=AiThompsonSampling).
ns3ai_ratecontrol_ts about 15 s on the server
Parameters (12)
| Parameter | Default | Unit | Description |
|---|---|---|---|
Simulated duration --duration | 5 | s | Simulated duration (s) |
Number of extra CSMA nodes --nCsma | 3 | - | Number of extra CSMA nodes |
Number of Wi-Fi stations --nWifi | 3 | - | Number of Wi-Fi stations |
Log echo application events --verbose | true | - | Log echo application events |
Write PCAP traces --tracing | false | - | Write PCAP traces |
Rate adaptation --raa | AiThompsonSampling | - | Rate adaptation: MinstrelHt, AiConstantRate or AiThompsonSampling (set for the paired Python agent; binary default MinstrelHt) |
Maximum bytes to send --maxBytes | 0 | - | Maximum bytes to send (0 = unlimited) |
Point-to-point link rate --p2pRate | 50 | Mbit/s | Point-to-point link rate (Mbps) |
Point-to-point link delay --p2pDelay | 10 | ms | Point-to-point link delay (ms) |
CSMA channel delay --csmaDelay | 9000 | ns | CSMA channel delay (ns) |
CSMA channel rate --csmaRate | 150 | Mbit/s | CSMA channel rate (Mbps) |
Wi-Fi standard --standard | 11ac | - | Wi-Fi standard (e.g. 11ac) |
Reproduce it locally
With the example's built-in defaults, in the public Docker image:
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ns3ai_ratecontrol_ts"With the same parameters the browser run form starts from:
docker run --rm -it uzairdocker69/ns3-ntn-toolkit:latest ./ns3 run "ns3ai_ratecontrol_ts --duration=5 --nCsma=3 --nWifi=3 --verbose=true --tracing=false --raa=AiThompsonSampling --maxBytes=0 --p2pRate=50 --p2pDelay=10 --csmaDelay=9000 --csmaRate=150 --standard=11ac"More AI / MARL 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.
@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}
}