Slashdot Log In
Making BitTorrent Clients Prioritize By Geography?
Posted by
timothy
on Tue Dec 02, 2008 12:43 PM
from the hey-you're-blocking-my-bandwidth dept.
from the hey-you're-blocking-my-bandwidth dept.
Daengbo writes "While I live in S.Korea and have virtually unlimited bandwidth in and out of the country, not all my Asian friends are so lucky. Many of the SE Asian and African countries have small international pipes. Even when a user has a high-speed local connection, downloads from abroad will trickle in.
Bittorrent clients apparently don't prioritize other users on the same ISP or at least in the same country. Why is that? Is it difficult to manage? If I were to write a plug-in for, say, Deluge, what hurdles would I be likely to come across? If this functionality is available in other clients or through plug-ins, please chime in."
Related Stories
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
Azereus already has a plugin for this (Score:5, Informative)
Re:Azereus already has a plugin for this (Score:5, Informative)
Is that the same plugin that constantly runs a barrage of pings in a hidden shell? Can't remember the name, but I ran a similar sounding plugin and didn't see much speed improvement but it sure did chew up my CPU.
Parent
Re: (Score:3, Informative)
It probably is the same one. I seem to remember that it was developed as part of a university project. I probably even read about it right here on /. I never checked the background activity so I can't comment on the barrage of pings. I do recall that it didn't make much of a difference in my torrent speeds. I'm on DSL at home and always get consistently good torrent performance.
Re: (Score:3, Insightful)
The "barrage" of pings may not have been necessary. A good first step is simply running the IPs through a geolocation database. There are various free ones available, and it's a pretty good first step for narrowing things down. They're very effective at getting the country right, and do a decent job at getting you to at least a nearby city.
From there, if you need farther precision, a single ICMP packet is required to determine the number of hops to a host by checking the TTL. Combine these two things and it
Re:Azereus already has a plugin for this (Score:5, Funny)
You can tell me, I work in the same place.
Parent
Re: (Score:3, Funny)
Where do you two work, I want to come join you so I can browse /. instead of doing my job. :p
Re:Azereus already has a plugin for this (Score:5, Informative)
Parent
Re:Azereus already has a plugin for this (Score:5, Interesting)
ISPs actually like P4P. It gives the customers what they want (fast P2P) and it gives the ISPs what they want (less data sent to the tubes that they don't own, and thus reduced costs and overhead.)
Parent
Re:Azereus already has a plugin for this (Score:5, Interesting)
Parent
Re: (Score:3, Interesting)
That isn't what ono does (Score:3, Interesting)
Ono [northwestern.edu] uses statistical data from CDNs to be a little bit smarter about picking peers in certain cases. In most cases the random solution is fine; your client can just randomly pick peers then stick with fast ones and drop slow ones. Ono aims to improve performance in certain cases where that strategy isn't very good.
Just in case anyone reading doesn't notice, Ono aims to find peers that are close to you on the network. That doesn't necessarily mean close to you geographically and so doesn't answer this ask /.
Won't work (Score:3, Insightful)
There is little to no support for multicast by last-mile ISPs.
It would be nice - ISPs keep bitching about how P2P is eating their bandwidth, but they don't bother implementing multicast which would make P2P use a fraction of the bandwidth it currently does.
Admittedly, in addition to lack of support, IPv4 multicast is pretty "meh" - there aren't many multicast addresses available and I have yet to see a good way of choosing/assigning them on a global network.
Re: (Score:3, Insightful)
It would be nice - ISPs keep bitching about how P2P is eating their bandwidth, but they don't bother implementing multicast which would make P2P use a fraction of the bandwidth it currently does.
I believe you mean P2P uses a fraction of the bandwidth it would if we had multicast. I have a constant upstream of 200k/s, to 5 clients, each getting 40k/s down from me. With multicast, I could have a constant upstream of 200k/s, to 5 clients, each getting 200k/s from me. This means I would send 200k/s up; my router would route for about 6 hops, then send duplicate packets out to 5 different routers from that hop, which would then send 200k/s down to various points on the Internet. Instead of consumin
Re:Won't work (Score:4, Informative)
Look at it from a different perspective - 100 people want one file of size A megabytes, and you start with one person seeding.
With classic unicast distribution, 100*A needs to be sent by that one person.
With P2P, much less needs to be sent, but still 100*A needs to traverse the network. It may or may not traverse fewer hops - it may in fact traverse more.
With multicast, A megabytes leave the single origin, and that gets multipled by routers as needed in the most efficient manner. In the end, the least amount of data needs to be sent in order for everyone to achieve completion. Yes, in the short term the network load will probably not be reduced much, but the time that high load occurs for will be far less before everyone has the file and there is little need for lots of bandwidth.
Parent
Re: (Score:3, Insightful)
Extending a business partnership with them, and convincing them that they CAN allow users to serve content without choking their already oversold bandwidth
This is fairly easy to do right now eith US ISPs...it's called a "business account".
They do cost more, but in my case I get 5 static IPs, guaranteed bandwidth, and no interference of any kind with my data (no port blocking, no throttling, and no caps) for $140. Compared to the non-business version with one dynamic IP, port blocking and some throttling (but no caps yet) at $70, it's not a bad deal.
"Prioritizing" (Score:5, Insightful)
Re:"Prioritizing" (Score:5, Insightful)
Just remember - prioritizing is one thing, but it's a slippery slope to peer exclusion.
Not really. Prioritize who you request data from, but not who you send it to. If all incoming requests are treated equally, but you only request from the optimal peers, you get all the benefits without any of the omgcensorship fud.
Parent
uTorrent (Score:5, Informative)
Re:uTorrent (Score:5, Informative)
Local peer Discovery works only within a lan, the corresponding broadcast messages are not routed over the internet
Parent
Re:uTorrent (Score:5, Informative)
rtorrent [rakshasa.no]
Parent
Re:uTorrent (Score:5, Interesting)
I run rtorrent in a detached screen session on a headless FreeBSD machine tucked away in the closet. I add torrent files to it just by dropping them into rtorrent's watch folder, everything else (starting, stopping, throttle management for off hours) is taken care of automatically. I do not have to have my laptop on or listen to the desktop whine all the time. Plus, rtorrent is blazing fast AND platform agnostic.
It is also accessible in many ways, ssh being the most obvious, but there are also many GUIs available, with which you can manage torrents from afar. I like it how it is possible to add a torrent to the queue, then take a 3 hour train ride home and find it's all done for you. Magic. So, yes, a torrent client that is run in a terminal can be a Very Good Thing for those who can set it up and use it the way it was meant to be. (And I am pretty sure it was meant to be used that way.)
Parent
Re: (Score:3, Funny)
Re:uTorrent (Score:5, Insightful)
That just means that ws_ftp's GUI is a pile of shit, it doesn't mean that GUIs are inherently slow.
Parent
Re: (Score:3, Insightful)
Re: (Score:2, Funny)
Negative.
Re: (Score:3, Interesting)
It's not a plugin, and it doesn't make you more or less likely to get busted. It simply searched the peer list from the tracker and prioritizes peers on the same subnet as you, and optionally removes your throughput limits.
A good feature, but it doesn't completely solve the problem, since it only works within your local subnet, and is therefore inherently incompatible with NAT.
Ono (Score:5, Informative)
Non-geo-ip (Score:4, Interesting)
One would not even need to prioritize by geographic location: the client could easily give extra priority points by network class: C first, then B, then A, then the rest. The odds of having a very fat pipe to another machine in the same class C are far better than having a fat pipe to a random machine across the planet.
And that would also alleviate the load on backbone links.
Re: (Score:3, Informative)
That doesn't work well with networks split with CIDR. For example, the 24.x.y.z block is in the Class A address range, but it's not a class A block.
They should prioritize by altitude (Score:4, Funny)
That way they can take advantage of the tendency of IP packets to flow downhill.
Re: (Score:2, Redundant)
So that's why my download speed is so much more than my upload speed!
Already Made "Ono" (Score:5, Informative)
Latency? Hops? (Score:4, Interesting)
How good is latency or hops as indicator of distance from peer? The idea is that if it takes 5 hops, as opposed to 10, then the peer taking the least hops to get to is the closest.
For Vuze, there's Ono and P4P (Score:5, Informative)
For Vuze [vuze.com], formerly Azureus [sourceforge.net], there are Ono [northwestern.edu] and P4P [yale.edu], which should do what you're looking for, although for different reasons. Unfortunately, they both rely on people in your region being interested in the same torrents you are, while P4P additionally benefits from an iTracker, an ISP provided tracker that's topology aware (they did some work to prioritize based on ping latency, using that as a distance estimate, but I don't know if it's a fallback mechanism). Due to the iTracker infrastructure and possibly conflicting supporters, there are some privacy concerns [torrentfreak.com].
Geolocation libraries (Score:3, Informative)
"Bittorrent clients apparently don't prioritize other users on the same ISP or at least in the same country. Why is that? Is it difficult to manage?"
The reason BitTorrent doesn't prioritize other users on the same ISP or the same country is that it doesn't know which ones are part of the same ISP or the same country. For ISPs, since the introduction of CIDR addresses, ISPs can have multiple blocks of IPs. Can you honestly tell me what all of, say, Comcast's IP blocks are with any degree of certainty?
For countries, you either need to know which IP blocks IANA has allocated to which IP registry or use a geolocation library.
MaxMind's GeoIP [maxmind.com] seems to be the de facto geolocation library, but they charge money for the "good" version. There is a free version [maxmind.com] now, but it has some annoying requirements, such as having to include "This product includes GeoLite data created by MaxMind, available from http://maxmind.com/ [maxmind.com]" in all advertising materials and documentation. It also only has a 99.5% accuracy as claimed by its creators, which means the the accuracy is probably considerably lower than they claim. Even if it were 99.5%, that means it's wrong for 1 out of every 200 people.
Re: (Score:3, Insightful)
Why don't the ISPs help? (Score:5, Insightful)
Re:Why don't the ISPs help? (Score:5, Funny)
Better yet, ISPs should just snail mail their customers linux cds/dvds. That would basically eliminate all torrent traffic.
Parent
Re:Why don't the ISPs help? (Score:5, Funny)
And then they could work on snail mailing truckloads of porn. That would basically eliminate all other traffic.
Parent
Because it's a pointless thing to do (Score:5, Insightful)
If your ISPs international pipe is flooded then bittorrent will automatically prefer local peers as they'll be the only people who can send you data at a fast enough rate. If you notice local peers who you're not connected to then it's most likely just because they've already reached their connection limit.
Most bittorent clients will connect to many peers and try to saturate your downstream bandwidth. They don't care where in the world those peers are as long as they're fast. If, in your part of the world, local peers are faster then that means you should just automatically connect to more local peers.
Napster's Old Peer Selection (Score:5, Interesting)
It was mostly because universities were complaining and so we weighted everyone on Internet 2 towards each other, but it also worked quite well for service providers like @Home and AOL. Since ISPs don't seem to care as much when their own bandwidth is used, a lot of complaints about our bandwidth consumption disappeared overnight. Indiana state university and someone else helped out if I remember correctly.
It was a rather simple system that used BGP routing tables from a number of routers to build a graph of network connectivity. It wasn't perfect, but it didn't have to be.
That said, with IPv6 weighting is *much* easier because of how the IP space is divided up. You can do a super naive implementation just by prefix.
An Azureus plugin Ono does something similar, though I believe they just look up the IP address for a CDN and weight people that look up the same IP towards each other. It is a decent solution, but it only works for between people who are running the plugin.
Tune your TCP Receive Window first (Score:5, Informative)
The biggest speed issue facing Asia/Australia is the latency of traffic to the rest of the planet. The (Windows) TCP Receive Window is tuned too small for the distances required. If you change the receive window to the maximum, you can get 4x more data in the same period using any client (P2P, browsers, etc...).
Refer to:
http://cable-dsl.navasgroup.com/index.htm#IncreasingWindow [navasgroup.com]
They're MY bits, not YOURS (Score:3, Interesting)
The most popular answer I managed to get was "if the machine's running out of money, they should restrict the cash withdrawal function to customers of this branch".
Does anyone see a parallel here?
2 meg data file could solve most of this! (Score:3, Interesting)
And I proposed it for two popular BitTorrent clients, only to be told, "we don't need that.."
Simple enough to do. Start with Class C address.. less then 2^24 of them, as some
are reserved, and not routable. Make a bitmap that big, so divide by 8.
Only a two meg file. Then just watch your connections, total by bytes received, then divide by 8. If the result is greater than say 1 kb/sec sustained, then
set the appropriate bit to true. Allow the bitmap to be zeroed if you move or whatever.
After getting the list of peers, prioritize connection attempts towards those
that have a useful sustainable rate. Nothing worse than seeing 80% of my
connections saying connected 30 minutes, 100 KB transferred. Sigh.
While in china, I had a 2 mb connection. But too many Chinese hammering it, so
I could sustain, 2 mbit up, and 1 mbit down. Asymmetric the wrong way..
Seems blindingly obvious to me, yet I still see no clients with this feature.
Re:Stop It (Score:5, Insightful)
Prioritize by network topology is a better way to put it, that just happens to coincide with physical AND political geography in many cases. In the case where you can get 10Mb over a 10-hop connection, or 8Mb over a 3-hop connection, which do you pick? If you pick the latter, there is a good chance that two other users can utilize the other 70% of that 10-hop connection, making total throughput (theoretically) 24Mb.
Parent
Re: (Score:3, Interesting)
Re: (Score:2, Flamebait)
Oh, you meant prioritize by politics, not geography.
No. You can try reading the summary, asshole. Here, I'll repost it here in case you were too lazy to read it above:
"While I live in S.Korea and have virtually unlimited bandwidth [wired.com] in and out of the country, not all my Asian friends are so lucky. Many of the SE Asian and African countries have small international pipes [nationmaster.com]. Even when a user has a high-speed local connection, downloads from abroad will trickle in.
Bittorrent clients apparently don't prioritize other users on the same ISP or at least in the same country. Why is that? Is it difficult to manage? If I were to write a plug-in for, say, Deluge [deluge-torrent.org], what hurdles would I be likely to come across? If this functionality is available in other clients or through plug-ins, please chime in."
Re: (Score:2)
Re: (Score:2, Interesting)
No. Prioritize by ASN. A smart tracker would get a BGP feed and then hook users together based on locality of network connectivity.
Any other approach is "wrong."
Re:You Asians Have Big Pipelines (Score:5, Funny)
Parent