Alexander Afanasyev | ca58dc2 | 2013-12-28 21:04:59 +0000 | [diff] [blame^] | 1 | .. _Face Registration: |
| 2 | |
| 3 | Face Management and Registration Protocol |
| 4 | ----------------------------------------- |
| 5 | |
| 6 | Face Management Protocol |
| 7 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 8 | |
| 9 | The Face Management Protocol provides a method for an entity such as ndndc to control |
| 10 | the faces maintained by ndnd, which are subsequently used in the Registration Protocol. |
| 11 | |
| 12 | The FMP supports ``newface``, ``destroyface``, and ``queryface`` operations. |
| 13 | |
| 14 | A request operation is represented as a NDN Interest with |
| 15 | a NDN Data in NDN-TLV encoding, while the majority of the request parameters embedded |
| 16 | as a component of the Interest name. |
| 17 | A response is represented as a Data for which the name matches the Interest, |
| 18 | and the content encodes any necessary response data. |
| 19 | |
| 20 | For the Face Management Protocol, the content of the Data packet is FaceInstance object |
| 21 | as defined below. |
| 22 | |
| 23 | For example, the following steps necessary to create a new face: |
| 24 | |
| 25 | - Create NDN-TLV encoded FaceInstance object, containing action ``newface`` and other |
| 26 | necessary fields to set up the face (e.g., ``IPProto``, ``Host``, ``Port``). |
| 27 | |
| 28 | - Create NDN-TLV encoded Data packet (``<NFBLOB>``), whose content is the encoded |
| 29 | FaceInstance object |
| 30 | |
| 31 | - Express an Interest ``/ndnx/<NDNDID>/newface/<NFBLOB>``, where |
| 32 | |
| 33 | * ``<NDNDID>`` is the SHA256 of the public key of the forwarding daemon. |
| 34 | |
| 35 | * ``<NFBLOB>`` is encoded Data packet with encoded FaceInstance object as content. |
| 36 | |
| 37 | The verb, ``newface`` occurs redundantly in both the Interest prefix and in the ``NFBLOB``. |
| 38 | Its presence in the prefix is for dispatching the request. |
| 39 | It is also in the ``NFBLOB``, so that it is signed. |
| 40 | |
| 41 | The forwarding daemon creates the new face and answers with a FaceInstance containing |
| 42 | at least the ``FaceID``. |
| 43 | |
| 44 | FaceInstance |
| 45 | ^^^^^^^^^^^^ |
| 46 | |
| 47 | :: |
| 48 | |
| 49 | FaceInstance ::= FACE-INSTANCE-TYPE TLV-LENGTH |
| 50 | Action? |
| 51 | FaceID? |
| 52 | IPProto? |
| 53 | Host? |
| 54 | Port? |
| 55 | MulticastInterface? |
| 56 | MulticastTTL? |
| 57 | FreshnessPeriod? |
| 58 | |
| 59 | Action ::= ACTION-TYPE TLV-LENGTH |
| 60 | ("newface" | "destroyface" | "queryface") |
| 61 | |
| 62 | FaceID ::= FACEID-TYPE TLV-LENGTH |
| 63 | nonNegativeInteger |
| 64 | |
| 65 | IPProto ::= FACEID-TYPE TLV-LENGTH |
| 66 | nonNegativeInteger |
| 67 | (*IANA protocol number; 6=TCP, 17=UDP*) |
| 68 | |
| 69 | Host ::= HOST-TYPE TLV-LENGTH |
| 70 | <textual representation of numeric IPv4 or IPv6 address> |
| 71 | |
| 72 | Port ::= PORT-TYPE TLV-LENGTH |
| 73 | nonNegativeInteger |
| 74 | (* from the range [1..65535] *) |
| 75 | |
| 76 | MulticastInterface ::= MULTICAST-INTERFACE-TYPE TLV-LENGTH |
| 77 | <textual representation of numeric IPv4 or IPv6 address> |
| 78 | |
| 79 | MulticastTTL ::= MULTICAST-TTL-TYPE TLV-LENGTH |
| 80 | nonNegativeInteger |
| 81 | (* from the range [1..255] *) |
| 82 | |
| 83 | See :ref:`Data packet's meta info description <MetaInfo>` for definition of ``FreshnessPeriod``. |
| 84 | |
| 85 | Action |
| 86 | ++++++ |
| 87 | |
| 88 | When FaceInstance is used as a request, the Action must be specified. |
| 89 | It will not be present in a response. |
| 90 | |
| 91 | +-----------------+----------------------------------------------------------------------+ |
| 92 | | Action | Description | |
| 93 | +=================+======================================================================+ |
| 94 | | ``newface`` | If a face matching the parameters does not already exist, an attempt | |
| 95 | | | is made to create it. | |
| 96 | | | | |
| 97 | | | Then if the face exists (whether new or old) the full description is | |
| 98 | | | returned as a FaceInstance. | |
| 99 | +-----------------+----------------------------------------------------------------------+ |
| 100 | | ``destroyface`` | At least the FaceID must be present. | |
| 101 | | | If permitted, the face is destroyed. | |
| 102 | +-----------------+----------------------------------------------------------------------+ |
| 103 | | ``queryface`` | TBD | |
| 104 | +-----------------+----------------------------------------------------------------------+ |
| 105 | |
| 106 | FaceID |
| 107 | ++++++ |
| 108 | |
| 109 | FaceID is not present in a `newface` request, but must be specified in |
| 110 | a `destroyface` or `queryface` request. |
| 111 | FaceID is always present in a response. |
| 112 | |
| 113 | Host |
| 114 | ++++ |
| 115 | |
| 116 | Identifies the IPv4 or IPv6 numeric address of the remote ndnd for this |
| 117 | FaceInstance. |
| 118 | |
| 119 | Port |
| 120 | ++++ |
| 121 | |
| 122 | Port identifies the port on the remote ndnd, or the port for the multicast group. |
| 123 | |
| 124 | MulticastInterface |
| 125 | ++++++++++++++++++ |
| 126 | |
| 127 | If the Host is a multicast address, and there are multiple |
| 128 | interfaces present, MulticastInterface will identify the unicast |
| 129 | numeric address of the interface to which the multicast address will be |
| 130 | attached. |
| 131 | |
| 132 | MulticastTTL |
| 133 | ++++++++++++ |
| 134 | |
| 135 | Specifies the TTL to be used for multicast operations. The default value is 1. |
| 136 | |
| 137 | FreshnessPeriod |
| 138 | ++++++++++++++++ |
| 139 | |
| 140 | FreshnessPeriod is optional in a request, but is treated as a hint by the forwarding daemon. |
| 141 | In a response, FreshnessPeriod specifies the remaining lifetime in milliseconds of the |
| 142 | face. |
| 143 | |
| 144 | Prefix Registration Protocol |
| 145 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 146 | |
| 147 | The prefix registration protocol uses the ForwardingEntry element type |
| 148 | to represent both requests and responses. |
| 149 | |
| 150 | :: |
| 151 | |
| 152 | ForwardingEntry ::= FORWARDING-ENTRY TLV-LENGTH |
| 153 | Action? |
| 154 | Name? |
| 155 | FaceID? |
| 156 | ForwardingFlags? |
| 157 | FreshnessPeriod? |
| 158 | |
| 159 | Action ::= ACTION-TYPE TLV-LENGTH |
| 160 | ("prefixreg" | "selfreg" | "unreg") |
| 161 | |
| 162 | FaceID ::= FACEID-TYPE TLV-LENGTH |
| 163 | nonNegativeInteger |
| 164 | |
| 165 | ForwardingFlags ::= FORWARDING-FLAGS TLV-LENGTH |
| 166 | nonNegativeInteger |
| 167 | |
| 168 | See :ref:`Name section <Name>` for definition of ``Name`` and |
| 169 | :ref:`Data packet's meta info description <MetaInfo>` for definition of ``FreshnessPeriod``. |
| 170 | |
| 171 | |
| 172 | Action |
| 173 | ++++++ |
| 174 | |
| 175 | When ForwardingEntry is used as a request, the Action must be specified. |
| 176 | It will not be present in a response. |
| 177 | |
| 178 | - `prefixreg` - Register (or re-register) the prefix on the specified face. |
| 179 | - `selfreg` - Register (or re-register) the prefix on the current face; the |
| 180 | FaceID need not be present in the request, but if present it must match |
| 181 | the current face. |
| 182 | - `unreg` - Remove the prefix registration for the specified face. |
| 183 | |
| 184 | FaceID |
| 185 | ++++++ |
| 186 | |
| 187 | FaceID is required in `prefixreg` and `unreg` requests. |
| 188 | FaceID is always present in a response. |
| 189 | |
| 190 | Name |
| 191 | ++++ |
| 192 | |
| 193 | This is the name prefix to be acted on. |
| 194 | |
| 195 | ForwardingFlags |
| 196 | +++++++++++++++ |
| 197 | |
| 198 | This integer holds the inclusive OR of the following bit fields: |
| 199 | |
| 200 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 201 | | Flag mnemonic | Bit (decimal) | Description | |
| 202 | +============================+===============+=============================================================================+ |
| 203 | | ``NDN_FORW_ACTIVE`` | 1 | Indicates that the entry is active; | |
| 204 | | | | interests will not be sent for inactive entries (but see note below). | |
| 205 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 206 | | ``NDN_FORW_CHILD_INHERIT`` | 2 | Denotes that this entry may be used even if there is a longer match | |
| 207 | | | | available. In the absence of this bit, the presence of a longer matching | |
| 208 | | | | prefix that has an active entry will prevent this entry from being used. | |
| 209 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 210 | | ``NDN_FORW_ADVERTISE`` | 4 | Indicates that the prefix may be advertised to other nodes. | |
| 211 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 212 | | ``NDN_FORW_LAST`` | 8 | Indicates that this entry should be used last, if nothing else worked. | |
| 213 | | | | This is intended to be used by ndndc and similar programs to monitor | |
| 214 | | | | unanswered interests. | |
| 215 | | | | | |
| 216 | | | | The presence of this flag on any entry causes the associated face to be | |
| 217 | | | | considered non-local, as far as interest forwarding is concerned. | |
| 218 | | | | Thus it will not receive interests with Scope=1, nor will it receive | |
| 219 | | | | interests in namespaces that are marked local. However, the ability of | |
| 220 | | | | the face to change prefix registrations is not affected. | |
| 221 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 222 | | ``NDN_FORW_CAPTURE`` | 16 | Says that no shorter prefix may be used, overriding child-inherit bits that | |
| 223 | | | | would otherwise make the shorter entries usable. | |
| 224 | | | | | |
| 225 | | | | For a child-inherit bit to be overridden, the ``NDN_FORW_CAPTURE_OK`` must | |
| 226 | | | | be set in the same forwarding entry that has ``NDN_FORW_CHILD_INHERIT`` | |
| 227 | | | | set. Note that this means that using ``NDN_FORW_CAPTURE`` will have no | |
| 228 | | | | effect if the ``NDN_FORW_CAPTURE_OK`` flag is not used. | |
| 229 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 230 | | ``NDN_FORW_LOCAL`` | 32 | Restricts the namespace to use by applications on the local machine. | |
| 231 | | | | | |
| 232 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 233 | | ``NDN_FORW_TAP`` | 64 | Causes the entry to be used right away. This is intended for debugging | |
| 234 | | | | and monitoring purposes. It is likely that there will be no response as | |
| 235 | | | | a result, so no intentional delay is added before any further forwarding | |
| 236 | | | | of this interest. | |
| 237 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 238 | | ``NDN_FORW_CAPTURE_OK`` | 128 | used in conjunction with ``NDN_FORW_CHILD_INHERIT`` allows a | |
| 239 | | | | ``NDN_FORW_CAPTURE`` flag on a longer prefix to override the effect of | |
| 240 | | | | the child-inherit bit. | |
| 241 | +----------------------------+---------------+-----------------------------------------------------------------------------+ |
| 242 | |
| 243 | The flags ``NDN_FORW_ADVERTISE``, ``NDN_FORW_CAPTURE`` and ``NDN_FORW_LOCAL`` affect |
| 244 | the prefix as a whole, rather than the individual registrations. |
| 245 | Their effects take place whether or not the ``NDN_FORW_ACTIVE`` bit is set. |
| 246 | |
| 247 | FreshnessPeriod |
| 248 | +++++++++++++++ |
| 249 | |
| 250 | FreshnessPeriod is optional in a request, but is treated as a hint by the forwarding daemon. |
| 251 | In a response, FreshnessPeriod specifies the remaining lifetime in milliseconds of the registration. |
| 252 | |
| 253 | |
| 254 | Type code assignment |
| 255 | ^^^^^^^^^^^^^^^^^^^^ |
| 256 | |
| 257 | Face management and registration protocol uses the following type codes, which are assigned |
| 258 | from the :ref:`application range (128-252) <type reservations>`. |
| 259 | |
| 260 | Some codes (e.g., `Name`, `FreshnessPeriod`), re-use code assignment from the NDN-TLV specification. |
| 261 | |
| 262 | +---------------------------------------------+-------------------+----------------+ |
| 263 | | Type | Assigned value | Assigned value | |
| 264 | | | (decimal) | (hexadecimal) | |
| 265 | +=============================================+===================+================+ |
| 266 | | **Application-specific definitions** | |
| 267 | +---------------------------------------------+-------------------+----------------+ |
| 268 | | FaceInstance | 128 | 0x80 | |
| 269 | +---------------------------------------------+-------------------+----------------+ |
| 270 | | ForwardingEntry | 129 | 0x81 | |
| 271 | +---------------------------------------------+-------------------+----------------+ |
| 272 | | Action | 130 | 0x82 | |
| 273 | +---------------------------------------------+-------------------+----------------+ |
| 274 | | FaceID | 131 | 0x83 | |
| 275 | +---------------------------------------------+-------------------+----------------+ |
| 276 | | IPProto | 132 | 0x84 | |
| 277 | +---------------------------------------------+-------------------+----------------+ |
| 278 | | Host | 133 | 0x85 | |
| 279 | +---------------------------------------------+-------------------+----------------+ |
| 280 | | Port | 134 | 0x86 | |
| 281 | +---------------------------------------------+-------------------+----------------+ |
| 282 | | MulticastInterface | 135 | 0x87 | |
| 283 | +---------------------------------------------+-------------------+----------------+ |
| 284 | | MulticastTTL | 136 | 0x88 | |
| 285 | +---------------------------------------------+-------------------+----------------+ |
| 286 | | ForwardingFlags | 137 | 0x89 | |
| 287 | +---------------------------------------------+-------------------+----------------+ |
| 288 | | **Re-used definitions** | |
| 289 | +---------------------------------------------+-------------------+----------------+ |
| 290 | | FreshnessPeriod | 20 | 0x14 | |
| 291 | +---------------------------------------------+-------------------+----------------+ |
| 292 | | Name | 2 | 0x02 | |
| 293 | +---------------------------------------------+-------------------+----------------+ |