blob: f93185eeebbba424cc96fc79c68071bd5688440a [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?
Junxiao Shif2bbb902019-03-15 14:36:30 -040018 ApplicationParameters?
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 Shi707ea002018-07-17 15:42:52 -040025As recommended by :ref:`TLV evolvability guidelines <evolvability>`, unrecognized non-critical TLV elements may appear in the Interest packet.
26However, they must not appear before the ``Name`` element.
27
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000028Name
29~~~~
30
Alexander Afanasyeve2800232013-11-27 02:24:14 +000031See :ref:`Name section <Name>` for details.
32
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050033The ``Name`` element that can be put in the Interest is further restricted to have at least one name component.
34Interests that include Name TLV that has zero name components MUST be discarded.
Alexander Afanasyev25286362016-09-05 20:55:25 -070035
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050036CanBePrefix
37~~~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000038
39::
40
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050041 CanBePrefix ::= CAN-BE-PREFIX-TYPE TLV-LENGTH(=0)
Alexander Afanasyeve2800232013-11-27 02:24:14 +000042
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050043When 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 +000044
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050045When not present, the ``Name`` element is either exact or full name of the Data packet:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000046
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050047- 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 +000048
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050049- 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 -070050
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000051MustBeFresh
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050052~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000053
Alexander Afanasyeve2800232013-11-27 02:24:14 +000054::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000055
56 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
57
Junxiao Shif2bbb902019-03-15 14:36:30 -040058The 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 -050059Refer for :ref:`FreshnessPeriod section <FreshnessPeriod>` for more information.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000060
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050061ForwardingHint
62~~~~~~~~~~~~~~
63
64::
65
66 ForwardingHint ::= FORWARDING-HINT-TYPE TLV-LENGTH
67 Delegation+
68
69The ForwardingHint element contains a list of name delegations, as defined in :ref:`link` section.
70Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path.
71Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000072
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000073.. _Nonce:
74
75Nonce
76~~~~~
77
78Nonce defined as follows:
79
80::
81
82 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
83
Alexander Afanasyev4b896112014-06-23 21:47:15 -070084The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000085The combination of Name and Nonce should uniquely identify an Interest packet.
86This is used to detect looping Interests.
87
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000088InterestLifetime
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050089~~~~~~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000090
Alexander Afanasyeve2800232013-11-27 02:24:14 +000091::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000092
93 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
94
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070095``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000096The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
97
98Nodes 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
100It is the application that sets the value for ``InterestLifetime``.
101If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
102The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700103
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500104HopLimit
105~~~~~~~~
spirosmastorakis988e7412016-10-27 14:01:59 -0700106
Junxiao Shicfc5d212017-06-02 17:48:51 +0000107::
spirosmastorakis988e7412016-10-27 14:01:59 -0700108
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500109 HopLimit ::= HOP-LIMIT-TYPE TLV-LENGTH(=1) BYTE{1}
spirosmastorakis988e7412016-10-27 14:01:59 -0700110
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500111The 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
113If 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
121If 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 Shif2bbb902019-03-15 14:36:30 -0400127ApplicationParameters
128~~~~~~~~~~~~~~~~~~~~~
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500129
130::
131
Junxiao Shif2bbb902019-03-15 14:36:30 -0400132 ApplicationParameters ::= APPLICATION-PARAMETERS-TYPE TLV-LENGTH
133 BYTE*
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500134
Junxiao Shif2bbb902019-03-15 14:36:30 -0400135The ``ApplicationParameters`` element can carry any arbitrary data that parameterizes the request for Data.
136The 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).