Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 1 | .. _Interest: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 2 | |
| 3 | Interest Packet |
| 4 | --------------- |
| 5 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 6 | NDN Interest packet is TLV defined as follows: |
| 7 | |
| 8 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 9 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame] | 10 | Interest ::= INTEREST-TYPE TLV-LENGTH |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 11 | Name |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 12 | CanBePrefix? |
| 13 | MustBeFresh? |
Junxiao Shi | cfc5d21 | 2017-06-02 17:48:51 +0000 | [diff] [blame] | 14 | ForwardingHint? |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 15 | Nonce? |
| 16 | InterestLifetime? |
| 17 | HopLimit? |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 18 | ApplicationParameters? |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 19 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 20 | ``Name`` is the only required element in an Interest packet. |
| 21 | ``Nonce`` is required when an Interest is transmitted over the network links, i.e., a compliant forwarder must augment the Interest with the ``Nonce`` element if it is missing. |
| 22 | ``CanBePrefix``, ``MustBeFresh``, ``InterestLifetime``, and ``ForwardingHint`` are optional elements to guide Interest matching or forwarding. |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 23 | Interest can also include an optional ``ApplicationParameters`` element. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 24 | |
Junxiao Shi | 707ea00 | 2018-07-17 15:42:52 -0400 | [diff] [blame] | 25 | As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet. |
| 26 | However, they must not appear before the ``Name`` element. |
| 27 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 28 | Name |
| 29 | ~~~~ |
| 30 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 31 | See :ref:`Name section <Name>` for details. |
| 32 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 33 | The ``Name`` element that can be put in the Interest is further restricted to have at least one name component. |
| 34 | Interests that include Name TLV that has zero name components MUST be discarded. |
Alexander Afanasyev | 2528636 | 2016-09-05 20:55:25 -0700 | [diff] [blame] | 35 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 36 | CanBePrefix |
| 37 | ~~~~~~~~~~~ |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 38 | |
| 39 | :: |
| 40 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 41 | CanBePrefix ::= CAN-BE-PREFIX-TYPE TLV-LENGTH(=0) |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 42 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 43 | When present, ``Name`` element in the Interest is a prefix, exact, or full name of the requested Data packet. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 44 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 45 | When not present, the ``Name`` element is either exact or full name of the Data packet: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 46 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 47 | - if the last component of the ``Name`` has type ``ImplicitSha256DigestComponent``, Interest can be matched only to a Data packet with full name that includes the implicit digest component; |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 48 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 49 | - if the last component has any other type, Interest is matched to Data if all name components in Interest's ``Name`` element equal to components in Data's ``Name`` element, without consideration of the implicit digest component. |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame] | 50 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 51 | MustBeFresh |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 52 | ~~~~~~~~~~~ |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 53 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 54 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 55 | |
| 56 | MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0) |
| 57 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 58 | The presence or absence of the ``MustBeFresh`` element indicates whether a content store may satisfy the Interest with stale Data. |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 59 | Refer for :ref:`FreshnessPeriod section <FreshnessPeriod>` for more information. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 60 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 61 | ForwardingHint |
| 62 | ~~~~~~~~~~~~~~ |
| 63 | |
| 64 | :: |
| 65 | |
| 66 | ForwardingHint ::= FORWARDING-HINT-TYPE TLV-LENGTH |
| 67 | Delegation+ |
| 68 | |
| 69 | The ForwardingHint element contains a list of name delegations, as defined in :ref:`link` section. |
| 70 | Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path. |
| 71 | Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 72 | |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 73 | .. _Nonce: |
| 74 | |
| 75 | Nonce |
| 76 | ~~~~~ |
| 77 | |
| 78 | Nonce defined as follows: |
| 79 | |
| 80 | :: |
| 81 | |
| 82 | Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4} |
| 83 | |
Alexander Afanasyev | 4b89611 | 2014-06-23 21:47:15 -0700 | [diff] [blame] | 84 | The Nonce carries a randomly-generated 4-octet long byte-string. |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 85 | The combination of Name and Nonce should uniquely identify an Interest packet. |
| 86 | This is used to detect looping Interests. |
| 87 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 88 | InterestLifetime |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 89 | ~~~~~~~~~~~~~~~~ |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 90 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 91 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 92 | |
| 93 | InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger |
| 94 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame] | 95 | ``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 96 | The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node. |
| 97 | |
| 98 | Nodes that forward Interests may decrease the lifetime to account for the time spent in the node before forwarding, but are not required to do so. It is recommended that these adjustments be done only for relatively large delays (measured in seconds). |
| 99 | |
| 100 | It is the application that sets the value for ``InterestLifetime``. |
| 101 | If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000). |
| 102 | The missing element may be added before forwarding. |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 103 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 104 | HopLimit |
| 105 | ~~~~~~~~ |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 106 | |
Junxiao Shi | cfc5d21 | 2017-06-02 17:48:51 +0000 | [diff] [blame] | 107 | :: |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 108 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 109 | HopLimit ::= HOP-LIMIT-TYPE TLV-LENGTH(=1) BYTE{1} |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 110 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 111 | The optional ``HopLimit`` element indicates the number of hops the Interest is allowed to be forwarded. The value is encoded as a 1-byte unsigned integer value in the range 0-255. |
| 112 | |
| 113 | If element is present: |
| 114 | |
| 115 | - if the ``HopLimit`` value is larger than or equal to 1, a node should accept the packet and decrease the encoded value by 1. |
| 116 | |
| 117 | If the ``HopLimit`` value becomes 0, a node can satisfy this Interest locally (cache or applications bound to local faces), but must not forward the Interests to any non-local faces. |
| 118 | |
| 119 | - if ``HopLimit`` is 0, a node must drop the packet |
| 120 | |
| 121 | If omitted: |
| 122 | |
| 123 | - a node should accept the packet; |
| 124 | |
| 125 | - when desired, a node can augment the Interest with the ``HopLimit`` element. |
| 126 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 127 | ApplicationParameters |
| 128 | ~~~~~~~~~~~~~~~~~~~~~ |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 129 | |
| 130 | :: |
| 131 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 132 | ApplicationParameters ::= APPLICATION-PARAMETERS-TYPE TLV-LENGTH |
| 133 | BYTE* |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 134 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame^] | 135 | The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data. |
| 136 | The Interest's name MUST include a Interest parameters digest component to ensure uniqueness and integrity of the parameterized Interest (see :ref:`Interest Parameters Digest Component` section for additional details). |