blob: d9511def3a41bfa107fb9f8628acc0e12298e3dd [file] [log] [blame]
Ashlesh Gawande6c86e302019-09-17 22:27:05 -05001Install
2=======
3
4Prerequisites
5-------------
6
Junxiao Shi48ada892021-11-04 09:02:21 -06007Mini-NDN is tested on the following Linux distributions:
8
9- Ubuntu 20.04 (recommended)
Junxiao Shi1e720872022-07-19 10:24:12 -060010- Ubuntu 22.04
Junxiao Shi48ada892021-11-04 09:02:21 -060011- Debian 11 (WiFi scenario does not work)
12- Fedora 33 (WiFi scenario does not work)
13
14You must have sudo privileges to install and run Mini-NDN.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050015
16Using Vagrantfile
17-----------------
18
19With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine
20and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
21(default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN
22can 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.
23
24Using install.sh
25----------------
26
Junxiao Shi48ada892021-11-04 09:02:21 -060027Mini-NDN has the following dependencies:
28
29- `NDN Forwarding Daemon (NFD) <https://named-data.net/doc/NFD/>`_
30- `Named Data Link State Routing (NLSR) <https://named-data.net/doc/NLSR/>`_
31- `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_
32- `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_
33- `infoedit <https://github.com/NDN-Routing/infoedit>`_
34- `Mininet <http://mininet.org/>`_
35- `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional)
36
37To install Mini-NDN and its dependencies, clone this repository and run:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050038
39::
40
Junxiao Shi48ada892021-11-04 09:02:21 -060041 ./install.sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050042
Junxiao Shi48ada892021-11-04 09:02:21 -060043The script accepts various command line flags.
44Some notable flags are:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050045
Junxiao Shi48ada892021-11-04 09:02:21 -060046- ``-y`` skips interactive confirmation before installation.
47- ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_.
48 This shortens installation time by downloading binary packages, but is only available on Ubuntu.
49- ``--source`` prefers installing NDN software from source code.
awlaneeda7e072024-10-27 15:52:35 -050050- ``--use-existing`` will only install dependencies not already in the executable path.
dulalsaurab8c8e6332021-05-21 20:37:03 +000051
52IMPORTANT: For now, Mininet-WiFi only works with ``--source`` installation because the current NFD release (0.7.1) doesn't
53incorporate `issue 5155 <https://redmine.named-data.net/issues/5155>`, a required patch for WiFi module to work properly.
54With the next NFD release, Mininet-WiFi will work with both ``source`` and ``ppa``. Alternatively, you can
55checkout (at your own risk) a third-party source "`Use NFD nightly with Mini-NDN <https://yoursunny.com/t/2021/NFD-nightly-minindn/>`", which provides
56NFD-nightly version and contains all the necessary patches.
57
Junxiao Shi48ada892021-11-04 09:02:21 -060058- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
59 and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
60 faster after applying this patch. However, your experiments cannot use any NDN security related
61 features (signatures, verifier, access control, etc).
62- ``--no-wifi`` skips Mininet-WiFi dependency.
63 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 -050064
Junxiao Shi48ada892021-11-04 09:02:21 -060065You can see all command line flags by running:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050066
67::
68
Junxiao Shi48ada892021-11-04 09:02:21 -060069 ./install.sh -h
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050070
Junxiao Shi48ada892021-11-04 09:02:21 -060071The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
72directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
73changes will be reflected immediately.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050074
Junxiao Shi48ada892021-11-04 09:02:21 -060075If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
76under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
77reinstall the software (``./waf && sudo ./waf install``).
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050078
dulalsaurab8c8e6332021-05-21 20:37:03 +000079
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050080Installing Dependencies
81-----------------------
82
Junxiao Shi48ada892021-11-04 09:02:21 -060083This section outlines how to install dependnecies manually.
84If you used ``install.sh``, you do not need to perform these steps.
85
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050086Mininet
87_______
88
89Mini-NDN is based on Mininet. To install Mininet:
90
91::
92
93 git clone --depth 1 https://github.com/mininet/mininet.git
94
95After Mininet source is on your system, run the following command to
96install Mininet core dependencies and Open vSwitch:
97
98::
99
100 ./util/install.sh -nv
101
102To check if Mininet is working correctly, run this test:
103
104::
105
106 sudo mn --test pingall
107
108This will print out a series of statements that show the test setup and
109the results of the test. Look for ``Results:`` two-thirds of the way
110down where it will indicate the percentage of dropped packets. Your
111results should show "0% dropped (2/2 received)".
112
113NOTE: Mini-NDN, while providing a high level of emulation of hosts,
114requires programs to be installed onto your computer. It will not work
115if they are not installed. If you do not want NDN software installed
116onto your computer, you can use a virtual machine, which can be quite
117simply set up with the provided Vagrantfile.
118
119NDN dependencies
120________________
121
122Each node in Mini-NDN will run the official implementation of NDN
123installed on your system. The following dependencies are needed:
124
125Mini-NDN uses NFD, NLSR, and ndn-tools.
126
127- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
128- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
129- To install ndn-tools: https://github.com/named-data/ndn-tools
130
131.. warning::
132 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
133 It will not work in most cases! If you used ./install.sh -a in the past but now want
134 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
135 with apt. Similarly, remove from apt if switching to source.
136
137Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
138security for better scalability.
139
140Note that all three of these can be installed from the Named Data PPA.
141Instructions for setting it up can be found in the NFD installation
142instructions. Note that PPA and installs from source **cannot** be
143mixed. You must completely remove PPA installs from the system if switching
144to source and vice-versa.
145
146For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
147place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
148a bug from the default configuration file for the PPA, which is
149incompatible with Mini-NDN.
150
151Infoedit
152________
153
154Infoedit is used to edit configuration files for NFD and NLSR.
155To install infoedit:
156
157::
158
159 git clone --depth 1 https://github.com/NDN-Routing/infoedit
160 cd infoedit
161 make
162 sudo make install
163
164Verification
165------------
166
167You can execute the following example to bring up the Mini-NDN command line
168with NFD and NLSR running on each node:
169
170::
171
172 sudo python examples/mnndn.py
173
174You can use these steps to run the sample pingall experiment:
175
1761. Issue the command: ``sudo python examples/nlsr/pingall.py``
1772. When the ``mini-ndn>`` CLI prompt appears, the experiment has
178 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
179 experiment.
1803. Issue the command:
181 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
182 report a count of 50.
1834. Issue the command:
184 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
185 report a count of 0.
awlane022b2bf2024-08-28 19:22:46 -0500186
187
188Release Versions
189----------------
190
191We provide a set of shortcuts to install major release versions of NDN
192dependencies from source.
193
194You can install the most recent release using:
195
196::
197
198 ./install.sh --source --release=current
199
200You can also select a specified release using:
201
202::
203
204 ./install.sh --source --release=[chosen version]
205
206
207Currently, the compatible versions include:
208
209- ``2024-08``: ndn-cxx 0.9.0, NFD 24.07, NLSR 24.08, PSync 0.5.0,
210 ndn-tools 24.07, and compatible versions of ndn-traffic-generator
211 and infoedit.