<?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=Ag</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=Ag"/>
	<link rel="alternate" type="text/html" href="https://g2.doxu.org/wiki/Special:Contributions/Ag"/>
	<updated>2026-04-28T06:34:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://g2.doxu.org/index.php?title=User:Ag/monobook.js&amp;diff=2867</id>
		<title>User:Ag/monobook.js</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=User:Ag/monobook.js&amp;diff=2867"/>
		<updated>2007-10-03T22:18:38Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=User:Ag/monobook.js&amp;diff=2866</id>
		<title>User:Ag/monobook.js</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=User:Ag/monobook.js&amp;diff=2866"/>
		<updated>2007-10-03T22:11:04Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;importScript('User:AzaToth/twinkle.js');&lt;br /&gt;
TwinkleConfig = {&lt;br /&gt;
        revertMaxRevisions              :       50,&lt;br /&gt;
        userTalkPageMode                :       'window',&lt;br /&gt;
        showSharedIPNotice              :       true,&lt;br /&gt;
        openTalkPage                    :       [ 'agf', 'norm', 'vand' ],&lt;br /&gt;
        openTalkPageOnAutoRevert        :       false,&lt;br /&gt;
        openAOLAnonTalkPage             :       false,&lt;br /&gt;
        summaryAd                       :       &amp;quot; using [[WP:TWINKLE|TW]]&amp;quot;,&lt;br /&gt;
        deletionSummaryAd               :       &amp;quot; using [[WP:TWINKLE|TW]]&amp;quot;,&lt;br /&gt;
        protectionSummaryAd             :       &amp;quot; using [[WP:TWINKLE|TW]]&amp;quot;,&lt;br /&gt;
        watchSpeedyPages                :       [ 'g3', 'g5', 'g10', 'g11', 'g12' ],&lt;br /&gt;
        watchProdPages                  :       true,&lt;br /&gt;
        openUserTalkPageOnSpeedyDelete  :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],&lt;br /&gt;
        watchRevertedPages              :       [ 'agf', 'norm', 'vand', 'torev' ],&lt;br /&gt;
        markRevertedPagesAsMinor        :       [ 'agf', 'norm', 'vand', 'torev' ],&lt;br /&gt;
        deleteTalkPageOnDelete          :       false,&lt;br /&gt;
        watchWarnings                   :       true,&lt;br /&gt;
        markAIVReportAsMinor            :       true,&lt;br /&gt;
        markSpeedyPagesAsMinor          :       true,&lt;br /&gt;
        offerReasonOnNormalRevert       :       true,&lt;br /&gt;
        orphanBacklinksOnSpeedyDelete   :       {orphan:true, exclude:['g6']}&lt;br /&gt;
};&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=User:Ag&amp;diff=2865</id>
		<title>User:Ag</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=User:Ag&amp;diff=2865"/>
		<updated>2007-10-03T22:08:10Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Umm, hello.&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=URN&amp;diff=2864</id>
		<title>URN</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=URN&amp;diff=2864"/>
		<updated>2007-09-27T23:17:13Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Uniform Resource Name==&lt;br /&gt;
&lt;br /&gt;
A Uniform Resource Name is used to identify a file on the network by providing a unique key (taken from the files hash).&lt;br /&gt;
&lt;br /&gt;
===Examples:===&lt;br /&gt;
&lt;br /&gt;
 urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C&lt;br /&gt;
:A URN representing a specific MP3 file of the &amp;quot;I have a dream&amp;quot; speech by Martin Luther King, using the files [[SHA1]] hash.&lt;br /&gt;
&lt;br /&gt;
 urn:tree:tiger:BL5OM7M75DWHAXMFZFJ23MU3LVMRXKFO6HTGUTY&lt;br /&gt;
:The URN of the same file, this time using it's [[TigerTree]] root hash.&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=SHA1&amp;diff=2863</id>
		<title>SHA1</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=SHA1&amp;diff=2863"/>
		<updated>2007-09-27T22:51:40Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== SHA1 ==&lt;br /&gt;
&lt;br /&gt;
===More information:===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/SHA-1 SHA hash functions (Wikipedia)]&lt;br /&gt;
&lt;br /&gt;
[http://www.faqs.org/rfcs/rfc3174.html US Secure Hash Algorithm 1 (SHA1) (RFC3174)]&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=TigerTree&amp;diff=2862</id>
		<title>TigerTree</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=TigerTree&amp;diff=2862"/>
		<updated>2007-09-27T22:41:28Z</updated>

		<summary type="html">&lt;p&gt;Ag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tiger-Tree Hashing ==&lt;br /&gt;
Tiger-Tree Hashing is a way of verifying that small pieces of a file are valid, and free from corruption. Without a system such as TTH, an application would be unable to locate where corruption was occurring in a file, and would not be able to repair the errors.&lt;br /&gt;
&lt;br /&gt;
In a tree hash, a file is broken up into small pieces, and each small piece of a file is hashed. These pieces are divided into sets according to some simple rules, and the hashes in each of these sets concatenated and hashed again. The process can be repeated some number of times (hence the diagram of a tree), until there remains one hash, called the root hash.&lt;br /&gt;
&lt;br /&gt;
Refer to the [http://www.open-content.net/specs/draft-jchapweske-thex-02.html THEX protocol] for in depth infromation about Tree Hash EXchange and tree hashes in general. Refer to the [http://www.cs.technion.ac.il/~biham/Reports/Tiger/ Tiger Hash web page] for information about the Tiger Hash algorithm. Refer to the [http://sourceforge.net/projects/tigertree/ TigerTree project page on sourceforge] for the specifics on how the tiger hash algorithm has been implemented into a Merkle hash tree structure to create 'Tiger-Tree' hash sets.&lt;br /&gt;
&lt;br /&gt;
Note that when encountering the word 'Tiger-Tree', an author may sometimes be referring to the Tiger Tree root hash, or at other times the entire hash tree structure.&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=Gnutella2-powered_software&amp;diff=2861</id>
		<title>Gnutella2-powered software</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=Gnutella2-powered_software&amp;diff=2861"/>
		<updated>2007-09-23T15:42:22Z</updated>

		<summary type="html">&lt;p&gt;Ag: /* Gnutella2 Clients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gnutella2 Clients==&lt;br /&gt;
&lt;br /&gt;
The following clients support Gnutella2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table width=&amp;quot;100%&amp;quot; border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;6&amp;quot; cellspacing=&amp;quot;1&amp;quot; bgcolor=&amp;quot;#A5CAD2&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt; &lt;br /&gt;
    &amp;lt;th width=&amp;quot;55%&amp;quot;&amp;gt;Client Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th width=&amp;quot;23%&amp;quot;&amp;gt;Platform&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th width=&amp;quot;22%&amp;quot;&amp;gt;Support&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;[http://www.shareaza.com Shareaza]&amp;lt;br&amp;gt;&lt;br /&gt;
Shareaza pioneered the Gnutella2 platform and continues to play an active role in its development.  Connects to several additional networks as well.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Windows&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Full 1.0 Support&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;[http://www.gnucleus.com/ Gnucleus]&amp;lt;br&amp;gt;&lt;br /&gt;
Gnucleus is one of the first Gnutella clients and is an open source Gnutella2 client. It is based on GnucDNA, a Gnutella2 library.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;Windows&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;Full 1.0 Support&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot; class=&amp;quot;normal&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;[http://www.morpheus.com/ Morpheus]&amp;lt;br&amp;gt;&lt;br /&gt;
Morpheus is a mainstream P2P client which switched from the FastTrack network to the Gnutella network and now to the Gnutella2 network.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Windows&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Uses GnucDNA&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;[http://sourceforge.net/projects/agio/ Adagio]&amp;lt;br&amp;gt;&lt;br /&gt;
Adagio is a Gnutella2 server which aims to provide a very configurable, highly reliable cross-platform daemon.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;Cross-Platform&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;1.0 Support&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;[http://www.kiwialpha.com/ Kiwi]&amp;lt;br&amp;gt;&lt;br /&gt;
Lightweight client, based on GnucDNA&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Windows&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Uses GnucDNA&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;[http://www.filescope.com/ FileScope]&amp;lt;br&amp;gt;&lt;br /&gt;
FileScope is a file sharing program that connects to multiple peer-to-peer (P2P) networks and allows for finding and downloading all types of files. Written in C#.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;Windows&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;1.0 Support (Beta)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;[http://www.mldonkey.net/ MLDonkey]&amp;lt;br&amp;gt;&lt;br /&gt;
An open source deamon client. Has many different GUI's you can use. Also connects to many other networks in addition to Gnutella2.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;Cross-Platform&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;1.0 Support (Beta)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;[http://www.pocketg2.com/ Pocket G2]&amp;lt;br&amp;gt;&lt;br /&gt;
Pocket G2 is a Gnutella2 client written in VB.net for Pocket PCs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;Windows Mobile&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;center&amp;quot; valign=&amp;quot;middle&amp;quot; bgcolor=&amp;quot;#F2F2F2&amp;quot;&amp;gt;1.0 Support (Alpha)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=TCP_Stream_Connection_and_Handshaking&amp;diff=2860</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=2860"/>
		<updated>2007-09-20T20:34:08Z</updated>

		<summary type="html">&lt;p&gt;Ag: /* Node State Negotiation */&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-Hub: 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-Hub: True&lt;br /&gt;
X-Hub-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-Hub: False&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
&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 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/x-gnutella2&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 should not be identical to those used to negotiate Gnutella1 to minimize network pollution.&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-Hub: [True|False]&lt;br /&gt;
X-Hub-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-Hub header indicates whether the transmitting node is currently&lt;br /&gt;
operating as a hub. Hub nodes will send &amp;quot;X-Hub: True&amp;quot; while leaf nodes will&lt;br /&gt;
send &amp;quot;X-Hub: False&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The X-Hub-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-Hub-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-Hub-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-Hub-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-Hub 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-Hub-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;
- NOTE: because X-Ultrapeer and X-Ultrapeer-Needed has been used on Gnutella2 for a longtime, there should be some backward compatibility code to comunicate with older nodes until they disappear.&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>Ag</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=TCP_Stream_Connection_and_Handshaking&amp;diff=2859</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=2859"/>
		<updated>2007-09-20T20:00:15Z</updated>

		<summary type="html">&lt;p&gt;Ag: /* Content Type (Protocol) */&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-Hub: 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-Hub: True&lt;br /&gt;
X-Hub-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-Hub: False&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
&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 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/x-gnutella2&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 should not be identical to those used to negotiate Gnutella1 to minimize network pollution.&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-Hub: [True|False]&lt;br /&gt;
X-Hub-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-Hub header indicates whether the transmitting node is currently&lt;br /&gt;
operating as a hub. Hub nodes will send &amp;quot;X-Hub: True&amp;quot; while leaf nodes will&lt;br /&gt;
send &amp;quot;X-Hub: False&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The X-Hub-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-Hub-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-Hub-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-Hub-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-Hub 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-Hub-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;
- NOTE: because X-Ultrapeer and X-Ultrapeer-Needed has been used on Gnutella2 for longtime, there should be some backword compatibility code to comunicate with older nodes until they disapper.&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>Ag</name></author>
	</entry>
</feed>