| Structure
Name |
Recommended
Data Type |
Use |
| User_max_up_speed_kb |
Unsigned Int, kilobytes |
Track user upload speed |
| User_max_down_speed_kb |
Unsigned Int, kilobytes | Track user download speed |
| User_24h_max_up_kb |
Unsigned Int, kilobytes | Track 24h MB Traffic Uploads
(volitile) |
| User_24h_max_down_kb | Unsigned Int, kilobytes | Track 24h MB Traffic Downloads
(volitile) |
| User_maximum_24h_traffic |
Unsigned Int, kilobytes | Maximum possible observed traffic |
| User_24h_traffic_STDEV_up | Unsigned Byte, Standard Deviation Units |
Should be within 0.10 to 0.05
strictly based on upload speeds. "0.XX" |
| User_24h_traffic_STDEV_down | Unsigned Byte, Standard Deviation Units |
Should be within 0.10 to 0.05
strictly based on upload speeds. "0.XX" |
| User_update_interval |
Already existant |
Hourly updates a good idea |
| User_last_updated |
Signed Long, Unix Time |
64 bit POSTIX Time, NOT BCD time! |
| User_record_expires |
Unsigned Byte, hours |
Delete record
if user inactive more than ~7 days |
| Data
structure |
Typical
output |
Bytes |
Total |
| version : unsigned byte; | 00x for version 01, always
Binary not ASCII |
1 |
1 |
| message-number : unsigned int;
(32 bits) |
Message number should always go
up in sequence by some fixed rule (+3 for one private tracker vs +11
for another). The message number must restart at zero after each
tracker reboot, after that it is up to the tracker to determine its own
sequence for this accounting message. |
4 |
5 |
| force-reply : char[1]; | "Y" forces immediate reply (6s), "R" forces prognostic reply (67s), "N" forces no reply | 1 |
6 |
|
file-or-client : char[1];
|
"L" ('local' file statistical
error) or "G" ('global' client statistical error) |
1 |
7 |
| mode-accounting-failure : char[1]; | "U" (upload) or "D" (download);
or "S" (global client statistics) |
1 |
8 |
| affected-object-hash : unsigned byte[12]; | The {first (for uploads) or last
(for downloads)} 12 bytes of the SHA-1 hash of the affected shared
object. Always
Binary not ASCII. Must be XORed over "101010101..." (uploads) or
"11001100..." (downloads). Sending the 'cleartext' of the file SHA-1 hash would decrease the privacy to the protocol. ALSO For global client failures this should be filled with binary zeros. |
12 |
20 |
| message-crc16-CCITT : short
unsigned int; |
Mandatory. Two bytes. Applies to
the whole message. This field is necessary for the client program to
make a reply. CRC-16-CCITT : x16 + x12 + x5 + 1 |
2 |
22 |
| Data
structure |
Typical
output |
Bytes |
Total |
| version : unsigned byte; | 0000x for version 0001, always
Binary not ASCII. Mandatory. |
1 |
1 |
| message-processing-status :
unsigned byte; |
01x = success : no syntax
errors, no checksum errors; 05x = success : syntax errors, no checksum errors; 09x = failure : syntax and checksum errors ... did you send this? |
1 |
2 |
| reply : unsigned int; |
Mandatory. Message number should
always go
up or down in sequence by some fixed rule unique to the private tracker
to avoid protocol attacks. By only sending back the CRC of the message
number, acknowledgment is possible and some possible other measures
could be taken by either program or the user or both. Replies should work like this : Essentially a 32 bit checksum of the accounting error message should be computed by the client and transmitted back to the tracker. The answerback should be computed and stored by the tracker when the accounting error message is issued. Syntax :: reply = crc32K(private-tracker-error-message + md5(private-tracker-error-message)) "+" designates binary domain bit string concatenation This checksum should not include the CRC16 transmitted to the client in the original accounting error message, as the CRC16 is only there for adverse network conditions. The goal is to eliminate the CRC16 as a source of spoofing or attack. CRC-32-Koopan (aka crc32K) should be used here : x32 + x30 + x29 + x28 + x26 + x20 + x19 + x17 + x16 + x15 + x11 + x10 + x7 + x6 + x4 + x2 + x + 1 |
4 |
5 |
| message-crc8-CCITT :
unsigned byte; |
Mandatory. One byte. Applies to
the whole message. This should only be paid attention to if the user is
communicating a low bit rates -- as with dialup modems. CRC-8-CCITT : x8 + x2 + x + 1 If this checksum is deemed unworkable, CRC-16-CCITT : x16 + x12 + x5 + 1 should be used as a replacement. Asymmetry of checksums here is a protection mechanism to make spoofing more difficult. Hashsums are only being avoided to limit bandwidth. |
1 |
6 |