blob: 57d0d57cfe30046061997abe220fb3cc6c3ef781 [file] [log] [blame]
Alexander Afanasyev26181532014-05-07 23:38:51 -07001Getting Started with NFD
2========================
3
4A 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
12Installing
13----------
14
15From source
16~~~~~~~~~~~
17
18To install NFD from source:
19
20- install ``ndn-cxx`` according to `ndn-cxx installation
Alexander Afanasyev84e29772014-07-02 15:24:31 -070021 instructions <http://named-data.net/doc/ndn-cxx/0.2.0/INSTALL.html>`__
Alexander Afanasyev26181532014-05-07 23:38:51 -070022- install ``NFD`` according to :doc:`these
23 instructions <INSTALL>`
24
25If downloading code using git, don't forget to checkout the correct
26branch for both ``ndn-cxx`` and ``NFD``
27
28::
29
30 git clone https://github.com/named-data/ndn-cxx
31 cd ndn-cxx
Alexander Afanasyev84e29772014-07-02 15:24:31 -070032 git checkout ndn-cxx-0.2.0
Alexander Afanasyev26181532014-05-07 23:38:51 -070033 ...
34 # continue with ndn-cxx installation instructions
35
Alexander Afanasyev84e29772014-07-02 15:24:31 -070036 git clone --recursive https://github.com/named-data/NFD
Alexander Afanasyev26181532014-05-07 23:38:51 -070037 cd NFD
Alexander Afanasyev84e29772014-07-02 15:24:31 -070038 git checkout NFD-0.2.0
Alexander Afanasyev26181532014-05-07 23:38:51 -070039 ...
40 # continue with NFD installation instructions
41
42From binaries
43~~~~~~~~~~~~~
44
45On OSX, NFD can be installed with MacPorts. Refer to :ref:`How to start using NDN
46MacPorts repository on OSX` FAQ question for more details.
47
48On 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
52Initial 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
59General
60~~~~~~~
61
62After installing NFD from source, you need to create a proper config file. If default
63location for ``./waf configure`` was used, this can be accomplished by simply copying the
64sample configuration file:
65
66::
67
68 sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
69
70NFD Security
71~~~~~~~~~~~~
72
73NFD provides mechanisms to enable strict authorization for all management commands. In
74particular, one can authorize only specific public keys to create new Faces or change the
75forwarding strategy for specific namespaces. For more information about how to generate
76private/public key pair, generate self-signed certificate, and use this self-signed
77certificate to authorize NFD management commands refer to :ref:`How to configure NFD
78security` FAQ question.
79
80In the sample configuration file, all authorizations are disabled, effectively allowing
81anybody on the local machine to issue NFD management commands. **The sample file is
82intended only for demo purposes and MUST NOT be used in a production environment.**
83
84Running
85-------
86
87**You should not run ndnd or ndnd-tlv, otherwise NFD will not work
88correctly**
89
90Starting
91~~~~~~~~
92
93In order to use NFD, you need to start two separate daemons: ``nfd`` (the forwarder
94itself) and ``nrd`` (RIB manager that will manage all prefix registrations). The
95recommended way is to use `nfd-start` script:
96
97::
98
99 nfd-start
100
101On OS X it may ask for your keychain password or ask ``nfd/nrd wants to sign using key in
102your keychain.`` Enter your keychain password and click Always Allow.
103
104Later, you can stop NFD with ``nfd-stop`` or by simply killing the ``nfd`` process.
105
106
107
108Connecting to remote NFDs
109~~~~~~~~~~~~~~~~~~~~~~~~~
110
111To create a UDP or TCP tunnel to remote NFD and create route toward it,
112use the following command in terminal:
113
114::
115
116 nfdc register /ndn udp://<other host>
117
118where ``<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
125The ``/ndn`` means that NFD will forward all Interests that start with ``/ndn`` through
126the face to the other host. If you only want to forward Interests with a certain prefix,
127use it instead of ``/ndn``. This only forwards Interests to the other host, but there is
128no "back route" for the other host to forward Interests to you. For that, you must go to
129the other host and use ``nfdc`` to add the route.
130
131The "back route" can also be automatically configured with ``nfd-autoreg``. For more
132information refer to `nfd-autoreg manpage
133<http://named-data.net/doc/NFD/current/manpages/nfd-autoreg.html>`_.
134
135Playing with NFD
136----------------
137
138After you installed, configured, and started NFD, you can try to install
139and play with the following:
140
141Sample applications:
142
143- `Simple examples in ndn-cxx
Alexander Afanasyev84e29772014-07-02 15:24:31 -0700144 library <http://named-data.net/doc/ndn-cxx/0.2.0/examples.html>`__.
Alexander Afanasyev26181532014-05-07 23:38:51 -0700145 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
158Real 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>`__