blob: 87faf101d38cec46937e0b64dbf093c282aa9e26 [file] [log] [blame]
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00001.. _interest:
2
3Interest Packet
4---------------
5
6NDN Interest packet is TLV defined as follows::
7
8 Interest ::= INTEREST-TYPE TLV-LENGTH
9 Name
10 Selectors?
11 Nonce
12 Scope?
13 InterestLifetime?
14
15Selectors::
16
17 Selectors ::= SELECTORS-TYPE TLV-LENGTH
18 MinSuffixComponents?
19 MaxSuffixComponents?
20 PublisherPublicKeyLocator?
21 Exclude?
22 ChildSelector?
23 MustBeFresh?
24
25``Name`` and ``Nonce`` are the only two two required elements in an Interest packet.
26Selectors are optional elements that further qualify Data that may match the Interest.
27They 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.
28If Selectors TLV is present in the Interest, it MUST contain at least one selector.
29
30The two other optional elements, Scope and InterestLifetime, are referred to as *Guiders*.
31They 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.
32
33
34Name
35~~~~
36
37The Name element in an Interest is synonymous with the term *prefix*. See :ref:`Name section<name>` for details.
38
39Nonce
40~~~~~
41
42Nonce defined as follows::
43
44 Nonce ::= NONCE-TYPE TLV-LENGTH BYTE+
45
46The Nonce carries a randomly-genenerated byte-string. The combination of Name and Nonce should uniquely identify an Interest packet. This is used to detect looping Interests\footnote{We plan to select a recommended length for Nonce in next revision.}.
47
48Selectors
49~~~~~~~~~
50
51MinSuffixComponents, MaxSuffixComponents
52++++++++++++++++++++++++++++++++++++++++
53
54.. code-block:: none
55
56 MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
57 nonNegativeInteger
58
59 MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
60 nonNegativeInteger
61
62When 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.
63These 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.
64The 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.
65
66
67PublisherPublicKeyLocator
68+++++++++++++++++++++++++
69
70.. code-block:: none
71
72 PublisherPublicKeyLocator ::= PUBLISHER-PUBLIC-KEY-TYPE TLV-LENGTH Name
73
74This element specifies the name of the key which is used to sign the Data packet that the consumer is requesting.
75This is a way for the Interest to select answers from a particular publisher.
76
77Exclude
78+++++++
79
80.. code-block:: none
81
82 Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
83 Any ::= ANY-TYPE TLV-LENGTH(=0)
84
85The ``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.
86For 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``.
87
88Exclude 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.
89
90The 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:
91
92- If none of the ``Any`` components are specified, the filter excludes only to the names specified in the Exclude list.
93
94- 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.
95
96- 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.
97
98- 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.
99
100
101Exclude filter MUST not consist of a single ``Any`` component or one NameComponent with leading and trailing ``Any'' components.
102
103
104ChildSelector
105+++++++++++++
106
107.. code-block:: none
108
109 ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
110 nonNegativeInteger
111
112Often a given Interest can match more than one Data within a given content store.
113The ``ChildSelector`` provides a way of expressing a preference for which of these should be returned.
114If the value is 0, the leftmost child is preferred.
115If 1, the rightmost child is preferred.
116Here leftmost and rightmost refer to the least and greatest components according to the canonical NDN name component ordering (:ref:`Name Section<name>`).
117This ordering is only done at the level of the name hierarchy one past the name prefix.
118
119For 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.
120In 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.
121
122MustBeFresh
123+++++++++++
124
125.. code-block:: none
126
127 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
128
129This selector is encoded with Type and Length but no Value part.
130When 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.
131When it is present in an Interest packet, the router should not return Data packet from its content store whose FreshnessPeriod has expired.
132
133The 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.
134
135Scope
136+++++
137
138.. code-block:: none
139
140 Scope ::= SCOPE-TYPE TLV-LENGTH nonNegativeInteger
141
142This value limits how far the Interest may propagate.
143Scope 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.
144Scope 2 limits propagation to no further than the next node.
145Other values are not defined at this time, and will cause the Interest packet to be dropped.
146
147Note that Scope is not a hop count---the value is not decremented as the Interest is forwarded.
148
149InterestLifetime
150++++++++++++++++
151
152.. code-block:: none
153
154 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
155
156``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
157The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
158
159Nodes 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).
160
161It is the application that sets the value for ``InterestLifetime``.
162If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
163The missing element may be added before forwarding.
164
165Changes from CCNx
166~~~~~~~~~~~~~~~~~
167
168- ``Nonce`` is changed from optional to required.
169
170- ``PublisherPublicKeyDigest`` is replaced by ``PublisherPublicKeyLocator``.
171
172- ``AnswerOriginKind`` is simplified from 4bits to a 1-bit ``MustBeFresh``.
173
174- ``FaceID`` has been removed.
175
176- ``InterestLifetime`` changes the unit to the number of milliseconds.
177
178- Removed Bloom Filter from Exclude.