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 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 21 | ``-d`` or ``--daemon`` |
| 22 | Run ndn-autoconfig in daemon mode, detecting network change events and re-running |
| 23 | auto-discovery procedure. In addition, the auto-discovery procedure is unconditionally |
| 24 | re-run every hour. |
| 25 | |
| 26 | NOTE: if connection to NFD fails, the daemon will be terminated. |
| 27 | |
| 28 | ``-c [FILE]`` or ``--config=[FILE]`` |
| 29 | Use the specified configuration file. If `enabled = true` is not specified in the |
| 30 | configuration file, no actions will be performed. |
| 31 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 32 | ``--ndn-fch-url=[URL]`` |
| 33 | Use the specified URL to find the closest hub (NDN-FCH protocol). If not specified, |
| 34 | ``http://ndn-fch.named-data.net`` will be used. Only ``http://`` URLs are supported. |
| 35 | |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame^] | 36 | ``-h`` or ``--help`` |
| 37 | Print help message and exit. |
| 38 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 39 | ``-V`` or ``--version`` |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame^] | 40 | Show version information and exit. |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 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 |
Eric Newberry | 81a9a86 | 2016-12-27 22:59:27 -0700 | [diff] [blame] | 49 | `the NDN research testbed <https://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 |
Eric Newberry | 81a9a86 | 2016-12-27 22:59:27 -0700 | [diff] [blame] | 127 | `<https://ndncert.named-data.net/>`_ as described in `Certification Architecture |
| 128 | <https://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 | |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame^] | 182 | Exit status |
| 183 | ----------- |
| 184 | |
| 185 | 0: No error. |
| 186 | |
| 187 | 1: An unspecified error occurred. |
| 188 | |
| 189 | 2: Malformed command line, e.g., invalid, missing, or unknown argument. |
| 190 | |
| 191 | 4: Insufficient privileges. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 192 | |
| 193 | See also |
| 194 | -------- |
| 195 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 196 | :ref:`ndn-autoconfig-server`, :doc:`ndn-autoconfig.conf` |