APT-TORRENT Home Page

>> English slogan to be determined

You are here: Home page » DOCUMENTATION

>>How does it work

23 October 2000
Author: 

Description:
Apt-Torrent is a multithread application composed of 2 modules:
- an apt http daemon which act as a gateway
- a bittorrent package fetcher

Apt-Torrent run as a system daemon, and is listening for http requests on port 6968 on localhost by default. This is why after the package installation, you should have such a line in your /etc/apt/sources.list:

The rest of the configuration (mostly BitTorrent tweaks) fall into /etc/apt/apt-torrent.conf.

How it works:
Apt-Torrent is acting like an httpd package server for apt. It will work with any program that is using apt as a backend like dselect/aptitude/synaptic/...etc.

Diagram1

Since it is often best for comprehension to use an example, I’ll explain one.
Suppose you want to install frozen-bubble.

Updating the packages lists:
You first run an update with for example, aptitude:

# aptitude update
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Ign file: ./ Release
Hit http://127.0.0.1 unstable/main Packages

What happened ?
aptitude update has connected to our local micro http server (1), and asked for packages lists. In this case, the proxy forwarded the request to the "official" repository configured in /etc/apt/apt-torrent.conf. By default, the "official" repository is:

TORRENT_FILE_SERVER="sianka.free.fr"

So the micro http server will translate aptitude’s requests to this server (2).
When the micro http server gets the answer, it is forwarded to aptitude.
As a result, the package list fetching is acting like if this line was in /etc/apt/sources.list:

deb http://sianka.free.fr/debian/ unstable main

Requesting a package:
We want to install frozen-bubble:

# aptitude install frozen-bubble
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following NEW packages will be automatically installed:
 fb-music-high frozen-bubble-data
The following packages have been kept back:
 galeon galeon-common
The following NEW packages will be installed:
 fb-music-high frozen-bubble frozen-bubble-data
0 packages upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 12.1MB/12.2MB of archives. After unpacking 17.3MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
Get:1 http://127.0.0.1 unstable/main fb-music-high 0.1.1 [6950kB]
Get:2 http://127.0.0.1 unstable/main frozen-bubble-data 1.0.0-6 [5155kB]
Fetched 12.1MB in 24s (488kB/s)
Selecting previously deselected package fb-music-high.
(Reading database ... 208931 files and directories currently installed.)
Unpacking fb-music-high (from .../fb-music-high_0.1.1_all.deb) ...
Selecting previously deselected package frozen-bubble-data.
Unpacking frozen-bubble-data (from .../frozen-bubble-data_1.0.0-6_all.deb) ...
Selecting previously deselected package frozen-bubble.
Unpacking frozen-bubble (from .../frozen-bubble_1.0.0-6_i386.deb) ...
Setting up fb-music-high (0.1.1) ...
Setting up frozen-bubble-data (1.0.0-6) ...
Setting up frozen-bubble (1.0.0-6) ...

Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

What happened ?

When the apt request hit Apt-Torrent, the program is looking for "official" .torrent file on the http repository. You can see this in the log file:

DEBUG: Received request GET /debian/./frozen-bubble-data_1.0.0-6_all.deb HTTP/1.1
DEBUG: Fetching torrent file <-sianka.free.fr/debian/frozen-bubble-data_1.0.0-6_all.deb.torrent

Apt-Torrent is using the request from aptitude to build a torrent file "official" location. Then it fetch the torrent file
After getting this torrent file, Apt-Torrent is giving it to the local Bittorrent package fetcher and wait for the complete upload (3). The torrent file is using an regular seeder/tracker to find the packages on the Bittorrent network (4).

DEBUG: Waiting for file /var/cache/apt-torrent/frozen-bubble-data_1.0.0-6_all.deb to be downloaded.....
INFO: Download complete of /var/cache/apt-torrent/frozen-bubble-data_1.0.0-6_all.deb.complete.
DEBUG: Sending file /var/cache/apt-torrent/frozen-bubble-data_1.0.0-6_all.deb to apt.

When the package fetcher has finished downloading the package, it inform the micro http server with a dummy file .complete. Then it forward the package to apt.


Site développé sous SPIP 1.9.2c
Templates available (GPL)
RSS