triglav 0.1.0

High-performance multi-path networking tool with intelligent uplink management
Documentation
//! Multi-path connection management with intelligent uplink selection.
//!
//! This module implements the core multi-path functionality:
//! - Uplink discovery and management
//! - Intelligent packet scheduling across uplinks
//! - Automatic failover and recovery
//! - Bandwidth aggregation
//! - Quality-based path selection
//! - ECMP-aware flow hashing (Dublin Traceroute technique)
//! - NAT detection and traversal support
//! - Path discovery and diversity assessment
//! - Throughput optimization with BBR-style congestion control
//! - Path MTU discovery
//! - Effective throughput scoring (bandwidth + latency combined)

mod uplink;
mod scheduler;
mod manager;
mod flow_hash;
mod nat;
mod path_discovery;
mod throughput;
pub mod aggregator;

pub use uplink::{Uplink, UplinkConfig, UplinkState, ConnectionParams};
pub use scheduler::{Scheduler, SchedulerConfig, SchedulingStrategy};
pub use manager::{MultipathManager, MultipathConfig, MultipathEvent};
pub use aggregator::{
    BandwidthAggregator, AggregatorConfig, AggregationMode,
    ReorderBuffer, ReorderStats, AggregatorStats,
};
pub use throughput::{
    ThroughputOptimizer, ThroughputConfig, ThroughputSummary,
    EffectiveThroughput, BdpEstimator, PmtudState, BbrState,
    FrameBatcher, DEFAULT_MTU, MIN_MTU, MAX_MTU,
};

// Dublin Traceroute-inspired modules
pub use flow_hash::{
    FlowId, FlowHashBucket, EcmpPathEnumerator,
    calculate_flow_hash, flow_hash_from_addrs,
};
pub use nat::{
    NatId, NatType, NatDetectionState, UplinkNatState,
    IpIdMarker, NatProbe, NatProbeResponse, ProbeMatcher,
    compute_udp_checksum,
};
pub use path_discovery::{
    PathDiscovery, PathDiscoveryConfig, PathDiversity,
    DiscoveredPath, Hop, EcmpFlowSelector,
};

use std::time::Duration;

/// Default probe interval for uplink quality measurement.
pub const DEFAULT_PROBE_INTERVAL: Duration = Duration::from_secs(1);

/// Default timeout for considering an uplink dead.
pub const DEFAULT_UPLINK_TIMEOUT: Duration = Duration::from_secs(10);

/// Minimum RTT samples before making scheduling decisions.
pub const MIN_RTT_SAMPLES: usize = 3;

/// Weight decay factor for exponential moving average.
pub const EMA_ALPHA: f64 = 0.2;