Discussion:
[libtorrent] Share mode message between libtorrent
Ardhi Putra Pratama
2016-09-18 13:21:38 UTC
Permalink
Hello guys,

I noticed there are some exchanged message between libtorrent peer if
we enable "share mode" in a particular torrent.
https://github.com/arvidn/libtorrent/blob/master/src/bt_peer_connection.cpp#L1715.
I tried to look up some specification but cannot find any.

This procedure is called in send_share_mode, but the function is not
called by anyone :
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L913

So, what's going on here? What's the effect of this share mode message?

Kind regards,
ardhi

------------------------------------------------------------------------------
Arvid Norberg
2016-09-18 14:35:18 UTC
Permalink
You're right that it doesn't seem like torrent::send_share_mode() is called
anywhere. It's supposed to be called when a torrent enters share mode, and
each new peer is also supposed to be let know that we're in share mode.

The main purpose is to treat share mode peers differently, specifically
(off the top of my head):

* don't disconnect them, even if they're redundant
* count the pieces they have as more available than regular pieces (to
avoid overlap in pieces that share-mode peers seed).

There may be some other behavior that changes for seed mode peers too.

It looks like this has been broken for a while probably. If you're up for
it, a patch should probably go towards RC_1_1 (and ideally a simulation
that exercises this feature too).
Post by Ardhi Putra Pratama
Hello guys,
I noticed there are some exchanged message between libtorrent peer if
we enable "share mode" in a particular torrent.
https://github.com/arvidn/libtorrent/blob/master/src/bt_
peer_connection.cpp#L1715.
I tried to look up some specification but cannot find any.
This procedure is called in send_share_mode, but the function is not
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L913
So, what's going on here? What's the effect of this share mode message?
Kind regards,
ardhi
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
------------------------------------------------------------------------------
Ardhi Putra Pratama
2016-09-19 08:19:45 UTC
Permalink
Thanks for the quick reply, Arvid.

I agree that share_mode peers should be treated differently. That's
one of the reason I brought this up.

Just wanted to confirm, this is not in any standard bittorrent
specification, nor in documented extension. Am I right about this?

That being said, can we know whether a peer is using share mode? I saw
some of the attribute access in
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L9610.
However, it's not available in peer_info().
--
Ardhi Putra Pratama
@ardhipoetra

Delft University of Technology
Post by Arvid Norberg
You're right that it doesn't seem like torrent::send_share_mode() is called
anywhere. It's supposed to be called when a torrent enters share mode, and
each new peer is also supposed to be let know that we're in share mode.
The main purpose is to treat share mode peers differently, specifically
* don't disconnect them, even if they're redundant
* count the pieces they have as more available than regular pieces (to
avoid overlap in pieces that share-mode peers seed).
There may be some other behavior that changes for seed mode peers too.
It looks like this has been broken for a while probably. If you're up for
it, a patch should probably go towards RC_1_1 (and ideally a simulation
that exercises this feature too).
Post by Ardhi Putra Pratama
Hello guys,
I noticed there are some exchanged message between libtorrent peer if
we enable "share mode" in a particular torrent.
https://github.com/arvidn/libtorrent/blob/master/src/bt_
peer_connection.cpp#L1715.
I tried to look up some specification but cannot find any.
This procedure is called in send_share_mode, but the function is not
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L913
So, what's going on here? What's the effect of this share mode message?
Kind regards,
ardhi
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
------------------------------------------------------------------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
------------------------------------------------------------------------------
Arvid Norberg
2016-09-19 15:27:44 UTC
Permalink
I don't believe share mode is documented. This is something that people
have talked about for a while, and the specific rules in libtorrent are
heavily based on what Bram Cohen suggested many years ago. It's possible
all discussions about this has been in-person though, offline.

If you're up for it, please feel free to write a draft documenting it on
the bittorrent.org github page!

Also, as always, patches against libtorrent are welcome, if you're
interested in bringing this feature back to life (I suppose it should at
least be enabled, but not having dead functions lying around). Ideally
there should be some test coverage of it too though.
Post by Ardhi Putra Pratama
Thanks for the quick reply, Arvid.
I agree that share_mode peers should be treated differently. That's
one of the reason I brought this up.
Just wanted to confirm, this is not in any standard bittorrent
specification, nor in documented extension. Am I right about this?
That being said, can we know whether a peer is using share mode? I saw
some of the attribute access in
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L9610.
However, it's not available in peer_info().
--
Ardhi Putra Pratama
@ardhipoetra
Delft University of Technology
Post by Arvid Norberg
You're right that it doesn't seem like torrent::send_share_mode() is
called
Post by Arvid Norberg
anywhere. It's supposed to be called when a torrent enters share mode,
and
Post by Arvid Norberg
each new peer is also supposed to be let know that we're in share mode.
The main purpose is to treat share mode peers differently, specifically
* don't disconnect them, even if they're redundant
* count the pieces they have as more available than regular pieces (to
avoid overlap in pieces that share-mode peers seed).
There may be some other behavior that changes for seed mode peers too.
It looks like this has been broken for a while probably. If you're up for
it, a patch should probably go towards RC_1_1 (and ideally a simulation
that exercises this feature too).
On Sun, Sep 18, 2016 at 9:21 AM, Ardhi Putra Pratama <
Post by Ardhi Putra Pratama
Hello guys,
I noticed there are some exchanged message between libtorrent peer if
we enable "share mode" in a particular torrent.
https://github.com/arvidn/libtorrent/blob/master/src/bt_
peer_connection.cpp#L1715.
I tried to look up some specification but cannot find any.
This procedure is called in send_share_mode, but the function is not
https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L913
So, what's going on here? What's the effect of this share mode message?
Kind regards,
ardhi
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
------------------------------------------------------------
------------------
Post by Arvid Norberg
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
------------------------------------------------------------------------------
Loading...