ns3-gym  by tkn-tub

RL toolkit for networking research using OpenAI Gym and ns-3 network simulator

Created 7 years ago
628 stars

Top 52.7% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a framework for applying reinforcement learning (RL) to network simulation research by integrating the OpenAI Gym toolkit with the ns-3 network simulator. It enables researchers to develop and test RL agents for network optimization tasks, offering a standardized interface for RL experimentation within a powerful simulation environment.

How It Works

ns3-gym acts as a bridge between ns-3 simulations and RL agents. It exposes ns-3 simulation parameters and events as Gym environments, allowing RL algorithms to interact with the network simulation by observing states, taking actions, and receiving rewards. The framework leverages ZeroMQ (ZMQ) for inter-process communication between the ns-3 simulator and the Python-based RL agent.

Quick Start & Requirements

  • Installation: Requires Linux (Ubuntu 22+ recommended). Install ns-3 dependencies (gcc, g++, python3, python3-pip, cmake), ZMQ, Protocol Buffers, and pkg-config. Download and build ns-3 (version 3.40 or compatible). Clone the ns3-gym repository into ns-3's contrib directory, checkout the correct branch (app-ns-3.36+), and build ns-3. Install ns3gym Python package using pip3 install --user ./model/ns3gym.
  • Prerequisites: C++ compiler, Python 3, ns-3, ZMQ, Protocol Buffers, pkg-config.
  • Links: ns-3 documentation, ns3-gym GitHub

Highlighted Details

  • Enables using any ns-3 simulation script as a Gym environment by implementing a C++ interface.
  • Provides examples for cognitive radio channel selection and RL-based TCP congestion control.
  • Allows observation of any ns-3 variable or parameter for RL state representation.

Maintenance & Community

  • Developed by TU-Berlin (Piotr Gawlowicz, Anatolij Zubow).
  • BibTeX citation provided for academic referencing.

Licensing & Compatibility

  • The project's license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking is therefore undetermined.

Limitations & Caveats

  • The gym.make('ns3-v0') interface may cause errors with newer OpenAI Gym versions; ns3env.Ns3Env() is the recommended alternative.
  • The RL-TCP agent is still under development, with existing interfaces for monitoring and controlling TCP parameters.
Health Check
Last Commit

3 months ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
0
Star History
6 stars in the last 30 days

Explore Similar Projects

Starred by Deepak Pathak Deepak Pathak(Cofounder of Skild AI; Professor at CMU), Anastasis Germanidis Anastasis Germanidis(Cofounder of Runway), and
1 more.

deer by VinF

0%
489
Deep reinforcement learning framework
Created 9 years ago
Updated 3 months ago
Starred by Hanlin Tang Hanlin Tang(CTO Neural Networks at Databricks; Cofounder of MosaicML), Amanpreet Singh Amanpreet Singh(Cofounder of Contextual AI), and
2 more.

coach by IntelLabs

0.0%
2k
Reinforcement learning framework for experimentation (discontinued)
Created 8 years ago
Updated 2 years ago
Feedback? Help us improve.