Skip to main content

Crate rat_congestion

Crate rat_congestion 

Source
Expand description

§RAT Congestion Control Library

A high-performance, platform-optimized congestion control library implementing BBR and CUBIC algorithms with intelligent switching capabilities.

This library is designed as a pure computational engine that processes network data provided by the caller, without collecting any system data itself.

§Features

  • Pure Computation: No system data collection, all data provided by caller
  • BBR Algorithm: Google’s Bottleneck Bandwidth and Round-trip propagation time algorithm
  • CUBIC Algorithm: High-performance CUBIC congestion control with optimizations
  • Intelligent Switching: Dynamic algorithm selection based on network conditions
  • Platform Optimizations: Automatic platform detection and SIMD optimizations
  • Zero-Copy Design: Minimal allocations and efficient batch processing
  • Unified Entry Point: Single API for all platforms, auto-configured

§Quick Start

use rat_congestion::{CongestionController, PacketEvent};
use std::time::Duration;

// Create a controller with automatic platform optimization
// Note: In real usage, you need to provide NetworkMetrics and MetricsWindow implementations
// let mut controller = CongestionController::new(metrics, metrics_window);

§Advanced Usage

use rat_congestion::{CongestionController, ControllerConfig};

// Create with custom configuration
let config = ControllerConfig::builder()
    .initial_algorithm("bbr")
    .auto_switching(true)
    .build();

// Note: In real usage, you need to provide NetworkMetrics and MetricsWindow implementations
// let mut controller = CongestionController::with_config(config, metrics, metrics_window);

Structs§

Bbr
BBR congestion control algorithm with performance optimizations.
CongestionConfig
Configuration for the congestion manager.
CongestionController
Unified congestion control interface with automatic platform optimization.
CongestionManager
High-performance congestion control manager.
ControllerConfig
Configuration for the congestion controller.
ControllerConfigBuilder
Configuration builder for the congestion controller.
Cubic
CUBIC congestion control algorithm with performance optimizations.

Enums§

AlgorithmType
Algorithm selection strategy.
CongestionEvent
Events that trigger congestion control algorithm updates.

Constants§

DEFAULT_MSS
Default packet size (bytes)
INITIAL_CWND
Default initial congestion window (packets)
MIN_CWND
Minimum congestion window (packets)
PLATFORM
Detect the current platform at compile time.

Traits§

CongestionControlAlgorithm
Core trait for congestion control algorithms.
MetricsWindow
Trait for metrics window (rolling statistics)
NetworkMetrics
Trait for network metrics collection

Type Aliases§

PacingRate
PacketEvent
WindowSize