Giter Club home page Giter Club logo

alakazaam's Introduction

AlaKazaam:

📚 Reti Peer To Peer - Università degli Studi di Ferrara 📚

A peer-to-peer server based on Kazaa's approach:

Smart Query flooding

Hierarchic

  • Super-nodes managing their peers
  • On startup, the client contacts a super-node (and may later become one)
  • Publish: client sends list of files to its super-node
  • Search: send query to super-node, and the super- nodes flood queries among themselves
  • Fetch: get file directly from peer(s); can fetch from multiple peers at once

Functioning

  • Each peer is either a group leader or assigned to a group leader
  • Group leader tracks the content in all its children

Motivation for super-nodes

  • Query consolidation ** Many connected nodes may have only a few files ** Propagating query to a sub-node may take more time than for the super-node to answer itself
  • Stability ** Super-node selection favors nodes with high up-time ** How long you’ve been on is a good predictor of how long you’ll be around in the future

Usage

python3 AlaKazaam.py

Note: Python 3.6 or above is required

Peer's supported commands:

[xxxB] = the parameter length in bytes

# Search a Supernode
SUPE[4B].Pktid[16B].IPP2P[55B].PP2P[5B].TTL[2B]
# Response will be
ASUP[4B].Pktid[16B].IPP2P[55B].PP2P[5B]

# Login
LOGI[4B].IPP2P[55B].PP2P[5B]
# Response will be
ALGI[4B].SessionID[16B]

# Add a file
ADFF[4B].SessionID[16B].Filemd5[32B].Filename[100B]
# No response from the server

# Remove a file
DEFF[4B].SessionID[16B].Filemd5[32B]
# No response from the server

# Logout
LOGO[4B].SessionID[16B]
# Response will be
ALGO[4B].\#delete[3B]

# Search a file
QUER[4B].Pktid[16B].IPP2P[55B].PP2P[5B].TTL[2B].Ricerca[20B]
# Response will be
AQUE[4B].Pktid[16B].IPP2P[55B].PP2P[5B].Filemd5[32B].Filename[100B]

# Choose a file among the supernodes
FIND[4B].SessionID[16B].Ricerca[20B]
# Response will be
AFIN[4B].\#idmd5[3B].{Filemd5_i[32B].Filename_i[100B].\#copy_i[3B].{IPP2P_i_j[55B].PP2P_i_j[5B]}(j=1..\#copy_i)}(i=1..\#idmd5)

# Retrieve a file
RETR[4B].Filemd5[16B]
# Response will be
ARET[4B].\#chunk[6B].{Lenchunk_i[5B].data[LB]}(i=1..\#chunk)

Authors 🚀

Enjoy 😎

alakazaam's People

Contributors

fiav1 avatar giovannifiorini avatar nicfontana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

marcorambaldi

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.