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`` |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 22 | Run ndn-autoconfig in daemon mode. In this mode, the auto-discovery procedure is re-run |
| 23 | hourly or when a network change event is detected. |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 24 | |
| 25 | NOTE: if connection to NFD fails, the daemon will be terminated. |
| 26 | |
| 27 | ``-c [FILE]`` or ``--config=[FILE]`` |
| 28 | Use the specified configuration file. If `enabled = true` is not specified in the |
| 29 | configuration file, no actions will be performed. |
| 30 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 31 | ``--ndn-fch-url=[URL]`` |
| 32 | Use the specified URL to find the closest hub (NDN-FCH protocol). If not specified, |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 33 | ``http://ndn-fch.named-data.net/`` will be used. Only ``http://`` URLs are supported. |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 34 | |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame] | 35 | ``-h`` or ``--help`` |
| 36 | Print help message and exit. |
| 37 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 38 | ``-V`` or ``--version`` |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame] | 39 | Show version information and exit. |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 40 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 41 | .. _NDN hub discovery procedure: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 42 | |
| 43 | NDN hub discovery procedure |
| 44 | --------------------------- |
| 45 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 46 | When an end host starts up, or detects a change in its network environment, it MAY use |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 47 | this procedure to discover a NDN router, in order to gain connectivity to |
Alexander Afanasyev | 77cddbc | 2019-01-28 14:38:16 -0500 | [diff] [blame^] | 48 | `the NDN research testbed <https://named-data.net/ndn-testbed/>`__. |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 49 | This procedure can discover either an NDN router in the local network, or a NDN testbed |
| 50 | gateway router (commonly known as a "hub"). |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 51 | |
| 52 | Overview |
| 53 | ^^^^^^^^ |
| 54 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 55 | This procedure contains four methods to discover a NDN router: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 56 | |
| 57 | 1. Look for a local NDN router by multicast. |
| 58 | This is useful in a home or small office network. |
| 59 | |
| 60 | 2. Look for a local NDN router by DNS query with default suffix. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 61 | 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] | 62 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 63 | 3. Find closest hub by sending an HTTP request to NDN-FCH server. |
| 64 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 65 | 4. Connect to the home hub according to user certificate. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 66 | This ensures connectivity from anywhere. |
| 67 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 68 | After connecting, two prefixes will be registered toward the router: |
Stumble | 62b19a6 | 2015-08-03 10:17:45 -0700 | [diff] [blame] | 69 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 70 | - ``/`` --- this allows application communication |
| 71 | - ``/localhop/nfd`` --- this informs NFD-RIB that there is connectivity to a router |
Stumble | 62b19a6 | 2015-08-03 10:17:45 -0700 | [diff] [blame] | 72 | |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 73 | Stage 1: multicast discovery |
| 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 75 | |
| 76 | Request |
| 77 | +++++++ |
| 78 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 79 | The end host sends Interest ``/localhop/ndn-autoconf/hub`` over a multicast face. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 80 | |
| 81 | Response |
| 82 | ++++++++ |
| 83 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 84 | A producer app on the router answers this Interest with a Data packet that contains a |
| 85 | ``Uri`` TLV element. The value of this element is the FaceUri for the router, such as |
| 86 | a UDP tunnel. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 87 | |
| 88 | Stage 2: DNS query with default suffix |
| 89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 90 | |
| 91 | Request |
| 92 | +++++++ |
| 93 | |
| 94 | The end host sends a DNS query that is equivalent to this command:: |
| 95 | |
| 96 | dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv |
| 97 | |
| 98 | Response |
| 99 | ++++++++ |
| 100 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 101 | The DNS server should answer with an SRV record that contains the hostname and UDP port |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 102 | number of a nearby NDN router. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 103 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 104 | Stage 3: HTTP Request to NDN-FCH server |
| 105 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 106 | |
| 107 | This stage uses a simple HTTP-based API. For more information about NDN-FCH server, refer |
| 108 | to the `NDN-FCH README file <https://github.com/named-data/ndn-fch>`__. |
| 109 | |
| 110 | Request |
| 111 | +++++++ |
| 112 | |
Alexander Afanasyev | 77cddbc | 2019-01-28 14:38:16 -0500 | [diff] [blame^] | 113 | HTTP/1.0 request for the NDN-FCH server URI (`<http://ndn-fch.named-data.net/>`__ by default) |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 114 | |
| 115 | Response |
| 116 | ++++++++ |
| 117 | |
| 118 | The HTTP response is expected to be a hostname or an IP address of the closest hub, |
| 119 | inferred using IP-geo approximation service. |
| 120 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 121 | Stage 4: find home router |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 122 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 123 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 124 | This stage assumes that user has configured default certificate using |
Alexander Afanasyev | 77cddbc | 2019-01-28 14:38:16 -0500 | [diff] [blame^] | 125 | `<https://ndncert.named-data.net/>`__ as described in `Certification Architecture |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 126 | <https://redmine.named-data.net/attachments/download/23/CertificationArchitecture.pptx>`__. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 127 | |
| 128 | Request |
| 129 | +++++++ |
| 130 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 131 | The end host loads the default user identity (eg. ``/ndn/edu/ucla/cs/afanasev``), and |
| 132 | converts it to DNS format. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 133 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 134 | The end host sends a DNS query for an SRV record of name ``_ndn._udp.`` + user identity in |
| 135 | DNS format + ``_homehub._autoconf.named-data.net``. For example:: |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 136 | |
| 137 | _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net |
| 138 | |
| 139 | Response |
| 140 | ++++++++ |
| 141 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 142 | The DNS server should answer with an SRV record that contains the hostname and UDP port |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 143 | number of the home hub of this user's site. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 144 | |
| 145 | Client procedure |
| 146 | ---------------- |
| 147 | |
| 148 | Stage 1 |
| 149 | ^^^^^^^ |
| 150 | |
| 151 | Send a multicast discovery Interest. |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 152 | If this Interest is answered, connect to the router and terminate auto-discovery. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 153 | |
| 154 | Stage 2 |
| 155 | ^^^^^^^ |
| 156 | |
| 157 | Send a DNS query with default suffix. |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 158 | If this query is answered, connect to the router and terminate auto-discovery. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 159 | |
| 160 | Stage 3 |
| 161 | ^^^^^^^ |
| 162 | |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 163 | Send HTTP request to NDN-FCH server. |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 164 | If request succeeds, attempt to connect to the discovered hub and terminate |
Alexander Afanasyev | 2a00194 | 2016-12-14 18:18:41 -0800 | [diff] [blame] | 165 | auto-discovery. |
| 166 | |
| 167 | Stage 4 |
| 168 | ^^^^^^^ |
| 169 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 170 | Load default user identity, and convert it to DNS format. |
| 171 | If either fails, the auto-discovery fails. |
Alexander Afanasyev | 49272f7 | 2014-04-06 21:49:46 -0700 | [diff] [blame] | 172 | |
Junxiao Shi | b53fe64 | 2018-07-25 11:45:35 -0600 | [diff] [blame] | 173 | Send a DNS query to find home hub. |
| 174 | If this query is answered, connect to the home hub and terminate auto-discovery. |
| 175 | Otherwise, the auto-discovery fails. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 176 | |
Davide Pesavento | 59769b1 | 2017-11-12 23:52:06 -0500 | [diff] [blame] | 177 | Exit status |
| 178 | ----------- |
| 179 | |
| 180 | 0: No error. |
| 181 | |
| 182 | 1: An unspecified error occurred. |
| 183 | |
| 184 | 2: Malformed command line, e.g., invalid, missing, or unknown argument. |
| 185 | |
| 186 | 4: Insufficient privileges. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 187 | |
| 188 | See also |
| 189 | -------- |
| 190 | |
Alexander Afanasyev | 5c47597 | 2015-12-20 16:16:56 -0800 | [diff] [blame] | 191 | :ref:`ndn-autoconfig-server`, :doc:`ndn-autoconfig.conf` |