GithubHelp home page GithubHelp logo

the7day / hairgap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cea-sec/hairgap

0.0 0.0 0.0 75 KB

A set of tools to transfer data over a unidirectional network link (typically a network diode).

License: GNU General Public License v3.0

Makefile 2.72% C 93.17% Shell 4.11%

hairgap's Introduction

Hairgap

hairgap is a set of tools to transfer data over a unidirectional network link (typically a network diode). It uses catid's wirehair (https://github.com/catid/wirehair) librairy for error correction and is written to handle high bandwith transfers (> 200 MB/s).

It is meant to be a mere transport on a dedicated, safe link: no authentication nor encryption is guaranteed, although there is a work in progress on this matter.

This should be considered alpha quality, any bug report will be very welcome.

Usage

Before anything, to make high bandwith transfers work properly on a linux machine, you might want to change at least these system options on the receiver side:

net.core.rmem_max=67108864 # at least 4MB, 64MB is fine
net.core.rmem_default=67108864 # equal to net.core.rmem_max (if you dare)
net.core.netdev_max_backlog=10000 # works fine

and

net.ipv4.udp_rmem # multiply all three values by 32

Or, on newer kernels:

net.ipv4.udp_mem="49314528 65752736 3082158"

To use, on the receiver side first:

$ hairgapr LISTENING_IP > OUTPUT_FILE

Then, on the sender side:

$ hairgaps RECEIVER_IP < INPUT_FILE

see hairgap[sr] -h for various options. For very reliable transfers on machines with a fast CPU, I would suggest -N 30000 -r 1.5, which sets a relatively high redundancy (+50% of redundant data) and big redundancy blocks for a better resistance to loss bursts (N=30000).

Note that a static ARP entry for RECEIVER_IP must be provided for hairgaps to work properly. One way to achieve this is as follows:

# arp -s 10.0.0.1 aa:bb:cc:00:01:02

Compiling

Compilation has only been tested on linux.

Note: you should either git clone --recursive or git submodules --init --update to retrieve submodules.

$ make

Installing

# make install

Testing

Testing properly will require you to set the aforementioned sysctls. Note that the tests can currently deadlock, try to restart them. This is another FIXME. More tests are on their way.

$ make test

Protocol

Hairgap implements its own, very simple protocol. Its documentation is on its way too.

Hacking

See hairgap.h first, it will give you pointers.

hairgap's People

Contributors

fmonjalet 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.