Is Linux Installation Process Simpler, Easier, Faster than Windows Installation?

155 views
Skip to first unread message

Johny Why

unread,
Apr 8, 2023, 1:08:30 AM4/8/23
to ns-3-users
Either Windows method (ming or WSL). 

Not asking about running performance, just installation process (but feel free to comment on performance too). 

If Linux is easier, then if possible i'd like to create a virtual machine image with ns3 installed and configured, to share to my team. 

Thx!

Tommaso Pecorella

unread,
Apr 8, 2023, 5:58:25 AM4/8/23
to ns-3-users
VMs will usually kill your performances, but to learn ns-3 they're for sure easier to setup. You can also use docker, which might give you a slimmer image to share.

If you're good enough at tinkering you can also have a docker image and develop inside the container using VScode - it's super-handy in some cases.
Again, the performances are not ideal, but it depends on what you have to do.

As a side note, if you can read YAML (it's fairly easy) you can find a complete set of instructions on installing ns-3 in the  utils/tests/gitlab-ci* files.

Johny Why

unread,
Apr 8, 2023, 11:19:25 AM4/8/23
to ns-3-users
So, ns3 on Linux is for sure easier to setup? Or ns3 on a vm that someone configured for you?
thx

Tommaso Pecorella

unread,
Apr 8, 2023, 12:34:05 PM4/8/23
to ns-3-users
Well, I can't be sure because I never used Windows. I can tell that on Linux it's very easy. Like... 6 commands if you don't need the python interface. If you need that as well it depends, but it's easy as well.

Just as an example:
- Get Ubuntu 22.04.
- sudo apt update
- sudo apt upgrade <- technically unnecessary, but it's always a good thing to do
- sudo apt install -y g++ cmake ninja-build ccache python3 python3-dev gsl-bin libgsl-dev libgsl27 libboost-all-dev libgtk-3-dev libfl-dev libxml2 libxml2-dev libopenmpi-dev openmpi-bin openmpi-common openmpi-doc libsqlite3-dev sqlite3 libeigen3-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools ssh git
- cd ns-3-dev
- ./ns3 configure --enable-examples --enable-tests
- ./ns3 build

Easy, isn't it ?

Note that the above list of packages is an overshoot, as it will install some stuff you'll probably not need, like gtk, openmpi and qt (these are optional and needed only by some specialized modules).

Also... note for whoever will read this post in the future:
The above commands are valid today (April 8, 2023). Future ns-3 releases might need more or less packages, and the commands might change over time. Do NOT blindly copy-paste and then complain that it's not working.
Do NOT stick to ns-3.38 and Ubuntu 22.04 just because the above command list works for 3.38 and Ubuntu 22.04. Read the documentation.

Ashley Tharp

unread,
Apr 8, 2023, 4:34:44 PM4/8/23
to ns-3-...@googlegroups.com
Well, here's my tutorial on how to set up ns-3.37 using WSL on Windows 11. 

Generally I find if there is a tutorial I can just mindlessly follow, that is always easiest lol. I made it to basically run a setup script called startup.sh in the home directory that goes ahead and installs all the packages you need. Just uses the latest ubuntu jellyfish distro, so eventually I'm sure this code will go out of date, but I wrote it less than a month ago. 

I did go ahead and build all the "extra" modules that I could, but there was 1 or 2 I couldn't figure out and the docs seemed to have a broken link so I gave up for ns-3.37, but the BRITE topo module and some other stuff, I built every little thing I could, so it's almost completely comprehensive build with all the extras supported. 

Check it out and feel free to respond here or leave a comment on my medium article if you run into any issues, or you can email ashley.tharp AT gmail to collab with me directly. 


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/98cd98c3-7a52-4c9d-987a-e8484ccb2bbdn%40googlegroups.com.

Tommaso Pecorella

unread,
Apr 8, 2023, 4:44:45 PM4/8/23
to ns-3-users
I would suggest this: https://www.nsnam.org/docs/installation/html/index.html as a guide (it's the one the maintainers made, and we try to keep it up-to-date).
It might look a bit more complex, but we try to address all the major systems. For example, it considers two different packages installation methods on macOS.

@Ashley: feel free to suggest improvements to the official installation guide, contributions are appreciated.


Ashley Tharp

unread,
Apr 8, 2023, 9:08:56 PM4/8/23
to ns-3-...@googlegroups.com
Ok, I'll take a look at the contributions guidelines next time I get a moment. Thanks for the suggestion. 

johny why

unread,
Apr 20, 2023, 9:04:13 AM4/20/23
to ns-3-...@googlegroups.com
@Tommaso Pecorella
I got an error with one of your commands. All commands ran successfully up to this point:

boom@DESKTOP-42DPTPI:~/ns-3-dev$ /ns3 configure --enable-examples --enable-tests
-bash: /ns3: No such file or directory
boom@DESKTOP-42DPTPI:~/ns-3-dev$ ls
AUTHORS  CHANGES.md  CMakeLists.txt  CONTRIBUTING.md  LICENSE  README.md  RELEASE_NOTES.md  VERSION  bindings  build-support  contrib  doc  examples  ns3  scratch  src  test.py  utils  utils.py

boom@DESKTOP-42DPTPI:~/ns-3-dev$ ns3 configure --enable-examples --enable-tests
Command 'ns3' not found, did you mean:
  command 'ns' from deb ns2 (2.35+dfsg-3.1)
  command 'nsm' from deb linuxptp (3.1.1-3)
  command 'nsd' from deb nsd (4.3.9-1)
  command 's3' from deb libs3-2 (2.0-3)
  command 'nse' from deb ns2 (2.35+dfsg-3.1)
  command 'ns6' from deb ipv6toolkit (2.0+ds.1-1)
Try: sudo apt install <deb name>

Can you link to the ns3 documentation for this command?


On Sat, Apr 8, 2023 at 9:34 AM Tommaso Pecorella <tomm...@gmail.com> wrote:
Well, I can't be sure because I never used Windows. I can tell that on Linux it's very easy. Like... 6 commands if you don't need the python interface. If you need that as well it depends, but it's easy as well.

Just as an example:
- Get Ubuntu 22.04.
- sudo apt update
- sudo apt upgrade <- technically unnecessary, but it's always a good thing to do
- sudo apt install -y g++ cmake ninja-build ccache python3 python3-dev gsl-bin libgsl-dev libgsl27 libboost-all-dev libgtk-3-dev libfl-dev libxml2 libxml2-dev libopenmpi-dev openmpi-bin openmpi-common openmpi-doc libsqlite3-dev sqlite3 libeigen3-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools ssh git
- cd ns-3-dev
- ./ns3 configure --enable-examples --enable-tests
- ./ns3 build

Easy, isn't it ?Do NOT blindly copy-paste and then complain that it's not working.

johny why

unread,
Apr 20, 2023, 9:08:49 AM4/20/23
to ns-3-...@googlegroups.com
Ok, you already shared the link. Problem solved. Your post doesn't show the leading dot.

johny why

unread,
Apr 20, 2023, 5:10:39 PM4/20/23
to ns-3-...@googlegroups.com
My mistake. Your commands aren't missing the leading dot. Was hard to see.

johny why

unread,
Apr 20, 2023, 5:15:38 PM4/20/23
to ns-3-...@googlegroups.com
My build took about 4 to 6 hours. Is that normal?

Also, my output is different than shown in the manual. 

My output i got the module list on the config statement, instead of after the build. Is that normal?

boom@DESKTOP-42DPTPI:~/ns-3-dev$ ./ns3 configure --enable-examples --enable-tests
-- The CXX compiler identification is GNU 11.3.0
-- The C compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CCache is enabled.
-- Using default output directory /home/boom/ns-3-dev/build
-- Proceeding without cmake-format
-- Performing Test MISSING_OSTREAM_NULLPTR_OPERATOR
-- Performing Test MISSING_OSTREAM_NULLPTR_OPERATOR - Failed
-- Performing Test FILESYSTEM_LIBRARY_IS_LINKED
-- Performing Test FILESYSTEM_LIBRARY_IS_LINKED - Success
-- find_external_library: SQLite3 was found.
-- Found GTK3_GTK: /usr/lib/x86_64-linux-gnu/libgtk-3.so
-- GTK3 was found.
-- LibXML2 was found.
-- Visualizer requires Python bindings
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- GSL was found.
-- docs: doxygen documentation not enabled due to missing dependencies: doxygen dot dia
-- Failed to locate sphinx-build executable (missing: SPHINX_EXECUTABLE)
-- docs: sphinx documentation not enabled due to missing dependencies: Sphinx epstopdf pdflatex latexmk convert dvipng
-- Performing Test HAVE_UINT128_T
-- Performing Test HAVE_UINT128_T - Failed
-- Performing Test HAVE___UINT128_T
-- Performing Test HAVE___UINT128_T - Success
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for netpacket/packet.h
-- Looking for netpacket/packet.h - found
-- Looking for getenv
-- Looking for getenv - found
-- Platform doesn't support TAP and EMU features. Continuing without them.
-- Precompiled headers were enabled.
-- Processing src/antenna
-- Processing src/aodv
-- Processing src/applications
-- Processing src/bridge
-- Processing src/brite
-- find_external_library: brite was not found. Missing headers: "Brite.h" and missing libraries: "brite".
-- Skipping src/brite
-- Processing src/buildings
-- Processing src/click
-- find_external_library: click was not found. Missing headers: "simclick.h" and missing libraries: "nsclick click".
-- Skipping src/click
-- Processing src/config-store
-- Processing src/core
-- Looking for include files boost/units/quantity.hpp, boost/units/systems/si.hpp
-- Looking for include files boost/units/quantity.hpp, boost/units/systems/si.hpp - found
-- Boost Units have been found.
-- Processing src/csma
-- Processing src/csma-layout
-- Processing src/dsdv
-- Processing src/dsr
-- Processing src/energy
-- Processing src/flow-monitor
-- Processing src/internet
-- Processing src/internet-apps
-- Processing src/lr-wpan
-- Processing src/lte
-- Processing src/mesh
-- Processing src/mobility
-- Processing src/netanim
-- Processing src/network
-- Processing src/nix-vector-routing
-- Processing src/olsr
-- Processing src/openflow
-- find_external_library: openflow was not found. Missing headers: "openflow.h" and missing libraries: "openflow".
-- Skipping src/openflow
-- Processing src/point-to-point
-- Processing src/point-to-point-layout
-- Processing src/propagation
-- Processing src/sixlowpan
-- Processing src/spectrum
-- Processing src/stats
-- Processing src/test
-- Processing src/topology-read
-- Processing src/traffic-control
-- Processing src/uan
-- Processing src/virtual-net-device
-- Processing src/wave
-- Processing src/wifi
-- Processing src/wimax
-- ---- Summary of ns-3 settings:
Build profile                 : default
Build directory               : /home/boom/ns-3-dev/build
Build with runtime asserts    : ON
Build with runtime logging    : ON
Build version embedding       : OFF (not requested)
BRITE Integration             : OFF (missing dependency)
DES Metrics event collection  : OFF (not requested)
DPDK NetDevice                : OFF (not requested)
Emulation FdNetDevice         : OFF (not requested)
Examples                      : ON
File descriptor NetDevice     : OFF (missing dependency)
GNU Scientific Library (GSL)  : ON
GtkConfigStore                : ON
LibXml2 support               : ON
MPI Support                   : OFF (not requested)
ns-3 Click Integration        : OFF (missing dependency)
ns-3 OpenFlow Integration     : OFF (missing dependency)
Netmap emulation FdNetDevice  : OFF (not requested)
PyViz visualizer              : OFF (missing dependency)
Python Bindings               : OFF (not requested)
SQLite support                : ON
Eigen3 support                : ON
Tap Bridge                    : OFF (not requested)
Tap FdNetDevice               : OFF (not requested)
Tests                         : ON


Modules configured to be built:
antenna                   aodv                      applications
bridge                    buildings                 config-store
core                      csma                      csma-layout
dsdv                      dsr                       energy
flow-monitor              internet                  internet-apps
lr-wpan                   lte                       mesh
mobility                  netanim                   network
nix-vector-routing        olsr                      point-to-point
point-to-point-layout     propagation               sixlowpan
spectrum                  stats                     test
topology-read             traffic-control           uan
virtual-net-device        wave                      wifi
wimax

Modules that cannot be built:
brite                     click                     fd-net-device
mpi                       openflow                  tap-bridge
visualizer


-- Configuring done
-- Generating done
-- Build files have been written to: /home/boom/ns-3-dev/cmake-cache
Finished executing the following commands:
mkdir cmake-cache
cd cmake-cache; /usr/bin/cmake -DCMAKE_BUILD_TYPE=default -DNS3_ASSERT=ON -DNS3_LOG=ON -DNS3_WARNINGS_AS_ERRORS=OFF -DNS3_NATIVE_OPTIMIZATIONS=OFF -DNS3_EXAMPLES=ON -DNS3_TESTS=ON -G Ninja .. ; cd ..

boom@DESKTOP-42DPTPI:~/ns-3-dev$ ./ns3 build
[0/2] Re-checking globbed directories...
[1880/1880] Linking CXX executable ../build/utils/perf/ns3-dev-perf-io-default
Finished executing the following commands:
cd cmake-cache; /usr/bin/cmake --build . -j 1 ; cd ..

Gabriel Ferreira

unread,
Apr 20, 2023, 7:16:49 PM4/20/23
to ns-3-users
You apparently built using a single core (-j 1), 
so it should take a few hours for the default build profile
(which has debugging instrumentation 
and enables compiler optimizations). 
The exception would be if you had a computer with very high single-core clocks.

Since you have ccache installed, the following builds should be a lot faster. 

johny why

unread,
Apr 20, 2023, 7:20:33 PM4/20/23
to ns-3-...@googlegroups.com
Thank you. 

Which "following builds"?


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/cPcG_l_q4sE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/f826d5ea-9af3-4b7b-9f3d-20d089f0404cn%40googlegroups.com.

johny why

unread,
Apr 20, 2023, 9:47:21 PM4/20/23
to ns-3-...@googlegroups.com
Is the below a problem?
i got:

boom@DESKTOP-42DPTPI:~/ns-3-dev$ ./test.py
[0/2] Re-checking globbed directories...
ninja: no work to do.

Finished executing the following commands:
cd cmake-cache; /usr/bin/cmake --build . -j 1 ; cd ..
[1/761] PASS: TestSuite degrees-radians
...
[761/761] PASS: Example src/aodv/examples/aodv
760 of 761 tests passed (760 passed, 0 skipped, 1 failed, 0 crashed, 0 valgrind errors)
List of FAILed tests:
    int64x64

Which "following builds"?

thx

Gabriel Ferreira

unread,
Apr 20, 2023, 10:02:14 PM4/20/23
to ns-3-users
You're using a c++ based simulator, 
so you're probably going to write your own simulation scenario 
in c++, which will require a compilation of that scenario and linking 
to the currently built libraries. 

Most people usually also modify one of the existing libraries to test 
their theories on protocol improvements/flaws. 

In that case, you recompile that library and the ones affected by API/ABI changes. 

Gabriel Ferreira

unread,
Apr 20, 2023, 10:07:28 PM4/20/23
to ns-3-users
You are most likely using WSLv1, which causes incorrect floating point rounding 
due to Microsoft refusing to change the settings of the floating point unit of your processor 
when switching from Windows and Linux processes. https://github.com/microsoft/WSL/issues/830

If you're not using WSLv1, then it can be a problem.
 In that case, please inform the operating system and its version. 

johny why

unread,
Apr 21, 2023, 12:46:35 AM4/21/23
to ns-3-...@googlegroups.com
ok, this is weird. My default version is 2, but the distros are 1

PS C:\Users\John> wsl --status
Default Distribution: Ubuntu
Default Version: 2

PS C:\Users\John> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         1
  Arch      Stopped         1

Do i need to reinstall the distros, or rebuild ns3?

Gabriel Ferreira

unread,
Apr 21, 2023, 12:51:44 AM4/21/23
to ns-3-users
Yeah, that's why I prefer to use mingw. 

You can change the WSL version per distro
 (it copies the user space to a VM filesystem).

I don't recall the command, but should be
 wsl --set-version or wsl --set-distro-version

No need to rebuild ns-3. It will work fine with WSLv2 
(since the hypervisor does respect the floating
 point unit settings). 

johny why

unread,
Apr 21, 2023, 12:56:44 AM4/21/23
to ns-3-...@googlegroups.com
That seems to work with WSL too. 
wsl --set-version Ubuntu 2

johny why

unread,
Apr 21, 2023, 2:58:31 AM4/21/23
to ns-3-...@googlegroups.com
How can you tell i built with only 1 core? I'm getting:

boom@DESKTOP-42DPTPI:~$ nproc
2

Gabriel Ferreira

unread,
Apr 21, 2023, 8:34:51 AM4/21/23
to ns-3-users
It was the following in the ns3 build output : -j 1

I wrote that not to use all threads to prevent the
 system from becoming unresponsive. 

But you can pass that number of jobs by yourself 
if a stuttering system doesn't bother you. 

Reply all
Reply to author
Forward
0 new messages