The Gnutella module

The Gnutella module: a gnutella node implementation

The Gnutella network


Gnutella is a widely-used distributed file-sharing system.
Basically, the protocol defines a gnutella-network as a set of interconnected nodes. A node (almost) always acts as client, server and router:
- as a client, when it is downloading a file from a server.
- as a server, when it is uploading a file to a client.
- as a router, at any time (when connected to the gnutella-network at all).
You can find a lot of informations about this protocol by simply searching for "gnutella" in your favorite search engine.

The KVIrc implementation

First of all, you have to open the gnutella window with the command:

    gnutella.open
The window is splitted in 4 tabs that control all the module actions:
The first tab is the "Network" controller.
The list on the left side shows the currently active (or attempted) network connections.
By double clicking on a connection item, you will be able to see some statistics about the node it refers to.
The buttons in the left part allow you to kill connections.
The list on the right contains a set of ip addresses of the hosts that are have a gnutella-application running and are (probably) connected to some part of the gnutella-network.
You can add ip addresses to this list by typing them in the edit box just below and pressing enter.
A Gnutella-session usually starts by connecting to a Gnutella-hostcache machine (in order to get a list of gnutella nodes): the button with the arrow on the right shows a menu with a list of the widely known gnutella-hostcaches. You can select a hostcache from that list to automatically add it to the ip address list.
Once you have some ip addreses in the list, you can select some of these , and click "Connect to selected". After a first connection has been estabilished, you're officially on the gnutella-network.
If you check the corresponding option in the Network controller, KVIrc will attempt to keep up a number of network connections (the number is specified in the options dialog).
Take care in choosing a good number of connections: if you set it too low (1-2), your searches will lead to a small amount of results, if you set it too big (this depends on your available bandwidth), you might get overloaded with data to route, and your bandwidth will soon saturate.
Personally I choose 4 as number of minimum connections to keep up, but I've seen clients that have 25 as default (!!!).

The second tab is the "Search" window.
From here you can trigger your search queries and check the results.
Since every client has its own rules about matching the search criteria (and some clients send out garbage query-hits at all), you will probably get more search results than expected. For this reason , a local filter can be applied to the current search results.
By double-clicking on a search result, you can attempt to start a download session for the file.

The third tab is the "Shares" window.
Here you can see the list of the files that you are offering for download.
You can add files to this list by clicking the "add" button on the right.

The last tab is ther "Transfers" window.
Here you can monitor the currently running transfers.


Smart download

This plugin has a basic "smart download" feature. Basically, you choose a file to download and the engine goes and downloads it , full stop :)).
No , it is not exactly like that: this program has no human brain emulation yet.
Anyway, with some luck, it will be able to download the file without any human interaction: it will retry interrupted or failed (for non critical reasons) downloads, up to a specified number of attempts. This is useful when a server from which you want to download replies with a "503 Server Busy" or "503 Service Unavailable" HTTP message: this usually means that the server has actually too much work to satisfy the request, but later might be able to. You don't need to manually retry the download, the engine will do it for you.
The plugin will retry also in some other cases; for example, when the download speed drops under a certain (specified) rate for a certain amount of time (this is called "stall"): the connection will be dropped and restarted again: this often helps (don't ask me why).
When there is no way to download the file by retrying the transfer from the same host (there are some "hidden" rules to decide this, including the maximum retry amount), the smart download agent will look for another query hit with the same filename and file size; if found, it will attempt to download from that host, if not found, it will perform a query and look again for a hit in 30 seconds.
That's all the intelligence that I have put in there; that's not too much: you still need a lot of luck.

The clue


Once you have readed about the gnutella protocol, and understood the basic meaning of the four tabs, you should be ready to start sharing.
It is just a matter of trying.
I had a lot of fun in implementing this module: a sort of personal challenge.
Enjoy using it :)
Description
Attempts a new gnutella connection to the node specified by the <ip> address and the <port>
You can find more informations in the gnutella module documentation.

Main index, Module documentation index
KVirc 3.0.0 documentation
Generated by diego at Sat Jul 13 15:37:55 2002