百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

ns3-ai

> 编程语言
开源

使用 Python 来实现 ns-3 和流行框架之间的交互,这意味着您可以在不更改任何框架的情况下,在 ns-3 中训练和测试您的 AI 算法。

356 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 Python 来实现 ns-3 和流行框架之间的交互,这意味着您可以在不更改任何框架的情况下,在 ns-3 中训练和测试您的 AI 算法。

ns3-ai

Introduction

ns–3 is widely recognized as an excellent open-source networking simulation tool utilized in network research and education. In recent times, there has been a growing interest in integrating AI algorithms into network research, with many researchers opting for open-source frameworks such as TensorFlow and PyTorch. Integrating the ML frameworks with simulation tools in source code level has proven to be a challenging task due to their independent development. As a result, it is more practical and convenient to establish a connection between the two through interprocess data transmission.

Our model offers an efficient solution to facilitate the data exchange between ns-3 and Python-based AI frameworks. It does not implement any specific AI algorithms. Instead, it focuses on enabling interconnectivity between Python and C++. Therefore, it is necessary to separately install the desired AI framework. Then, by cloning or downloading our work and importing the relevant Python modules, you can seamlessly exchange data between ns-3 and your AI algorithms.

The approach for enabling this data exchange is inspired by ns3-gym, but it utilizes a shared-memory-based approach, which not only ensures faster execution but also provides greater flexibility.

Features

  • High-performance data interaction module in both C++ and Python side.
  • A high-level Gym interface for using Gymnasium APIs, and a low-level message interface for customizing the shared data.
  • Useful skeleton code to easily integrate with AI frameworks on Python side.

Installation

Check out install.md for how to install and setup ns3-ai.

Quickstart on ns3-ai

Demo

To get started on ns3-ai, check out the A-Plus-B example. This example shows how C++ passes two numbers to Python and their sum is passed back to C++, with the implementation using all available interfaces: Gym interface, message interface (struct-based) and message interface (vector-based).

Documentation

Ready to deploy ns3-ai in your own research? Before you code, please go over the tutorials on Gym interface and message interface. They provide step-by-step guidance on writing C++-Python interfaces, with some useful code snippets.

We also created some pure C++ examples, which uses C++-based ML frameworks to train models. They don't rely on interprocess communication, so there is no overhead in serialization and interprocess communication. See using-pure-cpp for details.

Examples

Please refer to the README.md in corresponding directories for more information.

A-Plus-B

This example show how you can use ns3-ai by a very simple case that you transfer a and b from ns-3 (C++) to Python and calculate a + b in Python to put back the results.

Multi-BSS

This example simulates a VR gaming scenario. We change the CCA threshold using DQN to meet VR delay and throughput requirements. Model optimization is in progress.

RL-TCP

This example is inspired by ns3-gym example. We build this example for the benchmarking and to compare with their module.

Rate-Control

This is an example that shows how to develop a new rate control algorithm for the ns-3 Wi-Fi module using ns3-ai. Available examples are Constant Rate and Thompson Sampling.

LTE-CQI

This original work is done based on 5G NR branch in ns-3. We made some changes to make it also run in LTE codebase in ns-3 mainline. We didn't reproduce all the experiments on LTE, and the results in our paper are based on NR work.

Other materials

Google Summer of Code 2023

'ns3-ai improvements' has been chosen as one of the project ideas for the ns-3 projects in GSoC 2023. The project developed the message interface (struct-based & vector-based) and Gym interface, provided more examples and enhanced stability and usability.

  • Project wiki page: GSOC2023ns3-ai

Online tutorial

Note: this tutorial explains the original design, which is not up to date with the newer interface.

Join us in this online recording to get better knowledge about ns3-ai. The slides introducing the ns3-ai model could also be found here.

Cite Our Work

Please use the following bibtex:

…

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言