-
Notifications
You must be signed in to change notification settings - Fork 1
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
Communication options #1
Comments
One question missing from all of this is: Why? Specifically, why is hiding supernode IPs particularly advantageous? When hot wallets on the supernode were part of the design, the incentive for attack was obvious, but now that that has been eliminated, even if someone knows the IP of a supernode, there is little gain to be had from attacking it. Without such secrecy, a much simpler alternative is: Option 5Upon starting a supernode sends an announcement to the network containing (among other things) the IP and port on which it is reachable. Ordinary nodes synchronize this list with each other. Supernodes communicate directly. |
To reduce probability of a DOS attack on an RTA auth sample |
As I understand it, the auth sample is determined on the fly as needed and selected randomly based on a generated random value which can't be predicted; the timespan from when the auth sample is generated to when it is complete is measured in milliseconds. |
Regarding Option 2: the only way to guarantee that the message from A to B actually reaches B is to make the hop limit equal to the diameter of the network graph. To reuse your example from Option 2, here's the same graph but with some different edges: You could increase it to a maximum of three, but then I could draw another counterexample where 3 doesn't work, and so on. I could draw a connected network in your 15 node example where it requires 12 hops to reach any of the DRs (where I include B as a DR). It seems that, since you have no guarantee at all of how connections are established, the only provably guaranteed value of T that will reach B is a value so is so absurdly large that it will reach every node on the network in the vast majority of cases. |
An auth sample is selected from the list based on the block hash. So, DOS attack on that list can be an issue. Adding disqualification transactions makes such attack even more profitable (you can trigger disqualification of another's supernodes.) |
There are two very relevant parameters here: hop limit and size of randomly selected subset of supernodes. We believe we can find an optimal combination of those. Also, I don't think it makes sense to talk about any guarantees, we rather talk about maximizing probabilities. |
Communication options
Current state and motivation
Original P2P network is used for communication between supernodes. Announcements (messages of a special type) are periodically broadcast by every peer and are used for both keeping lists of active peers and building paths (tunnels) between the peers. Such approach induces a high value traffic in the network.
Yet another, less critical, issue is present in the current approach. Even though peers in the original P2P network have discoverable IPs, the complexity of IP discovery is exponential with respect to the number of peers in the network. However, any attempt to build a preferable path between 2 peers makes this complexity linear.
Those issues were raised by @jagerman (see #187). The following document lists several approaches we considering, addressing the concerns.
When we first started working on issue, we were mainly focused on Option 1 since it would allow us to reduce the amount of traffic without making significant changes to current design. Options 3 and 4 were also under consideration. At the same time we started work on disqualification transactions design -- this mechanism means to be used in any case. Later, however, digging into Options 3 and 4 brought us to Option 2, which we believe is the most optimal solution taking into account all practical considerations.
Publishing this document we would like to hear reaction of the community before making the final decision.
Since there are still a few open issues, the estimates provided below are preliminary and may be changed if development scope needs to be extended.
Optimization Options
P2P broadcast optimization
We can reduce the amount of traffic (both keep-alive and data messages) during P2P broadcasts by
Reducing frequency of announcements, we, however, make both peer monitoring and building tunnels less robust.
Disqualification transactions
Disqualification transaction is a special type of timed transactions in the blockchain, used to prevent a disqualified supernode from being selected to participate in an authorization sample. There are two mechanisms to issue a disqualification transaction:
Both mechanisms can be used either in conjunction or on their own.
Development Paths
Option 1: Keep current design and enhance it
Announcement optimization using Blockchain-based List
Tunnel selection
Currently, to build tunnels, graftnode selects only first three tunnels from announcement list for this supernode. However, at that moment, the list of peer connection can be different from the list which was at the moment of the receiving announce. In the case of increasing time delay between announcements, this situation becomes even more important. To optimize this, graftnode must select only tunnels which have active connections.
Pros
Cons
Open issues
Estimate
~2 weeks (testing included)
Option 2: Implement Unstructured Distributed Hash Table (DHT)
On the figure above node A sends a message, addressed to node B. Nodes R retransmit the message issued by A. Nodes T terminate the broadcast, assuming 2 hops are allowed. DR nodes know IP of node B.
Pros
Cons
Open issues
Estimate
~ 2.5-3.5 weeks (testing included)
Option 3: Supernode overlay/direct connections
We build a network overlay of supernodes, independent from P2P network. The overlay (or its subset) forms a DHT-like cluster. The DHT cluster can consists of full supernodes only. The DHT stores key-values pairs of supernode public identification keys and IPs. Both requests to join and queries are to be signed by private identification key and validated, upon entering DHT, against public identification key, retrieved from the blockchain. Peers in the supernode overlay communicate directly.
The disqualification transaction mechanism is used in this case as well.
On the figure above supernode A, attempting to sends a message to supernode B, queries DHT first.
Pros
Cons
Open issues
Estimate
~3.5 weeks (testing included)
Option 4: Supernode overlay/Hop over DHT
Again a network overlay of supernodes, independent from P2P network. The overlay forms a DHT-like cluster, where each node knows only small subset of the whole cluster. The DHT stores key-values pairs of supernode public identification keys and IPs. Unlike regular DHT that provides values in response to key-based queries, a sending peer passes a message itself to the DHT cluster. In case a cluster peer knows IP of the message's addressee, it forwards the message to the latter. Otherwise, the peer forwards the message to a known successor, according to the DHT algorithm.
Both requests to join and messages are to be signed by private identification key and validated, upon entering DHT, against public identification key, retrieved from the blockchain.
The DHT cluster can consist of full supernodes only. The number of hops, required for message delivery, does not exceed the number of successors.
On the figure above supernode A sends a message to supernode B, passing it through DHT nodes.
Pros
Cons
Open issues
Estimate
~4.5 weeks (testing included)
The text was updated successfully, but these errors were encountered: