blob: 6e27d50bddb645faca617f472a98d44f897162f4 [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
14 Scope?
15 InterestLifetime?
16
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
22The two other optional elements, Scope and InterestLifetime, are referred to as *Guiders*.
23They affect Interest forwarding behavior, e.g., how far the Interest may be forwarded, and how long an Interest may be kept in the PIT. They are not grouped.
24
25
26Name
27~~~~
28
Alexander Afanasyeve2800232013-11-27 02:24:14 +000029The Name element in an Interest is synonymous with the term *prefix*.
30See :ref:`Name section <Name>` for details.
31
Alexander Afanasyeve2800232013-11-27 02:24:14 +000032.. _Selectors:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000033
34Selectors
35~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000036
37::
38
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070039 Selectors ::= SELECTORS-TYPE TLV-LENGTH
Alexander Afanasyeve2800232013-11-27 02:24:14 +000040 MinSuffixComponents?
41 MaxSuffixComponents?
42 PublisherPublicKeyLocator?
43 Exclude?
44 ChildSelector?
45 MustBeFresh?
46
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000047MinSuffixComponents, MaxSuffixComponents
48++++++++++++++++++++++++++++++++++++++++
49
Alexander Afanasyeve2800232013-11-27 02:24:14 +000050::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000051
52 MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
53 nonNegativeInteger
54
55 MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
56 nonNegativeInteger
57
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070058When 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.
59These 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 +000060The 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.
61
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070062
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000063PublisherPublicKeyLocator
64+++++++++++++++++++++++++
65
Alexander Afanasyeve2800232013-11-27 02:24:14 +000066::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000067
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000068 PublisherPublicKeyLocator ::= KeyLocator
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000069
70This element specifies the name of the key which is used to sign the Data packet that the consumer is requesting.
71This is a way for the Interest to select answers from a particular publisher.
72
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000073See :ref:`KeyLocator` section for more detail.
74
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000075Exclude
76+++++++
77
Alexander Afanasyeve2800232013-11-27 02:24:14 +000078::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000079
80 Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
81 Any ::= ANY-TYPE TLV-LENGTH(=0)
82
83The ``Exclude`` selectors allows requester to specify list and/or ranges of names 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 -070084For 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 +000085
86Exclude 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.
87
88The 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:
89
90- If none of the ``Any`` components are specified, the filter excludes only to the names specified in the Exclude list.
91
92- 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.
93
94- 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.
95
96- 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.
97
98
Alexander Afanasyeve2800232013-11-27 02:24:14 +000099Exclude 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 +0000100
101
102ChildSelector
103+++++++++++++
104
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000105::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000106
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700107 ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000108 nonNegativeInteger
109
110Often a given Interest can match more than one Data within a given content store.
111The ``ChildSelector`` provides a way of expressing a preference for which of these should be returned.
112If the value is 0, the leftmost child is preferred.
113If 1, the rightmost child is preferred.
114Here leftmost and rightmost refer to the least and greatest components according to the canonical NDN name component ordering (:ref:`Name Section<name>`).
115This ordering is only done at the level of the name hierarchy one past the name prefix.
116
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700117For 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 +0000118In 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 -0700119
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000120MustBeFresh
121+++++++++++
122
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000123::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000124
125 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
126
127This selector is encoded with Type and Length but no Value part.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700128When 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 +0000129When it is present in an Interest packet, the router should not return Data packet from its content store whose FreshnessPeriod has expired.
130
131The 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.
132
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000133.. _Nonce:
134
135Nonce
136~~~~~
137
138Nonce defined as follows:
139
140::
141
142 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
143
Alexander Afanasyev4b896112014-06-23 21:47:15 -0700144The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000145The combination of Name and Nonce should uniquely identify an Interest packet.
146This is used to detect looping Interests.
147
148.. _Guiders:
149
150Guiders
151~~~~~~~
152
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000153Scope
154+++++
155
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000156::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000157
158 Scope ::= SCOPE-TYPE TLV-LENGTH nonNegativeInteger
159
160This value limits how far the Interest may propagate.
161Scope 0 prevents propagation beyond the local NDN daemon (even to other applications on the same host). Scope 1 limits propagation to the applications on the originating host.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700162Scope 2 limits propagation to no further than the next node.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000163Other values are not defined at this time, and will cause the Interest packet to be dropped.
164
165Note that Scope is not a hop count---the value is not decremented as the Interest is forwarded.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700166
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000167InterestLifetime
168++++++++++++++++
169
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000170::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000171
172 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
173
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700174``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000175The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
176
177Nodes 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).
178
179It is the application that sets the value for ``InterestLifetime``.
180If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
181The missing element may be added before forwarding.