blob: 90736224b6a28572e4892a5a033e2b12ea9c7c73 [file] [log] [blame]
Ashlesh Gawande6c86e302019-09-17 22:27:05 -05001Install
2=======
3
4Prerequisites
5-------------
6
7For this guide, you will need a laptop/desktop with a recent version of
8a Linux distro that is supported by Mininet. For this guide, the *Ubuntu 18.04 LTS* release was used.
9Some tweaks maybe required to Mini-NDN's install.sh file for other distros.
10Note that you'll need administrative privileges in order to download and install
11extra packages and also to execute **Mini-NDN**.
12
13Using Vagrantfile
14-----------------
15
16With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine
17and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
18(default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN
19can 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.
20
21Using install.sh
22----------------
23
24Mini-NDN depends on Mininet and NDN software to be installed in the system.
25If you have all the dependencies (see sections below) **installed in the system** simply
26clone this repository and run:
27
28::
29
30 ./install.sh -i
31
32The ``-i`` option uses ``setup.py develop`` to point the system install
33to the current directory. So any changes made to the cloned ``mini-ndn``
34folder will be used without having to install it again to the system.
35If you do not need to modify the core of Mini-NDN, then setup.py install (or pip install .)
36can be used directly. See :doc:`experiment <experiment>` for more information on running.
37
38If you don't have the dependencies, the following command will
39install them from source along with Mini-NDN. The dependencies include
40Mininet, NDN core (ndn-cxx, NFD, Chronosync, PSync, NLSR), Infoedit,
41and NDN Common Client Libraries (CCL). If you do not wish to install
42the master versions of the NDN core or want to switch to specific versions,
43you can edit the install.sh with release tags/specific versions.
44
45.. _scaling-note:
46.. important::
47 If you wish to scale Mini-NDN experiments and do not have use for security extensions
48 in your emulations, you should apply the ndn-cxx patch given in the ``patches`` folder
49 using ``./install.sh -p`` before running the following commands. The ndn-cxx patch is
50 taken from ndnSIM which provides an in-memory dummy KeyChain to reduce CPU computations.
51 After these patches are applied sleep time after NFD, nfdc, NLSR, etc. is not required
52 making the startup **MUCH** faster and scaling of Mini-NDN **MUCH** better.
53
54::
55
56 ./install.sh -a
57
58This pulls the NDN software from Github to ``ndn-src`` folder under the project.
59
60.. note::
61 If any changes are made to ``ndn-src`` folder, please don't forgot to re-install
62 the sources to the system.
63
64To install without CCL, use:
65
66::
67
68 ./install.sh -mni
69
Giovanni Griecobb31ed22020-03-23 10:04:59 +010070To install in "quiet" mode (without user interaction), use:
71
72::
73 ./install.sh -qa
74
75.. note::
76 The order of the flag -q is important to ensure that the environment is ready for
77 a quiet install.
78
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050079See ``install.sh -h`` for detailed options.
80
81Installing Dependencies
82-----------------------
83
84Mininet
85_______
86
87Mini-NDN is based on Mininet. To install Mininet:
88
89::
90
91 git clone --depth 1 https://github.com/mininet/mininet.git
92
93After Mininet source is on your system, run the following command to
94install Mininet core dependencies and Open vSwitch:
95
96::
97
98 ./util/install.sh -nv
99
100To check if Mininet is working correctly, run this test:
101
102::
103
104 sudo mn --test pingall
105
106This will print out a series of statements that show the test setup and
107the results of the test. Look for ``Results:`` two-thirds of the way
108down where it will indicate the percentage of dropped packets. Your
109results should show "0% dropped (2/2 received)".
110
111NOTE: Mini-NDN, while providing a high level of emulation of hosts,
112requires programs to be installed onto your computer. It will not work
113if they are not installed. If you do not want NDN software installed
114onto your computer, you can use a virtual machine, which can be quite
115simply set up with the provided Vagrantfile.
116
117NDN dependencies
118________________
119
120Each node in Mini-NDN will run the official implementation of NDN
121installed on your system. The following dependencies are needed:
122
123Mini-NDN uses NFD, NLSR, and ndn-tools.
124
125- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
126- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
127- To install ndn-tools: https://github.com/named-data/ndn-tools
128
129.. warning::
130 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
131 It will not work in most cases! If you used ./install.sh -a in the past but now want
132 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
133 with apt. Similarly, remove from apt if switching to source.
134
135Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
136security for better scalability.
137
138Note that all three of these can be installed from the Named Data PPA.
139Instructions for setting it up can be found in the NFD installation
140instructions. Note that PPA and installs from source **cannot** be
141mixed. You must completely remove PPA installs from the system if switching
142to source and vice-versa.
143
144For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
145place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
146a bug from the default configuration file for the PPA, which is
147incompatible with Mini-NDN.
148
149Infoedit
150________
151
152Infoedit is used to edit configuration files for NFD and NLSR.
153To install infoedit:
154
155::
156
157 git clone --depth 1 https://github.com/NDN-Routing/infoedit
158 cd infoedit
159 make
160 sudo make install
161
162Verification
163------------
164
165You can execute the following example to bring up the Mini-NDN command line
166with NFD and NLSR running on each node:
167
168::
169
170 sudo python examples/mnndn.py
171
172You can use these steps to run the sample pingall experiment:
173
1741. Issue the command: ``sudo python examples/nlsr/pingall.py``
1752. When the ``mini-ndn>`` CLI prompt appears, the experiment has
176 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
177 experiment.
1783. Issue the command:
179 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
180 report a count of 50.
1814. Issue the command:
182 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
183 report a count of 0.