Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation awareness, ISP network awareness etc. #675

Closed
Wasser-Eis opened this issue Mar 14, 2016 · 7 comments
Closed

Geolocation awareness, ISP network awareness etc. #675

Wasser-Eis opened this issue Mar 14, 2016 · 7 comments

Comments

@Wasser-Eis
Copy link

@Wasser-Eis Wasser-Eis commented Mar 14, 2016

Does WebTorrent uses geolocation awareness?
Does WebTorrent uses ISP network awareness?
Also peers which are in the same LAN get preferably matched together, right?

And more general:
What are the criteria which peer streams to which peer?

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Mar 14, 2016

Here is the code that discover and add peers inside webtorrent https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L297

It is based on this lib https://github.com/feross/torrent-discovery/blob/master/index.js#L151 which just re-emit the 'peer' event.

In the browser the websocket tracker client is used https://github.com/feross/bittorrent-tracker/blob/master/lib/client/websocket-tracker.js#L198 which just emit the 'peer' event whenever a new peer is available.

So the conclusion to your question is : no webtorrent just add any peers it can find.

I believe the algorithm to maximize the transfer speed is based on dropping connection to peers that don't send pieces fast enough.
It seems that this is good enough to avoid having to figure out the geolocation/ISP network/LAN of peers.

I think this is a good thing. Having to try to guess the causes for the connection speed with each speed could be very hard.

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Mar 14, 2016

Also see https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L990 and generally the term "choke", that's what happens when a peer doesn't send data fast enough.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Mar 16, 2016

@rom1504's explanation is correct.

There's no fancy logic that uses geolocation or ISP information to determine who to connect to. It's really hard to predict what will be fast. It's best to just connect to everyone and see if it's actually fast. This is what all BitTorrent clients do as well.

Also peers which are in the same LAN get preferably matched together, right?

For WebRTC peers, the local LAN IP address will be preferred over the public IP address, so that peers on the same LAN will take the optimal path. That's what WebRTC does by default. For normal BitTorrent peers, there's no difference for LAN peers (again, see the first explanation above).

@feross feross closed this Mar 16, 2016
@Wasser-Eis

This comment has been minimized.

Copy link
Author

@Wasser-Eis Wasser-Eis commented Mar 18, 2016

“If Netflix uses WebTorrent, customers would see higher video quality during peak hours. WebTorrent would allow customers with the same ISP to share video pieces with each other without leaving the ISP’s network,” Feross says.
Source: https://torrentfreak.com/webtorrent-brings-bittorrent-to-the-web-impresses-netflix-151213/

@jtremback

This comment has been minimized.

Copy link

@jtremback jtremback commented Mar 18, 2016

I think the fact is that light goes so fast, that geographical areas or isp boundaries are not always the most important thing.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Mar 18, 2016

WebTorrent would allow customers with the same ISP to share video pieces with each other without leaving the ISP’s network

This quote was in the context of the Netflix-Comcast spat where Comcast was throttling the speed of traffic at the Netflix-Comcast interchange. So, by using a torrent with a HTTP web seed hosted by Netflix, they can work around this issue because connections between Comcast users would be faster than between a Comcast user and the Netflix HTTP endpoint.

I think the fact is that light goes so fast, that geographical areas or isp boundaries are not always the most important thing.

Right. There's just too many possible factors that could affect speed that it's better to just connect and see what speed you get.

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.