GithubHelp home page GithubHelp logo

utp4j's Introduction

#utp4j - Micro Transport Protocol for Java

uTP is an implementation of the LEDBAT algorithm. uTP is a BitTorrent standard and build on top of UDP, as such, it implements its own mechanisms for reliable ordered delivery. utp4J is (still :( ) an experimental uTP implementation in Java, currently only suited for scientific purposes. I wrote this library as a part of my Bsc thesis at the University of Zurich and i'd like to continue developing it with the intention of releasing a stable version some day.

Interface

utp4j follows the same approach like java.nio. If you ever have worked with nio, you will be familiar with utp4j soon. Developers only need to know about a few classes in order to use utp4j efficiently. A set of semantically clear methods is provided. utp4j is aims to be asynchronous and most operations return handy future objects.

Features

  • LEDBAT algorithm
  • Dynamic RTO
  • Clock drift correction
  • Async Execution
  • Listener interface on some futures
  • Extended logging & Automated test executor

Usage

To open up a connection:

UtpSocketChannel c = UtpSocketChannel.open();
c.bind(port);
UtpConnectFuture cFut = c.connect(address);

// ... You either wait...
cFut.block()...
c.write(buffer);

// ...or do something else...

if (cFut.isDone()) {
	c.write(). 
}

The same on the server side:

UtpAcceptFuture accept = server.accept();

accept.block();
// ... block on the accept future
UtpSocketChannel channel = accept.getChannel();
UtpReadFuture rFut = channel.read(buffer);

rFut.block();
// wait for the completition of the operation. 
print(rFut.getBuffer());

Experimenting

There are a lot of research papers regarding LEDBAT. Because it is still an experimental algorithm, utp4j can become handy for those who are investigating delay based congestion control mechanisms. The example package contains an automated test executor. Different parameters can be specified in a CSV file. The experiments can run stable for days if desierd (depends on configuration, though). Extended logging for most of the state variables can be enabled to analyze LEDBAT behaviour. A bash script is available to quickly plot the results and can be modified if desired.

##Current Flaws

  • Correct handling of RST packets
  • Closing connection while sending/reading is not yet handled good enough
  • High CPU consumption
  • Probably some minor bugs.

##Appreciation I'd like to thank all members of the Communication Systems Group at the University Zurich for the opportunity, the provided test hardware, the room and patience. Special thanks to Thomas and Danni for all the constructive feedback, advices and tipps.

##Contact Please report any bugs, issues or suggestions to issues at utp4j dot net.

License

utp4j is licensed under the Apache 2.0 license.

utp4j's People

Contributors

iiljkic avatar tbocek avatar

Watchers

 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.