Giter Site home page Giter Site logo

p2p-gossip-protocol's Introduction

p2p-gossip-protocol

Implementation of a Gossip protocol for p2p communication in Java. Below a simple diagram of classes.

Basically each Peer implements a Listener and a Gossiper. The Listener receives UDP messages from other peers and passes them to the Message Controller that validates and store in a singleton class accessed through the PeerDAO. Old records saved are cleaned from time to time via a class called Garbage Collector. The peer itself reads a given file system (directory) via FileSystemReader and stores itself in the same DAO. The Gossiper chooses a random known peer from time to time to retransmit a record saved. P2P Gossip Protol UML diagram of classes

How to start a Peer?

Feel free to use the already implemented .jar file. Start each Peer using the following command line: java -jar "/Peer/dist/Peer.jar" <IP> <PORT> <PEER_NAME> <FOLDER_TO_SCAN> <FILE SYSTEM SCAN REFRESH TIME> <SELF GOSSIP TIME> <RELAY GOSSIP TIME> <CACHE TIME OF MESSAGES> Description of args:

  • IP, Port and Peer Name: IP, Port and Peer Name of this Peer
  • Folder to Scan and File System Scan Refresh Time: A directory that will be scanned every to propagate to other peers the files this peer has
  • Self gossip time: Interval between transmissions of this peer files to another random peer
  • Relay gossip time: Interval between transmissions of another peer files received by this peer to a third random peer
  • Cache time of messages: Every peer communicates its files to some peers randomly. This cache times deletes the old messages so the Peer keeps relaying only recent information, preventing the propagation of data about dead peers

Question?

Open an issue.

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.