Archived

This topic is now archived and is closed to further replies.

zxcvbnm6000

Question About Canonical Peer Priority

Recommended Posts

So I have a question about the new Canonical Peer Priority feature. I will not pretend I know how all of this works, so I apologize if this doesn’t make any sense. From what I have read, this feature is designed to help the overall swarm health by connecting the regional peers first instead of global peers. Kind of like mini pocket swarms. I can see how this is an added strength, but I can see this working against it too. By creating more regionalized swarms, it would seem that people who wish to disrupt P2P traffic now have a much better way to do it. All they need is a few local clients to poison the entire swarm, instead of just messing with a few peers. So for example, a government and/or anti-P2P groups could completely shut off an entire nation just by overpowering local connections. Also, I know torrents are far from anonymous, but it would seem that this also work in the favor of groups hoping to track down individuals. Instead of hoping to connect to people in their enforcement region, they can now simply setup a client there and collect all the information they need. I did read the more detailed article discussing attacks, but I don’t see how this prevents it. So the question is, how does this protect the peers and not just the overall swarm health?

Share this post


Link to post
Share on other sites

Here's a previous post of mine about the peer priority concept:

Incorrect. The actual priority in canocial peer priority is, for all intents and purposes, random. There's no preference for IP addresses more similar to your own. There's no preference for IP addresses closer to you or located in your own country.

It may not seem intuitive, but the actual priority matters little. The key is that all clients agree on the same priority. Paraphrasing from [1], the problem with "classical" BitTorrent is that a client will only accept the first 50 peers[2] that connect to it, and after that will not accept new incoming connections. Now, If a new peer joins the swarm, it won't be able to connect to the old swarm members that have all 50 slots used up. With a canonical peer priority, the 50 slots are allocated to peers with the highest priority, rather than first-come-first-served. Each pair of IPs is assigned an agreed upon, but essentially random, priority.[3] The newcomer will, by chance, have a high priority for some of the existing swarm members, so these existing swarm members will kick a lower-priority peer off one of their 50 slots to allow the newcomer to connect.

[1] Article explaining the concept: http://blog.libtorrent.org/2012/12/swarm-connectivity/

[2] In uTorrent this value is set by "Maximum number of connected peers per torrent".

[3] Formal specification BEP40: http://www.bittorrent.org/beps/bep_0040.html

tl;dr: Canonical peer priorities are random but agreed upon.

To directly address your concerns: Canonical peer priority does not lead to a segmented swarm, regional mini-swarms, or anything of that kind.

The article [1] actually has some statistics that show the exact opposite: With the classical BitTorrent first-come-first-served slot allocation, loosely connected islands are formed based on swarm-join time. Two peers that join the swarm at similar times are more likely to establish a connection than two peers that join at different times. But if we decide whether two peers should talk to each other not based on swarm-join time, but based on some random canonical priority, the clients "mingle" more, leading to one large swarm rather than many "mini-swarms".

That is exactly what is meant by the "improved connectivity" that the canonical peer priority should bring. Another nice effect is a decreased swarm join time, because "low-priority" existing peers are kicked off to allow "high-priority" new-comers to join the swarm.

Share this post


Link to post
Share on other sites