Show
Ignore:
Timestamp:
04/19/2007 02:29:22 PM (21 months ago)
Author:
mike
Message:

added donate page and changed donate paypal address to donate@…

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dotorg/trunk/html/fast_extensions.html

    r4460 r4635  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
    2         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     2        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    33<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    44<head> 
     
    1919<li><span>For Developers</span></li> 
    2020<!-- <li><a href="./blog">Blog</a></li> --> 
    21 <!-- <li><a href="./donate.html">Donate!</a></li> --> 
     21<li><a href="./donate.html">Donate!</a></li> 
    2222</ul> 
    2323</div> 
     
    2525<div id="second"> 
    2626<h1>Fast Extension</h1> 
    27 <p>The Fast Extension packages several extensions: <i>Have None/Have All</i>,  
     27<p>The Fast Extension packages several extensions: <i>Have None/Have All</i>, 
    2828<i>Reject Requests</i>, <i>Suggestions</i> and <i>Allowed Fast.</i> 
    2929These are enabled by setting the third least significant bit of the 
     
    5555</p> 
    5656<h2 id="Modifications_to_Semantics_of_Existing_Messages"> Modifications to Semantics of Existing Messages </h2> 
    57 <p>The Fast Extension modifies the semantics of the  
     57<p>The Fast Extension modifies the semantics of the 
    5858<i>Request</i>, <i>Choke</i>, <i>Unchoke</i>, and <i>Cancel</i> 
    59 messages, and adds a <i>Reject Request.</i>  Now, every request  
     59messages, and adds a <i>Reject Request.</i>  Now, every request 
    6060is guaranteed to result in EXACTLY ONE response 
    61 which is either the corresponding reject or corresponding piece  
     61which is either the corresponding reject or corresponding piece 
    6262message.  Even when a request is cancelled, the peer receiving 
    6363the cancel should respond with either the corresponding reject or 
    6464the corresponding piece: requests that are being processed are 
    6565allowed to complete. 
    66 </p><p>Choke no longer implicitly rejects all pending requests,  
    67 thus eliminating some race conditions which could cause pieces  
     66</p><p>Choke no longer implicitly rejects all pending requests, 
     67thus eliminating some race conditions which could cause pieces 
    6868to be needlessly requested multiple times. 
    69 </p><p>Additionally, if a peer receives a piece that was never requested,  
     69</p><p>Additionally, if a peer receives a piece that was never requested, 
    7070the peer MUST close the connection. 
    7171</p> 
    72 <h2 id="Have_All.2FHave_None"> Have All/Have None </h2>  
     72<h2 id="Have_All.2FHave_None"> Have All/Have None </h2> 
    7373<pre> <i>Have All</i>: &lt;len=0x0001&gt;&lt;op=0x0E&gt; 
    7474</pre> 
     
    7878has all or none of the pieces respectively.  When present, <i>Have All</i> 
    7979or <i>Have None</i> replace the <i>Have Bitfield.</i>  Exactly one of <i>Have All</i>, 
    80 <i>Have None</i>, or <i>Have Bitfield</i> MUST appear and only immediately after  
     80<i>Have None</i>, or <i>Have Bitfield</i> MUST appear and only immediately after 
    8181the handshake.  The reason for these messages is to save bandwidth.  Also 
    8282slightly to remove the idiosyncrasy of sending no message when a peer 
    8383has no pieces. 
    84 </p><p>When the fast extension is disabled, if a peer receives <i>Have All</i> or  
     84</p><p>When the fast extension is disabled, if a peer receives <i>Have All</i> or 
    8585<i>Have None</i> then the peer MUST close the connection. 
    8686</p> 
    87 <h2 id="Suggest_Piece"> Suggest Piece </h2>   
     87<h2 id="Suggest_Piece"> Suggest Piece </h2> 
    8888<pre> <i>Suggest Piece</i>: &lt;len=0x0005&gt;&lt;op=0x0D&gt;&lt;index&gt; 
    8989</pre> 
     
    9797any given time.  A peer receiving multiple <i>suggest piece</i> messages 
    9898MAY interpret this as meaning that all of the suggested pieces 
    99 are equally appropriate.    
    100 </p><p>When the fast extension is disabled, if a peer receives a  
     99are equally appropriate. 
     100</p><p>When the fast extension is disabled, if a peer receives a 
    101101<i>Suggest Piece</i> message, the peer MUST close the connection. 
    102102</p> 
     
    106106</pre> 
    107107<p><i>Reject Request</i> notifies a requesting peer that its request will not be satisfied. 
    108 </p><p>If the fast extension is disabled and a peer receives a reject  
     108</p><p>If the fast extension is disabled and a peer receives a reject 
    109109request then the peer MUST close the connection. 
    110110</p><p>When the fast extension is enabled: 
     
    126126 
    127127<h2 id="Allowed_Fast_Set_Generation"> Allowed Fast Set Generation </h2> 
    128 <p>The canonical algorithm for computing a peer <i>P'</i>s <i>allowed fast set</i>  
     128<p>The canonical algorithm for computing a peer <i>P'</i>s <i>allowed fast set</i> 
    129129follows.  All integers in this pseudocode are four bytes represented in network (big-endian) byte order.  <i>[a:b]</i> denotes the sequence of consecutive integers from <i>a</i> to <i>b</i> excluding <i>b</i>, i.e., <i>(a, a+1, a+2,..., b-1)</i>. <i>x[a:b]</i> denotes a subsequence of elements in an array <i>x</i> starting from index <i>a</i> to but not including index <i>b</i>. 
    130130</p><p>Let <i>ip</i> denote <i>P'</i>s IPv4 address.  We currently have no 
     
    132132(NAT) then <i>ip</i> should be the externally facing IP address of the 
    133133NAT.  Since the node sending the <i>Allowed Fast</i> messages computes 
    134 the set, the correct <i>ip</i> is usually the <i>ip</i> address on the other  
    135 end of the connection.  The host computing the set MAY use the <i>ip</i>  
     134the set, the correct <i>ip</i> is usually the <i>ip</i> address on the other 
     135end of the connection.  The host computing the set MAY use the <i>ip</i> 
    136136address on the other end of the connection regardless 
    137137</p><p>Let <i>sz</i> denote the number of pieces in the torrent. 
     
    141141<pre> x = 0xFFFFFF00 &amp; ip                           (1) 
    142142 x.append(infohash)                            (2) 
    143  while |a| &lt; k:  
     143 while |a| &lt; k: 
    144144   x = SHA1(x)                                 (3) 
    145145   for i in [0:5] and |a| &lt; k:                 (4) 
     
    152152<p>Step (1) selects the most significant octets in peer <i>P'</i>s 
    153153ip address.  We do this to prevent a user that obtains more than one 
    154 IP address on the same network from obtaining more than one  
     154IP address on the same network from obtaining more than one 
    155155<i>allowed fast set.</i>  Use of three bytes is heuristic and 
    156 historical.  
     156historical. 
    157157</p><p>Step (3) generates a 20-byte random number on each call.  By 
    158158performing a SHA-1 hash on the previous iteration's hash, we can 
     
    192192<p>Example results generated by this function: 
    193193</p> 
    194 <pre>7 piece allowed fast set for torrent with 1313 pieces and hex infohash    
     194<pre>7 piece allowed fast set for torrent with 1313 pieces and hex infohash 
    195195aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for node with IP 80.4.4.200: 
    196196  1059,431,808,1217,287,376,1188 
    197 9 piece allowed fast set for torrent with 1313 pieces and hex infohash      
     1979 piece allowed fast set for torrent with 1313 pieces and hex infohash 
    198198aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for node with IP 80.4.4.200: 
    199199  1059,431,808,1217,287,376,1188,353,508