Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 1 | Install |
| 2 | ======= |
| 3 | |
| 4 | Prerequisites |
| 5 | ------------- |
| 6 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 7 | Mini-NDN is tested on the following Linux distributions: |
| 8 | |
| 9 | - Ubuntu 20.04 (recommended) |
Junxiao Shi | 1e72087 | 2022-07-19 10:24:12 -0600 | [diff] [blame] | 10 | - Ubuntu 22.04 |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 11 | - Debian 11 (WiFi scenario does not work) |
| 12 | - Fedora 33 (WiFi scenario does not work) |
| 13 | |
| 14 | You must have sudo privileges to install and run Mini-NDN. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 15 | |
| 16 | Using Vagrantfile |
| 17 | ----------------- |
| 18 | |
| 19 | With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine |
| 20 | and 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 |
| 22 | can 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 | |
| 24 | Using install.sh |
| 25 | ---------------- |
| 26 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 27 | Mini-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 | |
| 37 | To install Mini-NDN and its dependencies, clone this repository and run: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 38 | |
| 39 | :: |
| 40 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 41 | ./install.sh |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 42 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 43 | The script accepts various command line flags. |
| 44 | Some notable flags are: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 45 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 46 | - ``-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. |
dulalsaurab | 8c8e633 | 2021-05-21 20:37:03 +0000 | [diff] [blame] | 50 | |
| 51 | IMPORTANT: For now, Mininet-WiFi only works with ``--source`` installation because the current NFD release (0.7.1) doesn't |
| 52 | incorporate `issue 5155 <https://redmine.named-data.net/issues/5155>`, a required patch for WiFi module to work properly. |
| 53 | With the next NFD release, Mininet-WiFi will work with both ``source`` and ``ppa``. Alternatively, you can |
| 54 | checkout (at your own risk) a third-party source "`Use NFD nightly with Mini-NDN <https://yoursunny.com/t/2021/NFD-nightly-minindn/>`", which provides |
| 55 | NFD-nightly version and contains all the necessary patches. |
| 56 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 57 | - ``--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 Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 63 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 64 | You can see all command line flags by running: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 65 | |
| 66 | :: |
| 67 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 68 | ./install.sh -h |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 69 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 70 | The script uses ``setup.py develop`` to point the system install of Python packages to the codebase |
| 71 | directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the |
| 72 | changes will be reflected immediately. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 73 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 74 | If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory |
| 75 | under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and |
| 76 | reinstall the software (``./waf && sudo ./waf install``). |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 77 | |
dulalsaurab | 8c8e633 | 2021-05-21 20:37:03 +0000 | [diff] [blame] | 78 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 79 | Installing Dependencies |
| 80 | ----------------------- |
| 81 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 82 | This section outlines how to install dependnecies manually. |
| 83 | If you used ``install.sh``, you do not need to perform these steps. |
| 84 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 85 | Mininet |
| 86 | _______ |
| 87 | |
| 88 | Mini-NDN is based on Mininet. To install Mininet: |
| 89 | |
| 90 | :: |
| 91 | |
| 92 | git clone --depth 1 https://github.com/mininet/mininet.git |
| 93 | |
| 94 | After Mininet source is on your system, run the following command to |
| 95 | install Mininet core dependencies and Open vSwitch: |
| 96 | |
| 97 | :: |
| 98 | |
| 99 | ./util/install.sh -nv |
| 100 | |
| 101 | To check if Mininet is working correctly, run this test: |
| 102 | |
| 103 | :: |
| 104 | |
| 105 | sudo mn --test pingall |
| 106 | |
| 107 | This will print out a series of statements that show the test setup and |
| 108 | the results of the test. Look for ``Results:`` two-thirds of the way |
| 109 | down where it will indicate the percentage of dropped packets. Your |
| 110 | results should show "0% dropped (2/2 received)". |
| 111 | |
| 112 | NOTE: Mini-NDN, while providing a high level of emulation of hosts, |
| 113 | requires programs to be installed onto your computer. It will not work |
| 114 | if they are not installed. If you do not want NDN software installed |
| 115 | onto your computer, you can use a virtual machine, which can be quite |
| 116 | simply set up with the provided Vagrantfile. |
| 117 | |
| 118 | NDN dependencies |
| 119 | ________________ |
| 120 | |
| 121 | Each node in Mini-NDN will run the official implementation of NDN |
| 122 | installed on your system. The following dependencies are needed: |
| 123 | |
| 124 | Mini-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 | |
| 136 | Please see the :ref:`scaling-note <scaling-note>` to learn about disabling |
| 137 | security for better scalability. |
| 138 | |
| 139 | Note that all three of these can be installed from the Named Data PPA. |
| 140 | Instructions for setting it up can be found in the NFD installation |
| 141 | instructions. Note that PPA and installs from source **cannot** be |
| 142 | mixed. You must completely remove PPA installs from the system if switching |
| 143 | to source and vice-versa. |
| 144 | |
| 145 | For PPA installs, if you are using a custom nfd.conf file in an experiment, you should |
| 146 | place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid |
| 147 | a bug from the default configuration file for the PPA, which is |
| 148 | incompatible with Mini-NDN. |
| 149 | |
| 150 | Infoedit |
| 151 | ________ |
| 152 | |
| 153 | Infoedit is used to edit configuration files for NFD and NLSR. |
| 154 | To 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 | |
| 163 | Verification |
| 164 | ------------ |
| 165 | |
| 166 | You can execute the following example to bring up the Mini-NDN command line |
| 167 | with NFD and NLSR running on each node: |
| 168 | |
| 169 | :: |
| 170 | |
| 171 | sudo python examples/mnndn.py |
| 172 | |
| 173 | You can use these steps to run the sample pingall experiment: |
| 174 | |
| 175 | 1. Issue the command: ``sudo python examples/nlsr/pingall.py`` |
| 176 | 2. 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. |
| 179 | 3. Issue the command: |
| 180 | ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 181 | report a count of 50. |
| 182 | 4. Issue the command: |
| 183 | ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 184 | report a count of 0. |