All Projects → justas- → PyPPSPP

justas- / PyPPSPP

Licence: LGPL-3.0 license
Python implementation of Peer-to-Peer Streaming Peer Protocol (PPSPP) [RFC7574]

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PyPPSPP

Netsix
Netsix allows you to share videos with your friends in a real peer-to-peer manner using WebRTC.
Stars: ✭ 113 (+527.78%)
Mutual labels:  peer-to-peer, sharing
limus
🎨 Make your screenshot/image more professional by rotating, adding shadow and more.
Stars: ✭ 101 (+461.11%)
Mutual labels:  sharing
p2p-project
A peer-to-peer networking framework to work across languages
Stars: ✭ 68 (+277.78%)
Mutual labels:  peer-to-peer
Shareaza
Shareaza is a peer-to-peer client for Windows that allows you to download any file-type found on several popular P2P networks.
Stars: ✭ 103 (+472.22%)
Mutual labels:  peer-to-peer
mirotalk
🚀 WebRTC - P2P - Simple, Secure, Fast Real-Time Video Conferences Up to 4k and 60fps, compatible with all browsers and platforms.
Stars: ✭ 1,593 (+8750%)
Mutual labels:  sharing
space-client-workshop
Workshop and Example to showcase how to build a desktop application on top of the Space Daemon and Client. From installation to building a full fledged private and peer to peer application
Stars: ✭ 31 (+72.22%)
Mutual labels:  peer-to-peer
orbit-db-cli
CLI for orbit-db
Stars: ✭ 60 (+233.33%)
Mutual labels:  peer-to-peer
addon-zerotier
ZeroTier One - Home Assistant Community Add-ons
Stars: ✭ 103 (+472.22%)
Mutual labels:  peer-to-peer
next-share
Social media share buttons for your next React apps.
Stars: ✭ 145 (+705.56%)
Mutual labels:  sharing
gravity
User-space deniable data encryption client.
Stars: ✭ 89 (+394.44%)
Mutual labels:  peer-to-peer
joatu-v2
The JoatU application, version 2. Written in Ruby on Rails.
Stars: ✭ 27 (+50%)
Mutual labels:  sharing
exocore
A distributed private application framework
Stars: ✭ 50 (+177.78%)
Mutual labels:  peer-to-peer
sprawl
Alpha implementation of the Sprawl distributed marketplace protocol.
Stars: ✭ 27 (+50%)
Mutual labels:  peer-to-peer
conceal-desktop
Conceal Desktop (GUI)
Stars: ✭ 65 (+261.11%)
Mutual labels:  peer-to-peer
WindFarm
Information the Wind concept, spec and upcoming events
Stars: ✭ 23 (+27.78%)
Mutual labels:  peer-to-peer
dctk
Direct Connect client library (ADC and NMDC) for the Go programming language
Stars: ✭ 15 (-16.67%)
Mutual labels:  peer-to-peer
dispersy
The elastic database system. A database designed for P2P-like scenarios, where potentially millions of computers send database updates around.
Stars: ✭ 81 (+350%)
Mutual labels:  peer-to-peer
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (+372.22%)
Mutual labels:  sharing
TrackCOVID
An open source project which provides privacy-preserving contact tracing for communities using QR codes
Stars: ✭ 23 (+27.78%)
Mutual labels:  peer-to-peer
go-peer
Library for create secure and anonymity decentralized networks.
Stars: ✭ 74 (+311.11%)
Mutual labels:  peer-to-peer

A native python client of Peer-to-Peer Streaming Peer Protocol (PPSPP) [RFC7574]

This repository contains a native Python3 client of Peer-to-Peer Streaming Peer Protocol and a bare-bones tracker server used to bootstrap the clients. At the moment, the client implements most of PPSPP standard and should be able to interoperate with Libswift, the reference implementation of PPSPP protocol.

The goal is to keep the client in a stable condition in the main branch. Development (if any) is happening in unstable or feature branches.

Usage

This PPSPP client can be used for files transfer or for multimedia streaming. The mode of client operation is determined based on the command-line parameters described below. Methods how to obtain a Merkle Tree Hash (Swarm ID) and how to run tracker server are explained in the following sections.

Sharing and downloading regular files:

python3 PyPPSPP.py
    # Required parameters
    --tracker <IP Address>          # IP Address of a tracker server
    --filename <Path>               # A path to a file that will be shared / downloaded
    --swarmid <Swarm ID string>     # An ID identifying clients swarm (Merkle Tree Root hash of a shared file)
    --filesize <Size in Bytes>      # Size of a shared file in bytes
    
    # Optional parameters
    --numpeers <Int>                # Limit a number of concurrent peers the client will connect to
    --identifier <String>           # Free text identifier added to the log/results file
    --tcp                           # Use TCP for connections between the peers (highly recommended for now)
    --workdir <Path>                # Change a current directory to the one indicated

A role of a client (seeder/leecher) will be determined based on a given file and a swarm ID. If the file is not empty and its Merkle Tree Root hash matches the given Swarm ID - the client will act as a seeder sharing the file. Otherwise (if a file is not found, or Merkle hash does not match the swarm ID) the file will be overwritten with an empty file and the client will start acting as a leecher.

Downloading Video-on-Demand file:

In the VoD use-case, the seeder is started as if it was sharing a regular file. The client is configured using the following command line parameters:

python3 PyPPSPP.py
    # Required parameters
    --tracker <IP Address>          # IP Address of a tracker server
    --swarmid <Swarm ID string>     # An ID identifying clients swarm (Merkle Tree Root hash of a shared file)
    --vod                           # This is VoD client
    
    # Optional parameters
    --skip <Int>                    # If a playback buffer is depleted, try jumping <Int> number of chunks forward. This allows the client to continue rendering a video stream if several missing chunks are blocking the rendering process
    --buffsz <Int>                  # The size of the download buffer in streaming content consumer
    --dlfwd <Int>                   # Try to download this many chunks ahead of the last chunk that was used to render a frame

Streaming and downloading a Live stream

Switching a client to the Live streaming mode is done by adding two additional command line parameters. See ContentGenerator.py file to see how the live content is produced.

N.B. Swarm ID has no meaning in a Live use-case. The only requirement is for all clients to use the same Swarm ID string.

python3 PyPPSPP.py
    # Use the same required parameters from the VoD use-case
    --live                          # This is a live streaming client
    --livesrc                       # This is a live streaming source

Obtaining a Swarm ID / Merkle Tree Root hash

A FileUtil.py tool can be used to generate files with a given size having random content, and to generate Merkle Tree Root hash of a given (or generated) file. The usage is as follows:

python3 FileUtil.py
    --filename <Path>   # Filename that will be generated or used for hash calculation
    --create            # Create a file
    --size <Int>        # Size of a created file (in Bytes)
    --hash              # Calculate and print a hash of a given (or generated) file

Running a Tracker Server

A tracker server is used to inform all new clients about other clients in the swarm. Tracker server is run as follows:

python3 TrackerServer.py

The server takes no command line parameters and binds itself to all local interfaces.

Using Application-Layer Traffic Optimization (ALTO) to rank the peers

This PPSPP client can use ALTO server to rank the peers. A simple ALTO server can be found in my PyALTO project. In order to use ALTO, add the following optional command line parameters:

python3 PyPPSPP.py
    # Optional parameters enabling ALTO integration
    --alto                      # Use ALTO to rank the peers
    --altoserver <IP>           # IP Address of an ALTO server
    --altocosttype <String>     # Use the indicated ALTO cost-type

Other information

Any bugs, ideas, suggestions and pull-requests should be made via GitHub. The source of the client is (C) Technical University of Denmark. All code is released to the public under the LGPL-3.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].