CTorrent Control Server

CTorrent Control Server (CTCS) is an interface for monitoring and managing Enhanced CTorrent clients. It can manage allocation of bandwidth, provide status information, and allow changes to the running configuration of each client. Communication with CTorrent is via a TCP connection, and the user interface is a web browser.

The current version is implemented in Perl since that was used to develop the original prototype. It may be reimplemented in C at some later date, but the Perl version is fully functional. You will need to install a Perl interpreter if your system does not already have one.



The preferred download mechanism is now the SourceForge File Release page. All new files will be available there for convenient downloading from a mirror site near to you.

ctcs-1.4.1.tar.gz: CTCS version 1.4.1. List of changes:

ctcs-1.4.tar.gz: CTCS version 1.4. List of changes:

ctcs-1.3.tar.gz: CTCS version 1.3. List of changes:

ctcs-1.2.tar.gz: CTCS version 1.2. List of changes:

ctcs-1.1.tar.gz: CTCS version 1.1. List of changes:

ctcs-1.0a.tar.gz: CTCS version 1.0a

ctcs-1.0a.diff: Patch file for 1.0
There was a minor bug in the original release that prevented the Messages feature from working (messages were discarded). If you previously downloaded version 1.0, please apply this small patch to enable the feature.


ctcs [-d <dlimit>] [-u <ulimit>] [-i <interval>] [-p <port>] [-P]
-d dlimit
Overall download bandwidth limit, in KB/s (default 100).
-u ulimit
Overall upload bandwidth limit, in KB/s (default 25). Use a value that is less than the maximum capacity of your network line.
-i interval
Bandwidth management change interval, in seconds (default 5). The recommended minimum value is 3. Higher values will reduce oscillation of individual torrent limits, but a value that is too high will cause very slow reactions to changes in bandwidth usage.
-p port
The TCP port on which to listen for connections (default 2780).
Prompt for an authorization password.
If your system does not have perl available at /usr/bin/perl, you will need to change the path in the first line of the file.

To connect Enhanced CTorrent (release dnh2 or later) clients to CTCS, use the "-S" command-line option, e.g. "-S localhost:2780". To use a web browser to view or change status, enter the same host and port as the location, e.g. "http://localhost:2780/".


Though there is a basic option, security is very minimal. Running CTCS on a computer or network with untrusted users is not recommended. It should go without saying that the CTCS listening port should not be made openly accessible from the public Internet (but there, it's said anyway).

The "-P" option will cause CTCS to prompt for a password when starting. This password will be used to authenticate CTorrent clients. It is intended that the same password will be used to authenticate web browser connections also, but this has not yet been implemented. Using a colon at the end of the -S parameter to CTorrent (as in "-S localhost:2780:") will cause the client to prompt for a password to send to CTCS when connecting.

All Torrents screen

This is the main CTCS display, which shows overall bandwidth status and provides a summary of each torrent.

Bandwidth Management

The top portion of the display provides the bandwidth management interface.

Current DL = 7 K/s DL Limit: K/s
Current UL = 34 K/s UL Limit: K/s
Change interval: sec
Advanced Limits

The current aggregate download and upload rates are shown at the left (determined by adding together the rates reported by each client). To the right of this the overall limits and change interval can be changed. To do this, enter the desired values and click the Change button.

The Advanced Limits function is covered further below.

Active Torrents

The next section of the display is a list of all active clients that are reporting to CTCS, and status information on the torrents they are running.

Show peers

Torrent Start Time
SeedLeechComplete DL RateUL Rate DL TotalUL Total Limit D/U
Example 1.torrent Tue Jan 3 21:24:27 2006
S: 0/3L: 7/7100% D= 0 B/sU= 11 K/s D= 393 MU= 1111 M 0 / 11 K/s
Example 2.torrent Tue Jan 3 20:24:06 2006
S: 0/25L: 44/52 +2100% D= 0 B/sU= 12 K/s D= 380 MU= 972 M 0 / 12 K/s
Example 3.torrent Wed Jan 4 22:13:55 2006
S: 1/2L: 1/2 20% (100% Avail) D= 7372 B/sU= 12 K/s D= 188 MU= 254 M 100 / 12 K/s

Each torrent is listed in blue along with the time the client was started, with its status information shown below it in white. The first two fields are the number of seeders and leechers connected (out of the tracker's totals), plus connections in progress if any. This is followed by the percentage of the torrent that you have; if it is not complete then the amount that is currently available from all connected peers is shown in parentheses. The current download and upload rates are shown in bytes, kilobytes, or megabytes per second, as are the total amounts downloaded and uploaded by the client. The bandwidth allocated to the client is shown in the last column, in kilobytes per second. Note that bandwidth is managed to a finer degree than this, so if you see a zero value it just means that less than 1K has been allocated. This is also why it may appear that the total is wrong if you add the displayed values yourself.

Clicking a torrent title will take you to the Torrent Details screen for that torrent. If CTCS has received any status messages from a client, an exclamation point (!) will be shown next to the title. If there are potentially severe messages, the title will be highlighted in yellow or red. (If the client is an older version not supporting severity, the title will be highlighted in yellow when any messages are present.) These messages can be read on the Torrent Details screen. Bandwidth limits may also be highlighted in yellow or green if they have been adjusted on the Advanced Limits screen.

The "Show peers" option will list each torrent's peers below the torrent's status information. For more information, see the Torrent Details screen description below.

Terminated Torrents

Clients that have disconnected from CTCS (assumed to have terminated) are listed in the lower portion of the display.

[Del] Torrent End Time
SeedLeechComplete DL RateUL Rate DL TotalUL Total Limit D/U
Finished example 4.torrent Sat Dec 24 19:09:55 2005
S: 0/1L: 5/5100% D= 0 B/sU= 16 K/s D= 720 MU= 136 M 0 / 15 K/s
Dead example 5.torrent Sun Jan 1 23:37:15 2006
S: 0/2L: 13/14100% D= 0 B/sU= 14 K/s D= 435 MU= 1937 M 0 / 13 K/s

This is just like the list of active torrents except that the end time replaces the start time. The last known status information is shown, which is normally the final status unless the client terminated abnormally (crashed). The Torrent Details screen (click the title) is an abbreviated version, allowing you to see the share ratio and any messages.

To remove a torrent from the list, check the box next to it and click the Delete button at the bottom left of the list. To clear the entire list, click the Delete All button at the bottom right.

Torrent Details

This screen shows detailed information about a particular client.

Upload/Download Ratio: 2.83
Seed time remaining: 54 hours 11 minutes

If nothing has been downloaded, the full size of the torrent is used as the amount downloaded; if you are only seeding, then the ratio effectively shows how many times you have uploaded the torrent.

The time remaining is an estimate based on the current download rate, current upload rate and target ratio, or actual seed time remaining.


Several configuration parameters can be changed in this part of the display.

Verbose output [-v] Disabled
Seed time [-e] ~hours remaining (-e 72)
Seed ratio [-E] Upload:Download
Max peers [-M] Current peers: 5
Min peers [-m] Current peers: 5
Download files [-n]
Cache size [-C] MB; 3552KB now in use
Pause torrent Stop upload/download
Completion command [-X]
Normal/status output
Interactive output
Error/warning output
Debug/verbose output
Console input
CTCS server

Note that the available options and their descriptions are now determined by the client and are only presented by CTCS. For details, see the Enhanced CTorrent User's Guide (command-line options and operator menu).

For parameters that have a corresponding command-line option, the option letter is shown in brackets next to the parameter name. Certain items may be highlighted when active or to draw attention; this does not indicate a problem.

Note that for "Seed time" an approximation of the number of hours remaining is shown, and a new value entered will be interpreted the same way. While a decimal value may be shown, the current client will use only the integer portion of any new value entered. The total number of seed hours (as it would have been given on the command line when starting the program), of dubious usefulness, is given in parentheses.

Other features are:

Pause torrent
This will cause the client to temporarily stop transferring data (uploading and downloading torrent content).
I/O channel redirection
The targets for the console input and output channels can be changed.


This section allows you to cause the client to perform an action.

Update Update tracker stats & get peers
Restart Restart the tracker session
Terminate Stop torrent (quit)

Force a normal update connection to the tracker.
This may be handy if messages from the tracker indicate that your client is no longer registered. You will connect to the tracker as if the client just started.
Stop the client in a normal manner (as when seeding has completed or the user hits control-c). This option is tinted red to help avoid accidental selection.


If any status messages have been received from the client, they are listed next. Messages are color-coded according to severity (supported with Enhanced CTorrent dnh2.2 and later).

Tue Jan  3 23:24:47 2006 warn, connect to tracker failed:  Operation timed out
Tue Jan  3 23:19:04 2006 warn, received nothing from tracker!

To acknowledge the messages (which clears the list from CTCS memory), click the Clear button.


The component files of the torrent are listed next.

File NameSizeComplete AvailablePriority
1Main.dat 393 M90%100%
2readme.txt 2 K100%100%
Total393 M

The file number, name, size (scaled to bytes, kilobytes, or megabytes), percentage complete, and percentage available are shown. Files which are complete (all available pieces have been downloaded) are tinted green. Partial availability is indicated by yellow tint; zero availability is indicated by red. If using the "-n" option to download specific files, the current files in progress are tinted blue.

If the "-n" option is in use, the prority of each file is indicated in the rightmost column. Files with priority "1" are included in the first group to be downloaded; files of the same priority will be downloaded together. The priorities can be altered by changing the values and clicking the "Set" button. This is equivalent to changing the "-n" configuration option, and the changes will be reflected in that value as well.

Status and Peers

This section is similar to what is displayed on the All Torrents screen.

Torrent Start Time
SeedLeechComplete DL RateUL Rate DL TotalUL Total Limit D/U
Example 1.torrent Tue Jan 3 21:24:27 2006
S: 0/4L: 8/9100% D= 0 B/sU= 15 K/s D= 393 MU= 1113 M 0 / 17 K/s
-BC0060-0x1B5809A843282B5EE23CEC0F00.131.203.0BitComet 0060
CnCi 77% -- --
-BC0060-5)0x9881006F56E31AA742F80.255.161.000BitComet 0060
CnCi 20% -- -U= 192 K
-BC0060-0x09645C51208ADDB8D53E29F700.171.219.0BitComet 0060
CnUi 2% -U= 2457 B/s -U= 496 K
-BC0060-0x01DE4ED5BB6797CC6C58EF1E0.48.201.000BitComet 0060
CnUi 10% -U= 7372 B/s -U= 4320 K
-BC0059-0xE507A66333F2A020E7DBFC4200.245.89.00BitComet 0059
CnCi 65% -- -U= 1072 K
exbc0x01014C4F524497240602B5B8E07B3AA30.95.210.00BitLord 1.1
CnUi 23% -U= 1638 B/s -U= 8592 K
-BC0059-0x9F1995D00E3BA5EF9ABEE4F80.74.215.00BitComet 0059
CnCi 49% -- -U= 11 M
-AZ2306-kW66DYIl3XoE00.183.31.0Azureus 2306
CnUi 93% -U= 5734 B/s -U= 38 M

The currently connected peers are listed below the client status information. The peer ID, IP address, and software name and version (if identified) are tinted green. Below this (mostly in white) is status information for that peer. The first field shows "C" or "U" to indicate whether the connection is choked or unchoked for downloading, followed by "i" or "n" to indicate whether your client is interested (or not) in downloading from the peer. The second field shows the same information for uploading to the peer (whether you have choked the peer and whether he is interested in your data). The third field is the percentage of pieces that the peer has. The next two fields are your client's current download and upload rates to the peer, and the last two are the total amount your client has downloaded from and uploaded to the peer.

Some information is color-coded to make it easier to interpret. Uninterested ("n") connections are shaded light gray. The percentage complete is shaded red according to its value, with 0% being pure red and 100% being white. The transfer rates and totals are shaded purple according to scale: white for a blank (zero) entry, light for M, medium for K, and dark for B. This should make it easier to visually compare numbers of similar magnitude.

Advanced Limits

This screen allows fine-tuning of the client bandwidth limits.

Torrent Current Rate Limit Minimum Maximum Shared
Example 2.torrent 0 13
Example 1.torrent 0 11
Example 3.torrent 8 12 0

Due to the complexity of these options, usage notes are displayed directly on the screen: