Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Improvement: Send keep alive to peers #44

Closed
ngosang opened this issue Apr 18, 2017 · 6 comments
Closed

Improvement: Send keep alive to peers #44

ngosang opened this issue Apr 18, 2017 · 6 comments

Comments

@ngosang
Copy link
Contributor

ngosang commented Apr 18, 2017

Now you are processing only some kinds of responses:
https://github.com/ngosang/magnetico/blob/89a226973bed86237c00648bcaee03cfebadd2ec/magneticod/magneticod/dht.py#L85
if you add:

            else:
                print("other => ", message.get(b"q"))

you will see a ton of "find_node" and "ping" responses.

I'm not sure but I think we should respond (at least to ping) to avoid that the peer think we are offline and stop sending us "get_peers" and "announce_peer" messages.

@boramalper
Copy link
Owner

boramalper commented Apr 30, 2017

I thought about it, but the problem is, when we maintain a fake / deceitful identity in the network for a prolonged period, I am afraid that we might hurt the network. Right now, as you remarked, we do not respond to the ping and any other responses except the ones that are crucial for the info hash trawling (find_peer and announce_peer), so after a certain period of time (15 minutes) or even before, we fade away from the memory and the routing table of the peers we visited. That way, our effect in the network will hopefully be minimized and won't turn into a Sybil attack.

An expert's opinion on this would be great actually. I'll ask Arvid Norberg's (the developer of libtorrent) opinion on the matter.

@itdaniher
Copy link

Mana responds to pings - I don't know if it's best practices (keen to hear what Norberg says) but I'm quite happy with how it's performing.

@mweinelt
Copy link
Contributor

mweinelt commented Sep 8, 2017

Any news on this topic?

@boramalper
Copy link
Owner

@mweinelt Arvid Norberg didn't reply (and I don't think he is ever going to reply) but I still think sending keep-alives to peers might harm the network (as I explained above). What do you think?

@mweinelt
Copy link
Contributor

mweinelt commented Sep 8, 2017

We'd probably stay as good peers in their routing tables about forever without adding any value to them. Not sure how fast we have exhausted a peers value, but I guess fast.

I don't have a full overview of all the mechanics at play, so my opinion may be of little value.

@boramalper
Copy link
Owner

We'd probably stay as good peers in their routing tables about forever without adding any value to them.

Exactly, and that's the problem. =)

I'm closing the issue as it'll not be implemented, but feel free to discuss further if you (or anybody) think(s) otherwise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants