Giter VIP home page Giter VIP logo

crust's Introduction

crust

Reliable p2p network connections in Rust with NAT traversal. One of the most needed libraries for any server-less / decentralised project.

Crate Travis Drone.io Appveyor Coverage
Build Status Build Status Build status Coverage Status

| API Documentation | MaidSafe System Documention | MaidSafe web site | Safe Community site |

#Overview

This library will allow p2p networks to establish and maintain a number of connections in a group when informed by users of the library. As connections are made these are passed up and the user can select which connections to maintain or drop. The library has a bootstrap handler which will attempt to reconnect to any previous "direct connected" nodes.

Tcp conections are always favoured as these will be by default direct connected (until we can test and confirm tcp hole punching). Tcp is also a known reliable protocol. Reliable udp is the fallback protocol and very effective.

The library contains a beacon system for finding nodes on a local network, this will be extended using a gossip type protocol for multi hop discovery.

Encryption of all streams will also allow for better masking of such networks and add to security, this is done also considering the possibility of attack where adversaries can send data continually we must decrypt prior to handling (meaning we do the work). There are several methods to mitigate this, including alerting upper layers of such activity. The user of the library has the option to provide a blacklisting capapbility per session to disconnect such nodes 'en masse'.

direct connected == Nodes we were previously connected to. tcp nodes or reliable udp nodes that allow incoming connections (i.e. direct or full cone nat that has been hole punched). This library also supports fallback endpoints being passed at construction that will allow a fallback should none of the nodes form any previous session are available.

##Nat traversal/Handling

Several methods are used for NAT traversal, UpNP, hole punching [See here for tcp NAT traversal] (http://www.cmlab.csie.ntu.edu.tw/~franklai/NATBT.pdf) and here for ucp/dht NAT traversal etc. These methods will be added to by the community to allow a p2p network that cannto be easily blocked. By default this library spawns sockets randomly, meaning ndoes appear on several ports over time and very difficult to trace.

##Todo Items

  • Tcp Networking
    • Tcp live port and backup random port selection
    • Create send/rcv channel from routing to connections object
    • Implement test for basic "hello world" two way communication
    • Set up Udp broadcast and respond when we have a port (we listen on any random port above 1024 [user space port]) available (broadcast port is 5483)
    • Add connection established/lost/ new messages to be passed to routing (via channel)
    • Implement connect() in connection manager
    • Benchmark tx/rv number of packets
    • Benchmark tx/rc Bytes per second
    • Allow tcp and then utp connections option and wrap in connection object. ](http://maidsafe.net/Whitepapers/pdf/DHTbasedNATTraversal.pdf)
  • Version 0.0.8
  • Update handle connect for TCP
  • Remove FailedToConnect event
  • Integrate bootstrap (Link ability to read and write bootstrap file)
  • Integrate beacon (Have connection manger start, broadcast on udp broadcast for port 5483 (later multicast for ipv6)
  • Send serialised bootstrap info as part of beacon reply (Link ability to send bootstrap file to any node requesting it)
  • Examples:
    • Beacon Client
    • Beacon Server
    • CLI Example - options:
      • Join / Start a client(optionally provide bootstrap info)
      • Allow sending messages at various rates per second
      • Print Incomming message rate per second
    • Local Network Test. 12 Linux, 2 OSX, 2 WIN
    • 101 Droplet test
  • Version 0.0.9
  • Utp Networking
    • Utp live port and backup random port selection
    • Create send/rcv channel from routing to connections object
    • Implement test for basic "hello world" two way communication
    • Add connection established/lost messages to be passed to routing (via channel)
    • Benchmark tx/rv number of packets
    • Benchmark tx/rc Bytes per second
    • NAT traversal [See here for tcp NAT traversal] (http://www.cmlab.csie.ntu.edu.tw/~franklai/NATBT.pdf) [and here for ucp/dht NAT traversal
  • Version 0.1 (crates.io)

crust's People

Contributors

dirvine avatar inetic avatar chandraprakash avatar maqi avatar

Watchers

James Cloos avatar ht_coder avatar

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.