JTella 0.8 – A Java API for Gnutella


JTella was developed by Ken McCrary as an easy to use Java API for the Gnutella network. It was first introduced in October 2000, and progressed to version 0.7 before development ceased. Version 0.7 was released on 10th October 2000. At the time of release, most Gnutella hosts were running version 0.4 of the Gnutella protocol. Version 0.6 implemented significant changes to the Gnutella protocol and due to this JTella 0.7 is incapable of connecting to version 0.6 hosts. Gnutella 0.6 has gradually replaced Gnutella 0.4 as the most commonly deployed protocol and compatibility for Gnutella 0.4 has been dropped from most clients. To take this into account Lancaster has developed JTella version 0.8 that provides compatibility with version 0.6 of the Gnutella protocol.


Introduction

JTella [1] was selected as the base for a dissertation project on Lancaster University’s undergraduate computer science degree in 2003. JTella was chosen over other Java implementations such as Limewire [2] as these were generally far more extensive and complex. The continuing development of JTella became the focus of this project which succeeded in modifying JTella to support the extended functionality of the Gnutella 0.6 network [3]. JTella 0.8 also supports some advanced functionality of the Gnutella 0.6 network, such as searching for identical files on different hosts by checking the sha1 hash of each file. Part of the project included the creation of a simple JTella client, which could be used to demonstrate the functionality of JTella 0.8. That client is provided here. It should be noted however, that this client is not considered ready for release as it lacks vital functionality. It is provided only as a learning resource. JTella is covered by the GNU Lesser Public License [4], and as such you can do whatever you wish with it, as long as you make the source code to anything you do with it freely available.


Installing JTella

First you should download the following JAR files from their respective download sites:

SWT
JTella 0.8
Example Servent

Extract the jar files and the SWT dll file to a directory or directories of your choice (It is not necessary, but is easier, if the path to each of the files contains no spaces). Then run the Java Virtual Machine using the following syntax:

javaw -classpath {swt.jar location};{jtella-08.jar location};{jtella-servent.jar location} -Djava.library.path={SWT dll directory} com.dan.servent.GUIStarter

Where each of the locations includes the file in question. So if the jar files were stored in C:\JTellaDemo and the SWT dll was stored in C:\SWTdll then the command to run the Jtella Servent would be:

javaw -classpath C:\JTellaDemo\swt.jar;C:\JTellaDemo\jtella-08.jar;C:\JTellaDemo\jtella-servent.jar -Djava.library.path=C:\SWTdll com.dan.servent.GUIStarter


Configuring the Servent

The JTella Servent will check on startup for the presence of a config file in the directory from which it is run. This file should be called "jtella.conf" and can contain any or all of the following items, each on a separate line:

downloaddir={put path of download directory here}
ultrapeer={true or false}
gatewayip={gateway IP of machine, formatted as a dotted quad}
port={incoming port for Gnutella push requests}
maxresponses={the maximum number of responses to searches to parse}

e.g:
downloaddir=C:\Temp
ultrapeer=false

The '#' character may be used at the start of a line to denote a comment, should one be required. It should also be noted that, on click of the 'Apply' button in the Options tab, the jtella.conf file will be created if it is not already present. It is therefore not expected that the user will have to generate it.

The file gwebcaches.list should be present in the directory from which the servent is run, much like the jtella.conf file. It will also be auto-generated should it not be present. The file contains a list of GWebCaches to query for hosts to connect to, or to update so that other hosts will attempt incoming connections. The advantage of using the pre-generated file is that caches which don't respond or which can't be communicated with properly have already been removed.


Additional Information

1. The JTella 0.7 home page http://jtella.sourceforge.net/
2. Limewire http://www.limewire.com
3. The Gnutella Protocol Specification http://www9.limewire.com/developer/gnutella_protocol_0.4.pdf
4. The GNU Public License http://www.gnu.org/copyleft/gpl.html