blob: 0206e6d33cdebbd8a41bb63bacf0de9bad596a74 [file] [log] [blame]
Alexander Afanasyeve2800232013-11-27 02:24:14 +00001.. _Interest:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00002
3Interest Packet
4---------------
5
Alexander Afanasyeve2800232013-11-27 02:24:14 +00006NDN Interest packet is TLV defined as follows:
7
8::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00009
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070010 Interest ::= INTEREST-TYPE TLV-LENGTH
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000011 Name
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050012 CanBePrefix?
13 MustBeFresh?
Junxiao Shicfc5d212017-06-02 17:48:51 +000014 ForwardingHint?
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050015 Nonce?
16 InterestLifetime?
17 HopLimit?
Zhiyi Zhang0c04fd82018-09-04 16:29:47 -040018 (ApplicationParameters |
19 ApplicationParameters InterestSignatureInfo InterestSignatureValue)?
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000020
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050021``Name`` is the only required element in an Interest packet.
22``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.
23``CanBePrefix``, ``MustBeFresh``, ``InterestLifetime``, and ``ForwardingHint`` are optional elements to guide Interest matching or forwarding.
Junxiao Shif2bbb902019-03-15 14:36:30 -040024Interest can also include an optional ``ApplicationParameters`` element.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000025
Zhiyi Zhang0c04fd82018-09-04 16:29:47 -040026If an Interest contains ``InterestSignatureInfo`` and ``InterestSignatureValue``, it is considered a Signed Interest.
27See :doc:`Signed Interest section <signed-interest>` for details.
28
Junxiao Shi707ea002018-07-17 15:42:52 -040029As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet.
30However, they must not appear before the ``Name`` element.
31
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000032Name
33~~~~
34
Alexander Afanasyeve2800232013-11-27 02:24:14 +000035See :ref:`Name section <Name>` for details.
36
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050037The ``Name`` element that can be put in the Interest is further restricted to have at least one name component.
38Interests that include Name TLV that has zero name components MUST be discarded.
Alexander Afanasyev25286362016-09-05 20:55:25 -070039
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050040CanBePrefix
41~~~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000042
43::
44
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050045 CanBePrefix ::= CAN-BE-PREFIX-TYPE 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
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000055MustBeFresh
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050056~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000057
Alexander Afanasyeve2800232013-11-27 02:24:14 +000058::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000059
60 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
61
Junxiao Shif2bbb902019-03-15 14:36:30 -040062The presence or absence of the ``MustBeFresh`` element indicates whether a content store may satisfy the Interest with stale Data.
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050063Refer for :ref:`FreshnessPeriod section <FreshnessPeriod>` for more information.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000064
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050065ForwardingHint
66~~~~~~~~~~~~~~
67
68::
69
70 ForwardingHint ::= FORWARDING-HINT-TYPE TLV-LENGTH
71 Delegation+
72
73The ForwardingHint element contains a list of name delegations, as defined in :ref:`link` section.
74Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path.
75Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000076
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000077.. _Nonce:
78
79Nonce
80~~~~~
81
82Nonce defined as follows:
83
84::
85
86 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
87
Alexander Afanasyev4b896112014-06-23 21:47:15 -070088The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000089The combination of Name and Nonce should uniquely identify an Interest packet.
90This is used to detect looping Interests.
91
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000092InterestLifetime
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050093~~~~~~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000094
Alexander Afanasyeve2800232013-11-27 02:24:14 +000095::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000096
97 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
98
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070099``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000100The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
101
102Nodes 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).
103
104It is the application that sets the value for ``InterestLifetime``.
105If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
106The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700107
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500108HopLimit
109~~~~~~~~
spirosmastorakis988e7412016-10-27 14:01:59 -0700110
Junxiao Shicfc5d212017-06-02 17:48:51 +0000111::
spirosmastorakis988e7412016-10-27 14:01:59 -0700112
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500113 HopLimit ::= HOP-LIMIT-TYPE TLV-LENGTH(=1) BYTE{1}
spirosmastorakis988e7412016-10-27 14:01:59 -0700114
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500115The 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.
116
117If element is present:
118
119- if the ``HopLimit`` value is larger than or equal to 1, a node should accept the packet and decrease the encoded value by 1.
120
121 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.
122
123- if ``HopLimit`` is 0, a node must drop the packet
124
125If omitted:
126
127- a node should accept the packet;
128
129- when desired, a node can augment the Interest with the ``HopLimit`` element.
130
Junxiao Shif2bbb902019-03-15 14:36:30 -0400131ApplicationParameters
132~~~~~~~~~~~~~~~~~~~~~
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500133
134::
135
Junxiao Shif2bbb902019-03-15 14:36:30 -0400136 ApplicationParameters ::= APPLICATION-PARAMETERS-TYPE TLV-LENGTH
137 BYTE*
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500138
Junxiao Shif2bbb902019-03-15 14:36:30 -0400139The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data.
Zhiyi Zhang0c04fd82018-09-04 16:29:47 -0400140The 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).