SDB:BitTorrent

Jump to: navigation, search
BitTorrent is a protocol for sharing large media and files over the internet. If interested in the concept you can read more here: BitTorrent on Wikipedia

Tested on openSUSE

Recommended articles

Icon-manual.png

Related articles

Finding a BitTorrent Client

In openSUSE, the default bittorrent clients are KTorrent (KDE) & Transmission (GNOME). KTorrent is full-featured and mature, and an obvious choice for those using KDE. For those using GNOME, the choice is less clear. Monsoon, Transmission and Deluge: all have their advocates, strengths & weaknesses for those wanting a GUI BitTorrent client. Some also prefer to use KTorrent in GNOME despite the need to load Qt/KDE libraries to run it. If unsure it is advisable to start with the default client in your installation, and explore the alternatives if that does not suffice.

Some who got used to utorrent under Windows, still prefer to use it under Wine in Linux, which actually runs quite well on older, low-end machines. Others prefer to use the wikipedia:cross-platform client, Vuze (formerly Azureus), which is written as a Java application. Those with slower machines will likely find the extra memory/resource requirements of running or Java to pose a problem. Those with faster machines may notice little speed penalty.

Moreover, a version of utorrent (server) for Linux is available to download, for 32 and 64 bit architectures. After unpacking the downloaded package, a user can launch the available bittorrent server and use it like a client through a web browser GUI, by making his/her browser address bar point to http://localhost:8080/gui/.

Anyway, as of writing (openSUSE 12.2), KTorrent, Transmission and Deluge, all provide everything users should need from a BitTorrent client.


Downloading openSUSE via BitTorrent

To obtain openSUSE iso's, use your browser to go to ftp.opensuse.org and click on the .torrent files to start your downloads automatically.

Speed problems

First of all, please keep your BitTorrent client running even after your download has finished. This helps all the others still trying to download the files because you might be the only one with a complete copy.

If the torrent download is slower than expected, make sure your maximum upload rate is set to 90% of the upload rate of your internet connection. Higher values will cause contention on your connection, resulting in very slow downloads. Lower values will make your download slower and also slow down the downloads of your peers.

Another trick is to change the port number in your BitTorrent client to something outside 6881-6999. A good suggestion are ports 6334-6342. This will enable you to download from some high-bandwidth peers at educational institutions sitting behind restrictive firewalls. Please note that you also have to substitute the allowed ports at your firewall with the alternative range.


BitTorrent and the SuSEfirewall2

The YaST firewall makes it nearly impossible to use the BitTorrent protocol. Extremely slow download times could be the end result. However, these procedures may help get BitTorrent Running:

The firewall is on the computer you download the file on

There are two ways to configure the firewall:

  1. Start the YaST firewall and select the zone you want to allow services for (where you want the enabled port). Click [Advanced...] and enter the correct information (syntax from-port:to-port numeric). Click [OK] (YaST might ask you if you are sure) to return to the main dialog; click [Cancel] to re-enter the port numbers. After returning to the main menu, click [Next] and [Accept] (or [Finish]) to finish configuration.
  2. Open the /etc/sysconfig/SuSEfirewall2 file in any text-editor
    Add the required ports to the FW_SERVICES_EXT_TCP, FW_SERVICES_INT_TCP or FW_SERVICES_DMZ_TCP variable.
    (# Examples: "ssh", "123 514", "3200:3299", "ftp 22 telnet 512:514")

See this page for more port information: http://compnetworking.about.com/od/bittorrent/qt/bittorrentports.htm.

Adding TCP: "6881:6999" is a good idea, but could result in a security risk. Not only P2P clients can use this port, as everyone should know.

The firewall is on the server and you use BitTorrent on a client

The example here is for a SUSE 9.0 server. You must redirect the port 6881 (ktorrent) to your client. This is done going to /etc/sysconfig and editing the file SuSEfirewall2.

Edit the line FW_FORWARD_MASQ to have something like mine:

FW_FORWARD_MASQ="0/0,10.3.204.103,tcp,6881"

10.3.204.103 is the internal IP of my client, give yours.

After saving the modified file, restart the firewall, only typing "SuSEfirewall2" and Enter (no "restart" option). Stop ktorrent and restart it. that's all.

Running BitTorrent Seeder on a Mirror Server

If you use to have a full copy of the openSUSE tree then you can seed all torrents automatically to the net by running the following command (from the BitTorrent package):

btlaunchmany --display_interval 60 --max_upload_rate 1000 --saveas_style 2 --torrent_dir /pub/opensuse/

Just replace the 1000 with the number of KB/s you want to serve by BitTorrent and /pub/opensuse/ by the path to the openSUSE tree.

You may safely ignore the warnings you see when the tool starts. This is only because BitTorrent is confused by the SL-OSS-current symlink but does not influence correct operation of the BitTorrent seeder.

You should stop the tool when you start a mirror sync because the tool would interfere with the sync otherwise. Just restart the tool after the sync again and it will resume seeding.


How to Share Any ISO-image over BitTorrent Using Azureus

Please upload as long as possible so that openSUSE gets spread. If you removed the download from azureus and you want to re-add it, this is the way to get it back.

  1. You should know where the .torrent file of your download is. If you don't know it, get it. (Maybe: http://download.opensuse.org/distribution/12.2/)
  2. Be sure to store a backup of the image in another folder
  3. Open azureus and go to File -> Open -> Torrent File
  4. Add the torrent file in the upper half
  5. Change the download location in the lower half of the window to your download
  6. Click OK and wait until the verifying is done

Then, Azureus should automatically transfer the download to the seeding window. If the torrent does not move into the seeding window on its own: Right-click on newly created entry in the download window of the My Torrents view. Select Force Re-check. The value in the 'Done' column will count from 0% to 100%. Upon reaching 100%, the file will be moved to the seeding list on the bottom of the My Torrents tab.