blob: 82180073cd59f98fa9cbc17dd60dae4f9f5542ff [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?
18 Parameters?
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.
23Interest can also include an optional ``Parameters`` element.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000024
25Name
26~~~~
27
Alexander Afanasyeve2800232013-11-27 02:24:14 +000028See :ref:`Name section <Name>` for details.
29
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050030The ``Name`` element that can be put in the Interest is further restricted to have at least one name component.
31Interests that include Name TLV that has zero name components MUST be discarded.
Alexander Afanasyev25286362016-09-05 20:55:25 -070032
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050033CanBePrefix
34~~~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000035
36::
37
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050038 CanBePrefix ::= CAN-BE-PREFIX-TYPE TLV-LENGTH(=0)
Alexander Afanasyeve2800232013-11-27 02:24:14 +000039
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050040When 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 +000041
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050042When not present, the ``Name`` element is either exact or full name of the Data packet:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000043
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050044- 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 +000045
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050046- 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 -070047
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000048MustBeFresh
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050049~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000050
Alexander Afanasyeve2800232013-11-27 02:24:14 +000051::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000052
53 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
54
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050055The presence or absense of the ``MustBeFresh`` element indicates whether a content store may satisfy the Interest with stale Data.
56Refer for :ref:`FreshnessPeriod section <FreshnessPeriod>` for more information.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000057
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050058ForwardingHint
59~~~~~~~~~~~~~~
60
61::
62
63 ForwardingHint ::= FORWARDING-HINT-TYPE TLV-LENGTH
64 Delegation+
65
66The ForwardingHint element contains a list of name delegations, as defined in :ref:`link` section.
67Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path.
68Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000069
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000070.. _Nonce:
71
72Nonce
73~~~~~
74
75Nonce defined as follows:
76
77::
78
79 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
80
Alexander Afanasyev4b896112014-06-23 21:47:15 -070081The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +000082The combination of Name and Nonce should uniquely identify an Interest packet.
83This is used to detect looping Interests.
84
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000085InterestLifetime
Alexander Afanasyeve9f48512018-01-15 23:44:50 -050086~~~~~~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000087
Alexander Afanasyeve2800232013-11-27 02:24:14 +000088::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000089
90 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
91
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070092``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000093The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
94
95Nodes 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).
96
97It is the application that sets the value for ``InterestLifetime``.
98If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
99The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700100
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500101HopLimit
102~~~~~~~~
spirosmastorakis988e7412016-10-27 14:01:59 -0700103
Junxiao Shicfc5d212017-06-02 17:48:51 +0000104::
spirosmastorakis988e7412016-10-27 14:01:59 -0700105
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500106 HopLimit ::= HOP-LIMIT-TYPE TLV-LENGTH(=1) BYTE{1}
spirosmastorakis988e7412016-10-27 14:01:59 -0700107
Alexander Afanasyeve9f48512018-01-15 23:44:50 -0500108The 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.
109
110If element is present:
111
112- if the ``HopLimit`` value is larger than or equal to 1, a node should accept the packet and decrease the encoded value by 1.
113
114 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.
115
116- if ``HopLimit`` is 0, a node must drop the packet
117
118If omitted:
119
120- a node should accept the packet;
121
122- when desired, a node can augment the Interest with the ``HopLimit`` element.
123
124Parameters
125~~~~~~~~~~
126
127::
128
129 Parameters ::= PARAMETERS-TYPE TLV-LENGTH
130 BYTE*
131
132The ``Parameters`` element can carry any arbitrary data that parameterizes the request for Data.
133The Interest's name should include a component or components to ensure uniqueness of the parametrized Interest.
134For example, a SHA256 digest of the ``Parameters`` TLV can be included as one of the components of the Interest name.