drasyl: From Peer-to-Peer Library to Software-Defined Networking Platform
Origins and Motivation
Five years ago, our work on drasyl began within the SANE research project, which aimed to enable decentralized, secure, and privacy-preserving data sharing between citizens and institutions. Achieving this required direct, efficient, and secure communication, even across communication barriers prevalent on the Internet such as NATs, firewalls, and IPv4/IPv6 incompatibilities.
Established solutions like WebRTC, while functional, rely on layered protocol stacks (STUN, TURN, SIP, DTLS) that add infrastructure dependencies, complex handshake procedures, multiple points of failure, and increased connection latency. These characteristics did not align with our architectural and operational requirements.
We envisioned a system as seamless as opening a local socket, while still providing location transparency, mutual authentication, end-to-end encryption, and the flexibility to construct custom overlay topologies. drasyl became this foundation, abstracting away Internet communication complexities so development could focus on application-level logic.
Evolving into a Networking Platform
drasyl’s ability to connect arbitrary peers with low latency and high reliability soon proved valuable beyond SANE. What began as an application-layer P2P library evolved into a Layer 3 IP-based overlay networking platform with integrated software-defined networking (SDN) capabilities.
Two recurring needs drove this shift:
- Transparent integration at the network layer, enabling unmodified IP-based applications to leverage drasyl.
- Support for flexible membership management, topology design, and routing control, which are critical for many application domains.
We built drasyl on Java with Netty as the networking backbone. While Netty provided a solid high-performance framework, its Layer 7 focus required significant additional work for Layer 3 support. We developed our own TUN adapter using JNA, followed by a high-performance epoll
/kqueue
variant tightly integrated with Netty. Although we created a pull request for Netty over two years ago, we did not succeed in getting it merged. Without upstream adoption, integrating it into drasyl would have required maintaining a custom Netty build, which was not feasible.
Looking back, high-performance networking on the JVM is possible, but it demands substantial engineering effort: developing our own TUN adapter, integrating with platform-specific APIs, bypassing JVM abstractions to reduce overhead, and building native images for JRE-free deployment. These measures, while effective, diverge from the JVM’s original aim of providing an abstract, platform-independent runtime and consumed substantial time that could have been spent on feature development.
A Fresh Start in Rust
After completing my dissertation, we decided to rebuild drasyl on a foundation more suited to an SDN platform. The programming language Rust was chosen for its combination of C/C++-level performance and control with strict memory and thread safety, achieved without a garbage collector. This combination enables the efficient development of high-performance, reliable networking applications while retaining portability and avoiding JVM-specific tuning.
This was not a direct port. We reengineered every component, including the P2P protocol and SDN management, while ensuring compatibility with the Java library. Development of the Rust-based implementation is publicly available at github.com/drasyl/drasyl-rs.
Redefining drasyl: Focus on SDN
Today, drasyl is a comprehensive software-defined overlay networking platform, capable of interconnecting heterogeneous devices and orchestrating data flows with precise control over network behavior. To reflect this transformation, we revised our project naming:
- drasyl → Rust-based SDN platform (formerly the Java-based P2P library and its extensions)
- drasyl-p2p → Rust-based peer-to-peer library
- drasyl-java → Legacy Java library
The documentation for drasyl-java
is now located at docs.java.drasyl.org, while docs.drasyl.org serves as the central documentation hub for the SDN platform. Docker images and Homebrew packages follow the same naming convention.
We remain committed to maintaining drasyl-java
, which has integrated the Rust-based P2P implementation since version 0.13 and will continue to benefit from future improvements. The first release of the new SDN platform is in its final testing phase, and we invite you to join our Discord to follow our latest developments.
Photo by Suzanne D. Williams on Unsplash