Git Product home page Git Product logo

network_com_hw's Introduction

NFTP

This is an implementation of a custom file transfer protocol using ZeroMQ. We'll call it Nikita's File Transfer Protocol. It supports multiple concurrent upload clients, asynchronous packet queing, and handles out of order packets.

The client program will upload a specified file using NFTP, then download it back using FTP. It will then compare the hashes of the sent and received file and will display performance metrics.

Performance is about double of FTP (albeit it doesn't offer any of the security features). My measurements show an upload speed of 8-10 Gb/s over a TCP socket, compared to 4-4.5 Gb/s for FTP.

Prerequisites

Using docker greatly simplifies the burden of getting the code running since we have a server/client model as well as multiple dependencies that have to be handled.

  • docker version 19.03+
  • docker compose version 1.28+
  • BuildKit enabled
  • BuildKit enabled for docker-compose

docker installation guide

docker-compose installation guide

To enable BuildKit, add these 3 environment variables to your .bashrc or equivalent:

export DOCKER_BUILDKIT=1 # Enable BuildKit
export COMPOSE_DOCKER_CLI_BUILD=1 # Enable BuildKit for docker-compose
export BUILDKIT_PROGRESS=plain # Full build output so you can see compiler build logs

Building and Running

To build the code:

docker-compose build

To run the client with the provided cad_mesh.stl file:

docker-compose run --rm client

If you want to really the test the performance, you will need a bigger file:

# Create a 1 GB empty file
dd if=/dev/urandom of=testdata bs=1M count=1024
# Run the client with a specified endpoint and filepath
docker-compose run --rm client "tcp://server:5557" "testdata"

You should see an output like this:

➜ docker-compose run --rm client client "tcp://server:5557" "testdata"
[+] Running 2/0
 ⠿ Container transfer-server-1  Running                                                                                                                                                                     0.0s
 ⠿ Container transfer-ftp-1     Running                                                                                                                                                                     0.0s
Uploading file with ZeroMQ: 100%
Transmission speed: 9.33 Gb/s
Done
Downloading file with FTP:
Transmission speed: 3.22 Gb/s
Done
Sent file hash:     J*�5����6#E���
Received file hash: J*�5����6#E���

network_com_hw's People

Contributors

nikita240 avatar jay-machina avatar

Watchers

James Cloos avatar  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.