Skip to content
PeergosPublic

About

A pure Java iroh implementation

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

39 Commits

Folders and files

Repository files navigation

jiroh

A Java implementation of iroh endpoints, interoperable with Rust iroh 1.x: QUIC with raw public key TLS, iroh relays, QUIC address discovery, pkarr lookup on the mainline DHT, mDNS discovery on the local network, multipath (draft-ietf-quic-multipath-21), iroh's QUIC NAT traversal (hole punching) and port mapping (PCP, NAT-PMP, UPnP).

It builds against Peergos's forks of kwik (QUIC) and agent15 (TLS 1.3), branch iroh, cloned next to it:

git clone -b iroh git@github.com:peergos/agent15.git
git clone -b iroh git@github.com:peergos/kwik.git
git clone git@github.com:peergos/jiroh.git
cd jiroh && ./gradlew test

Java 25. The fast Linux UDP path (GSO/GRO through FFM) needs --enable-native-access=ALL-UNNAMED; without it a DatagramChannel is used.

The Rust interop tests need the interop-probe binaries (cloned as interop-probe next to jiroh) and n0's iroh-relay; they are skipped when those are not built.

NAT traversal

./nat-test.sh [java|rust] [java|rust] [portmap] puts a server and a client behind two Linux NATs (masquerading in network namespaces, no root needed) with an iroh relay between them. The client knows only the server's relay, and the test passes when NAT traversal finds a direct path. Either side can be jiroh or Rust iroh. With portmap, the server's NAT maps ports over PCP and uses random ports for outgoing traffic, so the server can only be reached at its mapped address.

Throughput

./bench.sh [bytes] [streams] [java opts] runs every pairing of Rust iroh and jiroh over loopback. One bidirectional stream, 512 MiB, best of several runs, MiB/s (Ryzen 9 7940HS, Linux 6.8, Java 25, iroh 1.3):

client → server upload download
Rust iroh → Rust iroh 744 731
jiroh → Rust iroh 900 623
Rust iroh → jiroh 573 793
jiroh → jiroh 852 813

jiroh sends faster than Rust iroh, and jiroh to jiroh beats Rust iroh to Rust iroh by about 12–15%. Receiving from Rust iroh is slower, 77–85% of Rust↔Rust: Rust's sender is the bottleneck there and spends more CPU per byte towards jiroh (and towards a plain noq client) than towards iroh's own receiver. Repeated runs agree to within about 3%.

About

A pure Java iroh implementation

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages