Peer-to-Peer File Transfer


As controversial as it is popular, peer-to-peer (P2P) file sharing is unlikely to go away anytime soon. As long as Linux serves the "Information wants to be free" crowd (which will be forever), there will be Linux P2P tools.

Two general types of file-sharing protocols exist:

  • The traditional, Napster-style model, where files are uploaded and downloaded from one computer to another.

  • The BitTorrent model, where large files or packages are downloaded faster by allowing bits to come from several sources and combining them at the end.

Note that all types of files can and do circulate on file-sharing networks, including perfectly legal open-source software. At the same time, be aware that any file can be easily renamed and shared, so that the innocent-looking wav sound effect you pick up may be replaced by an active virus.

In this book, we're not going to examine the legal and moral questions of P2P file sharing. We note that, as of this writing, 6 of the top 10 downloads at the Sourceforge open-source development center (http://sourceforge.net) are file-sharing clients. Whether (and how) you choose to use these tools (as with all the other tools mentioned in this book) is entirely up to you.

SUSE Linux includes several clients that support each of these styles, which you will learn about in the following section.

Note

Some of these clients are not in the 64-bit SUSE Linux distribution.


Napster-Style File Sharing

While recording industry legal attacks against the original Napster application and network have transformed the original concept, there are still many applications and file-sharing networks that have sprung up to meet consumer demands, especially for electronic music files.

Gnutella, eDonkey/Overnet, and FastTrack (aka KaZaa) are perhaps the best known of the file-sharing networks to rise since Napster's fall. What makes them similar to Napster is the user's side of the process.

  1. A user goes online to locate and download a copy of a file (for example, an MP3 music file).

  2. The client connects to the P2P network and searches for the requested file among the shared directories of computers online at that moment.

  3. The client then displays a list of matching files and a little bit of information about the computer the file is on (mainly download speed).

  4. The user selects one copy from the list, and the client downloads the file from the selected computer.

The good thing about the system is that no matter what you're looking for, chances are someone on your network has it. The downside of this model relative to BitTorrent is that you're a prisoner of your partner's connection: No matter how fast your broadband or LAN is, if the person you're sharing with has a flaky dial-up that is only online an hour a day, that's the connection you get. If your client finds another copy of the file on another, faster computer, it will start a new download, but this can mean your hard drive begins to fill up with a bunch of partial downloads of the same file.

KMLDonkey is the KDE-based GUI for MLDonkey, a traditional P2P client that is looking for interoperability with several of these networks. GTK-Gnutella is its GNOME counterpart. They are both a little troublesome to work, but you should be able to avoid some of the pitfalls with this guide.

KMLDonkey

MLDonkey is a multi-network P2P client, which wants to work with all file sharers the world over. It began as a client for the eDonkey2000 network, now known as the Overnet, but now supports (to varying degrees) the Gnutella and FastTrack networks.

KMLDonkey is the GUI front for this client. Curiously enough, SUSE Linux includes this package, but not the core MLDonkey program without which KMLDonkey cannot function.

As a would-be KMLDonkey user, you must first go to the MLDonkey website (http://www.mldonkey.org) to download the "core" package and the server lists. Several stable versions of the core MLDonkey package are stored here as tarballs. Download the latest and install it into your home directory. Those who want to ride the bleeding edge can download and compile from CVS here, too. The server lists are included in the mlnet package (in some places also defined as the "core").

When both files have been downloaded, extract the MLDonkey tarball into your home directory. Then extract MLNet into the MLDonkey directory. Now run KMLDonkey, either from the Internet, Peer to Peer menu, or from the shell. If your servers don't appear (or you get a Failed to Connect message), run the MLNet file manually. The servers should now appear in the KMLDonkey window and you should be on your way.

When you connect to the Donkey network servers (the default setting), the main KMLDonkey screen should look like Figure 17.3.

Figure 17.3. KMLDonkey displays the servers you are currently connected to.


By default, the Servers tab displays all the servers you can connect to. This is useful on a first run when you're trying to make sure something's connecting, but may be tiresome after that. Go to Settings, Configure KMLDonkey to uncheck the Show All Servers box.

Click the Search tab to look for a file. Enter your search keyword(s) at the top and any modifiers further down. The categories are mostly self-explanatory, but if you are looking for an MP3 file, you may want to set a minimum bitrate. This indicates the relative sound quality of a music file. A bitrate of 128 is equivalent to a standard CD recording. The higher the bitrate, the bigger the file, so if you set your "max size" at 500KB and a bitrate of 128KB, you may see files that last only a few seconds.

These are file sharing networks, so do your part by designating at least one directory on your system for access to others (and probably not more than that). By default, KMLDonkey shares the Incoming directory where it places its own completed downloads. You can add more by going to the Uploads tab and right-clicking anywhere. Choose Share Directory from the context menu and type the path into the dialog box. Unfortunately, there is no Browse button in this dialog box, so you must type the full path.

GTK-Gnutella

Gnutella was one of the first decentralized networks to be created. Written by a developer at Nullsoft, the creators of the Winamp MP3 player for Windows, Gnutella was released under the GPL, and only officially available for one day. Nullsoft's owners, then called AOL/TimeWarner, were not pleased by this offering. A community of developers quickly formed to work on the code, and many clients have since been developed to support the Gnutella network.

The Gnutella2 network was created in 2003 and is designed to be a faster and a more efficient protocol than the original Gnutella protocol. Both networks still function.

GTK-Gnutella is a GUI client based on the Gimp Toolkit. It functions much like MLDonkey, but accesses only the two Gnutella networks.

The GTK-Gnutella interface is not exactly a thing of beauty, but it runs nicely. Like KMLDonkey, it first displays the servers you're connected to. To search for something, click in the New Search box and type your keyword(s). You'll be taken immediately to the Search Results window, which you can see in Figure 17.4.

Figure 17.4. The GTK-Gnutella Search Results window. Select your file(s) to download from this list. Note that the Search box on the left displays all your active searches and the number of hits it has generated.


You can modify your search in this window. Click Edit Filters. Not especially user-friendly, these filter dialog boxes are nonetheless pretty easy to understand. You can set filters for size and name, along with several other parameters.

Select the file(s) you want to download from the search list and click the Download Selected button at the bottom to begin downloading. Searches remain active as long as GTK-Gnutella is running, and whatever main window you're in, you can always see the current results of your search in the Search window below the New Search box.

Settings are also fairly technical in the way they are presented, but if you are not sure what a setting will do, try mousing over the setting; often you'll see a ToolTip with an explanation or hint.

Wrangling the BitTorrent

Whatis.com describes the most important advantage of BitTorrent as follows: "Rather than having to send a download to each customer requesting it, the distributor or holder of content sends it to one customer who in turn sends it to other customers who together share the pieces of the download back and forth until everyone has the complete download. This makes it possible for the original server to serve many requests for large files without requiring immense amounts of bandwidth."

For the most part, BitTorrent is the sharing format of choice for big collections of archived text, books, and audio and video clips, including entire taped concerts and movies. With SUSE Linux 10, Novell joined the ranks of Linux distributors offering BitTorrent downloads of its ISO images, making it just a little easier to pull down that 3.1GB package.

BitTorrent works a little differently from the traditional file-sharing arrangement discussed in the preceding section. It goes something like this:

  1. Someone with content to share creates a .torrent file to wrap the content in. This is done in the BitTorrent client. This person is referred to as the Seed.

  2. An announcement is made on a website or mailing list that this torrent (or set of torrents) is available, with instructions given on finding its location.

  3. People who want this file point their BitTorrent clients toward the seeded file.

  4. Any other clients that have the file (or some pieces of it, depending on the client) and are online contribute bits to every other client that is downloading the same file. This eases the load on the Seed and speeds the download for each client because more bits are coming down at the same time.

  5. When a download is complete, it's proper form to remain online and keep your client open for awhile so others can benefit. The client monitors the upload/download ratio and often can turn itself off when you have uploaded as many bits as you've downloaded (that is, a ratio of 1.0:1.0).

Finding torrents is not always an easy task. One site that attempted to be a BitTorrent content clearinghouse shut down after the Motion Picture Association of America threatened a lawsuit. The safe choices are downloading from official sources and getting music from "trade-friendly" artists (think jam bands: Phish, Grateful Dead, Leftover Salmon, String Cheese Incident). An excellent site for the latter is http://bt.etree.org (this is the BitTorrent part of this large music-trading community).

Azureus, the Java BitTorrent Client

The most manageable BitTorrent client for Linux is a bit of open source Java code called Azureus. Named for a species of frog notable for its blue coloring, Azureus is easy to install and easy to work with.

To install Azureus, head to the download page at http://azureus.sourceforge.net/download.php. Download the appropriate client for your system (choose between the GTK and Motif versions for Intel x86 processors, or the AMD64 or PowerPC versions for those processors). You will get a tarball that you can open with your favorite archiver.

Extract the tarball into your home directory, where it will create an /Azureus subdirectory. That's all you need to install the program. To set up Azureus the first time, you need to run the program from the shell. From the home directory, type ./azureus/azureus to start the Configuration Wizard. The wizard will identify your connection speed and adjust if necessary. Click Next to continue.

The next wizard screen tests the BitTorrent listen port to see if it is available. Click Test to run the test. If it fails, you need to reconfigure the Firewall in YaST or your hardware router to permit regular BitTorrent operations. See the next Tip for more detailed information.

Tip

BitTorrent works best when other clients have direct access to your bits. BitTorrent clients communicate through port 6881. If you're using the SUSE Firewall, you have to configure it to open the port. Go to the YaST Security and Users module and click Firewall. Click Next twice to get to the Firewall Configuration: Services page. Click the Expert button to add services. In the Additional TCP Services box, type 6881. Click OK, and port 6881 should be listed under Additional Services at the bottom. Click Next twice more, and then click Finish to confirm your changes.

If you have a hardware router that is your Internet gateway (as is often the case with broadband connections), you may have to configure that to permit BitTorrent communications as well. Visit http://www.portforward.com/routers.htm for helpful information on configuring several popular routers for BitTorrent.

BitTorrent clients will work even if you can't get the listen port open, but your upload/download speeds will suffer.


The last screen in the Configuration Wizard asks where to store your .torrent files. Accepting the defaults is perfectly OK. Click Finish to open Azureus.

When you have completed the installation, go back to the Azureus download site to get (via BitTorrent) the latest Java Runtime Environment (JRE). As with the Azureus client, click the appropriate client for your system. The difference is that Azureus will now open up to manage the download instead of your browser. You may even see the Upload Speed column activate as someone else uses some of the bits you've already downloaded.

Tip

When installing any new Java product, it's a good idea to check for a new JRE. Not everyone will have a convenient link like Azureus does. Go to http://www.java.com/en/download to get the latest and greatest. After the new JRE is installed, go to YaST and remove the earlier version.


Azureus has several plug-in enhancements for your BitTorrent experience, and a simple Installation Wizard to obtain and maintain them. Go to the Plugins menu and select Installation Wizard. Select By List from Sourceforge.net to see all the plug-ins downloadable from the Azureus site. Click the plug-in name for a description of the tool, and check the box to install it. Click Next, then Finish to begin the download. After it's installed, the Azureus Update Manager will automatically keep both the main program and any installed plug-in current. You'll also notice that plug-ins download into your torrent directory, and you become a seed for the next plug-in download.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net