blob: 30d9abd21b5cb485479e000f9c486a0f7003a8a1 [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
12 Selectors?
13 Nonce
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000014 InterestLifetime?
Junxiao Shicfc5d212017-06-02 17:48:51 +000015 ForwardingHint?
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000016
Alexander Afanasyev7455e9b2014-06-25 09:41:08 -070017``Name`` and ``Nonce`` are the only two required elements in an Interest packet.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000018Selectors are optional elements that further qualify Data that may match the Interest.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070019They are used for discovering and selecting the Data that matches best to what the application wants. Selectors are placed right after the Name to facilitate implementations that may use continuous memory block of Name and Selectors TLVs together as the index for PIT lookup. By using a TLV to group all the Selectors, an implementation can easily skip them to find Nonce, which is used together with Name to identify looping Interests.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000020If Selectors TLV is present in the Interest, it MUST contain at least one selector.
21
Junxiao Shicfc5d212017-06-02 17:48:51 +000022``InterestLifetime`` and ``ForwardingHint`` are optional and are referred to as *Guiders*.
23They affect Interest forwarding behavior.
Junxiao Shibdc75012015-01-13 22:09:12 -070024
25.. Guiders are not grouped.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000026
27
28Name
29~~~~
30
Alexander Afanasyeve2800232013-11-27 02:24:14 +000031The Name element in an Interest is synonymous with the term *prefix*.
32See :ref:`Name section <Name>` for details.
33
Alexander Afanasyev25286362016-09-05 20:55:25 -070034The Name element that can be put in the Interest is further restricted to have at least one NameComponent.
35Interests that include Name TLV that has zero name components MUST BE discarded.
36
Alexander Afanasyeve2800232013-11-27 02:24:14 +000037.. _Selectors:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000038
39Selectors
40~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000041
42::
43
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070044 Selectors ::= SELECTORS-TYPE TLV-LENGTH
Alexander Afanasyeve2800232013-11-27 02:24:14 +000045 MinSuffixComponents?
46 MaxSuffixComponents?
47 PublisherPublicKeyLocator?
48 Exclude?
49 ChildSelector?
50 MustBeFresh?
51
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000052MinSuffixComponents, MaxSuffixComponents
53++++++++++++++++++++++++++++++++++++++++
54
Alexander Afanasyeve2800232013-11-27 02:24:14 +000055::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000056
57 MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
58 nonNegativeInteger
59
60 MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
61 nonNegativeInteger
62
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070063When needed, ``MinSuffixComponents`` and ``MaxSuffixComponents`` allow a data consumer to indicate whether the Name in the Interest is the full name including the digest, or the full name except for the digest, or the content it is seeking has a known range of legitimate component counts.
64These two parameters refer to the number of name components beyond those in the prefix, and counting the implicit digest, that may occur in the matching Data.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000065The default for ``MinSuffixComponents`` is 0 and for ``MaxSuffixComponents`` is effectively infinite, meaning that any Data whose name starts with the prefix is a match. Often only one of these will be needed to get the desired effect.
66
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070067
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000068PublisherPublicKeyLocator
69+++++++++++++++++++++++++
70
Alexander Afanasyeve2800232013-11-27 02:24:14 +000071::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000072
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000073 PublisherPublicKeyLocator ::= KeyLocator
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000074
75This element specifies the name of the key which is used to sign the Data packet that the consumer is requesting.
76This is a way for the Interest to select answers from a particular publisher.
77
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000078See :ref:`KeyLocator` section for more detail.
79
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000080Exclude
81+++++++
82
Alexander Afanasyeve2800232013-11-27 02:24:14 +000083::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000084
Cenk Gündoğan9c0dbbd2016-09-14 19:21:07 +020085 Exclude ::= EXCLUDE-TYPE TLV-LENGTH AnyLeading? (NameComponent | AnyBetween)* AnyTrailing?
86 AnyLeading ::= Any NameComponent
87 AnyBetween ::= NameComponent Any NameComponent
88 AnyTrailing ::= NameComponent Any
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000089 Any ::= ANY-TYPE TLV-LENGTH(=0)
90
Cenk Gündoğanbc5f0ec2016-09-14 15:49:52 +020091The ``Exclude`` selectors allow requesters to specify list and/or ranges of name components that MUST NOT appear as a continuation of the Name prefix in the responding Data packet to the Interest.
Alexander Afanasyev4b8be212014-10-06 10:55:04 -070092For example, if Interest is expressed for ``/ndn/edu`` and Exclude specifies one name component ``ucla``, then neither data producer nor conforming NDN routers are allowed to return any Data packet that has prefix ``/ndn/edu/ucla``.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000093
94Exclude filter applies only to a name component of the Data packet name that is located at a position that numerically equals to the number of name components in the Interest packet, assuming 0 is the first name component.
95
96The Components in the exclusion list MUST occur in strictly increasing order according to the canonical NDN name component ordering (:ref:`Name Section<name>`), with optional leading, trailing, and interleaved ``Any`` components. The following defines processing of ``Any`` components:
97
Cenk Gündoğanbc5f0ec2016-09-14 15:49:52 +020098- If none of the ``Any`` components are specified, the filter excludes only the names specified in the Exclude list.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000099
100- If a leading ``Any`` component is specified, then the filter excludes all names that are smaller or equal (in NDN name component canonical ordering) to the first NameComponent in the Exclude list.
101
102- If a trailing ``Any`` component is specified, then the filter excludes all names that are larger or equal (in NDN name component canonical ordering) to the last NameComponent in the Exclude list.
103
104- If ``Any`` component is specified between two NameComponents in the list, then the filter excludes all names from the range from the right NameComponent to the left NameComponent, including both ends.
105
106
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000107Exclude filter MUST not consist of a single ``Any`` component or one NameComponent with leading and trailing ``Any`` components.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000108
109
110ChildSelector
111+++++++++++++
112
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000113::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000114
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700115 ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000116 nonNegativeInteger
117
118Often a given Interest can match more than one Data within a given content store.
119The ``ChildSelector`` provides a way of expressing a preference for which of these should be returned.
120If the value is 0, the leftmost child is preferred.
121If 1, the rightmost child is preferred.
122Here leftmost and rightmost refer to the least and greatest components according to the canonical NDN name component ordering (:ref:`Name Section<name>`).
123This ordering is only done at the level of the name hierarchy one past the name prefix.
Eric Newberry1c799952017-05-20 20:56:16 -0700124If the ``ChildSelector`` field is not present, the leftmost child is preferred (a value of 0).
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000125
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700126For example, assuming in the name hierarchy the component immediately after the name prefix is the version number, whose next level is the segment number, then setting ChildSelector to be 1 will retrieve the rightmost version number (i.e., the latest version) and the leftmost segment number (i.e., the first segment). However, this selection is only done with respect to a single content store, not globally. Additional rounds that exclude the earlier versions may be used to explore other content stores for newer versions.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000127In this case, the use of ChildSelector does not change the multi-round outcome, but it decreases the number of rounds needed to converge to an answer.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700128
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000129MustBeFresh
130+++++++++++
131
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000132::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000133
134 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
135
136This selector is encoded with Type and Length but no Value part.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700137When it is absent from an Interest packet, the router can respond with a Data packet from its content store whose FreshnessPeriod is either still valid or expired.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000138When it is present in an Interest packet, the router should not return Data packet from its content store whose FreshnessPeriod has expired.
139
140The FreshnessPeriod carried in each Data packet (:ref:`Data Section<data>`) is set by the original producer. It starts counting down when the Data packet arrives at a node. Consequently if a node is N hops away from the original producer, it may not consider the Data stale until N *X* FreshnessPeriod after the Data is produced.
141
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000142.. _Nonce:
143
144Nonce
145~~~~~
146
147Nonce defined as follows:
148
149::
150
151 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
152
Alexander Afanasyev4b896112014-06-23 21:47:15 -0700153The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000154The combination of Name and Nonce should uniquely identify an Interest packet.
155This is used to detect looping Interests.
156
157.. _Guiders:
158
159Guiders
160~~~~~~~
161
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000162InterestLifetime
163++++++++++++++++
164
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000165::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000166
167 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
168
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700169``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000170The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
171
172Nodes 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).
173
174It is the application that sets the value for ``InterestLifetime``.
175If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
176The missing element may be added before forwarding.
spirosmastorakis988e7412016-10-27 14:01:59 -0700177
Junxiao Shicfc5d212017-06-02 17:48:51 +0000178ForwardingHint
179++++++++++++++
spirosmastorakis988e7412016-10-27 14:01:59 -0700180
Junxiao Shicfc5d212017-06-02 17:48:51 +0000181::
spirosmastorakis988e7412016-10-27 14:01:59 -0700182
Junxiao Shicfc5d212017-06-02 17:48:51 +0000183 ForwardingHint ::= FORWARDING-HINT-TYPE TLV-LENGTH
184 Delegation+
spirosmastorakis988e7412016-10-27 14:01:59 -0700185
Junxiao Shicfc5d212017-06-02 17:48:51 +0000186The ForwardingHint field contains a list of name delegations, as defined in :ref:`link` section.
187Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path.
188Specifics of the forwarding logic for Interests with ``ForwardingHint`` will be defined in a separated document.