blob: 0e408fbe757b528043cac33f449af90cf89c7eb7 [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
Junxiao Shi78ce2952019-05-07 15:34:00 -040010 Interest = INTEREST-TYPE TLV-LENGTH
11 Name
12 [CanBePrefix]
13 [MustBeFresh]
14 [ForwardingHint]
15 [Nonce]
16 [InterestLifetime]
17 [HopLimit]
18 [ApplicationParameters [InterestSignature]]
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000019
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050020``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 Shif2bbb902019-03-15 14:36:30 -040023Interest can also include an optional ``ApplicationParameters`` element.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000024
Junxiao Shi78ce2952019-05-07 15:34:00 -040025If an Interest contains ``InterestSignature``, it is considered a Signed Interest.
Zhiyi Zhang0c04fd82018-09-04 16:29:47 -040026See :doc:`Signed Interest section <signed-interest>` for details.
27
Junxiao Shi707ea002018-07-17 15:42:52 -040028As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet.
29However, they must not appear before the ``Name`` element.
30
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000031Name
32~~~~
33
Alexander Afanasyeve2800232013-11-27 02:24:14 +000034See :ref:`Name section <Name>` for details.
35
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050036The ``Name`` element that can be put in the Interest is further restricted to have at least one name component.
37Interests that include Name TLV that has zero name components MUST be discarded.
Alexander Afanasyev25286362016-09-05 20:55:25 -070038
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050039CanBePrefix
40~~~~~~~~~~~
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
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
Junxiao Shi78ce2952019-05-07 15:34:00 -040060 MustBeFresh = MUST-BE-FRESH-TYPE
61 TLV-LENGTH ; == 0
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000062
Junxiao Shif2bbb902019-03-15 14:36:30 -040063The 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 -050064Refer for :ref:`FreshnessPeriod section <FreshnessPeriod>` for more information.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000065
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050066ForwardingHint
67~~~~~~~~~~~~~~
68
69::
70
Junxiao Shi78ce2952019-05-07 15:34:00 -040071 ForwardingHint = FORWARDING-HINT-TYPE TLV-LENGTH 1*Delegation
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050072
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
Junxiao Shi78ce2952019-05-07 15:34:00 -040086 Nonce = NONCE-TYPE
87 TLV-LENGTH ; == 4
88 4OCTET
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000089
Alexander Afanasyev4b896112014-06-23 21:47:15 -070090The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000091The combination of Name and Nonce should uniquely identify an Interest packet.
92This is used to detect looping Interests.
93
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000094InterestLifetime
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050095~~~~~~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000096
Alexander Afanasyeve2800232013-11-27 02:24:14 +000097::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000098
Junxiao Shi78ce2952019-05-07 15:34:00 -040099 InterestLifetime = INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000100
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700101``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000102The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
103
104Nodes 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).
105
106It is the application that sets the value for ``InterestLifetime``.
107If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
108The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700109
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500110HopLimit
111~~~~~~~~
spirosmastorakis988e7412016-10-27 14:01:59 -0700112
Junxiao Shicfc5d212017-06-02 17:48:51 +0000113::
spirosmastorakis988e7412016-10-27 14:01:59 -0700114
Junxiao Shi78ce2952019-05-07 15:34:00 -0400115 HopLimit = HOP-LIMIT-TYPE
116 TLV-LENGTH ; == 1
117 OCTET
spirosmastorakis988e7412016-10-27 14:01:59 -0700118
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500119The 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.
120
121If element is present:
122
123- if the ``HopLimit`` value is larger than or equal to 1, a node should accept the packet and decrease the encoded value by 1.
124
125 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.
126
127- if ``HopLimit`` is 0, a node must drop the packet
128
129If omitted:
130
131- a node should accept the packet;
132
133- when desired, a node can augment the Interest with the ``HopLimit`` element.
134
Junxiao Shif2bbb902019-03-15 14:36:30 -0400135ApplicationParameters
136~~~~~~~~~~~~~~~~~~~~~
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500137
138::
139
Junxiao Shi78ce2952019-05-07 15:34:00 -0400140 ApplicationParameters = APPLICATION-PARAMETERS-TYPE TLV-LENGTH *OCTET
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500141
Junxiao Shif2bbb902019-03-15 14:36:30 -0400142The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data.
Junxiao Shi78ce2952019-05-07 15:34:00 -0400143The 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).