blob: cd66d68f46db163d6b19366e4adb9a6956099cf6 [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.
dulalsaurab8c8e6332021-05-21 20:37:03 +000050
51IMPORTANT: For now, Mininet-WiFi only works with ``--source`` installation because the current NFD release (0.7.1) doesn't
52incorporate `issue 5155 <https://redmine.named-data.net/issues/5155>`, a required patch for WiFi module to work properly.
53With the next NFD release, Mininet-WiFi will work with both ``source`` and ``ppa``. Alternatively, you can
54checkout (at your own risk) a third-party source "`Use NFD nightly with Mini-NDN <https://yoursunny.com/t/2021/NFD-nightly-minindn/>`", which provides
55NFD-nightly version and contains all the necessary patches.
56
Junxiao Shi48ada892021-11-04 09:02:21 -060057- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
58 and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
59 faster after applying this patch. However, your experiments cannot use any NDN security related
60 features (signatures, verifier, access control, etc).
61- ``--no-wifi`` skips Mininet-WiFi dependency.
62 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 -050063
Junxiao Shi48ada892021-11-04 09:02:21 -060064You can see all command line flags by running:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050065
66::
67
Junxiao Shi48ada892021-11-04 09:02:21 -060068 ./install.sh -h
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050069
Junxiao Shi48ada892021-11-04 09:02:21 -060070The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
71directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
72changes will be reflected immediately.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050073
Junxiao Shi48ada892021-11-04 09:02:21 -060074If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
75under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
76reinstall the software (``./waf && sudo ./waf install``).
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050077
dulalsaurab8c8e6332021-05-21 20:37:03 +000078
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050079Installing Dependencies
80-----------------------
81
Junxiao Shi48ada892021-11-04 09:02:21 -060082This section outlines how to install dependnecies manually.
83If you used ``install.sh``, you do not need to perform these steps.
84
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050085Mininet
86_______
87
88Mini-NDN is based on Mininet. To install Mininet:
89
90::
91
92 git clone --depth 1 https://github.com/mininet/mininet.git
93
94After Mininet source is on your system, run the following command to
95install Mininet core dependencies and Open vSwitch:
96
97::
98
99 ./util/install.sh -nv
100
101To check if Mininet is working correctly, run this test:
102
103::
104
105 sudo mn --test pingall
106
107This will print out a series of statements that show the test setup and
108the results of the test. Look for ``Results:`` two-thirds of the way
109down where it will indicate the percentage of dropped packets. Your
110results should show "0% dropped (2/2 received)".
111
112NOTE: Mini-NDN, while providing a high level of emulation of hosts,
113requires programs to be installed onto your computer. It will not work
114if they are not installed. If you do not want NDN software installed
115onto your computer, you can use a virtual machine, which can be quite
116simply set up with the provided Vagrantfile.
117
118NDN dependencies
119________________
120
121Each node in Mini-NDN will run the official implementation of NDN
122installed on your system. The following dependencies are needed:
123
124Mini-NDN uses NFD, NLSR, and ndn-tools.
125
126- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
127- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
128- To install ndn-tools: https://github.com/named-data/ndn-tools
129
130.. warning::
131 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
132 It will not work in most cases! If you used ./install.sh -a in the past but now want
133 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
134 with apt. Similarly, remove from apt if switching to source.
135
136Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
137security for better scalability.
138
139Note that all three of these can be installed from the Named Data PPA.
140Instructions for setting it up can be found in the NFD installation
141instructions. Note that PPA and installs from source **cannot** be
142mixed. You must completely remove PPA installs from the system if switching
143to source and vice-versa.
144
145For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
146place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
147a bug from the default configuration file for the PPA, which is
148incompatible with Mini-NDN.
149
150Infoedit
151________
152
153Infoedit is used to edit configuration files for NFD and NLSR.
154To install infoedit:
155
156::
157
158 git clone --depth 1 https://github.com/NDN-Routing/infoedit
159 cd infoedit
160 make
161 sudo make install
162
163Verification
164------------
165
166You can execute the following example to bring up the Mini-NDN command line
167with NFD and NLSR running on each node:
168
169::
170
171 sudo python examples/mnndn.py
172
173You can use these steps to run the sample pingall experiment:
174
1751. Issue the command: ``sudo python examples/nlsr/pingall.py``
1762. When the ``mini-ndn>`` CLI prompt appears, the experiment has
177 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
178 experiment.
1793. Issue the command:
180 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
181 report a count of 50.
1824. Issue the command:
183 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
184 report a count of 0.