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