Image of an arrow

Introducing DHTNet: Distributed Peer-to-Peer Networking Made Simple

Avatar

aberaud

Savoir-faire Linux is excited to announce DHTNet, a powerful new C++17 library spun off from the Jami project that simplifies peer-to-peer connectivity. DHTNet enables developers to establish secure P2P connections between devices using only public keys, eliminating the need for centralized infrastructure or direct IP addressing.

Features

  • Connection Management: DHTNet simplifies the establishment and management of connections to peers, streamlining the communication process.
  • Multiplexed Sockets: It provides multiplexed sockets that allow multiple channels for data transmission, optimizing network resources.
  • UPnP Integration: DHTNet seamlessly integrates with UPnP, enabling automatic port mapping and enhanced network connectivity.
  • Server TURN Support: DHTNet includes support for server TURN, used as a fallback for connections if the NAT block all possible connections.

Technical Overview

DHTNet is a C++17 library designed to serve as a network overlay that provides an IP network abstraction. Its main objective is to establish secure peer-to-peer connections using public-key authentication.

DHTnet allows you to connect with a device simply by knowing its public key and efficiently manages peer discovery and connectivity establishment, including NAT traversal.

At its core, DHTNet integrates several established standards and technologies to provide robust P2P connectivity:

  • OpenDHT serves as the foundation for peer discovery on the distributed network
  • ICE (Interactive Connectivity Establishment) is handled by pjnath, supporting connection through NATs and firewalls
  • Security and authentication are implemented through GnuTLS

The library implements a true peer-to-peer architecture where devices can discover and connect to each other through public key-based addressing. This approach eliminates the need for static IP addresses or central coordination servers, making it particularly suitable for dynamic network environments.

Use Cases and Applications

DHTNet is particularly well-suited for:

  • Embedded systems and IoT devices that require direct peer-to-peer communication
  • Distributed applications that need to operate without central infrastructure
  • Systems where traditional client-server architectures are impractical
  • Development of decentralized networking protocols and applications

Technical Requirements

  • Build tested with:
    • GCC on GNU/Linux
    • Clang on Android, iOS and macOS
    • MSVC on Windows
  • C++17 compatible compiler required
  • Dependencies:
    • OpenDHT
    • Our fork of pjproject, implementing ICE/TCP
    • GnuTLS

Contributing

DHTNet is an open-source project under the GPLv3+ licence, and contributions from the community are welcome. The codebase aims to maintain high standards of code quality and documentation to facilitate collaboration and maintainability.

Future Development

The development roadmap includes:

  • Additional transport protocol support
  • Enhanced API documentation
  • Performance optimizations for constrained environments
  • Extended example implementations

We encourage developers interested in distributed systems and peer-to-peer networking to explore DHTNet and provide feedback on its functionality and potential improvements.

https://github.com/savoirfairelinux/dhtnet/

https://github.com/savoirfairelinux/dhtnet/blob/master/BUILD.md

Leave a comment

Your email address will not be published. Required fields are marked *


Similar articles

Image of an arrow
Thumbnail image

What’s new? We’re happy to announce the release of v2.8.0, which includes a few new features as well as bug fixes. Check out the summarized changelog below: Renamed command “Pick configuration” to “Change active buildConfiguration” Automatically re-scan when changing buildConfiguration Cache per-buildConfiguration scan results Make the recipes view appear as “loading” while a scan is […]

What’s new? We’re happy to announce the release of v2.7.0, which includes a few new features as well as bug fixes. Check out the summarized changelog below: Add bitbake environment scan for global variables Add skipped recipes to the tree view with skip reason Add support for latest Yocto devtool status output Add sanity check […]

What’s new? We’re happy to announce the release of v2.6.0, which includes which a few new features, improvements to user experience, and minor bug fixes. Check out the summarized changelog below: Handle completion on bash simple variable expansion Handle keywords import, require and inherit in Bash/Python context Add SPDX license suggestions Show license description on […]

What’s new? We’re happy to announce the release of v2.5.0, which includes a few new features as well as quality-of-life improvements and minor bug fixes. Here is the change log: Add Yocto variables renaming across a recipe file Add code suggestions for SRC_URI local files Add code suggestions for recipe names in variables (DEPENDS, RDEPENDS, […]

Nuremberg, April 9th, 2024 – In an era where cybersecurity threats are increasingly sophisticated and pervasive, Savoir-faire Linux, a leading provider in open-source technological innovation and software engineering for embedded systems across North America and Europe, is proud to announce the launch of its Cybersecurity professional services tailored specifically for product engineering and embedded systems. […]