blob: f4fbc20c030acae51d2ec5dae51b926e995835b4 [file] [log] [blame]
hilata6ee6e072014-04-20 17:10:18 -05001.. _ndn-autoconfig:
2
Alexander Afanasyev49272f72014-04-06 21:49:46 -07003ndn-autoconfig
4==============
5
hilata6ee6e072014-04-20 17:10:18 -05006Usage
7-----
Alexander Afanasyev49272f72014-04-06 21:49:46 -07008
9::
10
Alexander Afanasyev5c475972015-12-20 16:16:56 -080011 ndn-autoconfig [options]
Alexander Afanasyev49272f72014-04-06 21:49:46 -070012
hilata6ee6e072014-04-20 17:10:18 -050013Description
14-----------
15
16Client tool to run :ref:`NDN hub discovery procedure`.
17
Alexander Afanasyev5c475972015-12-20 16:16:56 -080018Options
19-------
20
21``-h`` or ``--help``
22 Print usage information.
23
24``-d`` or ``--daemon``
25 Run ndn-autoconfig in daemon mode, detecting network change events and re-running
26 auto-discovery procedure. In addition, the auto-discovery procedure is unconditionally
27 re-run every hour.
28
29 NOTE: if connection to NFD fails, the daemon will be terminated.
30
31``-c [FILE]`` or ``--config=[FILE]``
32 Use the specified configuration file. If `enabled = true` is not specified in the
33 configuration file, no actions will be performed.
34
35``-V`` or ``--version``
36 Print version information.
37
hilata6ee6e072014-04-20 17:10:18 -050038.. _NDN hub discovery procedure:
Alexander Afanasyev49272f72014-04-06 21:49:46 -070039
40NDN hub discovery procedure
41---------------------------
42
hilata6ee6e072014-04-20 17:10:18 -050043When an end host starts up, or detects a change in its network environment, it MAY use
44this procedure to discover a local or home NDN router, in order to gain connectivity to
45`the NDN research testbed <http://named-data.net/ndn-testbed/>`_.
Alexander Afanasyev49272f72014-04-06 21:49:46 -070046
47Overview
48^^^^^^^^
49
50This procedure contains three methods to discover a NDN router:
51
521. Look for a local NDN router by multicast.
53 This is useful in a home or small office network.
54
552. Look for a local NDN router by DNS query with default suffix.
hilata6ee6e072014-04-20 17:10:18 -050056 This allows network administrator to configure a NDN router in a large enterprise network.
Alexander Afanasyev49272f72014-04-06 21:49:46 -070057
583. Connect to the home NDN router according to user certificate.
59 This ensures connectivity from anywhere.
60
Stumble62b19a62015-08-03 10:17:45 -070061After connecting to an NDN router, two prefixes will be automatically registered:
62
Alexander Afanasyev5c475972015-12-20 16:16:56 -080063- ``/ndn``
64- ``/localhop/nfd`` --- this to inform RIB manager that there is connectivity to the hub
Stumble62b19a62015-08-03 10:17:45 -070065
Alexander Afanasyev49272f72014-04-06 21:49:46 -070066Stage 1: multicast discovery
67^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
69Request
70+++++++
71
72The end host sends an Interest over a multicast face.
73
74Interest Name is ``/localhop/ndn-autoconf/hub``.
75
76Response
77++++++++
78
hilata6ee6e072014-04-20 17:10:18 -050079A producer app on the HUB answer this Interest with a Data packet that contains a
80TLV-encoded `Uri` block. The value of this block is the URI for the HUB, preferrably a
81UDP tunnel.
Alexander Afanasyev49272f72014-04-06 21:49:46 -070082
83Stage 2: DNS query with default suffix
84^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
86Request
87+++++++
88
89The end host sends a DNS query that is equivalent to this command::
90
91 dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv
92
93Response
94++++++++
95
hilata6ee6e072014-04-20 17:10:18 -050096The DNS server should answer with an SRV record that contains the hostname and UDP port
97number of the NDN router.
Alexander Afanasyev49272f72014-04-06 21:49:46 -070098
99Stage 3: find home router
100^^^^^^^^^^^^^^^^^^^^^^^^^
101
hilata6ee6e072014-04-20 17:10:18 -0500102This stage assumes that user has configured default certificate using
103`<http://ndncert.named-data.net/>`_ as described in `Certification Architecture
104<http://redmine.named-data.net/attachments/download/23/CertificationArchitecture.pptx>`_.
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700105
106Request
107+++++++
108
hilata6ee6e072014-04-20 17:10:18 -0500109The end host loads the default user identity (eg. ``/ndn/edu/ucla/cs/afanasev``), and
110converts it to DNS format.
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700111
hilata6ee6e072014-04-20 17:10:18 -0500112The end host sends a DNS query for an SRV record of name ``_ndn._udp.`` + user identity in
113DNS format + ``_homehub._autoconf.named-data.net``. For example::
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700114
115 _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net
116
117Response
118++++++++
119
hilata6ee6e072014-04-20 17:10:18 -0500120The DNS server should answer with an SRV record that contains the hostname and UDP port
121number of the home NDN router of this user's site.
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700122
123Client procedure
124----------------
125
126Stage 1
127^^^^^^^
128
129Send a multicast discovery Interest.
130
131If this Interest is answered, connect to the HUB and terminate auto-discovery.
132
133Stage 2
134^^^^^^^
135
136Send a DNS query with default suffix.
137
138If this query is answered, connect to the HUB and terminate auto-discovery.
139
140Stage 3
141^^^^^^^
142
hilata6ee6e072014-04-20 17:10:18 -0500143* Load default user identity, and convert it to DNS format; if either fails, the
144 auto-discovery fails.
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700145
146* Send a DNS query to find home HUB.
hilata6ee6e072014-04-20 17:10:18 -0500147 If this query is answered, connect to the home HUB and terminate auto-discovery.
148 Otherwise, the auto-discovery fails.
149
150
151See also
152--------
153
Alexander Afanasyev5c475972015-12-20 16:16:56 -0800154:ref:`ndn-autoconfig-server`, :doc:`ndn-autoconfig.conf`