blob: 3f667503efc313681905c77c62fbf113f210817d [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 Pesavento82cc17a2025-02-17 18:30:05 -050020You can use the nightly build from GitHub package registry::
21
awlane73add712024-08-12 21:49:00 -050022 docker run -m 4g --cpus=4 -it --privileged \
23 -v /lib/modules:/lib/modules \
24 ghcr.io/named-data/mini-ndn:master bash
25
26NOTE: This nightly build is only currently supported for x86_64. ARM64 support
27(i.e. Apple silicon Macs) will be added in the future.
28
29Building your own Docker image
30------------------------------
31
32The provided Dockerfile can be used to build an image from scratch. To build with the Dockerfile:
33 - Clone the repository and type::
34
35 docker build -t minindn .
36
37 - You can then access the container through shell with::
38
39 docker run -m 4g --cpus=4 -it --privileged \
40 -v /lib/modules:/lib/modules \
41 minindn bin/bash
42
43Additional recommendations
44--------------------------
Davide Pesavento82cc17a2025-02-17 18:30:05 -050045
awlane73add712024-08-12 21:49:00 -050046- It is recommended to set reasonable constraints on memory (`-m`) and CPU cores (`--cpus`), especially on less
47 powerful or non-dedicated systems.
Davide Pesavento82cc17a2025-02-17 18:30:05 -050048- `--privileged` is mandatory for underlying `Mininet <https://mininet.org/>`__ to utilize the virtual switch
awlane73add712024-08-12 21:49:00 -050049- The root directory on `run` is `/mini-ndn`, which contains the installation and examples.
50- The GUI may not work for now due to docker and xterm setup issues and is independent from Mini-NDN.
51 If you intend to run the GUI, pass `-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix` to the `docker run` command.
52
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050053Using Vagrantfile
54-----------------
55
56With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine
57and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
58(default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN
59can be found in /home/vagrant/mini-ndn which is a symlink to /vagrant if Vagrantfile was used from within mini-ndn cloned on the host. Otherwise it is an actual clone of mini-ndn.
60
61Using install.sh
62----------------
63
Junxiao Shi48ada892021-11-04 09:02:21 -060064Mini-NDN has the following dependencies:
65
awlane73add712024-08-12 21:49:00 -050066- `NDN Forwarding Daemon (NFD) <https://docs.named-data.net/NFD/current/>`_
67- `Named Data Link State Routing (NLSR) <https://docs.named-data.net/NLSR/current/>`_
Junxiao Shi48ada892021-11-04 09:02:21 -060068- `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_
69- `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_
70- `infoedit <https://github.com/NDN-Routing/infoedit>`_
Davide Pesavento82cc17a2025-02-17 18:30:05 -050071- `Mininet <https://mininet.org/>`_
Junxiao Shi48ada892021-11-04 09:02:21 -060072- `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional)
73
74To install Mini-NDN and its dependencies, clone this repository and run:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050075
76::
77
Junxiao Shi48ada892021-11-04 09:02:21 -060078 ./install.sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050079
Junxiao Shi48ada892021-11-04 09:02:21 -060080The script accepts various command line flags.
81Some notable flags are:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050082
Junxiao Shi48ada892021-11-04 09:02:21 -060083- ``-y`` skips interactive confirmation before installation.
84- ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_.
85 This shortens installation time by downloading binary packages, but is only available on Ubuntu.
86- ``--source`` prefers installing NDN software from source code.
awlaneeda7e072024-10-27 15:52:35 -050087- ``--use-existing`` will only install dependencies not already in the executable path.
Junxiao Shi48ada892021-11-04 09:02:21 -060088- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
89 and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
90 faster after applying this patch. However, your experiments cannot use any NDN security related
91 features (signatures, verifier, access control, etc).
92- ``--no-wifi`` skips Mininet-WiFi dependency.
93 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 -050094
Junxiao Shi48ada892021-11-04 09:02:21 -060095You can see all command line flags by running:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050096
97::
98
Junxiao Shi48ada892021-11-04 09:02:21 -060099 ./install.sh -h
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500100
Junxiao Shi48ada892021-11-04 09:02:21 -0600101The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
102directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
103changes will be reflected immediately.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500104
Junxiao Shi48ada892021-11-04 09:02:21 -0600105If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
106under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
107reinstall the software (``./waf && sudo ./waf install``).
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500108
dulalsaurab8c8e6332021-05-21 20:37:03 +0000109
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500110Installing Dependencies
111-----------------------
112
awlane73add712024-08-12 21:49:00 -0500113This section outlines how to install dependencies manually.
Junxiao Shi48ada892021-11-04 09:02:21 -0600114If you used ``install.sh``, you do not need to perform these steps.
115
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500116Mininet
117_______
118
119Mini-NDN is based on Mininet. To install Mininet:
120
121::
122
123 git clone --depth 1 https://github.com/mininet/mininet.git
124
125After Mininet source is on your system, run the following command to
126install Mininet core dependencies and Open vSwitch:
127
128::
129
130 ./util/install.sh -nv
131
132To check if Mininet is working correctly, run this test:
133
134::
135
136 sudo mn --test pingall
137
138This will print out a series of statements that show the test setup and
139the results of the test. Look for ``Results:`` two-thirds of the way
140down where it will indicate the percentage of dropped packets. Your
141results should show "0% dropped (2/2 received)".
142
143NOTE: Mini-NDN, while providing a high level of emulation of hosts,
144requires programs to be installed onto your computer. It will not work
145if they are not installed. If you do not want NDN software installed
146onto your computer, you can use a virtual machine, which can be quite
147simply set up with the provided Vagrantfile.
148
149NDN dependencies
150________________
151
152Each node in Mini-NDN will run the official implementation of NDN
153installed on your system. The following dependencies are needed:
154
awlane73add712024-08-12 21:49:00 -0500155Mini-NDN uses ndn-cxx, NFD, NLSR, and ndn-tools.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500156
awlane73add712024-08-12 21:49:00 -0500157- To install ndn-cxx: https://docs.named-data.net/ndn-cxx/current/INSTALL.html
158- To install NFD: https://docs.named-data.net/NFD/current/INSTALL.html
159- To install NLSR: https://docs.named-data.net/NLSR/current/INSTALL.html
160- To install ndn-tools: https://github.com/named-data/ndn-tools/blob/master/INSTALL.md
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500161
162.. warning::
163 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
164 It will not work in most cases! If you used ./install.sh -a in the past but now want
165 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
166 with apt. Similarly, remove from apt if switching to source.
167
awlane73add712024-08-12 21:49:00 -0500168In cases where using NDN security is not important to the results, it is recommended
169to use the dummy keychain patch for ndn-cxx to disable it for improved scalability.
170This patch is located at `util/patches/ndn-cxx-dummy-keychain.patch.`
Ashlesh Gawande6c86e302019-09-17 22:27:05 -0500171
172Note that all three of these can be installed from the Named Data PPA.
173Instructions for setting it up can be found in the NFD installation
174instructions. Note that PPA and installs from source **cannot** be
175mixed. You must completely remove PPA installs from the system if switching
176to source and vice-versa.
177
178For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
179place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
180a bug from the default configuration file for the PPA, which is
181incompatible with Mini-NDN.
182
183Infoedit
184________
185
186Infoedit is used to edit configuration files for NFD and NLSR.
187To install infoedit:
188
189::
190
191 git clone --depth 1 https://github.com/NDN-Routing/infoedit
192 cd infoedit
193 make
194 sudo make install
195
196Verification
197------------
198
199You can execute the following example to bring up the Mini-NDN command line
200with NFD and NLSR running on each node:
201
202::
203
204 sudo python examples/mnndn.py
205
206You can use these steps to run the sample pingall experiment:
207
2081. Issue the command: ``sudo python examples/nlsr/pingall.py``
2092. When the ``mini-ndn>`` CLI prompt appears, the experiment has
210 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
211 experiment.
2123. Issue the command:
213 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
214 report a count of 50.
2154. Issue the command:
216 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
217 report a count of 0.
awlane022b2bf2024-08-28 19:22:46 -0500218
219
220Release Versions
221----------------
222
223We provide a set of shortcuts to install major release versions of NDN
224dependencies from source.
225
226You can install the most recent release using:
227
228::
229
230 ./install.sh --source --release=current
231
232You can also select a specified release using:
233
234::
235
236 ./install.sh --source --release=[chosen version]
237
238
239Currently, the compatible versions include:
240
241- ``2024-08``: ndn-cxx 0.9.0, NFD 24.07, NLSR 24.08, PSync 0.5.0,
242 ndn-tools 24.07, and compatible versions of ndn-traffic-generator
awlane749b07a2025-02-05 11:11:05 -0600243 and infoedit.
244
245Using gpsd (Experimental)
246----------------
247
248The gpsd application included currently is based on in-progress work and
249is not treated as part of the main dependencies. To use it, install the
250`gpsd` and `nc` (netcat) from your package manager, if not already present,
Davide Pesavento82cc17a2025-02-17 18:30:05 -0500251to enable the functionality.