hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 1 | .. _ndn-autoconfig: |
| 2 | |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 3 | ndn-autoconfig |
| 4 | ============== |
| 5 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 6 | Usage |
| 7 | ----- |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 8 | |
| 9 | :: |
| 10 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 11 | ndn-autoconfig [options] |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 12 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 13 | Description |
| 14 | ----------- |
| 15 | |
| 16 | Client tool to run :ref:`NDN hub discovery procedure`. |
| 17 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 18 | Options |
| 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 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 35 | ``--ndn-fch-url=[URL]`` |
| 36 | Use the specified URL to find the closest hub (NDN-FCH protocol). If not specified, |
| 37 | ``http://ndn-fch.named-data.net`` will be used. Only ``http://`` URLs are supported. |
| 38 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 39 | ``-V`` or ``--version`` |
| 40 | Print version information. |
| 41 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 42 | .. _NDN hub discovery procedure: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 43 | |
| 44 | NDN hub discovery procedure |
| 45 | --------------------------- |
| 46 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 47 | When an end host starts up, or detects a change in its network environment, it MAY use |
| 48 | this procedure to discover a local or home NDN router, in order to gain connectivity to |
| 49 | `the NDN research testbed <http://named-data.net/ndn-testbed/>`_. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 50 | |
| 51 | Overview |
| 52 | ^^^^^^^^ |
| 53 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 54 | This procedure contains four methods to discover a NDN router: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 55 | |
| 56 | 1. Look for a local NDN router by multicast. |
| 57 | This is useful in a home or small office network. |
| 58 | |
| 59 | 2. Look for a local NDN router by DNS query with default suffix. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 60 | This allows network administrator to configure a NDN router in a large enterprise network. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 61 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 62 | 3. Find closest hub by sending an HTTP request to NDN-FCH server. |
| 63 | |
| 64 | 4. Connect to the home NDN router according to user certificate. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 65 | This ensures connectivity from anywhere. |
| 66 | |
Stumble | 62b19a6 | 2015-08-03 10:17:45 -0700 | [diff] [blame] | 67 | After connecting to an NDN router, two prefixes will be automatically registered: |
| 68 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 69 | - ``/ndn`` |
| 70 | - ``/localhop/nfd`` --- this to inform RIB manager that there is connectivity to the hub |
Stumble | 62b19a6 | 2015-08-03 10:17:45 -0700 | [diff] [blame] | 71 | |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 72 | Stage 1: multicast discovery |
| 73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 74 | |
| 75 | Request |
| 76 | +++++++ |
| 77 | |
| 78 | The end host sends an Interest over a multicast face. |
| 79 | |
| 80 | Interest Name is ``/localhop/ndn-autoconf/hub``. |
| 81 | |
| 82 | Response |
| 83 | ++++++++ |
| 84 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 85 | A producer app on the HUB answer this Interest with a Data packet that contains a |
| 86 | TLV-encoded `Uri` block. The value of this block is the URI for the HUB, preferrably a |
| 87 | UDP tunnel. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 88 | |
| 89 | Stage 2: DNS query with default suffix |
| 90 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 91 | |
| 92 | Request |
| 93 | +++++++ |
| 94 | |
| 95 | The end host sends a DNS query that is equivalent to this command:: |
| 96 | |
| 97 | dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv |
| 98 | |
| 99 | Response |
| 100 | ++++++++ |
| 101 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 102 | The DNS server should answer with an SRV record that contains the hostname and UDP port |
| 103 | number of the NDN router. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 104 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 105 | Stage 3: HTTP Request to NDN-FCH server |
| 106 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 107 | |
| 108 | This stage uses a simple HTTP-based API. For more information about NDN-FCH server, refer |
| 109 | to the `NDN-FCH README file <https://github.com/named-data/ndn-fch>`__. |
| 110 | |
| 111 | Request |
| 112 | +++++++ |
| 113 | |
| 114 | HTTP/1.0 request for the NDN-FCH server URI (``http://ndn-fch.named-data.net`` by default) |
| 115 | |
| 116 | Response |
| 117 | ++++++++ |
| 118 | |
| 119 | The HTTP response is expected to be a hostname or an IP address of the closest hub, |
| 120 | inferred using IP-geo approximation service. |
| 121 | |
| 122 | |
| 123 | Stage 4: find home router |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 124 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 125 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 126 | This stage assumes that user has configured default certificate using |
| 127 | `<http://ndncert.named-data.net/>`_ as described in `Certification Architecture |
| 128 | <http://redmine.named-data.net/attachments/download/23/CertificationArchitecture.pptx>`_. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 129 | |
| 130 | Request |
| 131 | +++++++ |
| 132 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 133 | The end host loads the default user identity (eg. ``/ndn/edu/ucla/cs/afanasev``), and |
| 134 | converts it to DNS format. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 135 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 136 | The end host sends a DNS query for an SRV record of name ``_ndn._udp.`` + user identity in |
| 137 | DNS format + ``_homehub._autoconf.named-data.net``. For example:: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 138 | |
| 139 | _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net |
| 140 | |
| 141 | Response |
| 142 | ++++++++ |
| 143 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 144 | The DNS server should answer with an SRV record that contains the hostname and UDP port |
| 145 | number of the home NDN router of this user's site. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 146 | |
| 147 | Client procedure |
| 148 | ---------------- |
| 149 | |
| 150 | Stage 1 |
| 151 | ^^^^^^^ |
| 152 | |
| 153 | Send a multicast discovery Interest. |
| 154 | |
| 155 | If this Interest is answered, connect to the HUB and terminate auto-discovery. |
| 156 | |
| 157 | Stage 2 |
| 158 | ^^^^^^^ |
| 159 | |
| 160 | Send a DNS query with default suffix. |
| 161 | |
| 162 | If this query is answered, connect to the HUB and terminate auto-discovery. |
| 163 | |
| 164 | Stage 3 |
| 165 | ^^^^^^^ |
| 166 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 167 | Send HTTP request to NDN-FCH server. |
| 168 | |
| 169 | If request succeeds, attempt to connect to the discovered HUB and terminate |
| 170 | auto-discovery. |
| 171 | |
| 172 | Stage 4 |
| 173 | ^^^^^^^ |
| 174 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 175 | * Load default user identity, and convert it to DNS format; if either fails, the |
| 176 | auto-discovery fails. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 177 | |
| 178 | * Send a DNS query to find home HUB. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 179 | If this query is answered, connect to the home HUB and terminate auto-discovery. |
| 180 | Otherwise, the auto-discovery fails. |
| 181 | |
| 182 | |
| 183 | See also |
| 184 | -------- |
| 185 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 186 | :ref:`ndn-autoconfig-server`, :doc:`ndn-autoconfig.conf` |