Complete Docker solution for NS-3 (Network Simulator 3) featuring pre-built images, easy-to-use wrapper scripts, batch processing, and a full development environment with Jupyter Lab.
scratch/ scripts and results/ data.gdb, valgrind, and cmake tools.| Architecture | Support Status | Action Required |
|---|---|---|
| Intel/AMD (amd64) | ā Native | Just pull and run. Pre-built on Docker Hub. |
| Apple M1/M2 / ARM | ā ļø Manual Build | Requires building locally (see instructions below). |
Note for Mac M1/M2 Users: The pre-built image is
amd64. It runs via Rosetta emulation (slower). For native speed, use./scripts/buildx-push --runtime --arm64-onlyto build your own image.
This command pulls the image and sets up the environment.
make init
Run the included example directly:
./scripts/ns3 run wifi-simple
Or run your own code by placing .cc files in the scratch/ folder:
# Example: If you have scratch/my-sim.cc
./scripts/ns3 run my-sim
Lightweight mode for running simulations and getting results. Uses the runtime image (~500MB).
# Syntax
./scripts/ns3 run <simulation-name> [args]
# Example with arguments
./scripts/ns3 run "wifi-simple --distance=100 --time=20"
Perfect for parameter sweeps. Writes Python scripts in scratch/ that execute multiple simulations.
scratch/ (e.g., batch-experiment.py).make batch CMD="python3 scratch/batch-experiment.py"
Results are automatically saved to results/.
Full environment with Jupyter Lab, C++ tools, and Python bindings. Perfect for data analysis and debugging.
Start the environment:
docker compose --profile dev up -d ns3-dev
Access Jupyter:
docker compose logs ns3-dev | grep "http://127.0.0.1:8888"

Stop the environment:
make down
ns3-docker/
āāā scratch/ # š PUT YOUR CODE HERE (.cc files)
āāā results/ # š OUTPUTS (CSV, logs, traces)
āāā scripts/ # š§ Wrapper scripts (ns3, ns3-build, etc)
āāā examples/ # š Reference examples
āāā Dockerfile # Multi-stage definition
āāā docker-compose.yml # Service orchestration
āāā public/ # Assets for README
| Command | Description |
|---|---|
make ns3-build | Re-compiles all scripts in scratch/ |
make shell | Opens a bash shell inside the container |
make clean-all | Cleans build artifacts and removes containers |
make rebuild | Forces a rebuild of the Docker image locally |
If you want to modify the Docker image or build for ARM64:
# Build locally
make build
# Push to your own Docker Hub (requires .env configuration)
make push-latest
This project is licensed under MIT. NS-3 is licensed under GNU GPLv2.
Maintained by: Huaksonā
Docker Hub: huakson/ns3-simulatorā
Content type
Image
Digest
sha256:c4746b271ā¦
Size
721.1 MB
Last updated
11 months ago
docker pull huakson/ns3-simulator:3.42-dev