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

Rate-limit joining the P2P network #3

Open
kim opened this issue Aug 8, 2018 · 2 comments
Open

Rate-limit joining the P2P network #3

kim opened this issue Aug 8, 2018 · 2 comments
Assignees

Comments

@kim
Copy link
Collaborator

kim commented Aug 8, 2018

With better understanding of the HyParView protocol, there seems to be a relatively easy way to impede eclipse attacks: rate-limiting how many connections (resp. Joins) are accepted per time unit. To see why, we need to consider two operations of the protocol:

  1. Join
    A node wishing to join the network establishes a connection to one or more nodes already part of the network, and sends them a Join request. Crucially, if the connection was accepted in the first place, this request always succeeds, even if another node has to be ejected in favour of the new one.
  2. Shuffle
    In order to learn about new peers in the network, nodes propagate (a subset of) their own peer information in the network using a random walk. In exchange, they receive a new set of peers, some of which they may not currently have in their partial views. This operation is triggered periodically at a fixed interval on every node.

It is easy to see that a node can easily be eclipsed by Joining it faster than it Shuffles, where the number of required distinct node-ids/network addresses is a relatively small number corresponding to the size of the partial view of the victim node. However, the inverse also holds: if a fully-connected node accepts new connections at a rate strictly smaller than shuffle interval / size of active view, it is guaranteed that a Shuffle occurs before older nodes get ejected.

The question is whether this should be baked into the protocol (allowing faster joins when the node is not fully connected, and slowing down once it is), or handled at the IO layer (with a fixed rate limit).

@kim kim self-assigned this Aug 8, 2018
@tsenart
Copy link

tsenart commented Oct 4, 2018

@kim: How do you intend to use the token bucket rate limiter across the network? Are we going to Gossip bucket state across nodes, or will token bucket state be per-node?

@kim
Copy link
Collaborator Author

kim commented Oct 4, 2018

@tsenart per-node. As I tried to convey above, it is only necessary that a node Shuffles more frequently than it accepts new connections (resp. Joins).

@kim kim transferred this issue from oscoin/oscoin Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants