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 |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 4 | =============== |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 5 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 6 | The NDN Interest packet is a TLV defined as follows:: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 7 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 8 | Interest = INTEREST-TYPE TLV-LENGTH |
| 9 | Name |
| 10 | [CanBePrefix] |
| 11 | [MustBeFresh] |
| 12 | [ForwardingHint] |
| 13 | [Nonce] |
| 14 | [InterestLifetime] |
| 15 | [HopLimit] |
| 16 | [ApplicationParameters [InterestSignature]] |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 17 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 18 | ``Name`` is the only required element in an Interest packet. |
| 19 | ``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. |
| 20 | ``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] | 21 | Interest can also include an optional ``ApplicationParameters`` element. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 22 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 23 | If an Interest contains ``InterestSignature``, it is considered a Signed Interest. |
Zhiyi Zhang | 0c04fd8 | 2018-09-04 16:29:47 -0400 | [diff] [blame] | 24 | See :doc:`Signed Interest section <signed-interest>` for details. |
| 25 | |
Junxiao Shi | 707ea00 | 2018-07-17 15:42:52 -0400 | [diff] [blame] | 26 | As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet. |
| 27 | However, they must not appear before the ``Name`` element. |
| 28 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 29 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 30 | Name |
| 31 | ---- |
| 32 | |
| 33 | See :ref:`Name` for details. |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 34 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 35 | The ``Name`` element that can be put in the Interest is further restricted to have at least one name component. |
| 36 | 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] | 37 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 38 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 39 | CanBePrefix |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 40 | ----------- |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 41 | |
| 42 | :: |
| 43 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 44 | CanBePrefix = CAN-BE-PREFIX-TYPE |
| 45 | TLV-LENGTH ; == 0 |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 46 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 47 | 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] | 48 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 49 | 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] | 50 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 51 | - 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] | 52 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 53 | - 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] | 54 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 55 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 56 | MustBeFresh |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 57 | ----------- |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 58 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 59 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 60 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 61 | MustBeFresh = MUST-BE-FRESH-TYPE |
| 62 | TLV-LENGTH ; == 0 |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 63 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame] | 64 | The presence or absence of the ``MustBeFresh`` element indicates whether a content store may satisfy the Interest with stale Data. |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 65 | See :ref:`FreshnessPeriod` for more information. |
| 66 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 67 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 68 | ForwardingHint |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 69 | -------------- |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 70 | |
| 71 | :: |
| 72 | |
Alexander Afanasyev | 9fba5f4 | 2021-12-21 12:40:17 -0500 | [diff] [blame] | 73 | ForwardingHint = FORWARDING-HINT-TYPE TLV-LENGTH 1*Name |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 74 | |
Alexander Afanasyev | 9fba5f4 | 2021-12-21 12:40:17 -0500 | [diff] [blame] | 75 | The ForwardingHint element contains a list of Names ("delegations"). |
| 76 | Presence of the forwarding hint implies that Data can be retrieved by forwarding the Interest over path(s) pointed by the listed Names. |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 77 | 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] | 78 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 79 | |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 80 | .. _Nonce: |
| 81 | |
| 82 | Nonce |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 83 | ----- |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 84 | |
| 85 | :: |
| 86 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 87 | Nonce = NONCE-TYPE |
| 88 | TLV-LENGTH ; == 4 |
| 89 | 4OCTET |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 90 | |
Alexander Afanasyev | 4b89611 | 2014-06-23 21:47:15 -0700 | [diff] [blame] | 91 | The Nonce carries a randomly-generated 4-octet long byte-string. |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 92 | The combination of Name and Nonce should uniquely identify an Interest packet. |
| 93 | This is used to detect looping Interests. |
| 94 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 95 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 96 | InterestLifetime |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 97 | ---------------- |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 98 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 99 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 100 | |
Davide Pesavento | f9353df | 2020-06-21 19:19:56 -0400 | [diff] [blame] | 101 | InterestLifetime = INTEREST-LIFETIME-TYPE TLV-LENGTH NonNegativeInteger |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 102 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame] | 103 | ``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 104 | The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node. |
| 105 | |
| 106 | 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). |
| 107 | |
| 108 | It is the application that sets the value for ``InterestLifetime``. |
| 109 | If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000). |
| 110 | The missing element may be added before forwarding. |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 111 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 112 | |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 113 | HopLimit |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 114 | -------- |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 115 | |
Junxiao Shi | cfc5d21 | 2017-06-02 17:48:51 +0000 | [diff] [blame] | 116 | :: |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 117 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 118 | HopLimit = HOP-LIMIT-TYPE |
| 119 | TLV-LENGTH ; == 1 |
| 120 | OCTET |
spirosmastorakis | 988e741 | 2016-10-27 14:01:59 -0700 | [diff] [blame] | 121 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 122 | 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]. |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 123 | |
| 124 | If element is present: |
| 125 | |
| 126 | - if the ``HopLimit`` value is larger than or equal to 1, a node should accept the packet and decrease the encoded value by 1. |
| 127 | |
| 128 | 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. |
| 129 | |
| 130 | - if ``HopLimit`` is 0, a node must drop the packet |
| 131 | |
| 132 | If omitted: |
| 133 | |
| 134 | - a node should accept the packet; |
| 135 | |
| 136 | - when desired, a node can augment the Interest with the ``HopLimit`` element. |
| 137 | |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 138 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame] | 139 | ApplicationParameters |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 140 | --------------------- |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 141 | |
| 142 | :: |
| 143 | |
Junxiao Shi | 78ce295 | 2019-05-07 15:34:00 -0400 | [diff] [blame] | 144 | ApplicationParameters = APPLICATION-PARAMETERS-TYPE TLV-LENGTH *OCTET |
Alexander Afanasyev | e9f4851 | 2018-01-15 23:44:50 -0500 | [diff] [blame] | 145 | |
Junxiao Shi | f2bbb90 | 2019-03-15 14:36:30 -0400 | [diff] [blame] | 146 | The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data. |
Davide Pesavento | ec288fe | 2022-11-26 18:28:01 -0500 | [diff] [blame^] | 147 | The Interest's name MUST include a Interest parameters digest component to ensure uniqueness and integrity of the parameterized Interest (see :ref:`ParametersDigestComponent` for additional details). |
| 148 | |
| 149 | |
| 150 | InterestSignature |
| 151 | ----------------- |
| 152 | |
| 153 | See :ref:`InterestSignature`. |