blob: 391fdfa559fba9fa9d6bdafbf1912bbe5fd51471 [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
70See ``install.sh -h`` for detailed options.
71
72Installing Dependencies
73-----------------------
74
75Mininet
76_______
77
78Mini-NDN is based on Mininet. To install Mininet:
79
80::
81
82 git clone --depth 1 https://github.com/mininet/mininet.git
83
84After Mininet source is on your system, run the following command to
85install Mininet core dependencies and Open vSwitch:
86
87::
88
89 ./util/install.sh -nv
90
91To check if Mininet is working correctly, run this test:
92
93::
94
95 sudo mn --test pingall
96
97This will print out a series of statements that show the test setup and
98the results of the test. Look for ``Results:`` two-thirds of the way
99down where it will indicate the percentage of dropped packets. Your
100results should show "0% dropped (2/2 received)".
101
102NOTE: Mini-NDN, while providing a high level of emulation of hosts,
103requires programs to be installed onto your computer. It will not work
104if they are not installed. If you do not want NDN software installed
105onto your computer, you can use a virtual machine, which can be quite
106simply set up with the provided Vagrantfile.
107
108NDN dependencies
109________________
110
111Each node in Mini-NDN will run the official implementation of NDN
112installed on your system. The following dependencies are needed:
113
114Mini-NDN uses NFD, NLSR, and ndn-tools.
115
116- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
117- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
118- To install ndn-tools: https://github.com/named-data/ndn-tools
119
120.. warning::
121 Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
122 It will not work in most cases! If you used ./install.sh -a in the past but now want
123 to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
124 with apt. Similarly, remove from apt if switching to source.
125
126Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
127security for better scalability.
128
129Note that all three of these can be installed from the Named Data PPA.
130Instructions for setting it up can be found in the NFD installation
131instructions. Note that PPA and installs from source **cannot** be
132mixed. You must completely remove PPA installs from the system if switching
133to source and vice-versa.
134
135For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
136place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
137a bug from the default configuration file for the PPA, which is
138incompatible with Mini-NDN.
139
140Infoedit
141________
142
143Infoedit is used to edit configuration files for NFD and NLSR.
144To install infoedit:
145
146::
147
148 git clone --depth 1 https://github.com/NDN-Routing/infoedit
149 cd infoedit
150 make
151 sudo make install
152
153Verification
154------------
155
156You can execute the following example to bring up the Mini-NDN command line
157with NFD and NLSR running on each node:
158
159::
160
161 sudo python examples/mnndn.py
162
163You can use these steps to run the sample pingall experiment:
164
1651. Issue the command: ``sudo python examples/nlsr/pingall.py``
1662. When the ``mini-ndn>`` CLI prompt appears, the experiment has
167 finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
168 experiment.
1693. Issue the command:
170 ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
171 report a count of 50.
1724. Issue the command:
173 ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
174 report a count of 0.