Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 1 | Install |
| 2 | ======= |
| 3 | |
| 4 | Prerequisites |
| 5 | ------------- |
| 6 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 7 | Mini-NDN is officially supported on the following Linux distributions: |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 8 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 9 | - Ubuntu 20.04 |
| 10 | - Ubuntu 22.04 (recommended) |
| 11 | - Ubuntu 24.04 |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 12 | - Debian 11 (WiFi scenario does not work) |
| 13 | - Fedora 33 (WiFi scenario does not work) |
| 14 | |
| 15 | You must have sudo privileges to install and run Mini-NDN. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 16 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 17 | Using Docker |
| 18 | ------------ |
| 19 | |
| 20 | You can use the nightly build from GitHub package registry |
| 21 | :: |
| 22 | docker run -m 4g --cpus=4 -it --privileged \ |
| 23 | -v /lib/modules:/lib/modules \ |
| 24 | ghcr.io/named-data/mini-ndn:master bash |
| 25 | |
| 26 | NOTE: This nightly build is only currently supported for x86_64. ARM64 support |
| 27 | (i.e. Apple silicon Macs) will be added in the future. |
| 28 | |
| 29 | Building your own Docker image |
| 30 | ------------------------------ |
| 31 | |
| 32 | The provided Dockerfile can be used to build an image from scratch. To build with the Dockerfile: |
| 33 | - Clone the repository and type:: |
| 34 | |
| 35 | docker build -t minindn . |
| 36 | |
| 37 | - You can then access the container through shell with:: |
| 38 | |
| 39 | docker run -m 4g --cpus=4 -it --privileged \ |
| 40 | -v /lib/modules:/lib/modules \ |
| 41 | minindn bin/bash |
| 42 | |
| 43 | Additional recommendations |
| 44 | -------------------------- |
| 45 | - It is recommended to set reasonable constraints on memory (`-m`) and CPU cores (`--cpus`), especially on less |
| 46 | powerful or non-dedicated systems. |
| 47 | - `--privileged` is mandatory for underlying `Mininet <http://mininet.org/>`_ to utilize the virtual switch |
| 48 | - The root directory on `run` is `/mini-ndn`, which contains the installation and examples. |
| 49 | - The GUI may not work for now due to docker and xterm setup issues and is independent from Mini-NDN. |
| 50 | If you intend to run the GUI, pass `-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix` to the `docker run` command. |
| 51 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 52 | Using Vagrantfile |
| 53 | ----------------- |
| 54 | |
| 55 | With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine |
| 56 | and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count |
| 57 | (default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN |
| 58 | 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. |
| 59 | |
| 60 | Using install.sh |
| 61 | ---------------- |
| 62 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 63 | Mini-NDN has the following dependencies: |
| 64 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 65 | - `NDN Forwarding Daemon (NFD) <https://docs.named-data.net/NFD/current/>`_ |
| 66 | - `Named Data Link State Routing (NLSR) <https://docs.named-data.net/NLSR/current/>`_ |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 67 | - `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_ |
| 68 | - `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_ |
| 69 | - `infoedit <https://github.com/NDN-Routing/infoedit>`_ |
| 70 | - `Mininet <http://mininet.org/>`_ |
| 71 | - `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional) |
| 72 | |
| 73 | To install Mini-NDN and its dependencies, clone this repository and run: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 74 | |
| 75 | :: |
| 76 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 77 | ./install.sh |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 78 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 79 | The script accepts various command line flags. |
| 80 | Some notable flags are: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 81 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 82 | - ``-y`` skips interactive confirmation before installation. |
| 83 | - ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_. |
| 84 | This shortens installation time by downloading binary packages, but is only available on Ubuntu. |
| 85 | - ``--source`` prefers installing NDN software from source code. |
awlane | eda7e07 | 2024-10-27 15:52:35 -0500 | [diff] [blame] | 86 | - ``--use-existing`` will only install dependencies not already in the executable path. |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 87 | - ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead |
| 88 | and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly |
| 89 | faster after applying this patch. However, your experiments cannot use any NDN security related |
| 90 | features (signatures, verifier, access control, etc). |
| 91 | - ``--no-wifi`` skips Mininet-WiFi dependency. |
| 92 | 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] | 93 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 94 | You can see all command line flags by running: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 95 | |
| 96 | :: |
| 97 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 98 | ./install.sh -h |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 99 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 100 | The script uses ``setup.py develop`` to point the system install of Python packages to the codebase |
| 101 | directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the |
| 102 | changes will be reflected immediately. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 103 | |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 104 | If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory |
| 105 | under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and |
| 106 | reinstall the software (``./waf && sudo ./waf install``). |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 107 | |
dulalsaurab | 8c8e633 | 2021-05-21 20:37:03 +0000 | [diff] [blame] | 108 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 109 | Installing Dependencies |
| 110 | ----------------------- |
| 111 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 112 | This section outlines how to install dependencies manually. |
Junxiao Shi | 48ada89 | 2021-11-04 09:02:21 -0600 | [diff] [blame] | 113 | If you used ``install.sh``, you do not need to perform these steps. |
| 114 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 115 | Mininet |
| 116 | _______ |
| 117 | |
| 118 | Mini-NDN is based on Mininet. To install Mininet: |
| 119 | |
| 120 | :: |
| 121 | |
| 122 | git clone --depth 1 https://github.com/mininet/mininet.git |
| 123 | |
| 124 | After Mininet source is on your system, run the following command to |
| 125 | install Mininet core dependencies and Open vSwitch: |
| 126 | |
| 127 | :: |
| 128 | |
| 129 | ./util/install.sh -nv |
| 130 | |
| 131 | To check if Mininet is working correctly, run this test: |
| 132 | |
| 133 | :: |
| 134 | |
| 135 | sudo mn --test pingall |
| 136 | |
| 137 | This will print out a series of statements that show the test setup and |
| 138 | the results of the test. Look for ``Results:`` two-thirds of the way |
| 139 | down where it will indicate the percentage of dropped packets. Your |
| 140 | results should show "0% dropped (2/2 received)". |
| 141 | |
| 142 | NOTE: Mini-NDN, while providing a high level of emulation of hosts, |
| 143 | requires programs to be installed onto your computer. It will not work |
| 144 | if they are not installed. If you do not want NDN software installed |
| 145 | onto your computer, you can use a virtual machine, which can be quite |
| 146 | simply set up with the provided Vagrantfile. |
| 147 | |
| 148 | NDN dependencies |
| 149 | ________________ |
| 150 | |
| 151 | Each node in Mini-NDN will run the official implementation of NDN |
| 152 | installed on your system. The following dependencies are needed: |
| 153 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 154 | Mini-NDN uses ndn-cxx, NFD, NLSR, and ndn-tools. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 155 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 156 | - To install ndn-cxx: https://docs.named-data.net/ndn-cxx/current/INSTALL.html |
| 157 | - To install NFD: https://docs.named-data.net/NFD/current/INSTALL.html |
| 158 | - To install NLSR: https://docs.named-data.net/NLSR/current/INSTALL.html |
| 159 | - To install ndn-tools: https://github.com/named-data/ndn-tools/blob/master/INSTALL.md |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 160 | |
| 161 | .. warning:: |
| 162 | Please do not try to install NDN software from both the source (GitHub) and PPA (apt). |
| 163 | It will not work in most cases! If you used ./install.sh -a in the past but now want |
| 164 | to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding |
| 165 | with apt. Similarly, remove from apt if switching to source. |
| 166 | |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame^] | 167 | In cases where using NDN security is not important to the results, it is recommended |
| 168 | to use the dummy keychain patch for ndn-cxx to disable it for improved scalability. |
| 169 | This patch is located at `util/patches/ndn-cxx-dummy-keychain.patch.` |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 170 | |
| 171 | Note that all three of these can be installed from the Named Data PPA. |
| 172 | Instructions for setting it up can be found in the NFD installation |
| 173 | instructions. Note that PPA and installs from source **cannot** be |
| 174 | mixed. You must completely remove PPA installs from the system if switching |
| 175 | to source and vice-versa. |
| 176 | |
| 177 | For PPA installs, if you are using a custom nfd.conf file in an experiment, you should |
| 178 | place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid |
| 179 | a bug from the default configuration file for the PPA, which is |
| 180 | incompatible with Mini-NDN. |
| 181 | |
| 182 | Infoedit |
| 183 | ________ |
| 184 | |
| 185 | Infoedit is used to edit configuration files for NFD and NLSR. |
| 186 | To install infoedit: |
| 187 | |
| 188 | :: |
| 189 | |
| 190 | git clone --depth 1 https://github.com/NDN-Routing/infoedit |
| 191 | cd infoedit |
| 192 | make |
| 193 | sudo make install |
| 194 | |
| 195 | Verification |
| 196 | ------------ |
| 197 | |
| 198 | You can execute the following example to bring up the Mini-NDN command line |
| 199 | with NFD and NLSR running on each node: |
| 200 | |
| 201 | :: |
| 202 | |
| 203 | sudo python examples/mnndn.py |
| 204 | |
| 205 | You can use these steps to run the sample pingall experiment: |
| 206 | |
| 207 | 1. Issue the command: ``sudo python examples/nlsr/pingall.py`` |
| 208 | 2. When the ``mini-ndn>`` CLI prompt appears, the experiment has |
| 209 | finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the |
| 210 | experiment. |
| 211 | 3. Issue the command: |
| 212 | ``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 213 | report a count of 50. |
| 214 | 4. Issue the command: |
| 215 | ``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should |
| 216 | report a count of 0. |
awlane | 022b2bf | 2024-08-28 19:22:46 -0500 | [diff] [blame] | 217 | |
| 218 | |
| 219 | Release Versions |
| 220 | ---------------- |
| 221 | |
| 222 | We provide a set of shortcuts to install major release versions of NDN |
| 223 | dependencies from source. |
| 224 | |
| 225 | You can install the most recent release using: |
| 226 | |
| 227 | :: |
| 228 | |
| 229 | ./install.sh --source --release=current |
| 230 | |
| 231 | You can also select a specified release using: |
| 232 | |
| 233 | :: |
| 234 | |
| 235 | ./install.sh --source --release=[chosen version] |
| 236 | |
| 237 | |
| 238 | Currently, the compatible versions include: |
| 239 | |
| 240 | - ``2024-08``: ndn-cxx 0.9.0, NFD 24.07, NLSR 24.08, PSync 0.5.0, |
| 241 | ndn-tools 24.07, and compatible versions of ndn-traffic-generator |
| 242 | and infoedit. |