<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g2.doxu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nascentmind</id>
	<title>Gnutella2 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://g2.doxu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nascentmind"/>
	<link rel="alternate" type="text/html" href="https://g2.doxu.org/wiki/Special:Contributions/Nascentmind"/>
	<updated>2026-05-28T17:52:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://g2.doxu.org/index.php?title=Q2&amp;diff=2910</id>
		<title>Q2</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=Q2&amp;diff=2910"/>
		<updated>2009-02-07T15:46:34Z</updated>

		<summary type="html">&lt;p&gt;Nascentmind: /* Children */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Packets}}&lt;br /&gt;
&lt;br /&gt;
= /Q2 - Gnutella2 Query =&lt;br /&gt;
&lt;br /&gt;
The /Q2 packet is the generic Gnutella2 object query descriptor. It contains search&lt;br /&gt;
criteria, identification, authentication, return addressing and the type of information&lt;br /&gt;
the search client is interested in.&lt;br /&gt;
&lt;br /&gt;
== Sending ==&lt;br /&gt;
&lt;br /&gt;
A node should send a /Q2 packet to another node when it wishes to execute a query&lt;br /&gt;
on that node (and its searchable relations).&lt;br /&gt;
/Q2 packets should always be filtered against a query hash table if one is available&lt;br /&gt;
for the outbound link.&lt;br /&gt;
&lt;br /&gt;
== Receiving ==&lt;br /&gt;
&lt;br /&gt;
Upon receiving a query, a node should:&lt;br /&gt;
&lt;br /&gt;
* Verify its authentication&lt;br /&gt;
* Send an acknowledgment if it was not received from a hub&lt;br /&gt;
* Forward it to connected nodes if necessary (detailed below)&lt;br /&gt;
* Process it locally and dispatch results&lt;br /&gt;
&lt;br /&gt;
== Forwarding ==&lt;br /&gt;
&lt;br /&gt;
Forwarding of /Q2 packets is achieved based on fixed rules:&lt;br /&gt;
&lt;br /&gt;
* A query received from a leaf or via UDP is forwarded to all connected nodes&lt;br /&gt;
* A query received from a hub is forwarded to connected leaves only&lt;br /&gt;
&lt;br /&gt;
== Payload ==&lt;br /&gt;
&lt;br /&gt;
The payload of a /Q2 packet consists of a GUID which uniquely identifies the search&lt;br /&gt;
operation.&lt;br /&gt;
&lt;br /&gt;
== Children ==&lt;br /&gt;
&lt;br /&gt;
This packet has many defined child packet types at the current time:&lt;br /&gt;
* /Q2/UDP - Return Address and Authentication&lt;br /&gt;
* /Q2/URN - Universal Resource Name&lt;br /&gt;
* /Q2/DN - Descriptive Name (Generic) Criteria&lt;br /&gt;
* /Q2/MD - Metadata Criteria&lt;br /&gt;
* /Q2/SZR - Object Size Restriction Criteria&lt;br /&gt;
* /Q2/I - Interest&lt;br /&gt;
&lt;br /&gt;
== /Q2/UDP - Return Address and Authentication ==&lt;br /&gt;
&lt;br /&gt;
The /Q2/UDP child packet specifies the return address to be used for all direct&lt;br /&gt;
replies, and the query key authentication which authorises transmissions to this&lt;br /&gt;
address. If the query key is invalid, the query should be discarded and a valid query&lt;br /&gt;
key issued to the nominated address (if desired).&lt;br /&gt;
&lt;br /&gt;
=== Sending ===&lt;br /&gt;
&lt;br /&gt;
This child is required if the query is to be delivered via UDP. It is optional if delivered&lt;br /&gt;
via TCP: if not included, replies will be reverse forwarded via TCP.&lt;br /&gt;
&lt;br /&gt;
=== Receiving ===&lt;br /&gt;
&lt;br /&gt;
If this child is present, all replies should be directed to the nominated address. The&lt;br /&gt;
query key should be verified before replying.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
A network address (variable length) followed by a query key (fixed length of 32 bits).&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;br /&gt;
&lt;br /&gt;
== /Q2/URN - Universal Resource Name ==&lt;br /&gt;
&lt;br /&gt;
The /Q2/URN child specifies an exact universal resource name which will match the&lt;br /&gt;
query. Rules:&lt;br /&gt;
&lt;br /&gt;
* If one or more URNs are present in a query, whether or not they are understood, matching must occur on URN only and other criteria should be ignored.&lt;br /&gt;
* If multiple URNs are present, only one need match an object for it to be considered a match for the query.&lt;br /&gt;
* Following from the above, multiple URNs of the same family may be specified and match multiple objects (this allows a compound query for several known objects to be executed in one packet).&lt;br /&gt;
&lt;br /&gt;
=== Sending ===&lt;br /&gt;
&lt;br /&gt;
This child should be added if a specific URN is being sought.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
A string identifying the URN families followed by the URN in either text or binary&lt;br /&gt;
representation. Text representations should always be 8-bit so that they can be&lt;br /&gt;
considered binary.&lt;br /&gt;
&lt;br /&gt;
The following compact URN families are recognised:&lt;br /&gt;
&lt;br /&gt;
* bitprint or bp - 20 bytes of SHA1 followed by 24 bytes of tiger-tree root&lt;br /&gt;
* sha1 - 20 bytes of SHA1&lt;br /&gt;
* tree:tiger/ or ttr - 24 bytes of tiger-tree root&lt;br /&gt;
* md5 - 16 bytes of MD5&lt;br /&gt;
* ed2k - 16 bytes of compound MD4 (ed2k style root hash)&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;br /&gt;
&lt;br /&gt;
== /Q2/DN - Descriptive Name (Generic) Criteria ==&lt;br /&gt;
&lt;br /&gt;
The descriptive name child provides generic query text to be used in matching&lt;br /&gt;
objects.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
A string in the simple query language.&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;br /&gt;
&lt;br /&gt;
== /Q2/MD - Metadata Criteria ==&lt;br /&gt;
&lt;br /&gt;
The metadata child provides an XML document containing rich query information.&lt;br /&gt;
The schema identified in the XML must match a metadata schema of prospective&lt;br /&gt;
matching objects.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
A string containing XML. The header is optional. Standard plural/singular Gnutella&lt;br /&gt;
metadata schemas are used, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;applications xsi:noNamespaceSchemaLocation=&amp;quot;http://www.shareaza.com/schemas/application.xsd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;application title=&amp;quot;Shareaza&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/applications&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All string values are in simple query language, including XML attribute and element&lt;br /&gt;
values.&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;br /&gt;
&lt;br /&gt;
== /Q2/SZR - Size Restriction Criteria ==&lt;br /&gt;
&lt;br /&gt;
The size restriction criteria specify a minimum and maximum size for matching&lt;br /&gt;
objects.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
A minimum size followed by a maximum size, both quoted in bytes. These two&lt;br /&gt;
numbers may be expressed as two 32 bit integers or two 64 bit integers.&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;br /&gt;
&lt;br /&gt;
== /Q2/I - Interest ==&lt;br /&gt;
&lt;br /&gt;
The Interest packet advertises an interest in certain information classes, effectively&lt;br /&gt;
filtering the information that will be returned about matching objects.&lt;br /&gt;
&lt;br /&gt;
=== Sending ===&lt;br /&gt;
&lt;br /&gt;
Send an interest packet to restrict the type of information that will be returned about&lt;br /&gt;
matching objects. For example if querying only to find instances of a known object,&lt;br /&gt;
advertise interest for &amp;quot;URL&amp;quot; only. Omitting the interest packet produces a default set&lt;br /&gt;
of response information.&lt;br /&gt;
&lt;br /&gt;
=== Receiving ===&lt;br /&gt;
&lt;br /&gt;
If an interest packet is received, only return the requested information types. If no&lt;br /&gt;
interest packet is present, return all available information that is feasible. Extensions&lt;br /&gt;
may be withheld.&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
An array of strings identifying information classes. The following are defined:&lt;br /&gt;
&lt;br /&gt;
* URL - Locations where matching objects can be found&lt;br /&gt;
* DN - Descriptive names of matching objects&lt;br /&gt;
* MD - Full metadata of matching objects&lt;br /&gt;
* COM - User comments, ratings and reviews of matching objects&lt;br /&gt;
* FS - Partially available objects&lt;br /&gt;
&lt;br /&gt;
Note that default URNs are always supplied and need not be requested.&lt;br /&gt;
&lt;br /&gt;
=== Children ===&lt;br /&gt;
&lt;br /&gt;
This packet has no known children at the current time.&lt;/div&gt;</summary>
		<author><name>Nascentmind</name></author>
	</entry>
</feed>