Skip to main content

Crate ipfrs_network

Crate ipfrs_network 

Source
Expand description

IPFRS Network - libp2p-based networking layer

This crate provides the networking infrastructure for IPFRS including:

  • libp2p node management with full protocol support
  • QUIC transport with TCP fallback for reliable connectivity
  • Kademlia DHT for content and peer discovery
  • Bitswap protocol for block exchange
  • mDNS for local peer discovery
  • Bootstrap peer management with retry logic and circuit breaker
  • Provider record caching with TTL and LRU eviction
  • Connection limits and intelligent pruning
  • Network metrics and Prometheus export
  • NAT traversal (AutoNAT, DCUtR, Circuit Relay v2)
  • Query optimization with early termination and pipelining
  • Comprehensive health monitoring and logging

§Features

§Core Networking

  • Multi-transport: QUIC (primary) with TCP fallback for maximum compatibility
  • NAT Traversal: AutoNAT for detection, DCUtR for hole punching, Circuit Relay for fallback
  • Peer Discovery: Kademlia DHT, mDNS for local peers, configurable bootstrap nodes
  • Connection Management: Intelligent limits, priority-based pruning, bandwidth tracking

§DHT Operations

  • Content Routing: Provider record publishing and discovery with automatic refresh
  • Peer Routing: Find closest peers, routing table management
  • Query Optimization: Early termination, pipelining, quality scoring
  • Caching: Query results and provider records with TTL-based expiration
  • Semantic Routing: Vector-based content discovery using embeddings and LSH

§Pub/Sub Messaging

  • GossipSub: Topic-based publish/subscribe messaging
  • Mesh Formation: Automatic peer mesh optimization for topic propagation
  • Message Deduplication: Efficient duplicate detection
  • Peer Scoring: Quality-based peer selection for reliable delivery

§Reliability

  • Retry Logic: Exponential backoff with configurable limits
  • Circuit Breaker: Prevent cascading failures with failing peers
  • Fallback Strategies: Alternative peers, relay fallback, degraded mode
  • Health Monitoring: DHT health, connection health, bandwidth metrics

§Monitoring & Observability

  • Metrics: Connection stats, DHT stats, bandwidth tracking, query performance
  • Prometheus Export: Ready-to-use metrics export for monitoring systems
  • Structured Logging: Tracing spans with context propagation
  • Health Checks: Component-level and overall health assessment

§Quick Start

use ipfrs_network::{NetworkConfig, NetworkNode};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create configuration
    let config = NetworkConfig {
        listen_addrs: vec!["/ip4/0.0.0.0/udp/0/quic-v1".to_string()],
        enable_quic: true,
        enable_mdns: true,
        enable_nat_traversal: true,
        ..Default::default()
    };

    // Create and start network node
    let mut node = NetworkNode::new(config)?;
    node.start().await?;

    // Check network health
    let health = node.get_network_health();
    println!("Network status: {:?}", health.status);

    // Announce content to DHT
    let cid = cid::Cid::default();
    node.provide(&cid).await?;

    // Get network statistics
    let stats = node.stats();
    println!("Connected peers: {}", stats.connected_peers);

    Ok(())
}

§High-Level Facade

For easy integration of all features, use the NetworkFacade:

use ipfrs_network::NetworkFacadeBuilder;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a mobile-optimized node with advanced features
    let mut facade = NetworkFacadeBuilder::new()
        .with_preset_mobile()
        .with_semantic_dht()
        .with_gossipsub()
        .build()?;

    facade.start().await?;
    println!("Peer ID: {}", facade.peer_id());
    Ok(())
}

§Architecture

The crate is organized into several modules:

  • facade: High-level facade for easy integration of all modules
  • auto_tuner: Automatic network configuration tuning based on system resources
  • benchmarking: Performance benchmarking utilities for network components
  • node: Core NetworkNode implementation with libp2p swarm management
  • dht: Kademlia DHT operations and caching
  • peer: Peer store for tracking known peers and their metadata
  • connection_manager: Connection limits and intelligent pruning
  • bootstrap: Bootstrap peer management with retry logic
  • providers: Provider record caching with TTL
  • query_optimizer: Query optimization and performance tracking
  • metrics: Network metrics and Prometheus export
  • health: Health monitoring for network components
  • logging: Structured logging and tracing
  • protocol: Custom protocol support and version negotiation
  • fallback: Fallback strategies for resilience
  • semantic_dht: Vector-based semantic DHT for content routing by similarity
  • gossipsub: Topic-based pub/sub messaging with mesh optimization
  • geo_routing: Geographic routing optimization for proximity-based peer selection
  • dht_provider: Pluggable DHT provider interface for custom DHT implementations
  • peer_selector: Intelligent peer selection combining geographic proximity and quality metrics
  • multipath_quic: QUIC multipath support for using multiple network paths simultaneously
  • tor: Tor integration for privacy-preserving networking with onion routing and hidden services
  • diagnostics: Network diagnostics and troubleshooting utilities
  • session: Connection session management with lifecycle tracking and statistics
  • rate_limiter: Connection rate limiting for preventing connection storms and resource exhaustion
  • reputation: Peer reputation system for tracking and scoring peer behavior over time
  • metrics_aggregator: Time-series metrics aggregation with statistical analysis and trend tracking
  • load_tester: Load testing and stress testing utilities for performance validation
  • traffic_analyzer: Traffic pattern analysis and anomaly detection for network insights
  • network_simulator: Network condition simulation for testing under adverse conditions
  • policy: Network policy engine for fine-grained control over operations
  • utils: Common utility functions for formatting, parsing, and network operations

§Examples

See the examples/ directory for more comprehensive examples:

  • network_facade_demo.rs: Using the NetworkFacade for easy integration
  • basic_node.rs: Creating and starting a basic network node
  • dht_operations.rs: Content announcement and provider discovery
  • connection_management.rs: Connection tracking and bandwidth monitoring

Re-exports§

pub use adaptive_bandwidth_allocator::AdaptiveBandwidthAllocator;
pub use adaptive_bandwidth_allocator::AllocationPolicy;
pub use adaptive_bandwidth_allocator::AllocatorConfig;
pub use adaptive_bandwidth_allocator::AllocatorError;
pub use adaptive_bandwidth_allocator::BandwidthClass;
pub use adaptive_bandwidth_allocator::BandwidthEvent;
pub use adaptive_bandwidth_allocator::BandwidthStats as AbaBandwidthStats;
pub use adaptive_bandwidth_allocator::BandwidthWindow;
pub use adaptive_bandwidth_allocator::PeerBandwidthProfile;
pub use adaptive_peer_scheduler::AdaptivePeerScheduler;
pub use adaptive_peer_scheduler::BackpressureSignal as ApsBackpressureSignal;
pub use adaptive_peer_scheduler::PeerMetrics as ApsPeerMetrics;
pub use adaptive_peer_scheduler::ScheduleSlot;
pub use adaptive_peer_scheduler::SchedulerConfig as ApsSchedulerConfig;
pub use adaptive_peer_scheduler::SchedulerStats as ApsSchedulerStats;
pub use anti_entropy::AntiEntropyConfig;
pub use anti_entropy::DigestEntry;
pub use anti_entropy::GossipAntiEntropy;
pub use anti_entropy::MerkleDigest;
pub use anti_entropy::ReconcileResult;
pub use block_transfer::BlockTransfer;
pub use block_transfer::StreamingBlockTransfer;
pub use block_transfer::TransferChunk;
pub use block_transfer::TransferDirection;
pub use block_transfer::TransferManagerStats;
pub use block_transfer::TransferState;
pub use bandwidth_allocator::AllocationStats;
pub use bandwidth_allocator::AllocationStrategy;
pub use bandwidth_allocator::PeerAllocation;
pub use bandwidth_allocator::PeerBandwidthAllocator;
pub use bandwidth_budget::BandwidthBudgetManager;
pub use bandwidth_budget::BandwidthQuota;
pub use bandwidth_budget::BudgetConfig;
pub use bandwidth_budget::BudgetStats;
pub use bandwidth_budget::PeerBucket;
pub use bandwidth_monitor::BandwidthAnomaly;
pub use bandwidth_monitor::BandwidthMonitor;
pub use bandwidth_monitor::BandwidthMonitorStats;
pub use bandwidth_monitor::BandwidthSample;
pub use bandwidth_monitor::BandwidthStats;
pub use bandwidth_monitor::BandwidthStatsSnapshot;
pub use bandwidth_monitor::Direction;
pub use bandwidth_monitor::MonitorConfig;
pub use bandwidth_monitor::PeerBandwidth;
pub use bandwidth_monitor::PeerBandwidthMonitor;
pub use bandwidth_monitor::PeerBandwidthWindow;
pub use bandwidth_monitor::TickBandwidthSample;
pub use adaptive_timeout::AdaptiveTimeoutConfig;
pub use adaptive_timeout::PeerAdaptiveTimeout;
pub use adaptive_timeout::RttSample;
pub use adaptive_timeout::TimeoutEstimate;
pub use adaptive_timeout::TimeoutStats;
pub use connection_drainer::ConnectionDrainer;
pub use connection_drainer::DrainState;
pub use connection_drainer::DrainableConnection;
pub use connection_drainer::DrainerConfig;
pub use connection_drainer::DrainerStats;
pub use connection_health_monitor::AlertThresholds;
pub use connection_health_monitor::ChmAlertSeverity;
pub use connection_health_monitor::ChmHealthAlert;
pub use connection_health_monitor::ChmHealthMetric;
pub use connection_health_monitor::ChmHealthSample;
pub use connection_health_monitor::ChmMonitorStats;
pub use connection_health_monitor::ConnectionHealth;
pub use connection_health_monitor::ConnectionHealthMonitor;
pub use nat_traversal_manager::fnv1a_64 as ntm_fnv1a_64;
pub use nat_traversal_manager::xorshift64 as ntm_xorshift64;
pub use nat_traversal_manager::CandidateAddress;
pub use nat_traversal_manager::CandidateType;
pub use nat_traversal_manager::IcePair;
pub use nat_traversal_manager::NatTraversalManager as NtmNatTraversalManager;
pub use nat_traversal_manager::NatType as NtmNatType;
pub use nat_traversal_manager::PairState;
pub use nat_traversal_manager::StunAttribute;
pub use nat_traversal_manager::StunMessage;
pub use nat_traversal_manager::StunMessageType;
pub use nat_traversal_manager::TraversalConfig as NtmTraversalConfig;
pub use nat_traversal_manager::TraversalError;
pub use nat_traversal_manager::TraversalStats as NtmTraversalStats;
pub use peer_blacklist::BlacklistConfig;
pub use peer_blacklist::BlacklistEntry;
pub use peer_blacklist::BlacklistReason;
pub use peer_blacklist::BlacklistStats;
pub use peer_blacklist::PeerBlacklist;
pub use peer_exchange::PeerExchangeProtocol;
pub use peer_exchange::PeerSource;
pub use peer_exchange::PexConfig;
pub use peer_exchange::PexPeerRecord;
pub use peer_exchange::PexStats;
pub use peer_migration::MigrationItem as PmMigrationItem;
pub use peer_migration::PeerMigrationConfig as PmMigrationConfig;
pub use peer_migration::PeerMigrationManager;
pub use peer_migration::PeerMigrationRecord;
pub use peer_migration::PeerMigrationState as PmMigrationState;
pub use peer_migration::PeerMigrationStats as PmMigrationStats;
pub use traffic_shaper::tokens_available;
pub use traffic_shaper::xorshift64 as ts_xorshift64;
pub use traffic_shaper::xorshift_f64 as ts_xorshift_f64;
pub use traffic_shaper::DropPolicy;
pub use traffic_shaper::PeerShaperStats;
pub use traffic_shaper::PeerTokenBucket;
pub use traffic_shaper::PeerTrafficClass;
pub use traffic_shaper::PeerTrafficShaper;
pub use traffic_shaper::QueueEntry;
pub use traffic_shaper::QueuingDiscipline;
pub use traffic_shaper::ShaperConfig;
pub use traffic_shaper::ShaperError;
pub use traffic_shaper::ShaperEvent;
pub use traffic_shaper::ShaperStats;
pub use traffic_shaper::TrafficClass;
pub use traffic_shaper::TrafficShaper;
pub use traffic_shaper::TrafficToken;
pub use adaptive_lookup::AdaptiveLookupScheduler;
pub use adaptive_lookup::LookupSchedulerStats;
pub use adaptive_lookup::PeerLatencyTracker;
pub use adaptive_lookup::ALPHA_DEFAULT;
pub use adaptive_lookup::ALPHA_MAX;
pub use adaptive_lookup::ALPHA_MIN;
pub use adaptive_polling::ActivityLevel;
pub use adaptive_polling::AdaptivePolling;
pub use adaptive_polling::AdaptivePollingConfig;
pub use adaptive_polling::AdaptivePollingError;
pub use adaptive_polling::AdaptivePollingStats;
pub use arm_profiler::ArmDevice;
pub use arm_profiler::ArmProfiler;
pub use arm_profiler::PerformanceSample;
pub use arm_profiler::PerformanceStats;
pub use arm_profiler::ProfilerConfig;
pub use arm_profiler::ProfilerError;
pub use auto_tuner::AutoTuner;
pub use auto_tuner::AutoTunerConfig;
pub use auto_tuner::AutoTunerError;
pub use auto_tuner::AutoTunerStats;
pub use auto_tuner::SystemResources;
pub use auto_tuner::WorkloadProfile;
pub use background_mode::BackgroundModeConfig;
pub use background_mode::BackgroundModeError;
pub use background_mode::BackgroundModeManager;
pub use background_mode::BackgroundModeStats;
pub use background_mode::BackgroundState;
pub use batch_resolver::BatchCidResolver;
pub use batch_resolver::BatchResolverStats;
pub use batch_resolver::BatchResolverStatsSnapshot;
pub use batch_resolver::CachedResult;
pub use batch_resolver::LookupHandle;
pub use batch_resolver::PendingLookup;
pub use batch_resolver::PrefetchScheduler;
pub use benchmarking::BenchmarkConfig;
pub use benchmarking::BenchmarkError;
pub use benchmarking::BenchmarkResult;
pub use benchmarking::BenchmarkType;
pub use benchmarking::PerformanceBenchmark;
pub use bitswap::Bitswap;
pub use bitswap::BitswapEvent;
pub use bitswap::BitswapMessage;
pub use bitswap::BitswapStats;
pub use bootstrap::BootstrapConfig;
pub use bootstrap::BootstrapManager;
pub use bootstrap::BootstrapStats;
pub use bootstrap_coordinator::BootstrapCoordinator;
pub use bootstrap_coordinator::BootstrapPeer;
pub use bootstrap_coordinator::BootstrapStats as CoordinatorBootstrapStats;
pub use bootstrap_coordinator::BootstrapStatsSnapshot;
pub use bootstrap_coordinator::DiscoveryRecord;
pub use capability_registry::Capability;
pub use capability_registry::CapabilityAdvertisement;
pub use capability_registry::CapabilityRegistryStats;
pub use capability_registry::NodeCapabilities;
pub use capability_registry::NodeCapability;
pub use capability_registry::NodeCapabilityRegistry;
pub use capability_registry::PeerCapabilityRegistry;
pub use cert_pin::CertFingerprint;
pub use cert_pin::CertPinStore;
pub use cert_pin::PeerCertPin;
pub use cert_pin::PinPolicy;
pub use cert_pin::VerificationResult;
pub use churn_resilience::AdaptiveRefreshConfig;
pub use churn_resilience::AdaptiveRefreshScheduler;
pub use churn_resilience::ChurnEventType;
pub use churn_resilience::ChurnMetrics;
pub use churn_resilience::ChurnResilienceManager;
pub use churn_resilience::PeerChurnEvent;
pub use churn_resilience::PeerChurnTracker;
pub use connection_manager::ConnectionDirection;
pub use connection_manager::ConnectionLimitsConfig;
pub use connection_manager::ConnectionManager;
pub use connection_manager::ConnectionManagerStats;
pub use connection_migration::ConnectionMigrationManager;
pub use connection_migration::MigrationAttempt;
pub use connection_migration::MigrationConfig;
pub use connection_migration::MigrationError;
pub use connection_migration::MigrationState;
pub use connection_migration::MigrationStats;
pub use dht::DhtConfig;
pub use dht::DhtHealth;
pub use dht::DhtHealthStatus;
pub use dht::DhtManager;
pub use dht::DhtStats;
pub use dht::ProviderReannouncer;
pub use dht::ReannounceStats;
pub use dht_provider::DhtCapabilities;
pub use dht_provider::DhtPeerInfo;
pub use dht_provider::DhtProvider;
pub use dht_provider::DhtProviderError;
pub use dht_provider::DhtProviderRegistry;
pub use dht_provider::DhtProviderStats;
pub use dht_provider::DhtQueryResult;
pub use diagnostics::ConfigDiagnostics;
pub use diagnostics::ConfigIssue;
pub use diagnostics::DiagnosticResult;
pub use diagnostics::DiagnosticTest;
pub use diagnostics::NetworkDiagnostics;
pub use diagnostics::PerformanceMetrics;
pub use diagnostics::TroubleshootingGuide;
pub use facade::NetworkFacade;
pub use facade::NetworkFacadeBuilder;
pub use fallback::FallbackConfig;
pub use fallback::FallbackManager;
pub use fallback::FallbackResult;
pub use fallback::FallbackStrategy;
pub use fallback::RetryStats;
pub use geo_routing::GeoLocation;
pub use geo_routing::GeoPeer;
pub use geo_routing::GeoRegion;
pub use geo_routing::GeoRouter;
pub use geo_routing::GeoRouterConfig;
pub use geo_routing::GeoRouterStats;
pub use gossipsub::topics as gossipsub_topics;
pub use gossipsub::GossipSubConfig;
pub use gossipsub::GossipSubError;
pub use gossipsub::GossipSubManager;
pub use gossipsub::GossipSubMessage;
pub use gossipsub::GossipSubStats;
pub use gossipsub::IpfrsTopic;
pub use gossipsub::MeshHealthMonitor;
pub use gossipsub::MeshHealthStatus;
pub use gossipsub::MessageId;
pub use gossipsub::PeerScore;
pub use gossipsub::TopicId;
pub use gossipsub::TopicMessage;
pub use gossipsub::TopicSubscription;
pub use health::ComponentHealth;
pub use health::HealthChecker;
pub use health::HealthHistory;
pub use health::NetworkHealth;
pub use health::NetworkHealthStatus;
pub use identity::IdentityError;
pub use identity::PeerIdentityManager;
pub use identity::PreviousKeypair;
pub use identity::RotationRecord;
pub use ipfs_compat::ipfs_test_config;
pub use ipfs_compat::test_ipfs_connectivity;
pub use ipfs_compat::IpfsCompatTestResults;
pub use ipfs_compat::IPFS_BOOTSTRAP_NODES;
pub use ipfs_compat::TEST_CIDS;
pub use load_tester::LoadTestConfig;
pub use load_tester::LoadTestError;
pub use load_tester::LoadTestMetrics;
pub use load_tester::LoadTestResults;
pub use load_tester::LoadTestType;
pub use load_tester::LoadTester;
pub use logging::connection_span;
pub use logging::dht_span;
pub use logging::network_span;
pub use logging::LogLevel;
pub use logging::LoggingConfig;
pub use logging::NetworkEventType;
pub use logging::OperationContext;
pub use lookup_cache::CachedProviders;
pub use lookup_cache::LookupCache;
pub use lookup_cache::LookupCacheConfig;
pub use lookup_cache::LookupCacheStats;
pub use lookup_cache::ParallelLookupConfig;
pub use lookup_cache::ParallelLookupExecutor;
pub use lookup_cache::ParallelLookupResult;
pub use memory_monitor::ComponentMemory;
pub use memory_monitor::MemoryMonitor;
pub use memory_monitor::MemoryMonitorConfig;
pub use memory_monitor::MemoryMonitorError;
pub use memory_monitor::MemoryStats;
pub use mesh_repair::MeshRepairConfig;
pub use mesh_repair::MeshRepairCoordinator;
pub use mesh_repair::MeshRepairState;
pub use metrics::BandwidthMetricsSnapshot;
pub use metrics::ConnectionMetricsSnapshot;
pub use metrics::DhtMetricsSnapshot;
pub use metrics::MetricsSnapshot;
pub use metrics::NetworkMetrics;
pub use metrics::SharedMetrics;
pub use metrics_aggregator::AggregatedStatistics;
pub use metrics_aggregator::AggregatorConfig;
pub use metrics_aggregator::MetricStatistics;
pub use metrics_aggregator::MetricsAggregator;
pub use metrics_aggregator::TimeWindow;
pub use multipath_quic::MultipathConfig;
pub use multipath_quic::MultipathError;
pub use multipath_quic::MultipathQuicManager;
pub use multipath_quic::MultipathStats;
pub use multipath_quic::NetworkPath;
pub use multipath_quic::PathId;
pub use multipath_quic::PathQuality;
pub use multipath_quic::PathSelectionStrategy;
pub use multipath_quic::PathState;
pub use nat_traversal::HolePunchAttempt;
pub use nat_traversal::HolePunchStatus;
pub use nat_traversal::NatTraversalConfig;
pub use nat_traversal::NatTraversalManager;
pub use nat_traversal::NatTraversalStats;
pub use nat_traversal::NatType;
pub use nat_traversal::StunBinding;
pub use nat_traversal::TraversalStrategy;
pub use network_monitor::InterfaceType;
pub use network_monitor::NetworkChange;
pub use network_monitor::NetworkInterface;
pub use network_monitor::NetworkMonitor;
pub use network_monitor::NetworkMonitorConfig;
pub use network_monitor::NetworkMonitorError;
pub use network_monitor::NetworkMonitorStats;
pub use network_simulator::NetworkCondition;
pub use network_simulator::NetworkSimulator;
pub use network_simulator::SimulatorConfig;
pub use network_simulator::SimulatorError;
pub use network_simulator::SimulatorStats;
pub use node::BucketInfo;
pub use node::ConnectionEndpoint;
pub use node::InferenceWaiters;
pub use node::KademliaConfig;
pub use node::NatTraversalMetrics;
pub use node::NetworkConfig;
pub use node::NetworkEvent;
pub use node::NetworkHealthLevel;
pub use node::NetworkHealthSummary;
pub use node::NetworkNode;
pub use node::NetworkStats;
pub use node::RelayConfig;
pub use node::RoutingTableInfo;
pub use offline_queue::OfflineQueue;
pub use offline_queue::OfflineQueueConfig;
pub use offline_queue::OfflineQueueError;
pub use offline_queue::OfflineQueueStats;
pub use offline_queue::QueuedRequest;
pub use offline_queue::QueuedRequestType;
pub use offline_queue::RequestPriority;
pub use peer::PeerInfo;
pub use peer::PeerStore;
pub use peer::PeerStoreConfig;
pub use peer::PeerStoreStats;
pub use peer_capabilities::CapabilityConfig;
pub use peer_capabilities::CapabilityRegistry;
pub use peer_capabilities::CapabilityStats;
pub use peer_capabilities::PeerCapability;
pub use peer_capabilities::PeerCapabilitySet;
pub use peer_selector::PeerSelector;
pub use peer_selector::PeerSelectorConfig;
pub use peer_selector::PeerSelectorStats;
pub use peer_selector::SelectedPeer;
pub use peer_selector::SelectionCriteria;
pub use policy::BandwidthPolicy;
pub use policy::ConnectionPolicy;
pub use policy::ContentPolicy;
pub use policy::PolicyAction;
pub use policy::PolicyConfig;
pub use policy::PolicyEngine;
pub use policy::PolicyError;
pub use policy::PolicyResult;
pub use policy::PolicyStats;
pub use presets::NetworkPreset;
pub use protocol::ProtocolCapabilities;
pub use protocol::ProtocolHandler;
pub use protocol::ProtocolId;
pub use protocol::ProtocolRegistry;
pub use protocol::ProtocolVersion;
pub use provider_renewal::ProviderRecord;
pub use provider_renewal::ProviderRenewalScheduler;
pub use provider_renewal::RenewalConfig;
pub use provider_renewal::DEFAULT_PROVIDER_TTL_SECS;
pub use provider_renewal::DEFAULT_RENEWAL_THRESHOLD;
pub use providers::ProviderCache;
pub use providers::ProviderCacheConfig;
pub use providers::ProviderCacheStats;
pub use quality_predictor::QualityPrediction;
pub use quality_predictor::QualityPredictor;
pub use quality_predictor::QualityPredictorConfig;
pub use quality_predictor::QualityPredictorError;
pub use quality_predictor::QualityPredictorStats;
pub use query_batcher::PendingQuery;
pub use query_batcher::QueryBatchResult;
pub use query_batcher::QueryBatcher;
pub use query_batcher::QueryBatcherConfig;
pub use query_batcher::QueryBatcherError;
pub use query_batcher::QueryBatcherStats;
pub use query_batcher::QueryType;
pub use query_optimizer::QueryMetrics;
pub use query_optimizer::QueryOptimizer;
pub use query_optimizer::QueryOptimizerConfig;
pub use query_optimizer::QueryResult;
pub use quic::CongestionControl;
pub use quic::QuicConfig;
pub use quic::QuicConnectionInfo;
pub use quic::QuicConnectionState;
pub use quic::QuicMonitor;
pub use quic::QuicStats;
pub use rate_limiter::AtomicRateLimiterStats;
pub use rate_limiter::AtomicTokenBucket;
pub use rate_limiter::BackpressureController;
pub use rate_limiter::BackpressureSignal;
pub use rate_limiter::ConnectionPriority;
pub use rate_limiter::ConnectionRateLimiter;
pub use rate_limiter::GlobalLimiter;
pub use rate_limiter::PeerLimiter;
pub use rate_limiter::PeerRateLimiter;
pub use rate_limiter::PeerRateLimiterConfig;
pub use rate_limiter::PeerRateLimiterStats;
pub use rate_limiter::RateLimitDecision;
pub use rate_limiter::RateLimitResult;
pub use rate_limiter::RateLimiter;
pub use rate_limiter::RateLimiterConfig;
pub use rate_limiter::RateLimiterError;
pub use rate_limiter::RateLimiterStats;
pub use rate_limiter::RateLimiterStatsSnapshot;
pub use relay::RelayError;
pub use relay::RelayManager;
pub use relay::RelayReservation;
pub use reputation::PeerReputation;
pub use reputation::PeerReputationEvent;
pub use reputation::PeerReputationStats;
pub use reputation::PeerReputationStatsSnapshot;
pub use reputation::PeerReputationTracker;
pub use reputation::PeerTier;
pub use reputation::ReputationConfig;
pub use reputation::ReputationEvent;
pub use reputation::ReputationManager;
pub use reputation::ReputationScore;
pub use reputation::ReputationStats;
pub use semantic_dht::DistanceMetric;
pub use semantic_dht::LshConfig;
pub use semantic_dht::LshHash;
pub use semantic_dht::MergeResult;
pub use semantic_dht::NamespaceId;
pub use semantic_dht::PartialSyncConfig;
pub use semantic_dht::PartialSyncStats;
pub use semantic_dht::SearchResult;
pub use semantic_dht::SemanticDht;
pub use semantic_dht::SemanticDhtConfig;
pub use semantic_dht::SemanticDhtError;
pub use semantic_dht::SemanticDhtMetrics;
pub use semantic_dht::SemanticDhtStats;
pub use semantic_dht::SemanticNamespace;
pub use semantic_dht::SemanticQuery;
pub use semantic_dht::SemanticResult;
pub use semantic_dht::ShardBalancer;
pub use semantic_dht::ShardBalancerConfig;
pub use semantic_dht::VectorAnnotatedRecord;
pub use session::Session;
pub use session::SessionConfig;
pub use session::SessionManager;
pub use session::SessionMetadata;
pub use session::SessionState as ConnectionSessionState;
pub use session::SessionStats;
pub use throttle::BandwidthThrottle;
pub use throttle::ThrottleConfig;
pub use throttle::ThrottleError;
pub use throttle::ThrottleStats;
pub use throttle::TrafficDirection;
pub use topic_router::PrioritizedMessage;
pub use topic_router::TopicConfig;
pub use topic_router::TopicError;
pub use topic_router::TopicRouter;
pub use topic_router::TopicRouterStats;
pub use topic_router::TopicRouterStatsSnapshot;
pub use tor::CircuitId;
pub use tor::CircuitInfo;
pub use tor::CircuitState;
pub use tor::HiddenServiceConfig;
pub use tor::OnionAddress;
pub use tor::StreamId;
pub use tor::TorConfig;
pub use tor::TorError;
pub use tor::TorManager;
pub use tor::TorStats;
pub use traffic_analyzer::AnomalyType;
pub use traffic_analyzer::PatternType;
pub use traffic_analyzer::PeerProfile;
pub use traffic_analyzer::TrafficAnalysis;
pub use traffic_analyzer::TrafficAnalyzer;
pub use traffic_analyzer::TrafficAnalyzerConfig;
pub use traffic_analyzer::TrafficAnalyzerError;
pub use traffic_analyzer::TrafficAnalyzerStats;
pub use traffic_analyzer::TrafficAnomaly;
pub use traffic_analyzer::TrafficEvent;
pub use traffic_analyzer::TrafficPattern;
pub use traffic_analyzer::TrendDirection;
pub use routing_table::ContentRoutingTable;
pub use routing_table::RoutingEntry;
pub use routing_table::RoutingError;
pub use routing_table::RoutingTableStats;
pub use routing_table::DEFAULT_ENTRY_TTL;
pub use routing_table::DEFAULT_MAX_PROVIDERS;
pub use content_routing_cache::CacheConfig as CrcCacheConfig;
pub use content_routing_cache::CacheStats as CrcCacheStats;
pub use content_routing_cache::ContentRoutingCache;
pub use content_routing_cache::CrcProviderRecord;
pub use content_routing_cache::NegativeCacheEntry;
pub use content_routing_cache::RoutingHint;
pub use content_routing_cache::DEFAULT_HINT_TTL_MS as CRC_DEFAULT_HINT_TTL_MS;
pub use content_routing_cache::DEFAULT_MAX_HINTS as CRC_DEFAULT_MAX_HINTS;
pub use content_routing_cache::DEFAULT_MAX_NEGATIVE as CRC_DEFAULT_MAX_NEGATIVE;
pub use content_routing_cache::DEFAULT_MAX_PROVIDERS as CRC_DEFAULT_MAX_PROVIDERS;
pub use content_routing_cache::DEFAULT_NEGATIVE_TTL_MS as CRC_DEFAULT_NEGATIVE_TTL_MS;
pub use content_routing_cache::DEFAULT_PROVIDER_TTL_MS as CRC_DEFAULT_PROVIDER_TTL_MS;
pub use routing_table_sharding::EvictionPolicy;
pub use routing_table_sharding::NodeId as RtsNodeId;
pub use routing_table_sharding::RoutingEntry as RtsRoutingEntry;
pub use routing_table_sharding::RoutingTableSharding;
pub use routing_table_sharding::ShardConfig;
pub use routing_table_sharding::ShardId;
pub use routing_table_sharding::ShardStats;
pub use routing_table_manager::bucket_index as rtm_bucket_index;
pub use routing_table_manager::xor_distance as rtm_xor_distance;
pub use routing_table_manager::BucketEntry;
pub use routing_table_manager::KBucket;
pub use routing_table_manager::NodeId;
pub use routing_table_manager::RoutingTableManager;
pub use routing_table_manager::RoutingTableStats as RtmRoutingTableStats;
pub use routing_table_manager::DEFAULT_ALPHA as RTM_DEFAULT_ALPHA;
pub use routing_table_manager::DEFAULT_K as RTM_DEFAULT_K;
pub use routing_table_manager::DEFAULT_REPLACEMENT_CACHE_SIZE as RTM_DEFAULT_REPLACEMENT_CACHE_SIZE;
pub use peer_capability_negotiator::CapabilityPolicy;
pub use peer_capability_negotiator::CapabilityVersion;
pub use peer_capability_negotiator::NegotiationOffer;
pub use peer_capability_negotiator::NegotiationRecord;
pub use peer_capability_negotiator::NegotiationResult as PcnNegotiationResult;
pub use peer_capability_negotiator::NegotiatorConfig as PcnNegotiatorConfig;
pub use peer_capability_negotiator::NegotiatorStats;
pub use peer_capability_negotiator::PeerCapability as PcnPeerCapability;
pub use peer_capability_negotiator::PeerCapabilityNegotiator;
pub use protocol_negotiator::NegotiationResult;
pub use protocol_negotiator::NegotiatorConfig;
pub use protocol_negotiator::PeerNegotiationResult;
pub use protocol_negotiator::PeerNegotiatorStats;
pub use protocol_negotiator::PeerProtocolNegotiator;
pub use protocol_negotiator::PeerProtocolVersion;
pub use protocol_negotiator::PnNegotiatedSession;
pub use protocol_negotiator::PnNegotiationOutcome;
pub use protocol_negotiator::PnNegotiationRecord;
pub use protocol_negotiator::PnNegotiationStats;
pub use protocol_negotiator::PnNegotiatorConfig;
pub use protocol_negotiator::PnProtocolId;
pub use protocol_negotiator::PnProtocolNegotiator;
pub use protocol_negotiator::PnProtocolVersion;
pub use protocol_negotiator::PnSessionId;
pub use protocol_negotiator::ProtocolFeature;
pub use protocol_negotiator::ProtocolNegotiator;
pub use protocol_negotiator::ProtocolOffer;
pub use protocol_handshake::FeatureFlag;
pub use protocol_handshake::HandshakeError;
pub use protocol_handshake::HandshakeOffer;
pub use protocol_handshake::HandshakeResult;
pub use protocol_handshake::HandshakeStats;
pub use protocol_handshake::HandshakeStatsSnapshot;
pub use protocol_handshake::ProtocolHandshaker;
pub use protocol_handshake::ProtocolVersion as HandshakeProtocolVersion;
pub use protocol_handshake::DEFAULT_MAX_FRAME_SIZE;
pub use protocol_version::CompatibilityLevel;
pub use protocol_version::NegotiationResult as PvNegotiationResult;
pub use protocol_version::ProtocolDescriptor;
pub use protocol_version::ProtocolVersion as PvProtocolVersion;
pub use protocol_version::ProtocolVersionManager;
pub use protocol_version::VersionStats;
pub use gossip_metrics::GossipEvent;
pub use gossip_metrics::GossipMetricsSnapshot;
pub use gossip_metrics::MessageTrace;
pub use gossip_metrics::PeerGossipMetrics;
pub use gossip_overlay::GossipFanout;
pub use gossip_overlay::GossipMessage;
pub use gossip_overlay::GossipOverlayManager;
pub use gossip_overlay::GossipState;
pub use gossip_overlay::GossipStats;
pub use gossip_overlay::GossipStatsSnapshot;
pub use connection_pool::ConnectionPool;
pub use connection_pool::ConnectionState;
pub use connection_pool::PeerConnectionPool;
pub use connection_pool::PeerPoolConfig;
pub use connection_pool::PeerPoolStats;
pub use connection_pool::PeerPooledConnection;
pub use connection_pool::PoolConfig;
pub use connection_pool::PoolConnectionState;
pub use connection_pool::PoolError;
pub use connection_pool::PoolStats;
pub use connection_pool::PoolStatsSnapshot;
pub use connection_pool::PooledConnection;
pub use message_router::HandlerRegistration;
pub use message_router::MessagePriority;
pub use message_router::MessageRouter;
pub use message_router::MessageRouterStats;
pub use message_router::MessageType;
pub use message_router::PeerMessageRouter;
pub use message_router::PeerRoutedMessage;
pub use message_router::RouteRule;
pub use message_router::RoutedMessage;
pub use message_router::RouterError;
pub use message_router::RouterStats;
pub use message_router::RouterStatsSnapshot;
pub use subscription_router::fnv1a_64 as mr_fnv1a_64;
pub use subscription_router::DeliveryRecord;
pub use subscription_router::MessageTopic;
pub use subscription_router::RoutingMessage;
pub use subscription_router::SubRouterStats;
pub use subscription_router::Subscription;
pub use subscription_router::SubscriptionFilter;
pub use subscription_router::SubscriptionRouter;
pub use request_dedup::AcquireResult;
pub use request_dedup::DedupStats;
pub use request_dedup::DedupStatsSnapshot;
pub use request_dedup::RequestDeduplicator;
pub use request_dedup::ResolveResult;
pub use request_dedup::WaiterHandle;
pub use utils::exponential_backoff;
pub use utils::format_bandwidth;
pub use utils::format_bytes;
pub use utils::format_duration;
pub use utils::is_local_addr;
pub use utils::is_public_addr;
pub use utils::jittered_backoff;
pub use utils::moving_average;
pub use utils::parse_multiaddr;
pub use utils::parse_multiaddrs;
pub use utils::peers_match;
pub use utils::percentage;
pub use utils::truncate_peer_id;
pub use utils::validate_alpha;
pub use peer_discovery_manager::ConnectOutcome;
pub use peer_discovery_manager::DiscoveryConfig as PdmDiscoveryConfig;
pub use peer_discovery_manager::DiscoveryMethod;
pub use peer_discovery_manager::DiscoveryStats as PdmDiscoveryStats;
pub use peer_discovery_manager::PeerCandidate;
pub use peer_discovery_manager::PeerDiscoveryManager as PdmPeerDiscoveryManager;
pub use discovery_cache::DiscoveryCacheStats;
pub use discovery_cache::DiscoverySource;
pub use discovery_cache::PeerDiscoveryCache;
pub use discovery_cache::PeerRecord;
pub use discovery_lru::CacheEntry as LruCacheEntry;
pub use discovery_lru::DiscoveryCacheConfig as LruDiscoveryCacheConfig;
pub use discovery_lru::LruDiscoveryCacheStats;
pub use discovery_lru::LruPeerDiscoveryCache;
pub use circuit_breaker::CallResult;
pub use circuit_breaker::CircuitBreakerRegistry;
pub use circuit_breaker::CircuitBreakerState;
pub use circuit_breaker::CircuitConfig;
pub use circuit_breaker::CircuitStats;
pub use circuit_breaker::PeerCircuit;
pub use circuit_breaker::PeerCircuitBreaker;
pub use circuit_breaker::PeerCircuitState;
pub use circuit_breaker::RegistryStats;
pub use topology_mapper::NetworkTopologyMapper as LegacyNetworkTopologyMapper;
pub use topology_mapper::PathResult;
pub use topology_mapper::PeerEdge;
pub use topology_mapper::TopoEdge;
pub use topology_mapper::TopoNode;
pub use topology_mapper::TopologyNode;
pub use topology_mapper::TopologySnapshot;
pub use topology_mapper::TopologyStats;
pub use message_dedup::DedupConfig;
pub use message_dedup::DedupEntry;
pub use message_dedup::MessageDeduplicator;
pub use message_dedup::MsgDedupStats;
pub use message_dedup::MsgId;
pub use message_batcher::BatchConfig;
pub use message_batcher::BatchFlush;
pub use message_batcher::BatchMessage;
pub use message_batcher::BatcherStats;
pub use message_batcher::FlushReason;
pub use message_batcher::PeerMessageBatcher;
pub use message_codec::CodecConfig;
pub use message_codec::CodecError;
pub use message_codec::CodecStats;
pub use message_codec::EncodedMessage;
pub use message_codec::PeerMessageCodec;
pub use message_prioritizer::AgingConfig;
pub use message_prioritizer::MessagePriority as PeerMessagePriority;
pub use message_prioritizer::PeerMessagePrioritizer;
pub use message_prioritizer::PrioritizedMessage as PeerPrioritizedMessage;
pub use message_prioritizer::PrioritizerStats;
pub use priority_queue::MessagePriority as PeerQueuePriority;
pub use priority_queue::PeerPriorityQueue;
pub use priority_queue::QueueConfig;
pub use priority_queue::QueueStats;
pub use priority_queue::QueuedMessage;
pub use latency_tracker::LatencyBucket;
pub use latency_tracker::LatencyTrackerStats;
pub use latency_tracker::PeerLatency;
pub use latency_tracker::PeerLatencyTracker as HistogramLatencyTracker;
pub use latency_predictor::LatencySample;
pub use latency_predictor::PeerLatencyPredictor;
pub use latency_predictor::PeerLatencyState;
pub use latency_predictor::PredictorConfig;
pub use latency_predictor::PredictorStats;
pub use latency_predictor::TrendDirection as LatencyTrendDirection;
pub use peer_session::PeerSession as AuthPeerSession;
pub use peer_session::PeerSessionManager as AuthPeerSessionManager;
pub use peer_session::SessionCapability;
pub use peer_session::SessionManagerConfig as AuthSessionManagerConfig;
pub use peer_session::SessionToken;
pub use session_manager::PeerSession;
pub use session_manager::PeerSessionEntry;
pub use session_manager::PeerSessionManager;
pub use session_manager::PeerSessionState;
pub use session_manager::SessionDirection;
pub use session_manager::SessionManagerConfig;
pub use session_manager::SessionManagerStats;
pub use session_manager::SessionState;
pub use connection_limiter::LimiterConfig;
pub use connection_limiter::LimiterStats;
pub use connection_limiter::PeerConnectionInfo as LimiterPeerConnectionInfo;
pub use connection_limiter::PeerConnectionLimiter;
pub use connection_health::ConnectionEvent;
pub use connection_health::ConnectionHealthChecker;
pub use connection_health::ConnectionHealthState;
pub use connection_health::ConnectionRecord;
pub use connection_health::HealthCheckerConfig;
pub use announcement_manager::AnnouncementChannel;
pub use announcement_manager::AnnouncementConfig;
pub use announcement_manager::AnnouncementRecord;
pub use announcement_manager::AnnouncementStats;
pub use announcement_manager::PeerAnnouncementManager;
pub use routing_auditor::AuditFinding;
pub use routing_auditor::AuditSeverity;
pub use routing_auditor::AuditorConfig;
pub use routing_auditor::BucketInfo as AuditorBucketInfo;
pub use routing_auditor::RoutingTableAuditor;
pub use routing_auditor::DEFAULT_MAX_CAPACITY;
pub use peer_reputation::PeerReputationManager;
pub use peer_reputation::PrReputationConfig;
pub use peer_reputation::PrReputationEvent;
pub use peer_reputation::PrReputationScore;
pub use peer_reputation::PrReputationStats;
pub use ban_list::BanConfig;
pub use ban_list::BanEntry;
pub use ban_list::BanKind;
pub use ban_list::BanListStats;
pub use ban_list::PeerBanList;
pub use behavior_classifier::BehaviorProfile;
pub use behavior_classifier::BehaviorSignal;
pub use behavior_classifier::ClassifierStats;
pub use behavior_classifier::PeerBehaviorClassifier;
pub use sync_coordinator::PeerSyncCoordinator;
pub use sync_coordinator::SyncDirection;
pub use sync_coordinator::SyncPhase;
pub use sync_coordinator::SyncSession;
pub use sync_coordinator::SyncStats;
pub use peer_sync_protocol::ConflictPolicy;
pub use peer_sync_protocol::PeerSyncProtocol;
pub use peer_sync_protocol::PspSyncStats;
pub use peer_sync_protocol::SyncEntry;
pub use peer_sync_protocol::SyncError;
pub use peer_sync_protocol::SyncOperation;
pub use peer_sync_protocol::SyncState;
pub use peer_sync_protocol::VectorClock;
pub use congestion_controller::CccAlgorithm;
pub use congestion_controller::CccCongestionController;
pub use congestion_controller::CccConnId;
pub use congestion_controller::CccConnection;
pub use congestion_controller::CccControllerConfig;
pub use congestion_controller::CccControllerStats;
pub use congestion_controller::CccDecision;
pub use congestion_controller::CccEvent;
pub use congestion_controller::CccEventType;
pub use congestion_controller::CccState;
pub use congestion_controller::CongestionConfig;
pub use congestion_controller::CongestionController;
pub use congestion_controller::CongestionEvent;
pub use congestion_controller::CongestionState;
pub use congestion_controller::Decision;
pub use congestion_controller::MultiPeerCongestionManager;
pub use congestion_controller::PeerCongestionController;
pub use congestion_controller::WindowStats;
pub use load_balancer::AdaptiveLbStats;
pub use load_balancer::AdaptiveLoadBalancer;
pub use load_balancer::LbAlgorithm;
pub use load_balancer::LbDecision;
pub use load_balancer::LbPeer;
pub use load_balancer::LbRequest;
pub use load_balancer::LbStats;
pub use load_balancer::LbStrategy;
pub use load_balancer::PeerLoad;
pub use load_balancer::PeerLoadBalancer;
pub use trust_manager::PeerTrustManager;
pub use trust_manager::TrustAttestation;
pub use trust_manager::TrustLevel;
pub use trust_manager::TrustManagerStats;
pub use trust_manager::TrustRecord;
pub use flow_control::FlowControlConfig;
pub use flow_control::FlowControlStats;
pub use flow_control::FlowWindow;
pub use flow_control::PeerFlowControl;
pub use gossip_filter::FilterConfig;
pub use gossip_filter::FilterStats;
pub use gossip_filter::FilterVerdict;
pub use gossip_filter::GossipMessage as FilterGossipMessage;
pub use gossip_filter::PeerGossipFilter;
pub use gossip_content_filter::ContentGossipFilter;
pub use gossip_content_filter::FilterAction;
pub use gossip_content_filter::FilterRule;
pub use gossip_content_filter::GossipFilterStats;
pub use bloom_filter::BloomConfig;
pub use bloom_filter::BloomFilter;
pub use bloom_filter::BloomStats;
pub use bloom_filter::PeerBloomFilter;
pub use churn_manager::ChurnEvent;
pub use churn_manager::ChurnManagerConfig;
pub use churn_manager::ChurnStats;
pub use churn_manager::ChurnWindow;
pub use churn_manager::PeerChurnManager;
pub use churn_manager::PeerLifetime;
pub use request_priority_queue::PeerRequest;
pub use request_priority_queue::PeerRequestQueue;
pub use request_priority_queue::PriorityQueueStats as RequestQueueStats;
pub use request_priority_queue::RequestPriority as PeerRequestPriority;
pub use health_checker::HealthCheckerStats as PeerHealthCheckerStats;
pub use health_checker::HealthTier as PeerHealthTier;
pub use health_checker::HeartbeatRecord;
pub use health_checker::PeerHealthChecker;
pub use health_checker::PeerHealthCheckerConfig;
pub use scoreboard::PeerScoreboard;
pub use scoreboard::SbPeerScore;
pub use scoreboard::ScoreComponent;
pub use scoreboard::ScoreboardStats;
pub use peer_scoring::PeerMetrics;
pub use peer_scoring::PeerScoringSystem;
pub use peer_scoring::PsPeerScore;
pub use peer_scoring::PsScoringDimension;
pub use peer_scoring::ScoreTier;
pub use peer_scoring::ScoringError;
pub use peer_scoring::ScoringStats;
pub use peer_scoring::ScoringWeights;
pub use overlay_network::OverlayError;
pub use overlay_network::OverlayMessage;
pub use overlay_network::OverlayNetworkManager;
pub use overlay_network::OverlayNode;
pub use overlay_network::OverlayRoute;
pub use overlay_network::OverlayStats;
pub use overlay_network::OverlayTopology;
pub use overlay_network_manager::fnv1a_64 as onm_fnv1a_64;
pub use overlay_network_manager::xorshift64 as onm_xorshift64;
pub use overlay_network_manager::OverlayConfig;
pub use overlay_network_manager::OverlayError as OnmOverlayError;
pub use overlay_network_manager::OverlayNetworkManager as OnmOverlayNetworkManager;
pub use overlay_network_manager::OverlayNode as OnmOverlayNode;
pub use overlay_network_manager::OverlayStats as OnmOverlayStats;
pub use overlay_network_manager::OverlayTopology as OnmOverlayTopology;
pub use overlay_network_manager::RoutingPolicy;
pub use overlay_network_manager::VirtualRoute;
pub use flood_protection::fnv1a_message_id;
pub use flood_protection::CheckResult as FpCheckResult;
pub use flood_protection::FloodConfig;
pub use flood_protection::FloodProtection;
pub use flood_protection::FloodStats;
pub use flood_protection::MessageId as FpMessageId;
pub use flood_protection::PeerState as FpPeerState;
pub use flood_protection::ViolationRecord;
pub use flood_protection::ViolationType;
pub use security_monitor::IncidentStatus;
pub use security_monitor::NetworkSecurityMonitor;
pub use security_monitor::SecurityEvent;
pub use security_monitor::SecurityIncident;
pub use security_monitor::SecurityMonitorStats;
pub use security_monitor::ThreatLevel;
pub use security_monitor::ThreatScore;
pub use security_monitor::ThreatType;
pub use stream_multiplexer::priority_from_u8 as smx_priority_from_u8;
pub use stream_multiplexer::xorshift64 as smx_xorshift64;
pub use stream_multiplexer::FrameFlags;
pub use stream_multiplexer::LogicalStream;
pub use stream_multiplexer::MultiplexerConfig;
pub use stream_multiplexer::MultiplexerStats;
pub use stream_multiplexer::MuxError;
pub use stream_multiplexer::MuxEvent;
pub use stream_multiplexer::MuxStats;
pub use stream_multiplexer::StreamFrame;
pub use stream_multiplexer::StreamId as SmxStreamId;
pub use stream_multiplexer::StreamInfo;
pub use stream_multiplexer::StreamMultiplexer;
pub use stream_multiplexer::StreamPriority;
pub use stream_multiplexer::StreamState as SmxStreamState;
pub use stream_multiplexer::FLAG_FIN as SMX_FLAG_FIN;
pub use stream_multiplexer::FLAG_RST as SMX_FLAG_RST;
pub use stream_multiplexer::FLAG_SYN as SMX_FLAG_SYN;
pub use merkle_proof_verifier::sha256 as mpv_sha256;
pub use merkle_proof_verifier::MerkleHashAlgo;
pub use merkle_proof_verifier::MerkleNode;
pub use merkle_proof_verifier::MerkleProof;
pub use merkle_proof_verifier::MerkleProofVerifier;
pub use merkle_proof_verifier::MerkleTree;
pub use merkle_proof_verifier::ProofStep;
pub use merkle_proof_verifier::VerificationResult as MpvVerificationResult;
pub use peer_bandwidth_manager::BandwidthDirection;
pub use peer_bandwidth_manager::BandwidthLimit;
pub use peer_bandwidth_manager::BandwidthManagerConfig;
pub use peer_bandwidth_manager::BandwidthManagerStats;
pub use peer_bandwidth_manager::BandwidthUsage;
pub use peer_bandwidth_manager::FairnessPolicy;
pub use peer_bandwidth_manager::PeerBandwidthManager;
pub use peer_bandwidth_manager::PeerBandwidthState;
pub use gossip_message_filter::fnv1a_64 as gmf_fnv1a_64;
pub use gossip_message_filter::FilterConfig as GmfFilterConfig;
pub use gossip_message_filter::FilterRule as GmfFilterRule;
pub use gossip_message_filter::FilterStats as GmfFilterStats;
pub use gossip_message_filter::FilterVerdict as GmfFilterVerdict;
pub use gossip_message_filter::GossipMessage as GmfGossipMessage;
pub use gossip_message_filter::GossipMessageFilter;
pub use gossip_message_filter::MessageId as GmfMessageId;
pub use peer_trust_scorer::PeerTrustProfile;
pub use peer_trust_scorer::PeerTrustScorer;
pub use peer_trust_scorer::TrustBand;
pub use peer_trust_scorer::TrustConfig;
pub use peer_trust_scorer::TrustDimension;
pub use peer_trust_scorer::TrustEvent;
pub use peer_trust_scorer::TrustScorerStats;
pub use network_event_bus::BusError;
pub use network_event_bus::EventBusConfig;
pub use network_event_bus::EventBusStats;
pub use network_event_bus::EventFilter;
pub use network_event_bus::EventTopic;
pub use network_event_bus::NebNetworkEvent;
pub use network_event_bus::NebSubscription;
pub use network_event_bus::NetworkEventBus;
pub use network_event_bus::SubscriberId;
pub use network_qos_manager::NetworkQoSManager;
pub use network_qos_manager::QoSConfig;
pub use network_qos_manager::QoSPacket;
pub use network_qos_manager::QoSStats;
pub use network_qos_manager::QueueMetrics;
pub use network_qos_manager::SLASpec;
pub use network_qos_manager::SLAViolation;
pub use network_qos_manager::TrafficClass as QosTrafficClass;
pub use flood_sub_router::FloodMessage;
pub use flood_sub_router::FloodMessageId;
pub use flood_sub_router::FloodSubRouter;
pub use flood_sub_router::FloodTopic;
pub use flood_sub_router::ForwardDecision;
pub use flood_sub_router::FsrRouterStats;
pub use flood_sub_router::RouterConfig as FsrRouterConfig;
pub use flood_sub_router::SubscriptionRecord as FsrSubscriptionRecord;
pub use peer_reputation_graph::GraphConfig;
pub use peer_reputation_graph::GraphError;
pub use peer_reputation_graph::GraphStats;
pub use peer_reputation_graph::PeerReputationGraph;
pub use peer_reputation_graph::ReputationEvent as PrgReputationEvent;
pub use peer_reputation_graph::ReputationScore as PrgReputationScore;
pub use peer_reputation_graph::TrustEdge;
pub use gossip_protocol_engine::fnv1a_64 as gpe_fnv1a_64;
pub use gossip_protocol_engine::xorshift64 as gpe_xorshift64;
pub use gossip_protocol_engine::EngineError;
pub use gossip_protocol_engine::FanoutStrategy;
pub use gossip_protocol_engine::GossipConfig;
pub use gossip_protocol_engine::GossipEvent as GpeGossipEvent;
pub use gossip_protocol_engine::GossipMessage as GpeGossipMessage;
pub use gossip_protocol_engine::GossipPeer;
pub use gossip_protocol_engine::GossipProtocolEngine;
pub use gossip_protocol_engine::GossipStats as GpeGossipStats;
pub use network_circuit_breaker::xorshift64 as ncb_xorshift64;
pub use network_circuit_breaker::BreakerError;
pub use network_circuit_breaker::CircuitCallGuard;
pub use network_circuit_breaker::CircuitEvent;
pub use network_circuit_breaker::CircuitMetrics;
pub use network_circuit_breaker::CircuitOutcome;
pub use network_circuit_breaker::NcbCircuitConfig;
pub use network_circuit_breaker::NcbCircuitState;
pub use network_circuit_breaker::NetworkCircuitBreaker;
pub use peer_discovery_protocol::xorshift64 as pdp_xorshift64;
pub use peer_discovery_protocol::DiscoveredPeer;
pub use peer_discovery_protocol::DiscoveryConfig;
pub use peer_discovery_protocol::DiscoveryError;
pub use peer_discovery_protocol::DiscoveryEvent;
pub use peer_discovery_protocol::DiscoveryStats;
pub use peer_discovery_protocol::PdpDiscoveredPeer;
pub use peer_discovery_protocol::PdpDiscoveryConfig;
pub use peer_discovery_protocol::PdpDiscoveryError;
pub use peer_discovery_protocol::PdpDiscoveryEvent;
pub use peer_discovery_protocol::PdpDiscoveryMethod;
pub use peer_discovery_protocol::PdpDiscoveryStats;
pub use peer_discovery_protocol::PeerDiscoveryProtocol;
pub use message_authenticator::fnv1a_64 as mau_fnv1a_64;
pub use message_authenticator::hmac_fnv64 as mau_hmac_fnv64;
pub use message_authenticator::xorshift64 as mau_xorshift64;
pub use message_authenticator::AuthAlgorithm;
pub use message_authenticator::AuthError;
pub use message_authenticator::AuthKey;
pub use message_authenticator::AuthPolicy;
pub use message_authenticator::AuthStats;
pub use message_authenticator::MessageAuthenticator;
pub use message_authenticator::ReplayWindow;
pub use message_authenticator::SignedMessage;
pub use connection_pool_manager::xorshift64 as cpm_xorshift64;
pub use connection_pool_manager::AcquirePolicy;
pub use connection_pool_manager::ConnState;
pub use connection_pool_manager::ConnectionPoolManager;
pub use connection_pool_manager::CpmPoolConfig;
pub use connection_pool_manager::CpmPoolError;
pub use connection_pool_manager::CpmPoolStats;
pub use connection_pool_manager::PoolEvent;
pub use connection_pool_manager::PooledConnection as CpmPooledConnection;
pub use adaptive_routing_engine::AdaptiveRoutingEngine;
pub use adaptive_routing_engine::AreRouteEntry;
pub use adaptive_routing_engine::AreRouteKey;
pub use adaptive_routing_engine::AreRoutingConfig;
pub use adaptive_routing_engine::AreRoutingPolicy;
pub use adaptive_routing_engine::AreRoutingStats;
pub use adaptive_routing_engine::RoutingEngineError;
pub use peer_load_balancer::PeerLoadBalancer as PlbPeerLoadBalancer;
pub use peer_load_balancer::PlbBalancerConfig;
pub use peer_load_balancer::PlbBalancerStats;
pub use peer_load_balancer::PlbError;
pub use peer_load_balancer::PlbPeerId;
pub use peer_load_balancer::PlbPeerState;
pub use peer_load_balancer::PlbPeerStats;
pub use peer_load_balancer::PlbRequestRecord;
pub use peer_load_balancer::PlbStrategy;
pub use network_topology_mapper::NetworkTopologyMapper;
pub use network_topology_mapper::NtmEdge;
pub use network_topology_mapper::NtmMapperConfig;
pub use network_topology_mapper::NtmMapperError;
pub use network_topology_mapper::NtmNetworkTopologyMapper;
pub use network_topology_mapper::NtmNode;
pub use network_topology_mapper::NtmSnapshot;
pub use network_topology_mapper::NtmTopologyMetrics;
pub use stream_priority_scheduler::xorshift64 as sps_xorshift64;
pub use stream_priority_scheduler::SpsError;
pub use stream_priority_scheduler::SpsSchedulerConfig;
pub use stream_priority_scheduler::SpsSchedulerStats;
pub use stream_priority_scheduler::SpsSchedulingPolicy;
pub use stream_priority_scheduler::SpsStream;
pub use stream_priority_scheduler::SpsStreamId;
pub use stream_priority_scheduler::StreamPriorityScheduler;
pub use packet_fragmentation_assembler::fnv1a_64 as pfa_fnv1a_64;
pub use packet_fragmentation_assembler::xorshift64 as pfa_xorshift64;
pub use packet_fragmentation_assembler::PacketFragmentationAssembler;
pub use packet_fragmentation_assembler::PfaAssemblerConfig;
pub use packet_fragmentation_assembler::PfaAssemblerStats;
pub use packet_fragmentation_assembler::PfaFragment;
pub use packet_fragmentation_assembler::PfaFragmentRecord;
pub use packet_fragmentation_assembler::PfaMessageId;
pub use packet_fragmentation_assembler::PfaPacketFragmentationAssembler;
pub use packet_fragmentation_assembler::PfaReassemblyBuffer;
pub use packet_fragmentation_assembler::PfaReceiveResult;
pub use libp2p;

Modules§

adaptive_bandwidth_allocator
Adaptive bandwidth allocator for peer-to-peer networks.
adaptive_lookup
Adaptive Kademlia lookup scheduler that tunes alpha (parallelism) based on observed latency.
adaptive_peer_scheduler
Adaptive Peer Scheduler
adaptive_polling
Adaptive polling intervals for power-efficient network operations
adaptive_routing_engine
Adaptive Routing Engine
adaptive_timeout
Per-peer adaptive timeout estimation using the TCP-inspired SRTT/RTTVAR algorithm.
announcement_manager
Peer Announcement Manager
anti_entropy
Gossip Anti-Entropy — Merkle-digest-based state reconciliation between peers.
arm_profiler
ARM Performance Profiling for Network Operations
auto_tuner
Automatic network configuration tuning based on system resources and usage patterns.
background_mode
Background mode support with pause/resume functionality
ban_list
Peer ban list for temporary and permanent banning of misbehaving peers.
bandwidth_allocator
Peer bandwidth allocator using weighted max-min fairness.
bandwidth_budget
Per-peer bandwidth budget allocation and enforcement with token-bucket per peer.
bandwidth_monitor
Per-peer and aggregate bandwidth usage tracking with sliding window rate calculation.
batch_resolver
Batch CID resolver and prefetch scheduler for DHT performance optimization
behavior_classifier
Peer Behavior Classifier
benchmarking
Performance Benchmarking - Comprehensive benchmarking utilities for network components
bitswap
Bitswap protocol implementation for block exchange
block_transfer
Streaming block transfer management with chunked, resumable transfers.
bloom_filter
Bloom filter for probabilistic duplicate detection across peers.
bootstrap
Bootstrap peer management with retry logic
bootstrap_coordinator
Bootstrap coordinator for systematic peer discovery
capability_registry
Peer Capability Registry
cert_pin
Certificate fingerprint pinning for QUIC/TLS connections.
churn_manager
Peer churn tracking and stability scoring for DHT and routing decisions.
churn_resilience
Adaptive Kademlia refresh under peer churn.
circuit_breaker
Circuit breaker pattern for per-peer fault tolerance.
congestion_controller
TCP-inspired multi-algorithm congestion controller for IPFRS peer data streams.
connection_drainer
Graceful connection draining for orderly node shutdown.
connection_health
Connection Health Checker
connection_health_monitor
Connection Health Monitor
connection_limiter
Peer Connection Limiter
connection_manager
Connection management with limits and pruning
connection_migration
QUIC Connection Migration for Mobile Support
connection_pool
Connection Pool
connection_pool_manager
Connection Pool Manager
connection_tracker
Peer Connection Tracker
content_routing_cache
Content Routing Cache — multi-tier DHT routing cache.
content_routing_optimizer
Content Routing Optimizer
dht
Distributed Hash Table (Kademlia DHT) implementation
dht_optimizer
DHT Routing Table Optimizer for Kademlia bucket health analysis.
dht_provider
Custom DHT provider interface for pluggable DHT implementations
diagnostics
Network Diagnostics and Troubleshooting Utilities
discovery_cache
Peer Discovery Cache
discovery_lru
LRU Peer Discovery Cache
event_bus
NetworkEventBus — synchronous in-process publish-subscribe bus for network events.
facade
High-level network facade integrating all IPFRS network modules
fallback
Fallback strategies for network error handling
flood_protection
Multi-layer flood/DoS protection for P2P networks.
flood_sub_router
FloodSubRouter — topic-based message flooding router with subscription management, message deduplication, TTL-based expiry, and per-peer forwarding history to prevent routing loops.
flow_control
Window-based flow control for peer data transfer.
geo_routing
Geographic routing optimization for IPFRS network
gossip_content_filter
Content-based gossip message filtering for bandwidth reduction.
gossip_filter
Peer Gossip Filter — probabilistic duplicate/spam/storm suppression
gossip_message_filter
GossipMessageFilter — multi-criteria filter for GossipSub messages.
gossip_metrics
Gossip protocol efficiency metrics.
gossip_overlay
Gossip Overlay Manager — application-level gossip for lightweight state distribution
gossip_protocol_engine
Gossip Dissemination Protocol Engine
gossipsub
GossipSub - Topic-based pub/sub messaging
health
Network health check endpoints
health_checker
Peer Health Checker
identity
Peer identity key management with Ed25519 key rotation support.
ipfs_compat
IPFS compatibility and connectivity testing
latency_predictor
Peer Latency Predictor
latency_tracker
Per-peer latency histogram tracking with percentile reporting.
load_balancer
Peer load balancer with configurable strategies.
load_tester
Network Load Testing and Stress Testing Utilities
logging
Structured logging and tracing support
lookup_cache
DHT lookup result caching and parallel alpha query execution.
memory_monitor
Memory usage monitoring for network components
merkle_proof_verifier
Merkle inclusion proof verifier for content-addressed data.
mesh_repair
GossipSub mesh repair coordination
message_authenticator
Message authentication with HMAC-like construction and replay attack prevention.
message_batcher
Peer message batching for outbound message coalescing
message_codec
Length-delimited message encoding/decoding for peer communication.
message_dedup
Message deduplication using a two-layer approach.
message_prioritizer
PeerMessagePrioritizer — Multi-level priority queue with aging for outbound messages.
message_router
MessageRouter — Priority-based message dispatch with dead-letter queue.
metrics
Network metrics collection and reporting
metrics_aggregator
Metrics time-series aggregator for historical tracking and analysis
multipath_quic
QUIC Multipath Support
nat_traversal
NAT traversal system for P2P hole-punching.
nat_traversal_manager
ICE-based NAT traversal manager with STUN/TURN-like candidate gathering and hole-punching coordination.
network_circuit_breaker
Production-quality circuit breaker for network connections.
network_event_bus
NetworkEventBus — synchronous publish-subscribe event bus for network events.
network_monitor
Network interface monitoring and switch detection
network_qos_manager
Network Quality-of-Service (QoS) Manager.
network_simulator
Network Simulator - Simulate various network conditions for testing
network_topology_mapper
Network Topology Mapper
node
Network node implementation with full libp2p integration
offline_queue
Offline request queue for mobile and intermittent connectivity
overlay_network
Structured overlay network manager supporting multiple topology strategies.
overlay_network_manager
Virtual overlay network topology manager.
packet_fragmentation_assembler
Packet Fragmentation and Reassembly Engine
peer
Peer information and management
peer_bandwidth_manager
Per-peer bandwidth management with token-bucket rate limiting and fairness scheduling.
peer_blacklist
Peer blacklist with expiry, reason tracking, and reputation-based auto-blacklisting.
peer_capabilities
Peer Capability Advertisement and Negotiation
peer_capability_negotiator
Peer Capability Negotiation
peer_discovery
Peer Discovery Manager
peer_discovery_manager
Multi-strategy Peer Discovery Manager
peer_discovery_protocol
Multi-Strategy Peer Discovery Protocol
peer_exchange
Peer Exchange Protocol (PEX)
peer_health
Peer Health Monitor
peer_load_balancer
Peer-aware load balancer for IPFRS network layer.
peer_migration
Peer state migration for seamless node handoff in P2P networks.
peer_reputation
Peer Reputation Manager — long-term behavioral scoring for trust-weighted routing.
peer_reputation_graph
Peer Reputation Graph with trust propagation and reputation scoring.
peer_score
Peer Score Tracker for GossipSub mesh management
peer_scoring
Composite peer quality scoring engine for P2P overlay networks.
peer_selector
Intelligent peer selection combining geographic proximity and connection quality
peer_session
Authenticated peer session management with capability negotiation, session tokens, and expiry tracking.
peer_sync_protocol
Peer Sync Protocol — bidirectional state synchronisation using vector clocks and CRDTs.
peer_trust_scorer
Composite trust scoring system for network peers.
policy
Network Policy Engine - Fine-grained control over network operations
presets
Configuration presets for common use cases
priority_queue
Multi-level priority queue for outbound peer messages.
protocol
Protocol handler registry and version negotiation
protocol_handshake
Protocol handshake negotiation between peers.
protocol_negotiator
Protocol version and feature negotiation between peers.
protocol_version
Protocol versioning and compatibility negotiation for P2P connections.
provider_renewal
DHT provider record auto-renewal scheduler.
providers
Provider record cache with TTL
quality_predictor
Connection Quality Predictor
query_batcher
DHT query batching and frequency optimization
query_optimizer
DHT Query Optimization Module
quic
QUIC transport utilities and configuration
rate_limiter
Connection rate limiting for preventing connection storms and resource exhaustion.
relay
Circuit Relay v2 reservation management
reputation
Peer reputation system for tracking and scoring peer behavior
request_dedup
Request deduplication for concurrent DHT/Bitswap lookups.
request_priority_queue
Priority-based work queue for processing peer requests.
routing_auditor
Routing Table Auditor
routing_table
DHT-aware content routing table with geographic/latency affinity scoring.
routing_table_manager
Kademlia-style XOR-metric routing table manager for P2P overlay networks.
routing_table_sharding
Sharded DHT routing table that distributes peers across multiple shards based on XOR-distance partitioning, enabling parallel lookups and reduced contention under high peer churn.
scoreboard
Composite peer scoring system (PeerScoreboard)
security_monitor
NetworkSecurityMonitor — Real-time network security monitoring with anomaly detection, threat scoring, and incident management.
semantic_dht
Semantic DHT - Vector-based content routing
session
Connection Session Management
session_manager
Peer session lifecycle management with per-peer caps, state machine, and idle eviction.
stream_multiplexer
Stream Multiplexer — multiplexes multiple logical streams over a single connection with flow control, priority scheduling, and proper frame lifecycle management.
stream_priority_scheduler
Stream-level priority scheduler for multiplexed network streams.
subscription_router
SubscriptionRouter — topic/type-based message routing with subscription management, filter evaluation, and delivery tracking.
sync_coordinator
Peer sync coordinator for bidirectional synchronization sessions.
throttle
Bandwidth throttling for network traffic control
topic_router
TopicRouter — Intelligent GossipSub topic management with priority-based message queuing.
topology_mapper
Network Topology Mapper
tor
Tor Integration for Privacy-Preserving Networking
traffic_analyzer
Network Traffic Analysis and Pattern Detection
traffic_shaper
Network traffic shaping with multiple queuing disciplines.
trust_manager
Peer trust management for selective content acceptance based on trust hierarchies.
utils
Network Utilities

Macros§

log_network_error
Log a network error with context
log_network_event
Log a structured network event
log_network_warn
Log a network warning with context