blob: 85449cbf26f94b3d5308f244fcfb007b53b9fee1 [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?
15
Alexander Afanasyev7455e9b2014-06-25 09:41:08 -070016``Name`` and ``Nonce`` are the only two required elements in an Interest packet.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000017Selectors are optional elements that further qualify Data that may match the Interest.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070018They 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 +000019If Selectors TLV is present in the Interest, it MUST contain at least one selector.
20
Junxiao Shibdc75012015-01-13 22:09:12 -070021``InterestLifetime`` is optional and is referred to as a *Guider*.
22It affects Interest forwarding behavior, i.e., how long an Interest may be kept in the PIT.
23
24.. Guiders are not grouped.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000025
26
27Name
28~~~~
29
Alexander Afanasyeve2800232013-11-27 02:24:14 +000030The Name element in an Interest is synonymous with the term *prefix*.
31See :ref:`Name section <Name>` for details.
32
Alexander Afanasyeve2800232013-11-27 02:24:14 +000033.. _Selectors:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000034
35Selectors
36~~~~~~~~~
Alexander Afanasyeve2800232013-11-27 02:24:14 +000037
38::
39
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070040 Selectors ::= SELECTORS-TYPE TLV-LENGTH
Alexander Afanasyeve2800232013-11-27 02:24:14 +000041 MinSuffixComponents?
42 MaxSuffixComponents?
43 PublisherPublicKeyLocator?
44 Exclude?
45 ChildSelector?
46 MustBeFresh?
47
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000048MinSuffixComponents, MaxSuffixComponents
49++++++++++++++++++++++++++++++++++++++++
50
Alexander Afanasyeve2800232013-11-27 02:24:14 +000051::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000052
53 MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
54 nonNegativeInteger
55
56 MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
57 nonNegativeInteger
58
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070059When 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.
60These 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 +000061The 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.
62
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -070063
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000064PublisherPublicKeyLocator
65+++++++++++++++++++++++++
66
Alexander Afanasyeve2800232013-11-27 02:24:14 +000067::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000068
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000069 PublisherPublicKeyLocator ::= KeyLocator
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000070
71This element specifies the name of the key which is used to sign the Data packet that the consumer is requesting.
72This is a way for the Interest to select answers from a particular publisher.
73
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000074See :ref:`KeyLocator` section for more detail.
75
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000076Exclude
77+++++++
78
Alexander Afanasyeve2800232013-11-27 02:24:14 +000079::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000080
81 Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
82 Any ::= ANY-TYPE TLV-LENGTH(=0)
83
84The ``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 -070085For 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 +000086
87Exclude 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.
88
89The 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:
90
91- If none of the ``Any`` components are specified, the filter excludes only to the names specified in the Exclude list.
92
93- 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.
94
95- 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.
96
97- 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.
98
99
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000100Exclude 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 +0000101
102
103ChildSelector
104+++++++++++++
105
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000106::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000107
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700108 ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000109 nonNegativeInteger
110
111Often a given Interest can match more than one Data within a given content store.
112The ``ChildSelector`` provides a way of expressing a preference for which of these should be returned.
113If the value is 0, the leftmost child is preferred.
114If 1, the rightmost child is preferred.
115Here leftmost and rightmost refer to the least and greatest components according to the canonical NDN name component ordering (:ref:`Name Section<name>`).
116This ordering is only done at the level of the name hierarchy one past the name prefix.
117
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700118For 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 +0000119In 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 -0700120
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000121MustBeFresh
122+++++++++++
123
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000124::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000125
126 MustBeFresh ::= MUST-BE-FRESH-TYPE TLV-LENGTH(=0)
127
128This selector is encoded with Type and Length but no Value part.
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700129When 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 +0000130When it is present in an Interest packet, the router should not return Data packet from its content store whose FreshnessPeriod has expired.
131
132The 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.
133
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000134.. _Nonce:
135
136Nonce
137~~~~~
138
139Nonce defined as follows:
140
141::
142
143 Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
144
Alexander Afanasyev4b896112014-06-23 21:47:15 -0700145The Nonce carries a randomly-generated 4-octet long byte-string.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000146The combination of Name and Nonce should uniquely identify an Interest packet.
147This is used to detect looping Interests.
148
149.. _Guiders:
150
151Guiders
152~~~~~~~
153
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000154InterestLifetime
155++++++++++++++++
156
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000157::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000158
159 InterestLifetime ::= INTEREST-LIFETIME-TYPE TLV-LENGTH nonNegativeInteger
160
Alexander Afanasyeva6fc7272014-06-13 11:58:06 -0700161``InterestLifetime`` indicates the (approximate) time remaining before the Interest times out.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000162The value is the number of milliseconds. The timeout is relative to the arrival time of the Interest at the current node.
163
164Nodes 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).
165
166It is the application that sets the value for ``InterestLifetime``.
167If the ``InterestLifetime`` element is omitted, a default value of 4 seconds is used (4000).
168The missing element may be added before forwarding.