the forums at degreez.net

It is currently Thu Mar 28, 2024 12:02 pm

All times are UTC - 7 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Compact Mode
PostPosted: Sun May 10, 2009 1:58 am 
Offline

Joined: Sat Feb 11, 2006 8:00 am
Posts: 18
Location: France
Hi.

I'd like to know if Tornado is complient with COMPACT MODE?
And if not, will it be?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 10, 2009 12:26 pm 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
It'd help if I knew what "COMPACT MODE" was... Googling doesn't bring up any solid definition of it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 11, 2009 3:07 am 
Offline

Joined: Sat Feb 11, 2006 8:00 am
Posts: 18
Location: France
Quote:
compact : Setting this to 1 indicates that the client accepts a compact response. The peers list is replaced by a peers string with 6 bytes per peer. The first four bytes are the host (in network byte order), the last two bytes are the port (again in network byte order). It should be noted that some trackers only support compact responses (for saving bandwidth) and either refuse requests without "compact=1" or simply send a compact response unless the request contains "compact=0" (in which case they will refuse the request.) "


Found here : http://wiki.theory.org/index.php/BitTor ... S_Protocol

It seems to be a communication protocole for trackers to designate peers to clients, using less bandwitch.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 11, 2009 3:28 am 
Offline

Joined: Mon May 11, 2009 3:21 am
Posts: 1
Compact mode is a way to return peer list as a compact binary string :
Client give :
Code:
&info_hash=info_hash_here&peer_id=peer_id_here&port=54360&uploaded=0&downloaded=0&left=0&corrupt=0&key=D662A77D&numwant=200&compact=1&no_peer_id=1&ipv6=an_ipv6_address


Some tracker response with compact (binary in BBCode xD but I try to show you):
Code:
d8:intervali3600e12:min intervali3600e8:completei15e10:incompletei0e5:peers102:RZ¿Rþí¢{§^Kä!lîU±«/Zh/)ÔLýs7Z6K gß\ñ²¼X©=Sz÷dWZß#zvÂX©=\ñ²ÿÿÿ7SÀÀ1VØ.g¸e

Code:
d8:intervali2400e12:min intervali2400e8:completei18e10:incompletei0e5:peers102:RCZ9¡ÿZ¿R@v·{§U±  H¿UÞh/)ÔLýs7Z6K gß\ñ²¼Sz÷dWZß#zvÂX©=\ñ²ÿÿÿ7SÀÀ1VØ.g¸VD2ÿÿÿp}e


Tracker must respond with a peer list in binary format :
peers<string lenght>:<binary (lenght = 6) for IP:PORT of peer1><binary (lenght = 6) for IP:PORT of peer2>etc...
Compare to "classic" method, just removed the "peersl<peer list>"


Here is my php function to create peer pack list :
Code:
$resp = 'd8:intervali' . $annintval . 'e12:min intervali' . $annintval . 'e8:completei' . $torrent['seeders'] . 'e10:incompletei' . $torrent['leechers'] . 'e5:peers';
while ($row = mysql_fetch_assoc($res)){
   $peer_ip = explode('.', long2ip($row["ipv4"]));
   $peer_ip = pack("C*", $peer_ip[0], $peer_ip[1], $peer_ip[2], $peer_ip[3]);
   $peer_port = pack("n*", (int)$row["port"]);
   if($left == 0) {
      $time += 128;
   }
   $time = pack("C", $time);
   $peer[] = $time . $peer_ip . $peer_port;
   $pnum++;
}
$o = '';
for($i=0;$i<$pnum;$i++) {
   $o .= substr($peer[$i], 1, 6);
}

$resp .= strlen($o) . ':' . $o . 'e';



Edit:

Personaly, I use also the KEY param given into the URL, I don't know witch parameter give BitTornado. An I hope some params could be added (like Azureus) for :
require/suport Crypto
ipv6= IPv6 adress : if tracker haven't got IPv6 support, he cans return a peer list with IPv6
no_peer_id : I'm not sure about this but : if compact is set to 1, no_peer_id is set to 1 too.


I put the notifs to on.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 11, 2009 7:44 pm 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
Oh! Yes, it is, both client and tracker.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 12, 2009 12:08 am 
Offline

Joined: Sat Feb 11, 2006 8:00 am
Posts: 18
Location: France
Great.

2nd question now :

Is there some option to enable compact mode in Bittornado, or that's activated by default?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 12, 2009 9:06 am 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
Default behavior.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 12, 2009 9:24 am 
Offline

Joined: Sat Mar 13, 2004 11:16 am
Posts: 60
There is absolutely no good reason to disable compact. It's backwards compatible when enabled and just plain better for everybody to use it.

Plus there's no setting to disable it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 12, 2009 11:50 am 
Offline

Joined: Sat Feb 11, 2006 8:00 am
Posts: 18
Location: France
I don't want to disable it, i just wanted to be sure it was enabled by default ^^

Thx 4 answers.

Hop will be new versions of BitTornado in futur (almost 3 years i wait for that :p)

PS : why can't we donate for your project (not to Bram's one)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group