ns3-ai: Fostering Artificial Intelligence Algorithms for Networking Research

Recently, Artificial Intelligence (AI) has achieved its momentum in various areas such as image processing and natural language processing thanks to the advances in processing speed, data acquisition and storage. Many research efforts have been exerted to apply AI to computer networking. Performance evaluation of network systems using AI techniques can be conducted using ns-3, and such studies can be facilitated if ns-3 is able to interact with the existing open-source AI frameworks. In the past year, an ns-3 extension module called ns3-gym connecting ns-3 with the OpenAI Gym toolkit has been developed, which utilizes Zero MQ sockets as an interprocess communications (IPC) mechanism. In this paper, we propose a newly designed module between ns-3 and multiple Python-based AI frameworks, namely ns3-ai, to provide efficient and high-speed data exchange between the AI engines and ns-3. This module is built based on a shared memory implementation for IPC, which can achieve an IPC transfer speed up to 100 times faster than that of ns3-gym on a benchmark example. We also present our high-level interface design to improve the abstraction between ns-3 and different AI frameworks, and provide an example use case based on a 5G NR scenario. Our evaluation results show that this ns3-ai framework offers performance advantages over ns3-gym, especially for the use cases where large amounts of data must be transferred between ns-3 and the AI framework. This ns-3 extension module may foster the performance evaluation of AI algorithms in computer networking research with much reduced development workload.