Giter VIP home page Giter VIP logo

app-to-app-communicator's Introduction

Towards indestructable pure P2P apps

We envision a new Internet infrastructure built around people and their phones. This infrastructure should not rely on any server, require no infrastructure, and trust no entity except itself. The Tribler research group creates attack-resilient sharing software, including no-Internet-needed apps. We created a first pure P2P app - functional prototype only.

You can make a serverless pure P2P chat client or game by building upon this code.

App-to-app communicator

This app makes a global connected network consisting exclusively of smartphones. Not a single server is needed.

The Internet has shifted from PC to mobile, our App-to-app communicator creates a decentralized network of mobile apps that can keep themselves connected without central authority or server. This is made hard by NATs and firewalls of ISPs on cellular networks which can prevent making direct connections between devices, app-to-app communicator tries to get around these barriers through NAT puncturing.

The Tribler group at the TU Delft has done research about and developed projects around the field of decentralisation on the Internet over the past 11 years. Projects include Tribler, our own torrents-only anon network with Tor messages, blockchain technologies, the Android stealth app, Shadow Internet app, and the self-compiling Android app with viral wireless spreading ability. This is another prototype which contributes towards this work. The coming years we will consolidate and merge all this work into a single app. This app would be resilient to attacks and have the ability to bypass Internet kill switches (ongoing work).

Within 15 seconds this app should find the network and discover the first peer. See screenshot below.

![Screenshot] (https://raw.githubusercontent.com/Jaapp-/app-to-app-communicator/master/img/Screenshot.png)

Peer discovery

  1. When peer A starts App-to-app communicator, a connection request to peer B is made.
  2. Upon connection peer B chooses another connected peer, peer C, and sends the address of peer C to peer A as introduction response message.
  3. Peer B sends peer C a puncture request.
  4. Peer C sends a puncture message to peer A to punch a hole in its own NAT.

Peer walking

When starting the app-to-app communicator a connection is made to a hard-coded connectable bootstrap phone. For this prototype only a single hard-coded bootstrap IPv4 is used. Multiple phones, various bootstrap servers, or local discovery broadcasts are possible for future work.

UDP packet types

Several UDP messages are sent between peers. Every message includes the unique id of the sending peer, and the external IP address of the destination peer.

Introduction request (peer A -> B)

An introduction request is sent every 5 seconds to a random actively connected peer.

Introduction response (peer B -> A)

An introduction response is returned upon receiving an introduction request. A list of actively connected peers is returned, along with one random invitee. At the same time a puncture request is sent to the invitee.

Puncture Request (peer B -> C)

A request including a peer to puncture. Upon reception, a puncture message is sent to the given peer.

Puncture (peer C -> A)

A puncture message is sent to peer A to punch a hole peer C's NAT. This allows peer A to connect to peer C.

Identification

The app generates a unique identifier on its first launch. This peer ID is sent with every outgoing message, and is used to identify peers so that the app can differentiate between UDP packets from different peers which use the same address.

Local IP

The local IP address is obtained through a call to Android Network Info and displayed within the app.

IPv4 voting

An Android device doesn't know what its own IPv4 is. Each peer has its own WAN address, or external IP address, but a peer has no way of knowing its own WAN address without the help of others.

Each message contains the WAN address of its destination. The app determines what the most likely external IP is based on the reported IPv4 addresses. When there's conflicting reports, and devices claim to see different external IPs, our app relies on the majority judgement.

As IPv4 addresses can change quickly, we only look at just the last 3 reports.

Building

This app is made with Android studio, it can be imported, or compiled manually:

./gradlew build

The built APK can be found in app/build/outputs/apk/

app-to-app-communicator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-to-app-communicator's Issues

Blockchain Engineering - Group 1 - Connection is not working on mobile data?

Hey there,

We are currently working on the Trustchain Android app. In one of our demos, @synctext noticed that it was not possible to connect with a peer that is on mobile data. We have raised an issue (#58) on our repository and investigated this issue.

We first compared the source code of both repository to see whether we have accidentally removed something when merging both apps. Then we have cloned this repo and changed the IP address of the host.

After changing the IP address of the host and launching the modified version of this app, we have noticed that we were not able to connect with peers that are on mobile data.

We were wondering whether it is possible to connect to peers that are on mobile data with this app? Or is there something else that we need to modify to make it work on one of our device?

Kind regards,
@TimBuckers, @ClintonCao, @Michieldoesburg, @boninggong, and @laurensWe

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.