GithubHelp home page GithubHelp logo

geektoni / whanau-sybil-proof-dht Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 21.38 MB

Implementation of Whanau, a Sybil-proof Distributed Hash Table, using Peersim.

Java 12.19% Python 1.75% TeX 86.06%
distributed-systems distributed-hash-table java peersim whanau

whanau-sybil-proof-dht's Introduction

WhanauProtocol: A Sybil-proof Distribued Hash Table implemented in Peersim

Brief Overview

Whanau is a novel routing protocol for distributed hash tables (DHTs) that is efficient and robust against
Sybil attacks. We replicated the original paper [1] providing one of the first open-source Java-based implementations of the protocol. We performed several experiments in order to assess the real efficiency of the protocol on large-scale systems by using the Peersim framework. We tested its resilience under the presence of clustering attacks.

A report which summarize Whanau's procedure and the results can be found here.

[1] Lesniewski-Laas, Christopher, and M. Frans Kaashoek. "Whanau: A sybil-proof distributed hash table." (2010).

Installation

The project requires Java 1.8 and Maven and it was tested on Ubuntu 16.04 and 18.04, but it should work also on other Unix based machines (MacOS or other Linux distribution). No testing on Windows was performed.

In order to build the project you need to follow these steps:

git clone https://github.com/geektoni/whanau-sybil-proof-DHT
mvn initialize
mvn compile

If you encounter any problems feel free to open an issue on Github.

Usage

The protocol can be tested by using the following commands:

cd whanau-sybil-proof-DHT
mvn exec:java -Dexec.mainClass="peersim.Simulator" -Dexec.args="whanau.cfg"

It will run the Peersim's simulation using the whanau.cfg file to set up its internal configurations. The directory configurations contains several configuration files which can be used to test the protocol on different network conditions (varying the percentage of attack edges, the number of layers, the table sizes, etc.).

In order to run whanau with custom configuration, you need to run the following:

mvn exec:java -Dexec.mainClass="peersim.Simulator" -Dexec.args="configurations/<filename>.cfg"

Preset configurations

There are 5 configuration files ready to run:

  1. 10e4_nodes_1_layer_20perc_attack_edges.cfg
  2. 10e4_nodes_3_layer_20perc_attack_edges.cfg
  3. 10e4_nodes_10e3_fingers_and_succs_25perc_attack_edges_3_layers.cfg
  4. 10e4_nodes_no_attack.cfg
  5. dblp-dataset_15perc_attack_edges_5_layers.cfg

Running (1) and (2) highlights the difference that layers make in Whanau: percentage of success should pass from ~73% to ~96%. These networks have both: 10000 nodes, 100 fingers and successors per layer.

(3) shows that in the presence of a strong attack, having much more fingers and successors per layer (1000 instead of the standard 100) doesn't make much difference when dealing with Sybil entities.

(4) is just a vanilla network that embodies the ideal situation of no attacks

(5) loads a real social network (DBLP) instead of a surrogate one and tests the performances of the protocol with 5 layers and 15% of attack edges

NOTES: If the network should be loaded from a file make sure that:

  • the network.size parameter matches the number of nodes in the network file
  • the init.buildnetwork.social_network path/to/file.txt param is set (path relative to where the mvn exec command has been invoked)
  • the network has the following structure:
    • first line : <number_of_nodes> <blank> <number_of_edges>
    • following lines : <id_node_1> <blank> <id_node_2>
  • the network will be interpreted always as an undirected graph
  • the ids should be in the range [0,n-1] where n is the number of nodes

There is an utility script social-graphs/parse-network-file.py that takes as input (as argument, i.e. python social-graphs/parse-network-file.py path/to/file.txt) a file in the same format as described in the notes above, and transformes it in a valid input file (producing the *-parsed.txt) remapping the id of the nodes in the contiguous space that is requested. In other words, an export of the edges of a network with arbitrary integer ids can be easily adapted to the wanted format with this script

Contributors

Giovanni De Toni: [email protected]

Andrea Zampieri: [email protected]

whanau-sybil-proof-dht's People

Contributors

andreazampieri avatar geektoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

whanau-sybil-proof-dht's Issues

Fix the usage of LookupResult

Now there's only one integer accumulating the number of tries and the number of messages sent around. Doesn't it make sense to insert a new counter?
NOTE: the writer on file needs the counter of tries to be 'clean' in order to work properly

Should I fix it?

Issue with show_keys.py

@andreazampieri When I try to run it using python3 I get this message:

Traceback (most recent call last):
  File "show_keys.py", line 52, in <module>
    mng.window.showMaximized()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1952, in __getattr__
    return getattr(self.tk, attr)
AttributeError: '_tkinter.tkapp' object has no attribute 'showMaximized'

Apparently, it seems to be a problem related to the backend used to show the plot. See this answer
on Stackoverflow for a solution. https://stackoverflow.com/questions/12439588/how-to-maximize-a-plt-show-window-using-python/22418354#22418354

Should sybil nodes forward query messages?

I think that sybil nodes should just make the query fail, simulating a 'missing_key' error in the query.
As written in the paper (end of paragraph 5.1)

Then, honest nodes might have to send many useless query messages to Sybil nodes before eventually querying an honest node

To implement this we should tweak the function randomWalk() in order to stop the walk when a sybil node is encountered. Right now, sybil nodes just don't reply if they are asked for the value, but I think is a behaviour too gentle and not realistic

Check efficacy of cluster attack

Implement an Observer that extracts the distribution of the keys in the different layers, in order to assert whether the current implementation of the clustering attack is actually effective and realistic.

List of experiments which needs to be done

This is the list of experiments which needs to be done in order to evaluate the algorithm:

Number of Lookup messages used decreases as table size increase (we assume to use just 3 layers)
(Table size, number of nodes, percentage attack edges)

  • (10, 10000, 0.01)
  • (50, 10000, 0.01)
  • (100, 10000, 0.01)
  • (500, 10000, 0.01)
  • (1000, 10000, 0.01)
  • (2000, 10000, 0.01)
  • (10, 10000, 0.1)
  • (50, 10000, 0.1)
  • (100, 10000, 0.1)
  • (500, 10000, 0.1)
  • (1000, 10000, 0.1)
  • (2000, 10000, 0.1)
  • (10, 10000, 0.15)
  • (50, 10000, 0.15)
  • (100, 10000, 0.15)
  • (500, 10000, 0.15)
  • (1000, 10000, 0.15)
  • (2000, 10000, 0.15)

Number of lookup message used varying the percentage of attack edges (we assume to just use 3 layers and to fix the tables size to the optimal value for the network)
(Percentage of attack edges, table size, network size)

  • 0.0, 100, 10000
  • 0.01, 100, 10000
  • 0.1, 100, 10000
  • 0.15, 100, 10000
  • 0.20, 100, 10000
  • 0.25, 100, 10000
  • 0.0, 320, 100000
  • 0.01, 320, 100000
  • 0.10, 320, 100000
  • 0.15, 320, 100000
  • 0.20, 320, 100000
  • 0.25, 320, 100000

Number of lookup message is constant if there is no attack (the number of layers is fixed to 3)
(Network size, table size)

  • 5000, 70
  • 10000, 100
  • 100000, 320
  • 200000, 447

Number of layer improves quality
(attack edges, table size, network size, layer size)

  • 0.0, 100, 10000, 1
  • 0.1, 100, 10000, 1
  • 0.15, 100, 10000, 1
  • 0.20, 100, 10000, 1
  • 0.25, 100, 10000, 1
  • 0.0, 100, 10000, 5
  • 0.1, 100, 10000, 5
  • 0.15, 100, 10000, 5
  • 0.20, 100, 10000, 5
  • 0.25, 100, 10000, 5
  • 0.0, 100, 10000, 7
  • 0.1, 100, 10000, 7
  • 0.15, 100, 10000, 7
  • 0.20, 100, 10000, 7
  • 0.25, 100, 10000, 7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.