Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 1 | Install |
| 2 | ======= |
| 3 | |
| 4 | Prerequisites |
| 5 | ------------- |
| 6 | |
| 7 | For this guide, you will need a laptop/desktop with a recent version of |
| 8 | a Linux distro that is supported by Mininet. For this guide, the *Ubuntu 18.04 LTS* release was used. |
| 9 | Some tweaks maybe required to Mini-NDN's install.sh file for other distros. |
| 10 | Note that you'll need administrative privileges in order to download and install |
| 11 | extra packages and also to execute **Mini-NDN**. |
| 12 | |
| 13 | Using Vagrantfile |
| 14 | ----------------- |
| 15 | |
| 16 | With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine |
| 17 | and 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 |
| 19 | 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. |
| 20 | |
| 21 | Using install.sh |
| 22 | ---------------- |
| 23 | |
| 24 | Mini-NDN depends on Mininet and NDN software to be installed in the system. |
| 25 | If you have all the dependencies (see sections below) **installed in the system** simply |
| 26 | clone this repository and run: |
| 27 | |
| 28 | :: |
| 29 | |
| 30 | ./install.sh -i |
| 31 | |
| 32 | The ``-i`` option uses ``setup.py develop`` to point the system install |
| 33 | to the current directory. So any changes made to the cloned ``mini-ndn`` |
| 34 | folder will be used without having to install it again to the system. |
| 35 | If you do not need to modify the core of Mini-NDN, then setup.py install (or pip install .) |
| 36 | can be used directly. See :doc:`experiment <experiment>` for more information on running. |
| 37 | |
| 38 | If you don't have the dependencies, the following command will |
| 39 | install them from source along with Mini-NDN. The dependencies include |
| 40 | Mininet, NDN core (ndn-cxx, NFD, Chronosync, PSync, NLSR), Infoedit, |
| 41 | and NDN Common Client Libraries (CCL). If you do not wish to install |
| 42 | the master versions of the NDN core or want to switch to specific versions, |
| 43 | you 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 | |
| 58 | This 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 | |
| 64 | To install without CCL, use: |
| 65 | |
| 66 | :: |
| 67 | |
| 68 | ./install.sh -mni |
| 69 | |
| 70 | See ``install.sh -h`` for detailed options. |
| 71 | |
| 72 | Installing Dependencies |
| 73 | ----------------------- |
| 74 | |
| 75 | Mininet |
| 76 | _______ |
| 77 | |
| 78 | Mini-NDN is based on Mininet. To install Mininet: |
| 79 | |
| 80 | :: |
| 81 | |
| 82 | git clone --depth 1 https://github.com/mininet/mininet.git |
| 83 | |
| 84 | After Mininet source is on your system, run the following command to |
| 85 | install Mininet core dependencies and Open vSwitch: |
| 86 | |
| 87 | :: |
| 88 | |
| 89 | ./util/install.sh -nv |
| 90 | |
| 91 | To check if Mininet is working correctly, run this test: |
| 92 | |
| 93 | :: |
| 94 | |
| 95 | sudo mn --test pingall |
| 96 | |
| 97 | This will print out a series of statements that show the test setup and |
| 98 | the results of the test. Look for ``Results:`` two-thirds of the way |
| 99 | down where it will indicate the percentage of dropped packets. Your |
| 100 | results should show "0% dropped (2/2 received)". |
| 101 | |
| 102 | NOTE: Mini-NDN, while providing a high level of emulation of hosts, |
| 103 | requires programs to be installed onto your computer. It will not work |
| 104 | if they are not installed. If you do not want NDN software installed |
| 105 | onto your computer, you can use a virtual machine, which can be quite |
| 106 | simply set up with the provided Vagrantfile. |
| 107 | |
| 108 | NDN dependencies |
| 109 | ________________ |
| 110 | |
| 111 | Each node in Mini-NDN will run the official implementation of NDN |
| 112 | installed on your system. The following dependencies are needed: |
| 113 | |
| 114 | Mini-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 | |
| 126 | Please see the :ref:`scaling-note <scaling-note>` to learn about disabling |
| 127 | security for better scalability. |
| 128 | |
| 129 | Note that all three of these can be installed from the Named Data PPA. |
| 130 | Instructions for setting it up can be found in the NFD installation |
| 131 | instructions. Note that PPA and installs from source **cannot** be |
| 132 | mixed. You must completely remove PPA installs from the system if switching |
| 133 | to source and vice-versa. |
| 134 | |
| 135 | For PPA installs, if you are using a custom nfd.conf file in an experiment, you should |
| 136 | place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid |
| 137 | a bug from the default configuration file for the PPA, which is |
| 138 | incompatible with Mini-NDN. |
| 139 | |
| 140 | Infoedit |
| 141 | ________ |
| 142 | |
| 143 | Infoedit is used to edit configuration files for NFD and NLSR. |
| 144 | To 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 | |
| 153 | Verification |
| 154 | ------------ |
| 155 | |
| 156 | You can execute the following example to bring up the Mini-NDN command line |
| 157 | with NFD and NLSR running on each node: |
| 158 | |
| 159 | :: |
| 160 | |
| 161 | sudo python examples/mnndn.py |
| 162 | |
| 163 | You can use these steps to run the sample pingall experiment: |
| 164 | |
| 165 | 1. Issue the command: ``sudo python examples/nlsr/pingall.py`` |
| 166 | 2. 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. |
| 169 | 3. Issue the command: |
| 170 | ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 171 | report a count of 50. |
| 172 | 4. Issue the command: |
| 173 | ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 174 | report a count of 0. |