Docker image for NS-3 Network Simulator with GUI Support on OSX
Clone the repo then run:
make
This will download the ns3 version 3.26 and build the docker image for you.
If you don't want the ns3 src files in the host machine for development you can download ns3 inside the image by replacing the line COPY . /usr
in Dockerfile with these lines:
RUN wget http://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
RUN tar -xf ns-allinone-3.26.tar.bz2
brew install socat
brew cask install xquartz
open -a XQuartz
make run
cd ns3/ns-3.26
./waf configure
---- Summary of optional NS-3 features:
Build profile : debug
Build directory :
BRITE Integration : not enabled (BRITE not enabled (see option --with-brite))
DES Metrics event collection : not enabled (defaults to disabled)
Emulation FdNetDevice : enabled
Examples : not enabled (defaults to disabled)
File descriptor NetDevice : enabled
GNU Scientific Library (GSL) : enabled
Gcrypt library : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore : enabled
MPI Support : not enabled (option --enable-mpi not selected)
NS-3 Click Integration : not enabled (nsclick not enabled (see option --with-nsclick))
NS-3 OpenFlow Integration : not enabled (OpenFlow not enabled (see option --with-openflow))
Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc))
PlanetLab FdNetDevice : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
PyViz visualizer : enabled
Python API Scanning Support : not enabled (Missing 'pygccxml' Python module)
Python Bindings : enabled
Real Time Simulator : enabled
SQlite stats data output : enabled
Tap Bridge : enabled
Tap FdNetDevice : enabled
Tests : not enabled (defaults to disabled)
Threading Primitives : enabled
Use sudo to set suid bit : not enabled (option --enable-sudo not selected)
XmlIo : enabled
'configure' finished successfully (4.609s)
To make sure that it works, in the container run:
cd /usr/ns3/ns-3.26/scratch
mkdir example
cp ./../examples/tutorial/second.cc example/
cd ..
./waf --run example --vis
it should compile then run the visualization in xQuartz.
- Make sure you allow connetions from network clients in XQuartz (Preferences -> Security)
- Make sure that local xquartz socket is exposed on a TCP port.
lsof -i TCP:6000
- Check this thread moby/moby#8710