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