Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 1 | Getting started with NFD |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 2 | ======================== |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 4 | Supported platforms |
| 5 | ------------------- |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 6 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 7 | NFD is built against a continuous integration system and has been tested on the |
| 8 | following platforms: |
| 9 | |
Davide Pesavento | c5e3e7a | 2023-03-07 21:25:27 -0500 | [diff] [blame] | 10 | - Ubuntu 22.04 (jammy) |
Davide Pesavento | 4b7cffb | 2024-06-07 17:35:53 -0400 | [diff] [blame] | 11 | - Ubuntu 24.04 (noble) |
Davide Pesavento | c5e3e7a | 2023-03-07 21:25:27 -0500 | [diff] [blame] | 12 | - Debian 11 (bullseye) |
Davide Pesavento | 05bd6c2 | 2023-10-31 21:45:25 -0400 | [diff] [blame] | 13 | - Debian 12 (bookworm) |
Davide Pesavento | e541d1b | 2022-08-17 15:10:32 -0400 | [diff] [blame] | 14 | - CentOS Stream 9 |
Davide Pesavento | 2073dce | 2024-12-10 21:24:41 -0500 | [diff] [blame^] | 15 | - macOS 13 / 14 / 15 |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 16 | |
Davide Pesavento | c5e3e7a | 2023-03-07 21:25:27 -0500 | [diff] [blame] | 17 | NFD should also work on the following platforms, although they are not officially |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 18 | supported: |
| 19 | |
Davide Pesavento | c5e3e7a | 2023-03-07 21:25:27 -0500 | [diff] [blame] | 20 | - Any other recent version of Ubuntu not listed above |
Davide Pesavento | 2073dce | 2024-12-10 21:24:41 -0500 | [diff] [blame^] | 21 | - Fedora >= 34 |
| 22 | - Alpine >= 3.14 |
Davide Pesavento | 05bd6c2 | 2023-10-31 21:45:25 -0400 | [diff] [blame] | 23 | - Any version of Raspberry Pi OS based on Debian 11 (bullseye) or later |
Davide Pesavento | 2073dce | 2024-12-10 21:24:41 -0500 | [diff] [blame^] | 24 | - macOS >= 11 |
Davide Pesavento | 6d6f207 | 2022-09-12 23:08:34 -0400 | [diff] [blame] | 25 | - FreeBSD >= 12.2 |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 26 | |
| 27 | .. _Install NFD on Ubuntu Linux using the NDN PPA repository: |
| 28 | |
| 29 | Install NFD on Ubuntu Linux using the NDN PPA repository |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 30 | -------------------------------------------------------- |
| 31 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 32 | NFD binaries and related tools for supported versions of Ubuntu can be installed using |
| 33 | PPA packages from the **named-data** repository. First, you will need to add the |
| 34 | ``named-data/ppa`` repository to the binary package sources and update the list of |
| 35 | available packages. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 36 | |
Alexander Afanasyev | 84dd4ca | 2017-10-15 14:56:08 -0400 | [diff] [blame] | 37 | Preliminary steps if you have not used PPA packages before |
| 38 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 39 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 40 | To simplify adding new PPA repositories, Ubuntu provides the ``add-apt-repository`` tool, |
Davide Pesavento | cc7bee7 | 2016-04-22 02:21:13 +0200 | [diff] [blame] | 41 | which is not installed by default on some systems. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 42 | |
| 43 | :: |
| 44 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 45 | sudo apt install software-properties-common |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 46 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 47 | Adding the NDN PPA |
| 48 | ~~~~~~~~~~~~~~~~~~ |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 49 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 50 | After installing ``add-apt-repository``, run the following commands to add the `NDN PPA |
| 51 | repository`_:: |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 52 | |
| 53 | sudo add-apt-repository ppa:named-data/ppa |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 54 | sudo apt update |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 55 | |
| 56 | Installing NFD and other NDN packages |
| 57 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 58 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 59 | After you have added the `NDN PPA repository`_, NFD and other NDN packages can be easily |
| 60 | installed either using ``apt``, as shown below, or any other compatible package manager. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 61 | |
| 62 | :: |
| 63 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 64 | sudo apt install nfd |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 65 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 66 | For the list of available packages, refer to the `NDN PPA repository`_ page. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 67 | |
| 68 | .. _NDN PPA repository: https://launchpad.net/~named-data/+archive/ppa |
| 69 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 70 | Building from source |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 71 | -------------------- |
| 72 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 73 | Downloading from git |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 74 | ~~~~~~~~~~~~~~~~~~~~ |
| 75 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 76 | The first step is to obtain the source code for NFD and its main dependency, the |
| 77 | *ndn-cxx* library. If you do not want a development version of NFD, make sure you |
Davide Pesavento | 3bc8e19 | 2022-12-31 01:40:11 -0500 | [diff] [blame] | 78 | checkout the correct release tag (e.g., ``*-0.8.1``) from both repositories. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 79 | |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 80 | .. code-block:: sh |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 81 | |
| 82 | # Download ndn-cxx |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 83 | git clone https://github.com/named-data/ndn-cxx.git |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 84 | |
| 85 | # Download NFD |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 86 | git clone --recursive https://github.com/named-data/NFD.git |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 87 | |
Alexander Afanasyev | 84dd4ca | 2017-10-15 14:56:08 -0400 | [diff] [blame] | 88 | .. note:: |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 89 | While we strive to ensure that the latest version (git master branch) of NFD and ndn-cxx |
| 90 | always compiles and works properly, we cannot guarantee that there will be no issues. |
| 91 | If this is discovered to be the case, please use matching released versions (git tag or |
| 92 | tarball) of NFD and ndn-cxx instead. |
Alexander Afanasyev | 84dd4ca | 2017-10-15 14:56:08 -0400 | [diff] [blame] | 93 | |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 94 | Prerequisites |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 95 | ~~~~~~~~~~~~~ |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 96 | |
Davide Pesavento | bf4c131 | 2023-02-23 20:32:01 -0500 | [diff] [blame] | 97 | Install the `ndn-cxx library <https://docs.named-data.net/ndn-cxx/current/INSTALL.html>`__ |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 98 | and its prerequisites. |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 99 | |
Davide Pesavento | 914eb28 | 2024-12-10 15:33:26 -0500 | [diff] [blame] | 100 | On Linux, NFD needs the following *optional* dependencies to enable additional features: |
Junxiao Shi | e5e1e25 | 2014-12-13 22:07:35 -0700 | [diff] [blame] | 101 | |
Davide Pesavento | e541d1b | 2022-08-17 15:10:32 -0400 | [diff] [blame] | 102 | - On **Debian** and **Ubuntu**: |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 103 | |
| 104 | .. code-block:: sh |
Junxiao Shi | e5e1e25 | 2014-12-13 22:07:35 -0700 | [diff] [blame] | 105 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 106 | sudo apt install libpcap-dev libsystemd-dev |
| 107 | |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 108 | - On **CentOS** and **Fedora**: |
| 109 | |
| 110 | .. code-block:: sh |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 111 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 112 | sudo dnf install libpcap-devel systemd-devel |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 113 | |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 114 | Build |
| 115 | ~~~~~ |
| 116 | |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 117 | The following commands can be used to build and install NFD from source: |
| 118 | |
| 119 | .. code-block:: sh |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 120 | |
Davide Pesavento | 2150da8 | 2022-07-08 18:18:51 -0400 | [diff] [blame] | 121 | ./waf configure |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 122 | ./waf |
| 123 | sudo ./waf install |
| 124 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 125 | If you have installed ndn-cxx and/or any other dependencies into a non-standard path, |
| 126 | you may need to modify the ``PKG_CONFIG_PATH`` environment variable before running |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 127 | ``./waf configure``. For example: |
| 128 | |
| 129 | .. code-block:: sh |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 130 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 131 | export PKG_CONFIG_PATH="/custom/lib/pkgconfig:$PKG_CONFIG_PATH" |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 132 | ./waf configure |
| 133 | ./waf |
| 134 | sudo ./waf install |
| 135 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 136 | Refer to ``./waf --help`` for more options that can be used during the ``configure`` stage. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 137 | |
Alexander Afanasyev | 508411e | 2014-12-16 13:27:59 -0800 | [diff] [blame] | 138 | .. note:: |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 139 | If you are working on a source repository that has been compiled before, and you have |
| 140 | upgraded one of the dependencies, please execute ``./waf distclean`` to clear object files |
| 141 | and start over. |
Alexander Afanasyev | 508411e | 2014-12-16 13:27:59 -0800 | [diff] [blame] | 142 | |
Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 143 | Debug symbols |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 144 | ~~~~~~~~~~~~~ |
Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 145 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 146 | The default compiler flags include debug symbols in binaries. This should provide |
| 147 | more meaningful debugging information if NFD or other tools happen to crash. |
Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 148 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 149 | If this is not desired, the default flags can be overridden to disable debug symbols. |
| 150 | The following example shows how to completely disable debug symbols and configure |
| 151 | NFD to be installed into ``/usr`` with configuration in the ``/etc`` directory. |
Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 152 | |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 153 | .. code-block:: sh |
Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 154 | |
| 155 | CXXFLAGS="-O2" ./waf configure --prefix=/usr --sysconfdir=/etc |
| 156 | ./waf |
| 157 | sudo ./waf install |
| 158 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 159 | For Ubuntu PPA packages, debug symbols are available in ``*-dbg`` packages. |
Alexander Afanasyev | 84dd4ca | 2017-10-15 14:56:08 -0400 | [diff] [blame] | 160 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 161 | Customizing the compiler |
| 162 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
Alexander Afanasyev | 7c10b3b | 2015-01-20 12:24:27 -0800 | [diff] [blame] | 163 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 164 | To build NFD with a different compiler (rather than the platform default), set the |
| 165 | ``CXX`` environment variable to point to the compiler binary. For example, to build |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 166 | with clang on Linux, use the following: |
| 167 | |
| 168 | .. code-block:: sh |
Alexander Afanasyev | 7c10b3b | 2015-01-20 12:24:27 -0800 | [diff] [blame] | 169 | |
Eric Newberry | 81a9a86 | 2016-12-27 22:59:27 -0700 | [diff] [blame] | 170 | CXX=clang++ ./waf configure |
Alexander Afanasyev | 7c10b3b | 2015-01-20 12:24:27 -0800 | [diff] [blame] | 171 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 172 | Building the documentation |
| 173 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 174 | |
Davide Pesavento | 9f6a7d9 | 2020-10-06 15:21:48 -0400 | [diff] [blame] | 175 | Tutorials and API documentation can be built using the following commands: |
| 176 | |
| 177 | .. code-block:: sh |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 178 | |
| 179 | # Full set of documentation (tutorials + API) in build/docs |
| 180 | ./waf docs |
| 181 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 182 | # Only tutorials in build/docs |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 183 | ./waf sphinx |
| 184 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 185 | # Only API docs in build/docs/doxygen |
| 186 | ./waf doxygen |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 187 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 188 | If ``sphinx-build`` is detected during ``./waf configure``, manpages will automatically |
| 189 | be built and installed during the normal build process (i.e., during ``./waf`` and |
| 190 | ``./waf install``). By default, manpages will be installed into ``${PREFIX}/share/man`` |
| 191 | (the default value for ``PREFIX`` is ``/usr/local``). This location can be changed |
| 192 | during the ``./waf configure`` stage using the ``--prefix``, ``--datarootdir``, or |
| 193 | ``--mandir`` options. |
Alexander Afanasyev | 284257b | 2014-04-11 14:16:51 -0700 | [diff] [blame] | 194 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 195 | For further details, please refer to ``./waf --help``. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 196 | |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 197 | Initial configuration |
| 198 | --------------------- |
| 199 | |
| 200 | .. note:: |
| 201 | If you have installed NFD from binary packages, the package manager has already |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 202 | installed a working configuration and you can safely skip this section. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 203 | |
| 204 | General |
| 205 | ~~~~~~~ |
| 206 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 207 | After installing NFD from source, you need to create a proper configuration file. |
| 208 | If the default installation directories were used with ``./waf configure``, this |
| 209 | can be accomplished by simply copying the sample configuration file as follows:: |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 210 | |
| 211 | sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf |
| 212 | |
| 213 | NFD Security |
| 214 | ~~~~~~~~~~~~ |
| 215 | |
| 216 | NFD provides mechanisms to enable strict authorization for all management commands. In |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 217 | particular, one can authorize only specific public keys to create new faces or change the |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 218 | forwarding strategy for specific namespaces. For more information about how to generate |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 219 | public/private key pairs, generate self-signed certificates, and use them to authorize |
| 220 | NFD management commands, refer to the :ref:`How do I configure NFD security` FAQ question. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 221 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 222 | In the sample configuration file, all security mechanisms are disabled for local clients, |
| 223 | effectively allowing anybody on the local machine to issue NFD management commands. |
| 224 | |
| 225 | .. note:: |
| 226 | The sample configuration file is intended only for demo purposes and should NOT be |
| 227 | used in production environments. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 228 | |
| 229 | Running |
| 230 | ------- |
| 231 | |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 232 | Starting |
| 233 | ~~~~~~~~ |
| 234 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 235 | If you have installed NFD from source, it is recommended to start NFD with the |
| 236 | ``nfd-start`` script:: |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 237 | |
| 238 | nfd-start |
| 239 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 240 | On macOS, this command may ask for your keychain password or ask "nfd wants to sign using |
| 241 | key [xyz] in your keychain". Enter your keychain password and click "Always Allow". |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 242 | |
| 243 | Later, you can stop NFD with ``nfd-stop`` or by simply killing the ``nfd`` process. |
| 244 | |
Davide Pesavento | 2849fd4 | 2019-01-03 18:30:05 -0500 | [diff] [blame] | 245 | If you have installed NFD using a package manager, you can start and stop NFD using the |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 246 | operating system's service manager, such as ``systemctl`` or ``launchctl``. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 247 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 248 | Connecting to remote forwarders |
| 249 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 250 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 251 | To create a UDP tunnel to a remote instance of NFD, execute the following command |
| 252 | in a terminal:: |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 253 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 254 | nfdc face create udp://<other-host> |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 255 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 256 | where ``<other-host>`` is the name or IP address of the other host (e.g., |
| 257 | ``udp://ndn.example.net``). If successful, this will print something like:: |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 258 | |
Junxiao Shi | 849e12a | 2017-08-02 00:14:57 +0000 | [diff] [blame] | 259 | face-created id=308 local=udp4://10.0.2.15:6363 remote=udp4://131.179.196.46:6363 persistency=persistent |
| 260 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 261 | To add a route ``/ndn`` toward this remote forwarder, execute the following command |
| 262 | in a terminal:: |
Junxiao Shi | 849e12a | 2017-08-02 00:14:57 +0000 | [diff] [blame] | 263 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 264 | nfdc route add /ndn udp://<other-host> |
Junxiao Shi | 849e12a | 2017-08-02 00:14:57 +0000 | [diff] [blame] | 265 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 266 | This will print:: |
Junxiao Shi | 849e12a | 2017-08-02 00:14:57 +0000 | [diff] [blame] | 267 | |
| 268 | route-add-accepted prefix=/ndn nexthop=308 origin=static cost=0 flags=child-inherit expires=never |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 269 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 270 | This indicates that NFD will forward all Interests that start with ``/ndn`` through the |
| 271 | face to the other host. This forwards Interests to the other host, but does not provide |
| 272 | a "back route" for the other host to forward Interests to you. For this, you can rely on |
| 273 | the "automatic prefix propagation" feature of NFD or use the ``nfdc`` command on the other |
| 274 | host to add the route. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 275 | |
| 276 | Playing with NFD |
| 277 | ---------------- |
| 278 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 279 | After you have installed, configured, and started NFD, you can demonstrate the features |
| 280 | of NDN using the following applications and libraries. |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 281 | |
| 282 | Sample applications: |
| 283 | |
Davide Pesavento | bf4c131 | 2023-02-23 20:32:01 -0500 | [diff] [blame] | 284 | + `Simple examples using the ndn-cxx library <https://docs.named-data.net/ndn-cxx/current/examples.html>`__ |
Davide Pesavento | 3bc8e19 | 2022-12-31 01:40:11 -0500 | [diff] [blame] | 285 | + `Simple examples using the python-ndn library <https://python-ndn.readthedocs.io/en/latest/src/examples/basic_app.html>`__ |
Steve DiBenedetto | 62a9394 | 2014-08-24 17:13:52 -0600 | [diff] [blame] | 286 | |
| 287 | Real applications and libraries: |
| 288 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 289 | + `ndn-tools - Essential NDN command-line tools <https://github.com/named-data/ndn-tools>`__ |
Davide Pesavento | 3bc8e19 | 2022-12-31 01:40:11 -0500 | [diff] [blame] | 290 | + `ndn-traffic-generator - Simple traffic generator for NDN <https://github.com/named-data/ndn-traffic-generator>`__ |
| 291 | + `ndn-svs - State Vector Sync library <https://github.com/named-data/ndn-svs>`__ |
| 292 | + `PSync - Partial and full Sync library <https://github.com/named-data/PSync>`__ |