#sequence #high-level #udp #packet #constructs #transfer #data

adrnaln

Adrnaln is a library for UDP packet transfers with high level constructs for managing sequences of data

3 releases

new 0.1.2 May 9, 2024
0.1.1 May 8, 2024
0.1.0 May 8, 2024

#4 in #constructs

Download history 325/week @ 2024-05-04

326 downloads per month

MIT license

490KB
334 lines

adrnaln

Problem statement: It is desired to send any type of file across UDP with low latency or metadata overhead.

This is a simple library that provides high level constructs to manage a sequence of packets streaming over UDP.

Implementation

This library uses bincode to assist in the serial/deseralisation of Packet structs. These structs contain chunks from input file and also have global metadata about the sequence construction.

Usage

cargo test to run a synthetic test.

Run the example cargo run --example local_file_transfer -- --filepath <FILEPATH> ( This will currently spit the file into the cwd )

Performance

Flamegraph

To analyze performance use flamegraph ( cargo install flamegraph )

sudo cargo flamegraph --dev --example local_file_transfer -- --filepath <FILEPATH>

Tracing

docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest

Create a trace:

RUST_LOG=trace RUSTFLAGS="--cfg tokio_unstable" cargo run --example local_file_transfer -- --filepath=examples/resources/fox.png

Dependencies

~9–20MB
~245K SLoC