blob: 792e3273b4822c50dd60f74c800fa8947d4eb9f8 [file] [log] [blame]
Alexander Afanasyeve2800232013-11-27 02:24:14 +00001.. _Interest:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00002
3Interest Packet
Davide Pesaventoec288fe2022-11-26 18:28:01 -05004===============
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00005
Davide Pesaventoec288fe2022-11-26 18:28:01 -05006The NDN Interest packet is a TLV defined as follows::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00007
Junxiao Shi78ce2952019-05-07 15:34:00 -04008 Interest = INTEREST-TYPE TLV-LENGTH
9 Name
10 [CanBePrefix]
11 [MustBeFresh]
12 [ForwardingHint]
13 [Nonce]
14 [InterestLifetime]
15 [HopLimit]
16 [ApplicationParameters [InterestSignature]]
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000017
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050018``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 Shif2bbb902019-03-15 14:36:30 -040021Interest can also include an optional ``ApplicationParameters`` element.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000022
Junxiao Shi78ce2952019-05-07 15:34:00 -040023If an Interest contains ``InterestSignature``, it is considered a Signed Interest.
Zhiyi Zhang0c04fd82018-09-04 16:29:47 -040024See :doc:`Signed Interest section <signed-interest>` for details.
25
Junxiao Shi707ea002018-07-17 15:42:52 -040026As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet.
27However, they must not appear before the ``Name`` element.
28
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000029
Davide Pesaventoec288fe2022-11-26 18:28:01 -050030Name
31----
32
33See :ref:`Name` for details.
Alexander Afanasyeve2800232013-11-27 02:24:14 +000034
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050035The ``Name`` element that can be put in the Interest is further restricted to have at least one name component.
36Interests that include Name TLV that has zero name components MUST be discarded.
Alexander Afanasyev25286362016-09-05 20:55:25 -070037
Davide Pesaventoec288fe2022-11-26 18:28:01 -050038
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050039CanBePrefix
Davide Pesaventoec288fe2022-11-26 18:28:01 -050040-----------
Alexander Afanasyeve2800232013-11-27 02:24:14 +000041
42::
43
Junxiao Shi78ce2952019-05-07 15:34:00 -040044 CanBePrefix = CAN-BE-PREFIX-TYPE
45 TLV-LENGTH ; == 0
Alexander Afanasyeve2800232013-11-27 02:24:14 +000046
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050047When present, ``Name`` element in the Interest is a prefix, exact, or full name of the requested Data packet.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000048
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050049When not present, the ``Name`` element is either exact or full name of the Data packet:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000050
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050051- 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 Afanasyeveee8c252013-11-21 23:22:41 +000052
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050053- 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 Afanasyeva6fc7272014-06-13 11:58:06 -070054
Davide Pesaventoec288fe2022-11-26 18:28:01 -050055
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000056MustBeFresh
Davide Pesaventoec288fe2022-11-26 18:28:01 -050057-----------
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000058
Alexander Afanasyeve2800232013-11-27 02:24:14 +000059::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000060
Junxiao Shi78ce2952019-05-07 15:34:00 -040061 MustBeFresh = MUST-BE-FRESH-TYPE
62 TLV-LENGTH ; == 0
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000063
Junxiao Shif2bbb902019-03-15 14:36:30 -040064The presence or absence of the ``MustBeFresh`` element indicates whether a content store may satisfy the Interest with stale Data.
Davide Pesaventoec288fe2022-11-26 18:28:01 -050065See :ref:`FreshnessPeriod` for more information.
66
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000067
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050068ForwardingHint
Davide Pesaventoec288fe2022-11-26 18:28:01 -050069--------------
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050070
71::
72
Alexander Afanasyev9fba5f42021-12-21 12:40:17 -050073 ForwardingHint = FORWARDING-HINT-TYPE TLV-LENGTH 1*Name
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050074
Alexander Afanasyev9fba5f42021-12-21 12:40:17 -050075The ForwardingHint element contains a list of Names ("delegations").
76Presence of the forwarding hint implies that Data can be retrieved by forwarding the Interest over path(s) pointed by the listed Names.
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050077Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000078
Davide Pesaventoec288fe2022-11-26 18:28:01 -050079
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000080.. _Nonce:
81
82Nonce
Davide Pesaventoec288fe2022-11-26 18:28:01 -050083-----
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000084
85::
86
Junxiao Shi78ce2952019-05-07 15:34:00 -040087 Nonce = NONCE-TYPE
88 TLV-LENGTH ; == 4
89 4OCTET
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000090
Alexander Afanasyev4b896112014-06-23 21:47:15 -070091The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000092The combination of Name and Nonce should uniquely identify an Interest packet.
93This is used to detect looping Interests.
94
Davide Pesaventoec288fe2022-11-26 18:28:01 -050095
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000096InterestLifetime
Davide Pesaventoec288fe2022-11-26 18:28:01 -050097----------------
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000098
Alexander Afanasyeve2800232013-11-27 02:24:14 +000099::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000100
Davide Pesaventof9353df2020-06-21 19:19:56 -0400101 InterestLifetime = INTEREST-LIFETIME-TYPE TLV-LENGTH NonNegativeInteger
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000102
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700103``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000104The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
105
106Nodes 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
108It is the application that sets the value for ``InterestLifetime``.
109If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
110The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700111
Davide Pesaventoec288fe2022-11-26 18:28:01 -0500112
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500113HopLimit
Davide Pesaventoec288fe2022-11-26 18:28:01 -0500114--------
spirosmastorakis988e7412016-10-27 14:01:59 -0700115
Junxiao Shicfc5d212017-06-02 17:48:51 +0000116::
spirosmastorakis988e7412016-10-27 14:01:59 -0700117
Junxiao Shi78ce2952019-05-07 15:34:00 -0400118 HopLimit = HOP-LIMIT-TYPE
119 TLV-LENGTH ; == 1
120 OCTET
spirosmastorakis988e7412016-10-27 14:01:59 -0700121
Davide Pesaventoec288fe2022-11-26 18:28:01 -0500122The 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 Afanasyeve9f48512018-01-15 23:44:50 -0500123
124If 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
132If 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 Pesaventoec288fe2022-11-26 18:28:01 -0500138
Junxiao Shif2bbb902019-03-15 14:36:30 -0400139ApplicationParameters
Davide Pesaventoec288fe2022-11-26 18:28:01 -0500140---------------------
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500141
142::
143
Junxiao Shi78ce2952019-05-07 15:34:00 -0400144 ApplicationParameters = APPLICATION-PARAMETERS-TYPE TLV-LENGTH *OCTET
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500145
Junxiao Shif2bbb902019-03-15 14:36:30 -0400146The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data.
Davide Pesaventoec288fe2022-11-26 18:28:01 -0500147The 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
150InterestSignature
151-----------------
152
153See :ref:`InterestSignature`.