<?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=Daisuke</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=Daisuke"/>
	<link rel="alternate" type="text/html" href="https://g2.doxu.org/wiki/Special:Contributions/Daisuke"/>
	<updated>2026-04-28T01:10:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://g2.doxu.org/index.php?title=Main_Page&amp;diff=2852</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=Main_Page&amp;diff=2852"/>
		<updated>2007-01-10T14:28:58Z</updated>

		<summary type="html">&lt;p&gt;Daisuke: updated crawler url&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;table width=&amp;amp;quot;100%&amp;amp;quot; &amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;amp;quot;left&amp;amp;quot;&amp;gt;&lt;br /&gt;
== Gnutella2 Developer Network ==&lt;br /&gt;
Welcome to the Gnutella2 Developer Network.&lt;br /&gt;
The Gnutella2 Developer Network (or G2DN) is a convenient central location for discussing, developing and documenting all aspects of Gnutella2. Like the Gnutella2 platform itself, this website is designed to evolve through community support and participation. Everyone is free to contribute discussion, proposal documents, developer resources or any other relevant material.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Although the G2DN is primarily geared toward developers and technical enthusiasts, users of Gnutella2-enabled software are also welcome to participate. Those who are new to Gnutella2 may wish to check out some of the [[Gnutella2-powered software]].&amp;lt;/p&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;amp;quot;20px&amp;amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;amp;quot;right&amp;amp;quot; valign=&amp;amp;quot;bottom&amp;amp;quot; width=&amp;amp;quot;200px&amp;amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==News==&lt;br /&gt;
* ''10th, April, 2005'' - '''Gnutella2 website re-opened'''&lt;br /&gt;
&amp;lt;p&amp;gt;After server problems we're proud to re-launch the Gnutella2 website. It is now based on MediaWiki (like Wikipedia). The forums are gone, but we now have a [[mailing list]] for Gnutella2 related discussion. Feel free to contribute to the wiki after reading [[Gnutella2:Community Portal]] to learn about editing policy.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mailing List==&lt;br /&gt;
To allow communication among developers of Gnutella2 clients, there exists a [[mailing list]]. You can access it too via regular news reader at the news-to-mail gateway [http://www.gmane.org Gmane] (list page [http://dir.gmane.org/gmane.network.gnutella2.devel here]).&lt;br /&gt;
&lt;br /&gt;
== The Gnutella 2 Network==&lt;br /&gt;
# [[Gnutella2|What is Gnutella2]]&lt;br /&gt;
# [[Gnutella2 Standard]]&lt;br /&gt;
# [[Network Architecture]]&lt;br /&gt;
# [[Node Types and Responsibilities]]&lt;br /&gt;
# [[Background|Background / Archive]]&lt;br /&gt;
&lt;br /&gt;
== The Protocol==&lt;br /&gt;
# [[TCP Stream Connection and Handshaking]]&lt;br /&gt;
# [[UDP Transceiver]]&lt;br /&gt;
# [[Packet Structure]]&lt;br /&gt;
# [[Datatypes]]&lt;br /&gt;
# [[Basic Network Maintenance]]&lt;br /&gt;
# [[Known Hub Cache and Hub Cluster Cache]]&lt;br /&gt;
# [[Node Route Cache and Addressed Packet Forwarding]]&lt;br /&gt;
# [[Query Hash Tables]]&lt;br /&gt;
# [[Object Search Mechanism]]&lt;br /&gt;
# [[Search Security]]&lt;br /&gt;
# [[Search Description]]&lt;br /&gt;
# [[Search Acknowledgement]]&lt;br /&gt;
# [[Search Results]]&lt;br /&gt;
# [[Simple Query Language and Metadata]]&lt;br /&gt;
# [[Server for Uploading]]&lt;br /&gt;
# [[Client for Downloading]]&lt;br /&gt;
# [[User Profile Challenge and Delivery]]&lt;br /&gt;
&lt;br /&gt;
== Root Packets ==&lt;br /&gt;
{{Root packets}}&lt;br /&gt;
&lt;br /&gt;
== Proposals==&lt;br /&gt;
* [[Active Source Exchange]] (ASE) by Kevin O'Toole&lt;br /&gt;
&lt;br /&gt;
== Additional Information==&lt;br /&gt;
Since Gnutella2 somehow evolved from the original Gnutella protocol you might find the following links useful:&lt;br /&gt;
* [http://www.the-gdf.org The GDF Wiki]&lt;br /&gt;
* [http://groups.yahoo.com/group/the_gdf/ Gnutella Developer forum]&lt;br /&gt;
* [http://rfc-gnutella.sourceforge.net/ RFC Gnutella]&lt;br /&gt;
* [http://draketo.de/inhalt/krude-ideen/gnufu_en.html Gnutella for Users (GnuFU)]&lt;br /&gt;
* [http://crawler.trillinux.org/ Gnutella2 Crawler]&lt;/div&gt;</summary>
		<author><name>Daisuke</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=TCP_Stream_Connection_and_Handshaking&amp;diff=2851</id>
		<title>TCP Stream Connection and Handshaking</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=TCP_Stream_Connection_and_Handshaking&amp;diff=2851"/>
		<updated>2007-01-10T14:16:50Z</updated>

		<summary type="html">&lt;p&gt;Daisuke: /* Hub Address Exchange */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[UDP_Transceiver|UDP Transceiver &amp;gt;&amp;gt;]] | [[Main_Page|Main Page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
TCP stream connections are established between Gnutella2 nodes when they elect to&lt;br /&gt;
form a permeant link, creating the fundamental network topology of a highly&lt;br /&gt;
interconnected hub network serving dense clusters of leaf nodes.&lt;br /&gt;
&lt;br /&gt;
== Initiation ==&lt;br /&gt;
&lt;br /&gt;
TCP connections are initiated by leaf or hub nodes in an attempt to gain a connection&lt;br /&gt;
to a hub node. Leaf nodes are never the target of an outbound connection. The TCP&lt;br /&gt;
port number is not standardised, and must be stored with the IP address.&lt;br /&gt;
&lt;br /&gt;
== Handshaking ==&lt;br /&gt;
&lt;br /&gt;
Upon the establishment of a TCP stream connection between two Gnutella2 nodes, a&lt;br /&gt;
handshaking phase must be completed to negotiate the nature of the link and&lt;br /&gt;
exchange other necessary information.&lt;br /&gt;
&lt;br /&gt;
This handshaking phase is the only part of the communication which remains&lt;br /&gt;
compatible with the old Gnutella network, allowing new connections to be negotiated&lt;br /&gt;
without fore-knowledge the capabilities of the other node. The handshaking process&lt;br /&gt;
has been well documented elsewhere, however, a short summary is provided here.&lt;br /&gt;
&lt;br /&gt;
=== Handshake Stages ===&lt;br /&gt;
&lt;br /&gt;
The Gnutella handshake process consists of three header blocks. The node which&lt;br /&gt;
initiated the connection sends an initial header block, of the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
GNUTELLA CONNECT/0.6&lt;br /&gt;
Listen-IP: 1.2.3.4:6346&lt;br /&gt;
Remote-IP: 6.7.8.9&lt;br /&gt;
User-Agent: Shareaza 1.8.2.0&lt;br /&gt;
Accept: application/x-gnutella2&lt;br /&gt;
X-Ultrapeer: False&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The receiver then responds with its own header block:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
GNUTELLA/0.6 200 OK&lt;br /&gt;
Listen-IP: 6.7.8.9:6346&lt;br /&gt;
Remote-IP: 1.2.3.4&lt;br /&gt;
User-Agent: Shareaza 1.8.2.0&lt;br /&gt;
Content-Type: application/x-gnutella2&lt;br /&gt;
Accept: application/x-gnutella2&lt;br /&gt;
X-Ultrapeer: True&lt;br /&gt;
X-Ultrapeer-Needed: False&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the initiator accepts the receiver's header block, and provides any final&lt;br /&gt;
information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
GNUTELLA/0.6 200 OK&lt;br /&gt;
Content-Type: application/x-gnutella2&lt;br /&gt;
X-Ultrapeer: False&lt;br /&gt;
The latter two stages may be replaced with an error condition if the connection is&lt;br /&gt;
being rejected. Appropriate error status codes are returned in this case, for example:&lt;br /&gt;
GNUTELLA/0.6 503 Too many connections&lt;br /&gt;
(more headers)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that only the HTTP-style error code should be interpreted by the software: any&lt;br /&gt;
descriptive text provided is for display purposes only and is not standardised.&lt;br /&gt;
&lt;br /&gt;
== Headers ==&lt;br /&gt;
&lt;br /&gt;
Important headers which are required or strongly recommended are detailed in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
=== Addressing Headers ===&lt;br /&gt;
&lt;br /&gt;
Two important headers to send on all connections are &amp;quot;Remote-IP&amp;quot; and &amp;quot;Listen-IP&amp;quot;.&lt;br /&gt;
Both of these headers should be sent on the first transmission, meaning in the first&lt;br /&gt;
and second header blocks in the three block exchange.&lt;br /&gt;
&lt;br /&gt;
The Remote-IP header contains the IP address from which the remote host is&lt;br /&gt;
connecting. This allows a remote host operating through some kind of network&lt;br /&gt;
address translation system, to learn its effective external address.&lt;br /&gt;
&lt;br /&gt;
The Listen-IP header contains the IP address and port number that the local host is&lt;br /&gt;
listening for inbound TCP connections on. It should be listening for UDP datagrams&lt;br /&gt;
on the same port. The format of this header is &amp;quot;IP:PORT&amp;quot;, eg &amp;quot;1.2.3.4:6346&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Identification ===&lt;br /&gt;
&lt;br /&gt;
The User-Agent header is used to identify the client software operating on the&lt;br /&gt;
sending node. It should be sent on the first transmission, meaning in the first and&lt;br /&gt;
second header blocks in the three block exchange. Note that this is a descriptive&lt;br /&gt;
string that often includes a version number, and is not a &amp;quot;vendor code&amp;quot; as described&lt;br /&gt;
elsewhere.&lt;br /&gt;
&lt;br /&gt;
=== Content Type (Protocol) ===&lt;br /&gt;
&lt;br /&gt;
The Accept and Content-Type header exchange is used to negotiate the data&lt;br /&gt;
protocol that will be used in the connection, in this case Gnutella2. The Gnutella2&lt;br /&gt;
content type is &amp;quot;application/x-gnutella2&amp;quot;, and this exchange follows standard HTTP&lt;br /&gt;
rules for negotiating content type.&lt;br /&gt;
&lt;br /&gt;
The first step is to advertise support for the content type (Gnutella2) in the first&lt;br /&gt;
header block with &amp;quot;Accept: application/x-gnutella2&amp;quot;. The responding node will then&lt;br /&gt;
indicate that it will send Gnutella2 content with &amp;quot;Content-Type: application/xgnutella2&amp;quot;,&lt;br /&gt;
and that it also supports Gnutella2 with &amp;quot;Accept: application/x-gnutella2&amp;quot;.&lt;br /&gt;
The initiating host then confirms that it will be sending Gnutella2 with &amp;quot;Content-&lt;br /&gt;
Type: application/x-gnutella2&amp;quot; in the third header block. For more information on the&lt;br /&gt;
Accept/Content-Type exchange, consult a HTTP reference.&lt;br /&gt;
&lt;br /&gt;
Note that the content type negotiation process is designed to be a &amp;quot;one-way&amp;quot;&lt;br /&gt;
process, i.e. a different content type can be negotiated for sending and receiving.&lt;br /&gt;
However, when the gnutella2 protocol is negotiated, both channels must use the&lt;br /&gt;
same content type. This means that a receiving node must not accept Gnutella2 if&lt;br /&gt;
the initiator did not advertise support for it, and if at the end of the handshake,&lt;br /&gt;
bidirectional Gnutella2 was not negotiated, the connection should be terminated.&lt;br /&gt;
&lt;br /&gt;
=== Node State Negotiation ===&lt;br /&gt;
&lt;br /&gt;
There are two node types in a Gnutella2 peer to peer network, a hub and a leaf, as&lt;br /&gt;
described in [[Node Types and Responsibilities]]. During the initial handshake,&lt;br /&gt;
the two parties must exchange their current node type and advise of their&lt;br /&gt;
capabilities, negotiating the node types they will adopt when the connection&lt;br /&gt;
completes, and indeed whether it should complete at all.&lt;br /&gt;
&lt;br /&gt;
As the handshake sequence is compatible with Gnutella1, the headers involved in&lt;br /&gt;
negotiating node types are identical to those used to negotiate Gnutella1 &amp;quot;Ultrapeer&amp;quot;&lt;br /&gt;
states:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
X-Ultrapeer: [True|False]&lt;br /&gt;
X-Ultrapeer-Needed: [True|False]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both headers contain a Boolean value, &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, case insensitive.&lt;br /&gt;
&lt;br /&gt;
The X-Ultrapeer header indicates whether the transmitting node is currently&lt;br /&gt;
operating as a hub. Hub nodes will send &amp;quot;X-Ultrapeer: True&amp;quot; while leaf nodes will&lt;br /&gt;
send &amp;quot;X-Ultrapeer: False&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The X-Ultrapeer-Needed header indicates whether the transmitting node would like&lt;br /&gt;
(and allow) the receiver to be a hub. A hub which sees no need for additional hubs in&lt;br /&gt;
its area of the network, will send &amp;quot;X-Ultrapeer-Needed: False&amp;quot;, indicating to the&lt;br /&gt;
connecting node that it must operate in leaf mode if it wishes to connect. A hub&lt;br /&gt;
which sees a need for additional hubs, will send &amp;quot;X-Ultrapeer-Needed: True&amp;quot;,&lt;br /&gt;
indicating that the receiving node should become a hub, if it is capable of doing so. A&lt;br /&gt;
leaf may send &amp;quot;X-Ultrapeer-Needed: True&amp;quot; to indicate that it is seeking a connection&lt;br /&gt;
to a hub.&lt;br /&gt;
&lt;br /&gt;
The X-Ultrapeer header should be sent on all three of the header blocks to indicate&lt;br /&gt;
the current intended state of the node, while the X-Ultrapeer-Needed header should&lt;br /&gt;
be sent in the first two header blocks only, to indicate the desired status of the&lt;br /&gt;
receiver. If the nodes cannot agree on a satisfactory arrangement, the connection&lt;br /&gt;
will be terminated at or prior to the third header block with an appropriate message,&lt;br /&gt;
for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
GNUTELLA/0.6 503 Too many hub connections&lt;br /&gt;
GNUTELLA/0.6 503 Too many leaves&lt;br /&gt;
GNUTELLA/0.6 503 I have leaves, can't downgrade to leaf mode&lt;br /&gt;
GNUTELLA/0.6 503 Leaf mode disabled&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hub Address Exchange ===&lt;br /&gt;
&lt;br /&gt;
It is desirable for connecting nodes to exchange the node addresses of other hubs on&lt;br /&gt;
the network to facilitate rapid connection. The Gnutella2 protocol includes highly&lt;br /&gt;
efficient methods to share hub addresses with peers once connected, but for a node&lt;br /&gt;
trying to connect and encountering only &amp;quot;full&amp;quot; hubs, learning new hubs to try is&lt;br /&gt;
helpful.&lt;br /&gt;
&lt;br /&gt;
The X-Try-Hubs header was developed for this purpose. It contains a comma&lt;br /&gt;
separated list of hub node addresses and ports, along with a timestamp recording&lt;br /&gt;
the time the hub was last seen. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
X-Try-Hubs: 1.2.3.4:6346 2007-01-10T23:59Z, [..more..]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hub addresses should not be sent unless the transmitter has reasonable knowledge&lt;br /&gt;
of the hub's existence and the timestamp is not too old.&lt;br /&gt;
&lt;br /&gt;
=== Compression Negotiation and Encoding ===&lt;br /&gt;
&lt;br /&gt;
The Gnutella2 architecture makes widespread use of &amp;quot;deflate&amp;quot; compression, due to&lt;br /&gt;
its high availability and ease of integration. Support of compressed TCP links is not a&lt;br /&gt;
requirement in the Gnutella2 standard, however, it is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Deflate compression of a TCP link is negotiated with the pair standard HTTP headers&lt;br /&gt;
&amp;quot;Accept-Encoding&amp;quot; and &amp;quot;Content-Encoding&amp;quot;. For example:&lt;br /&gt;
&lt;br /&gt;
Header block one (initiator):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Accept-Encoding: deflate&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Header block two (receiver):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Accept-Encoding: deflate&lt;br /&gt;
Content-Encoding: deflate&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Header block three (initiator):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Content-Encoding: deflate&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the initiator advertises support for receiving a deflated connection.&lt;br /&gt;
The receiver then indicates that it too supports receiving a deflated connection, and&lt;br /&gt;
that it intends to transmit deflated data. Finally, the initiator upon noting that the&lt;br /&gt;
receiver supports deflate, indicates that it too will transmit deflated data.&lt;br /&gt;
&lt;br /&gt;
Note that unlike the content-type / protocol negotiation, deflated encoding can be&lt;br /&gt;
applied on either incoming, outgoing, or both channels of a connection.&lt;br /&gt;
&lt;br /&gt;
For performance reasons, nodes should consider whether they can afford to support&lt;br /&gt;
additional deflated connections before advertising support for them, or agreeing to&lt;br /&gt;
provide a deflated data stream. In the Gnutella2 network topology, all links benefit&lt;br /&gt;
from compression, except the leaf to hub channel of the leaf/hub link. Exempting this&lt;br /&gt;
channel from compression, saves the leaf and more importantly, the hub, a&lt;br /&gt;
considerable CPU and RAM investment.&lt;br /&gt;
&lt;br /&gt;
== Post Handshake Communication ==&lt;br /&gt;
&lt;br /&gt;
After the third and final header block has been received by the initiator, subsequent&lt;br /&gt;
communication over the TCP stream occurs in the negotiated protocol, with the&lt;br /&gt;
negotiated encoding. This means that while the handshake sequence was backwards&lt;br /&gt;
compatible with Gnutella1, after Gnutella2 support has been negotiated, all&lt;br /&gt;
subsequent communication occurs in the Gnutella2 common protocol - an entirely&lt;br /&gt;
new system not backwards compatible with any other protocol.&lt;/div&gt;</summary>
		<author><name>Daisuke</name></author>
	</entry>
</feed>