daviddias / webrtc-explorer

:earth_africa: P2P Network Routing Overlay designed for the Web platform (browsers)
MIT License
288 stars 32 forks source link

Problem with the calculation of the finger table #6

Closed areiter closed 9 years ago

areiter commented 9 years ago

I think there is a problem with the calculation of the finger table. If creating less than explorer.min-peers nodes, everything works as expected and the finger table only contains the first finger, linking to its successor.

Increasing the nodes yields a problem. Take a look at the following finger tables: https://gist.github.com/areiter/3818428f92d99a9e3d6b

It seems like, the calculation of the IDs of the fingers is only based on the local peer ID, and does not take the IDs of other peers into account. This works fine as long as the IDs start at zero and are increased by one for each peer. In the case of a hash value, with a few nodes in the large ID space, the fingers should consider the IDs of the other nodes: successor(successor(...n)) and so on.

Any ideas on that? Thanks