blob: 29f92b284126848a4afd3aa65f3ea16613278346 [file] [log] [blame]
Ashlesh Gawande6c86e302019-09-17 22:27:05 -05001Install
2=======
3
4Prerequisites
5-------------
6
awlane73add712024-08-12 21:49:00 -05007Mini-NDN is officially supported on the following Linux distributions:
Junxiao Shi48ada892021-11-04 09:02:21 -06008
awlane73add712024-08-12 21:49:00 -05009- Ubuntu 20.04
10- Ubuntu 22.04 (recommended)
11- Ubuntu 24.04
Junxiao Shi48ada892021-11-04 09:02:21 -060012- Debian 11 (WiFi scenario does not work)
13- Fedora 33 (WiFi scenario does not work)
14
15You must have sudo privileges to install and run Mini-NDN.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050016
awlane73add712024-08-12 21:49:00 -050017Using Docker
18------------
19
Davide Pesaventoef240762025-02-21 21:42:10 -050020You can use the latest image from `GitHub Container Registry
Davide Pesavento750d0402025-02-25 16:50:50 -050021<https://github.com/named-data/mini-ndn/pkgs/container/mini-ndn>`__:
22
23.. code-block:: sh
Davide Pesavento82cc17a2025-02-17 18:30:05 -050024
Davide Pesavento28a09122025-02-18 17:50:20 -050025 docker run -it --cpus=4 --memory=4g --privileged \
26 -v /lib/modules:/lib/modules \
Davide Pesaventoef240762025-02-21 21:42:10 -050027 ghcr.io/named-data/mini-ndn
awlane73add712024-08-12 21:49:00 -050028
29Building your own Docker image
30------------------------------
31
32The provided Dockerfile can be used to build an image from scratch. To build with the Dockerfile:
Davide Pesavento28a09122025-02-18 17:50:20 -050033
Davide Pesavento750d0402025-02-25 16:50:50 -050034- Clone the repository and type:
35
36 .. code-block:: sh
awlane73add712024-08-12 21:49:00 -050037
38 docker build -t minindn .
39
Davide Pesavento750d0402025-02-25 16:50:50 -050040- You can then access the container through shell with:
41
42 .. code-block:: sh
awlane73add712024-08-12 21:49:00 -050043
Davide Pesavento28a09122025-02-18 17:50:20 -050044 docker run -it --cpus=4 --memory=4g --privileged \
awlane73add712024-08-12 21:49:00 -050045 -v /lib/modules:/lib/modules \
Davide Pesavento28a09122025-02-18 17:50:20 -050046 minindn
awlane73add712024-08-12 21:49:00 -050047
48Additional recommendations
49--------------------------
Davide Pesavento82cc17a2025-02-17 18:30:05 -050050
Davide Pesavento28a09122025-02-18 17:50:20 -050051- It is recommended to set reasonable constraints on memory (``--memory``) and CPU cores (``--cpus``),
52 especially on less powerful or non-dedicated systems.
53- ``--privileged`` is mandatory for Mininet to utilize the virtual switch.
54- The container working directory is ``/mini-ndn``, which contains the installation and examples.
55- The GUI may not work due to docker and xterm setup issues and is independent from Mini-NDN. If you intend
56 to run the GUI, pass ``-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix`` to the ``docker run`` command.
awlane73add712024-08-12 21:49:00 -050057
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050058Using Vagrantfile
59-----------------
60
Davide Pesavento28a09122025-02-18 17:50:20 -050061With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 20.04 virtual machine
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050062and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
Davide Pesavento28a09122025-02-18 17:50:20 -050063(default 4 cores) and RAM (default 4GB) according to your needs before doing ``vagrant up``. Mini-NDN
64can be found in ``/home/vagrant/mini-ndn`` which is a symlink to ``/vagrant`` if Vagrantfile was used
65from within mini-ndn cloned on the host. Otherwise it is an actual clone of mini-ndn.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050066
67Using install.sh
68----------------
69
Junxiao Shi48ada892021-11-04 09:02:21 -060070Mini-NDN has the following dependencies:
71
awlane73add712024-08-12 21:49:00 -050072- `NDN Forwarding Daemon (NFD) <https://docs.named-data.net/NFD/current/>`_
73- `Named Data Link State Routing (NLSR) <https://docs.named-data.net/NLSR/current/>`_
Junxiao Shi48ada892021-11-04 09:02:21 -060074- `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_
75- `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_
76- `infoedit <https://github.com/NDN-Routing/infoedit>`_
Davide Pesavento82cc17a2025-02-17 18:30:05 -050077- `Mininet <https://mininet.org/>`_
Junxiao Shi48ada892021-11-04 09:02:21 -060078- `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional)
79
80To install Mini-NDN and its dependencies, clone this repository and run:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050081
Davide Pesavento750d0402025-02-25 16:50:50 -050082.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050083
Junxiao Shi48ada892021-11-04 09:02:21 -060084 ./install.sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050085
Junxiao Shi48ada892021-11-04 09:02:21 -060086The script accepts various command line flags.
87Some notable flags are:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050088
Junxiao Shi48ada892021-11-04 09:02:21 -060089- ``-y`` skips interactive confirmation before installation.
Davide Pesavento28a09122025-02-18 17:50:20 -050090- ``--ppa`` prefers installing NDN software from the `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`__.
Junxiao Shi48ada892021-11-04 09:02:21 -060091 This shortens installation time by downloading binary packages, but is only available on Ubuntu.
92- ``--source`` prefers installing NDN software from source code.
awlaneeda7e072024-10-27 15:52:35 -050093- ``--use-existing`` will only install dependencies not already in the executable path.
Junxiao Shi48ada892021-11-04 09:02:21 -060094- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
95 and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
96 faster after applying this patch. However, your experiments cannot use any NDN security related
97 features (signatures, verifier, access control, etc).
98- ``--no-wifi`` skips Mininet-WiFi dependency.
99 Currently Mininet-WiFi only works on Ubuntu, so that you must specify this option when installing on other distros.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500100
Junxiao Shi48ada892021-11-04 09:02:21 -0600101You can see all command line flags by running:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500102
Davide Pesavento750d0402025-02-25 16:50:50 -0500103.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500104
Junxiao Shi48ada892021-11-04 09:02:21 -0600105 ./install.sh -h
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500106
Junxiao Shi48ada892021-11-04 09:02:21 -0600107The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
108directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
109changes will be reflected immediately.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500110
Junxiao Shi48ada892021-11-04 09:02:21 -0600111If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
112under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
113reinstall the software (``./waf && sudo ./waf install``).
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500114
dulalsaurab8c8e6332021-05-21 20:37:03 +0000115
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500116Installing Dependencies
117-----------------------
118
awlane73add712024-08-12 21:49:00 -0500119This section outlines how to install dependencies manually.
Junxiao Shi48ada892021-11-04 09:02:21 -0600120If you used ``install.sh``, you do not need to perform these steps.
121
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500122Mininet
123_______
124
125Mini-NDN is based on Mininet. To install Mininet:
126
Davide Pesavento750d0402025-02-25 16:50:50 -0500127.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500128
129 git clone --depth 1 https://github.com/mininet/mininet.git
130
131After Mininet source is on your system, run the following command to
132install Mininet core dependencies and Open vSwitch:
133
Davide Pesavento750d0402025-02-25 16:50:50 -0500134.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500135
136 ./util/install.sh -nv
137
138To check if Mininet is working correctly, run this test:
139
Davide Pesavento750d0402025-02-25 16:50:50 -0500140.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500141
142 sudo mn --test pingall
143
144This will print out a series of statements that show the test setup and
145the results of the test. Look for ``Results:`` two-thirds of the way
146down where it will indicate the percentage of dropped packets. Your
147results should show "0% dropped (2/2 received)".
148
149NOTE: Mini-NDN, while providing a high level of emulation of hosts,
150requires programs to be installed onto your computer. It will not work
151if they are not installed. If you do not want NDN software installed
152onto your computer, you can use a virtual machine, which can be quite
153simply set up with the provided Vagrantfile.
154
155NDN dependencies
156________________
157
158Each node in Mini-NDN will run the official implementation of NDN
159installed on your system. The following dependencies are needed:
160
awlane73add712024-08-12 21:49:00 -0500161Mini-NDN uses ndn-cxx, NFD, NLSR, and ndn-tools.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500162
awlane73add712024-08-12 21:49:00 -0500163- To install ndn-cxx: https://docs.named-data.net/ndn-cxx/current/INSTALL.html
164- To install NFD: https://docs.named-data.net/NFD/current/INSTALL.html
165- To install NLSR: https://docs.named-data.net/NLSR/current/INSTALL.html
166- To install ndn-tools: https://github.com/named-data/ndn-tools/blob/master/INSTALL.md
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500167
168.. warning::
169 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
170 It will not work in most cases! If you used ./install.sh -a in the past but now want
171 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
172 with apt. Similarly, remove from apt if switching to source.
173
awlane73add712024-08-12 21:49:00 -0500174In cases where using NDN security is not important to the results, it is recommended
175to use the dummy keychain patch for ndn-cxx to disable it for improved scalability.
Davide Pesavento28a09122025-02-18 17:50:20 -0500176This patch is located at ``util/patches/ndn-cxx-dummy-keychain.patch``.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500177
178Note that all three of these can be installed from the Named Data PPA.
179Instructions for setting it up can be found in the NFD installation
180instructions. Note that PPA and installs from source **cannot** be
181mixed. You must completely remove PPA installs from the system if switching
182to source and vice-versa.
183
Davide Pesavento28a09122025-02-18 17:50:20 -0500184For PPA installs, if you are using a custom ``nfd.conf`` file in an experiment, you should
185place it in ``/usr/local/etc/ndn/`` rather than ``/etc/ndn/``. This is to avoid a bug with
186the default configuration file for the PPA, which is incompatible with Mini-NDN.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500187
188Infoedit
189________
190
191Infoedit is used to edit configuration files for NFD and NLSR.
192To install infoedit:
193
Davide Pesavento750d0402025-02-25 16:50:50 -0500194.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500195
196 git clone --depth 1 https://github.com/NDN-Routing/infoedit
197 cd infoedit
198 make
199 sudo make install
200
201Verification
202------------
203
204You can execute the following example to bring up the Mini-NDN command line
205with NFD and NLSR running on each node:
206
Davide Pesavento750d0402025-02-25 16:50:50 -0500207.. code-block:: sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500208
209 sudo python examples/mnndn.py
210
211You can use these steps to run the sample pingall experiment:
212
2131. Issue the command: ``sudo python examples/nlsr/pingall.py``
2142. When the ``mini-ndn>`` CLI prompt appears, the experiment has
215 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
216 experiment.
2173. Issue the command:
218 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
219 report a count of 50.
2204. Issue the command:
221 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
222 report a count of 0.
awlane022b2bf2024-08-28 19:22:46 -0500223
224
225Release Versions
226----------------
227
228We provide a set of shortcuts to install major release versions of NDN
229dependencies from source.
230
231You can install the most recent release using:
232
Davide Pesavento750d0402025-02-25 16:50:50 -0500233.. code-block:: sh
awlane022b2bf2024-08-28 19:22:46 -0500234
235 ./install.sh --source --release=current
236
237You can also select a specified release using:
238
Davide Pesavento750d0402025-02-25 16:50:50 -0500239.. code-block:: sh
awlane022b2bf2024-08-28 19:22:46 -0500240
241 ./install.sh --source --release=[chosen version]
242
awlane022b2bf2024-08-28 19:22:46 -0500243Currently, the compatible versions include:
244
245- ``2024-08``: ndn-cxx 0.9.0, NFD 24.07, NLSR 24.08, PSync 0.5.0,
246 ndn-tools 24.07, and compatible versions of ndn-traffic-generator
awlane749b07a2025-02-05 11:11:05 -0600247 and infoedit.
248
249Using gpsd (Experimental)
Davide Pesavento28a09122025-02-18 17:50:20 -0500250-------------------------
awlane749b07a2025-02-05 11:11:05 -0600251
252The gpsd application included currently is based on in-progress work and
Davide Pesavento28a09122025-02-18 17:50:20 -0500253is not treated as part of the main dependencies. To use it, install ``gpsd``
254and ``nc`` (netcat) from your package manager, if not already present,
Davide Pesavento82cc17a2025-02-17 18:30:05 -0500255to enable the functionality.