blob: 7b5a263b578bd235873f426b6c976707d6f405ae [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
10 Interest ::= INTEREST-TYPE TLV-LENGTH
11 Name
12 Selectors?
13 Nonce
14 Scope?
15 InterestLifetime?
16
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000017``Name`` and ``Nonce`` are the only two two required elements in an Interest packet.
18Selectors are optional elements that further qualify Data that may match the Interest.
19They 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.
20If 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
32.. _Nonce:
33
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000034Nonce
35~~~~~
36
Alexander Afanasyeve2800232013-11-27 02:24:14 +000037Nonce defined as follows:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000038
Alexander Afanasyeve2800232013-11-27 02:24:14 +000039::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000040
Alexander Afanasyeve2800232013-11-27 02:24:14 +000041 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
42
43The Nonce carries a randomly-genenerated 4-octet long byte-string.
44The combination of Name and Nonce should uniquely identify an Interest packet.
45This is used to detect looping Interests.
46
47.. _Selectors:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000048
49Selectors
50~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000051
52::
53
54 Selectors ::= SELECTORS-TYPE TLV-LENGTH
55 MinSuffixComponents?
56 MaxSuffixComponents?
57 PublisherPublicKeyLocator?
58 Exclude?
59 ChildSelector?
60 MustBeFresh?
61
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000062MinSuffixComponents, MaxSuffixComponents
63++++++++++++++++++++++++++++++++++++++++
64
Alexander Afanasyeve2800232013-11-27 02:24:14 +000065::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000066
67 MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
68 nonNegativeInteger
69
70 MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
71 nonNegativeInteger
72
73When 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.
74These 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.
75The 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.
76
77
78PublisherPublicKeyLocator
79+++++++++++++++++++++++++
80
Alexander Afanasyeve2800232013-11-27 02:24:14 +000081::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000082
83 PublisherPublicKeyLocator ::= PUBLISHER-PUBLIC-KEY-TYPE TLV-LENGTH Name
84
85This element specifies the name of the key which is used to sign the Data packet that the consumer is requesting.
86This is a way for the Interest to select answers from a particular publisher.
87
88Exclude
89+++++++
90
Alexander Afanasyeve2800232013-11-27 02:24:14 +000091::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000092
93 Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
94 Any ::= ANY-TYPE TLV-LENGTH(=0)
95
96The ``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.
97For example, if Interest is expressed for ``/ndn/edu`` and Exclude specifies one name component ``ucla``, then nor data producer nor conforming NDN routers are allowed to return any Data packet that has prefix ``/ndn/edu/ucla``.
98
99Exclude 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.
100
101The 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:
102
103- If none of the ``Any`` components are specified, the filter excludes only to the names specified in the Exclude list.
104
105- 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.
106
107- 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.
108
109- 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.
110
111
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000112Exclude 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 +0000113
114
115ChildSelector
116+++++++++++++
117
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000118::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000119
120 ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
121 nonNegativeInteger
122
123Often a given Interest can match more than one Data within a given content store.
124The ``ChildSelector`` provides a way of expressing a preference for which of these should be returned.
125If the value is 0, the leftmost child is preferred.
126If 1, the rightmost child is preferred.
127Here leftmost and rightmost refer to the least and greatest components according to the canonical NDN name component ordering (:ref:`Name Section<name>`).
128This ordering is only done at the level of the name hierarchy one past the name prefix.
129
130For 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.
131In 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.
132
133MustBeFresh
134+++++++++++
135
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000136::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000137
138 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
139
140This selector is encoded with Type and Length but no Value part.
141When 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.
142When it is present in an Interest packet, the router should not return Data packet from its content store whose FreshnessPeriod has expired.
143
144The 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.
145
146Scope
147+++++
148
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000149::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000150
151 Scope ::= SCOPE-TYPE TLV-LENGTH nonNegativeInteger
152
153This value limits how far the Interest may propagate.
154Scope 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.
155Scope 2 limits propagation to no further than the next node.
156Other values are not defined at this time, and will cause the Interest packet to be dropped.
157
158Note that Scope is not a hop count---the value is not decremented as the Interest is forwarded.
159
160InterestLifetime
161++++++++++++++++
162
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000163::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000164
165 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
166
167``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
168The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
169
170Nodes 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).
171
172It is the application that sets the value for ``InterestLifetime``.
173If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
174The missing element may be added before forwarding.
175
176Changes from CCNx
177~~~~~~~~~~~~~~~~~
178
179- ``Nonce`` is changed from optional to required.
180
181- ``PublisherPublicKeyDigest`` is replaced by ``PublisherPublicKeyLocator``.
182
183- ``AnswerOriginKind`` is simplified from 4bits to a 1-bit ``MustBeFresh``.
184
185- ``FaceID`` has been removed.
186
187- ``InterestLifetime`` changes the unit to the number of milliseconds.
188
189- Removed Bloom Filter from Exclude.