Crate triglav

Crate triglav 

Source
Expand description

§Triglav

High-performance multi-path VPN with intelligent uplink management.

Triglav provides a true virtual network interface (TUN) that transparently tunnels all IP traffic across multiple network paths with encryption, intelligent scheduling, automatic failover, and bandwidth aggregation.

§Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    Applications (Any Protocol)                   │
│              (TCP, UDP, ICMP, DNS, etc. - All traffic)          │
├─────────────────────────────────────────────────────────────────┤
│                      Kernel TCP/IP Stack                         │
├─────────────────────────────────────────────────────────────────┤
│                    TUN Virtual Interface                         │
│                 (utun/tun0 - Layer 3 IP packets)                 │
├─────────────────────────────────────────────────────────────────┤
│                        TunnelRunner                              │
│  ┌──────────────┐  ┌─────────────┐  ┌─────────────────────────┐ │
│  │  IP Parser   │──│    NAT      │──│  MultipathManager       │ │
│  │  (5-tuple)   │  │ Translation │  │  (encryption, routing)  │ │
│  └──────────────┘  └─────────────┘  └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│                   Multi-Path Connection Manager                  │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐         │
│  │ Uplink 1 │  │ Uplink 2 │  │ Uplink 3 │  │ Uplink N │         │
│  │  (WiFi)  │  │(Cellular)│  │(Ethernet)│  │   ...    │         │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘         │
├─────────────────────────────────────────────────────────────────┤
│              Quality Metrics & Prediction Engine                 │
├─────────────────────────────────────────────────────────────────┤
│                    Noise NK Encryption Layer                     │
├─────────────────────────────────────────────────────────────────┤
│               Transport (UDP Fast Path / TCP Fallback)           │
└─────────────────────────────────────────────────────────────────┘

§Key Features

  • True VPN: Virtual TUN interface captures all IP traffic transparently
  • Multi-path: Aggregate bandwidth across WiFi, cellular, ethernet
  • ECMP-aware: Flow-based routing maintains TCP connection consistency
  • Encrypted: Noise NK protocol with per-uplink sessions
  • NAT traversal: Works behind NATs with Dublin Traceroute-style probing
  • Cross-platform: Linux, macOS, Windows support

Re-exports§

pub use config::Config;
pub use error::Error;
pub use error::Result;
pub use types::*;

Modules§

cli
Beautiful CLI interface for Triglav.
config
Configuration management for Triglav.
crypto
Cryptographic primitives for Triglav.
error
Error types for Triglav.
metrics
Quality metrics, predictive analytics, and Prometheus export.
multipath
Multi-path connection management with intelligent uplink selection.
prelude
Prelude module for convenient imports
protocol
Wire protocol for Triglav.
proxy
Proxy servers for Triglav client.
server
Server-side components for Triglav.
transport
Transport layer for Triglav.
tun
TUN/TAP virtual network interface module.
types
Core types used throughout Triglav.
util
Utility functions and helpers.

Constants§

DEFAULT_PORT
Default port for Triglav server
MAX_MTU
Maximum transmission unit for packets
MAX_PAYLOAD
Maximum payload size after encryption overhead
PROTOCOL_VERSION
Protocol version for wire compatibility
VERSION
Library version