UberSletz0r Posted February 2, 2006 Report Share Posted February 2, 2006 What algorithm is currently used in uTorrent, to select what pieces to download from which peers/seeds?Does it prioritize requesting the most rare pieces and how does it select the peers/seeds to connect to first?tnx in advance Link to comment Share on other sites More sharing options...
DreadWingKnight Posted February 2, 2006 Report Share Posted February 2, 2006 how does it select the peers/seeds to connect to first?It doesn't know what seeds are actually seeds until it connects to them.It gets a peerlist from a tracker (or from DHT) and connects to peers based on that.Piece selection typically goes rarest first. Link to comment Share on other sites More sharing options...
UberSletz0r Posted February 2, 2006 Author Report Share Posted February 2, 2006 Yes, I know the client (generally) gets a list of 20 random addresses from the tracker. But that's not something you can change in the client (next to DHT, peer exchange and requesting more peers from the tracker).My question is what uTorrent does after receiving a list of peers.The algorithm should however make a choice which addresses to connect to first (is this done randomly?), if pieces have the same availability (assuming rarest first), what piece is chosen? (also, randomly?) and if a choice is made, what peer will be requested to send the chosen piece?I think there might be some room for (at least experimental) improvement. I notice I usually get higher up- and download rates with people within the network of my own ISP or people within my country. If for example connection attempts or piece requests where done based at ping times (latency), hop count (traceroute) or based on the country (DNSBL) you might get overall higher up and download rates. Link to comment Share on other sites More sharing options...
Firon Posted February 2, 2006 Report Share Posted February 2, 2006 speed is tied to how close you are to whoever you're sending/receiving to, it happens to every single program. and make sure you're using the beta anyway.And um, I think most trackers give out around 50 peers at minimum. Link to comment Share on other sites More sharing options...
UberSletz0r Posted February 2, 2006 Author Report Share Posted February 2, 2006 Although latency does not say much about the bandwidth (which essentially determines the speed limit), I think with small pieces/chunks the latency (which usually depends on the distance) indeed determines the speed.The point I want to make, is that, especially with torrents with many peers and seeds (where you won't connect to them all), connecting to the closest peers (lowest latency) will improve the speed.Next to that, requesting chunks/pieces at these same 'close' peers, might also have a performance benefit.I wonder if this theory would work in practice, if someone has experience with this idea and if this might be interesting to implement in uTorrent. (hence I wonder what algorithm uTorrent currently uses) Link to comment Share on other sites More sharing options...
slayers Posted February 3, 2006 Report Share Posted February 3, 2006 (...) connecting to the closest peers (lowest latency) will improve the speed.Next to that, requesting chunks/pieces at these same 'close' peers, might also have a performance benefit.If every peer had unlimited bandwidth to serve you, that statement would hold true. But peers are very much limited in bandwidth, are they not?If you want the fastest speeds the best protocol should prioritize based on speed and not some other indirect variable. Peers that are close to you could be choked, could have low upload capacity, could be firewalled and not connectable, could have incorrect settings, ... The list of possibilities to screw up is virtually endless so latency is a poor criteria. In the end what matters is the results, that is, how much you are actually getting from that peer. And that is exactly what the protocol does with the choking/optimistic unchoking algorithm. Link to comment Share on other sites More sharing options...
UberSletz0r Posted February 3, 2006 Author Report Share Posted February 3, 2006 [..]If you want the fastest speeds the best protocol should prioritize based on speed and not some other indirect variable. Peers that are close to you could be choked, could have low upload capacity, could be firewalled and not connectable, could have incorrect settings, ... The list of possibilities to screw up is virtually endless so latency is a poor criteria. In the end what matters is the results, that is, how much you are actually getting from that peer. And that is exactly what the protocol does with the choking/optimistic unchoking algorithm.But how can a client know what the speed of a peer is, if it's not connected to the peer and has downloaded something already. Of course the criterium should be speed, but what would give you a better chance to connect to a 'fast' peer in the first place?With a large amount of peers, clients tend to connect to only a small part of them (due to an established connection limit, max half-open connections, which determines time to connect to them 'all' etc). Wouldn't it be 'more intelligent' to try to connect to peers that have a higher probability on obtaining good speeds?Since nothing is known about the peers at start (choked, firewalled, settings etc), using an indirect variable might be better than just randomly connecting to them.I just wonder what the current implementation is and if this 'idea' would be better. Link to comment Share on other sites More sharing options...
Firon Posted February 3, 2006 Report Share Posted February 3, 2006 Randomly connects to them, and drops inactive peers (there's always inactive peers) after a few minutes (5 to be exact) so it can open up the connections for new ones. And really, ping means absolutely nothing, it's not any better than connecting randomly. Link to comment Share on other sites More sharing options...
ravel9 Posted January 18, 2011 Report Share Posted January 18, 2011 Back to the suggestion of choosing peers who are from same ISP, region or country... How about specifying a preference network prefix list and let BT match it against the peer list. The prefix list could be user configurable in the BT client. Perhaps for a small region or even small country, there are only a handful of ISPs and each ISP typically have a small no. of summarized prefixes, so that this list would be small. Link to comment Share on other sites More sharing options...
DreadWingKnight Posted January 18, 2011 Report Share Posted January 18, 2011 There are MAYBE 4 countries that would actually have ANY potential benefit because of a different bandwidth allocation for domestic vs international connections. The demand for it is so insignificant that it just doesn't statistically happen. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.