Alexander Afanasyev | 2618153 | 2014-05-07 23:38:51 -0700 | [diff] [blame] | 1 | Getting Started with NFD |
| 2 | ======================== |
| 3 | |
| 4 | A more recent version of this document may be available on `NFD Wiki |
| 5 | <http://redmine.named-data.net/projects/nfd/wiki/Getting_Started>`_. |
| 6 | |
| 7 | .. toctree:: |
| 8 | :maxdepth: 2 |
| 9 | |
| 10 | INSTALL |
| 11 | |
| 12 | Installing |
| 13 | ---------- |
| 14 | |
| 15 | From source |
| 16 | ~~~~~~~~~~~ |
| 17 | |
| 18 | To install NFD from source: |
| 19 | |
| 20 | - install ``ndn-cxx`` according to `ndn-cxx installation |
| 21 | instructions <http://named-data.net/doc/ndn-cxx/0.1.0/INSTALL.html>`__ |
| 22 | - install ``NFD`` according to :doc:`these |
| 23 | instructions <INSTALL>` |
| 24 | |
| 25 | If downloading code using git, don't forget to checkout the correct |
| 26 | branch for both ``ndn-cxx`` and ``NFD`` |
| 27 | |
| 28 | :: |
| 29 | |
| 30 | git clone https://github.com/named-data/ndn-cxx |
| 31 | cd ndn-cxx |
| 32 | git checkout ndn-cxx-0.1.0 |
| 33 | ... |
| 34 | # continue with ndn-cxx installation instructions |
| 35 | |
| 36 | git clone https://github.com/named-data/NFD |
| 37 | cd NFD |
| 38 | git checkout NFD-0.1.0 |
| 39 | ... |
| 40 | # continue with NFD installation instructions |
| 41 | |
| 42 | From binaries |
| 43 | ~~~~~~~~~~~~~ |
| 44 | |
| 45 | On OSX, NFD can be installed with MacPorts. Refer to :ref:`How to start using NDN |
| 46 | MacPorts repository on OSX` FAQ question for more details. |
| 47 | |
| 48 | On Ubuntu 12.04, 13.10, or 14.04, NFD can be installed from NDN PPA repository. Refer to |
| 49 | :ref:`How to start using NDN PPA repository on Ubuntu Linux` FAQ question. |
| 50 | |
| 51 | |
| 52 | Initial configuration |
| 53 | --------------------- |
| 54 | |
| 55 | .. note:: |
| 56 | If you have installed NFD from binary packages, the package manager has already |
| 57 | installed initial configuration and you can safely skip this section. |
| 58 | |
| 59 | General |
| 60 | ~~~~~~~ |
| 61 | |
| 62 | After installing NFD from source, you need to create a proper config file. If default |
| 63 | location for ``./waf configure`` was used, this can be accomplished by simply copying the |
| 64 | sample configuration file: |
| 65 | |
| 66 | :: |
| 67 | |
| 68 | sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf |
| 69 | |
| 70 | NFD Security |
| 71 | ~~~~~~~~~~~~ |
| 72 | |
| 73 | NFD provides mechanisms to enable strict authorization for all management commands. In |
| 74 | particular, one can authorize only specific public keys to create new Faces or change the |
| 75 | forwarding strategy for specific namespaces. For more information about how to generate |
| 76 | private/public key pair, generate self-signed certificate, and use this self-signed |
| 77 | certificate to authorize NFD management commands refer to :ref:`How to configure NFD |
| 78 | security` FAQ question. |
| 79 | |
| 80 | In the sample configuration file, all authorizations are disabled, effectively allowing |
| 81 | anybody on the local machine to issue NFD management commands. **The sample file is |
| 82 | intended only for demo purposes and MUST NOT be used in a production environment.** |
| 83 | |
| 84 | Running |
| 85 | ------- |
| 86 | |
| 87 | **You should not run ndnd or ndnd-tlv, otherwise NFD will not work |
| 88 | correctly** |
| 89 | |
| 90 | Starting |
| 91 | ~~~~~~~~ |
| 92 | |
| 93 | In order to use NFD, you need to start two separate daemons: ``nfd`` (the forwarder |
| 94 | itself) and ``nrd`` (RIB manager that will manage all prefix registrations). The |
| 95 | recommended way is to use `nfd-start` script: |
| 96 | |
| 97 | :: |
| 98 | |
| 99 | nfd-start |
| 100 | |
| 101 | On OS X it may ask for your keychain password or ask ``nfd/nrd wants to sign using key in |
| 102 | your keychain.`` Enter your keychain password and click Always Allow. |
| 103 | |
| 104 | Later, you can stop NFD with ``nfd-stop`` or by simply killing the ``nfd`` process. |
| 105 | |
| 106 | |
| 107 | |
| 108 | Connecting to remote NFDs |
| 109 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 110 | |
| 111 | To create a UDP or TCP tunnel to remote NFD and create route toward it, |
| 112 | use the following command in terminal: |
| 113 | |
| 114 | :: |
| 115 | |
| 116 | nfdc register /ndn udp://<other host> |
| 117 | |
| 118 | where ``<other host>`` is the name or IP address of the other host |
| 119 | (e.g., ``udp://spurs.cs.ucla.edu``). This outputs: |
| 120 | |
| 121 | :: |
| 122 | |
| 123 | Successful in name registration: ControlParameters(Name: /ndn, FaceId: 10, Origin: 0, Cost: 0, Flags: 1, ExpirationPeriod: 3600000 milliseconds, ) |
| 124 | |
| 125 | The ``/ndn`` means that NFD will forward all Interests that start with ``/ndn`` through |
| 126 | the face to the other host. If you only want to forward Interests with a certain prefix, |
| 127 | use it instead of ``/ndn``. This only forwards Interests to the other host, but there is |
| 128 | no "back route" for the other host to forward Interests to you. For that, you must go to |
| 129 | the other host and use ``nfdc`` to add the route. |
| 130 | |
| 131 | The "back route" can also be automatically configured with ``nfd-autoreg``. For more |
| 132 | information refer to `nfd-autoreg manpage |
| 133 | <http://named-data.net/doc/NFD/current/manpages/nfd-autoreg.html>`_. |
| 134 | |
| 135 | Playing with NFD |
| 136 | ---------------- |
| 137 | |
| 138 | After you installed, configured, and started NFD, you can try to install |
| 139 | and play with the following: |
| 140 | |
| 141 | Sample applications: |
| 142 | |
| 143 | - `Simple examples in ndn-cxx |
| 144 | library <http://named-data.net/doc/ndn-cxx/0.1.0/examples.html>`__. |
| 145 | If you have installed ndn-cxx from source, you already have compiled |
| 146 | these: |
| 147 | |
| 148 | + examples/producer |
| 149 | + examples/consumer |
| 150 | + examples/consumer-with-timer |
| 151 | |
| 152 | + tools/ndncatchunks3 |
| 153 | + tools/ndnputchunks3 |
| 154 | |
| 155 | - `Introductory examples of |
| 156 | NDN-CCL <http://redmine.named-data.net/projects/nfd/wiki/Getting_Started_-_Common_Client_Libraries#Install-the-Common-Client-Library>`__ |
| 157 | |
| 158 | Real applications and libraries: |
| 159 | |
| 160 | + `ndn-tlv-ping - Ping Application For |
| 161 | NDN <https://github.com/named-data/ndn-tlv-ping>`__ |
| 162 | + `ndn-traffic-generator - Traffic Generator For |
| 163 | NDN <https://github.com/named-data/ndn-traffic-generator>`__ |
| 164 | + `repo-ng - Next generation of NDN |
| 165 | repository <https://github.com/named-data/repo-ng>`__ |
| 166 | + `ChronoChat - Multi-user NDN chat |
| 167 | application <https://github.com/named-data/ChronoChat>`__ |
| 168 | + `ChronoSync - Sync library for multiuser realtime applications for |
| 169 | NDN <https://github.com/named-data/ChronoSync>`__ |