blob: 40da6b34463a7bae850054bc536cad84e7a77734 [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)
10- Debian 11 (WiFi scenario does not work)
11- Fedora 33 (WiFi scenario does not work)
12
13You must have sudo privileges to install and run Mini-NDN.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050014
15Using Vagrantfile
16-----------------
17
18With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine
19and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
20(default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN
21can 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.
22
23Using install.sh
24----------------
25
Junxiao Shi48ada892021-11-04 09:02:21 -060026Mini-NDN has the following dependencies:
27
28- `NDN Forwarding Daemon (NFD) <https://named-data.net/doc/NFD/>`_
29- `Named Data Link State Routing (NLSR) <https://named-data.net/doc/NLSR/>`_
30- `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_
31- `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_
32- `infoedit <https://github.com/NDN-Routing/infoedit>`_
33- `Mininet <http://mininet.org/>`_
34- `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional)
35
36To install Mini-NDN and its dependencies, clone this repository and run:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050037
38::
39
Junxiao Shi48ada892021-11-04 09:02:21 -060040 ./install.sh
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050041
Junxiao Shi48ada892021-11-04 09:02:21 -060042The script accepts various command line flags.
43Some notable flags are:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050044
Junxiao Shi48ada892021-11-04 09:02:21 -060045- ``-y`` skips interactive confirmation before installation.
46- ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_.
47 This shortens installation time by downloading binary packages, but is only available on Ubuntu.
48- ``--source`` prefers installing NDN software from source code.
49- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
50 and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
51 faster after applying this patch. However, your experiments cannot use any NDN security related
52 features (signatures, verifier, access control, etc).
53- ``--no-wifi`` skips Mininet-WiFi dependency.
54 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 -050055
Junxiao Shi48ada892021-11-04 09:02:21 -060056You can see all command line flags by running:
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050057
58::
59
Junxiao Shi48ada892021-11-04 09:02:21 -060060 ./install.sh -h
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050061
Junxiao Shi48ada892021-11-04 09:02:21 -060062The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
63directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
64changes will be reflected immediately.
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050065
Junxiao Shi48ada892021-11-04 09:02:21 -060066If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
67under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
68reinstall the software (``./waf && sudo ./waf install``).
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050069
70Installing Dependencies
71-----------------------
72
Junxiao Shi48ada892021-11-04 09:02:21 -060073This section outlines how to install dependnecies manually.
74If you used ``install.sh``, you do not need to perform these steps.
75
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050076Mininet
77_______
78
79Mini-NDN is based on Mininet. To install Mininet:
80
81::
82
83 git clone --depth 1 https://github.com/mininet/mininet.git
84
85After Mininet source is on your system, run the following command to
86install Mininet core dependencies and Open vSwitch:
87
88::
89
90 ./util/install.sh -nv
91
92To check if Mininet is working correctly, run this test:
93
94::
95
96 sudo mn --test pingall
97
98This will print out a series of statements that show the test setup and
99the results of the test. Look for ``Results:`` two-thirds of the way
100down where it will indicate the percentage of dropped packets. Your
101results should show "0% dropped (2/2 received)".
102
103NOTE: Mini-NDN, while providing a high level of emulation of hosts,
104requires programs to be installed onto your computer. It will not work
105if they are not installed. If you do not want NDN software installed
106onto your computer, you can use a virtual machine, which can be quite
107simply set up with the provided Vagrantfile.
108
109NDN dependencies
110________________
111
112Each node in Mini-NDN will run the official implementation of NDN
113installed on your system. The following dependencies are needed:
114
115Mini-NDN uses NFD, NLSR, and ndn-tools.
116
117- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
118- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
119- To install ndn-tools: https://github.com/named-data/ndn-tools
120
121.. warning::
122 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
123 It will not work in most cases! If you used ./install.sh -a in the past but now want
124 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
125 with apt. Similarly, remove from apt if switching to source.
126
127Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
128security for better scalability.
129
130Note that all three of these can be installed from the Named Data PPA.
131Instructions for setting it up can be found in the NFD installation
132instructions. Note that PPA and installs from source **cannot** be
133mixed. You must completely remove PPA installs from the system if switching
134to source and vice-versa.
135
136For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
137place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
138a bug from the default configuration file for the PPA, which is
139incompatible with Mini-NDN.
140
141Infoedit
142________
143
144Infoedit is used to edit configuration files for NFD and NLSR.
145To install infoedit:
146
147::
148
149 git clone --depth 1 https://github.com/NDN-Routing/infoedit
150 cd infoedit
151 make
152 sudo make install
153
154Verification
155------------
156
157You can execute the following example to bring up the Mini-NDN command line
158with NFD and NLSR running on each node:
159
160::
161
162 sudo python examples/mnndn.py
163
164You can use these steps to run the sample pingall experiment:
165
1661. Issue the command: ``sudo python examples/nlsr/pingall.py``
1672. When the ``mini-ndn>`` CLI prompt appears, the experiment has
168 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
169 experiment.
1703. Issue the command:
171 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
172 report a count of 50.
1734. Issue the command:
174 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
175 report a count of 0.