322 Commits

Author SHA1 Message Date
datagutt 80cd0c4585 feat: use Kalman-smoothed RTT in EDPF arrival time prediction
Replace rtt_min_ms (static floor) with Kalman filter value as the
propagation delay estimate in EDPF predicted arrival calculation.
The Kalman-smoothed RTT reflects current link conditions including
cellular handovers, while rtt_min_ms only captures the historical
minimum. Falls back to rtt_min_ms if Kalman hasn't initialized.
2026-03-15 05:13:03 +01:00
datagutt 1a32864f43 refactor: remove asymmetric EWMA, simplify to symmetric-only
EWMA is now only used for rtt_avg_delta (symmetric alpha=0.2). Remove
asymmetric constructor and is_initialized from production API since
smooth_rtt and fast_rtt EWMAs were replaced by the Kalman filter.
Asymmetric tests removed accordingly.
2026-03-15 05:05:31 +01:00
datagutt 012caf2fb0 refactor: replace EWMA smooth/fast RTT with Kalman filter as primary RTT estimator
Remove smooth_rtt and fast_rtt EWMA trackers from RttTracker. The Kalman
filter now serves as the sole smooth RTT source — its value() provides
the smoothed estimate and velocity() provides trend detection (replacing
the fast tracker's spike-catching role).

EWMA::asymmetric and is_initialized gated behind test-internals since
no production code uses them after this change. Stats export renamed
fast_rtt_ms → rtt_velocity to reflect the new semantics.
2026-03-15 04:59:54 +01:00
datagutt 27c6c00e5d feat: add EDPF scheduler, BLEST HoL guard, IoDS reordering prevention, and Kalman RTT filter
EDPF (Earliest Delivery Path First) selects link with lowest predicted
arrival time considering in-flight data, capacity, loss, and base RTT.
BLEST filters links causing head-of-line blocking (OWD > min_OWD + 50ms
with dynamic penalty). IoDS enforces monotonic arrival constraint to
prevent receiver reordering and reduce SRT retransmissions.

Pipeline wired as: BLEST filters → IoDS ordering → EDPF argmin, with
cascading fallbacks when filters are too restrictive.

Kalman filter (2-state [value, velocity]) added for trend-aware RTT
smoothing alongside existing EWMA. New SchedulingMode::Edpf variant
with runtime config support.
2026-03-15 04:49:10 +01:00
Thomas Lekanger 9823aae29d refactor: add dead code allowance for CmdResponse enum to improve compatibility 2026-02-15 22:45:19 +01:00
Thomas Lekanger 2a85283273 refactor: enhance RTT tracking with min-sample filter for improved stability 2026-02-15 20:14:10 +01:00
Thomas Lekanger 6a00f931bd Merge pull request #13 from irlserver/refactor/crate 2026-02-12 12:13:19 +01:00
Thomas Lekanger d4e86fef99 smhhhhhhhhhhhhhhh 2026-02-12 12:00:35 +01:00
Thomas Lekanger c1c1df839f refactor: fix formatting in UDP stream injection script 2026-02-12 11:58:28 +01:00
Thomas Lekanger 2b4bd84467 refactor: ensure injection thread panics are handled in random walk stability test 2026-02-12 11:57:49 +01:00
Thomas Lekanger ceae1e0cea chore: fmt 2026-02-12 11:57:46 +01:00
Thomas Lekanger 71063c4fe0 refactor: streamline UDP stream injection script formatting 2026-02-12 11:57:36 +01:00
Thomas Lekanger 8ef2b6c00b chore: fmt 2026-02-12 11:57:32 +01:00
Thomas Lekanger 281f34a043 test: add assertions for delay values in scenario tests 2026-02-12 11:56:49 +01:00
Thomas Lekanger bd96be69c4 refactor: update binary check command and improve resource cleanup in SrtlaTestStack 2026-02-12 11:56:42 +01:00
Thomas Lekanger b5487fd52e clippyyyy 2026-02-12 02:26:14 +01:00
Thomas Lekanger 5dc82e85f7 refactor: simplify mode handling in run_sender_with_config function 2026-02-12 02:23:53 +01:00
Thomas Lekanger c45080001c comment 2026-02-12 02:23:13 +01:00
Thomas Lekanger bb84439d28 At Least It Was Here 2026-02-12 02:22:02 +01:00
Thomas Lekanger 517030ff10 fmt fmt fmt 2026-02-12 02:19:21 +01:00
Thomas Lekanger 78d641c95b refactor: update inject_stream to allow dead code and enhance error handling in random walk test 2026-02-12 02:16:02 +01:00
Thomas Lekanger e7a38cb1af refactor: improve signal handling and validation in process management 2026-02-12 02:15:55 +01:00
Thomas Lekanger fd5fa6a5cc refactor: reset batch sender during connection reset 2026-02-12 02:15:32 +01:00
Thomas Lekanger 81e91fcf40 chore: fmt 2026-02-12 01:59:13 +01:00
Thomas Lekanger 3beedf1e4b refactor: update RTT handling to use Ewma for smoother calculations 2026-02-12 01:54:54 +01:00
Thomas Lekanger f10eaedf3f test: adjust cooldown timing in RTT threshold tests 2026-02-11 23:12:56 +01:00
Thomas Lekanger 45e71bccff feat: add initial configuration for CodeRabbit integration 2026-02-11 23:10:33 +01:00
Thomas Lekanger c87ebb37a1 Delete receiver 2026-02-11 23:10:06 +01:00
Thomas Lekanger 0bc155ab79 chore: fmt 2026-02-11 23:08:51 +01:00
Thomas Lekanger 6a4d01181a Add integration tests and update dependencies for network simulation
- Introduced a new `harness.rs` module for managing integration tests.
- Added common utilities for integration tests in `mod.rs`.
- Implemented basic connectivity tests in `netns_basic.rs` to validate registration and data forwarding.
- Created failure and recovery tests in `netns_failure.rs` to ensure link failure detection and recovery.
- Developed impairment tests in `netns_impairment.rs` to validate adaptation to network conditions.
- Added scenario-driven tests in `netns_scenario.rs` to assess stability under evolving impairments.
- Updated `Cargo.toml` and `Cargo.lock` to include `tempfile` dependency.
- Enhanced `lib.rs` to expose new test harness functionalities.
2026-02-11 21:59:34 +01:00
Thomas Lekanger ce147dd130 feat(network-sim): add network simulation toolkit with impairment modeling
- Introduced a new workspace with a `network-sim` crate for simulating network conditions.
- Implemented `ImpairmentConfig` for configuring network impairments using `tc netem`.
- Added `GemodelConfig` for modeling bursty packet loss with Gilbert-Elliott model.
- Created `Scenario` and `ScenarioConfig` for generating deterministic random-walk impairment scenarios.
- Implemented `Namespace` management for Linux network namespaces, including veth link creation.
- Added tests for impairment application and scenario generation to ensure functionality.
2026-02-11 21:16:39 +01:00
datagutt ce18df87e9 fix: clear pre-registration state on REG3 to prevent startup death spiral
Before REG3, forward_via_connection() tracks data packets in packet_log,
creating phantom in-flight counts that never get ACKed. Early NAKs from
these packets also penalize quality scoring. This cascading penalty
starves connections of traffic, causing the system to get stuck at low
throughput after startup.

Reset packet_log, in_flight_packets, congestion state, and quality cache
when REG3 is received so every connection starts with a clean slate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:08:45 +01:00
datagutt 082d118dac refactor: increase score hysteresis from 2% to 10% for enhanced mode
Increase SWITCH_THRESHOLD from 1.02 to 1.10 so a new connection must be
10% better before traffic is moved to it.  With the shorter 15ms cooldown,
hysteresis is now the primary stability mechanism; 2% was too small to
prevent noise-driven flip-flopping between connections with similar scores.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:57:28 +01:00
Thomas Lekanger 86039ff038 refactor: update MIN_SWITCH_INTERVAL_MS to 15 for improved connection rotation 2026-02-11 20:52:49 +01:00
Thomas Lekanger 308d3f00cc refactor: replace timestamp generation in keepalive packet functions with utility method 2026-02-11 19:42:48 +01:00
Thomas Lekanger 3f67a3db49 refactor: enhance logging in run_sender_with_config to include scheduling mode 2026-02-11 19:21:09 +01:00
Thomas Lekanger e4c749ca41 refactor: update STARTUP_GRACE_MS to 5000 and adjust related reconnection logic 2026-02-11 19:18:09 +01:00
Thomas Lekanger 3064c73ea9 feat: add queued_count method to BatchSender and update score calculation in SrtlaConnection 2026-02-11 19:11:12 +01:00
Thomas Lekanger 256aacc29e feat: implement dual-window RTT tracking and expose metrics in LinkStats 2026-02-11 18:06:45 +01:00
Thomas Lekanger 01021954c8 refactor: move Write import under unix cfg 2026-02-04 22:12:59 +01:00
Thomas Lekanger 1c95982d9d chore: fmt 2026-02-04 22:00:31 +01:00
Thomas Lekanger 910e94ac71 feat: add shared statistics for telemetry export and update command handling 2026-02-04 17:50:44 +01:00
Thomas Lekanger 2adaf0db48 chore: update dependencies to latest versions in Cargo.lock 2026-02-04 02:05:34 +01:00
Thomas Lekanger ac803f721c Merge pull request #12 from irlserver/feat/rtt-aware 2026-01-26 17:59:32 +01:00
Thomas Lekanger 1299184871 refactor: enable test internals for RTT threshold tests 2026-01-26 11:59:58 +01:00
Thomas Lekanger 5af36f74be refactor: conditionally compile len and is_empty methods for test purposes 2026-01-26 11:58:34 +01:00
Thomas Lekanger f8b98eb8dc refactor: add is_rtt_threshold method to SchedulingMode for better mode checks 2026-01-26 11:58:16 +01:00
Thomas Lekanger c0f834a0fd refactor: enhance spawn_config_listener to support Unix socket fallback and improve readability 2026-01-26 11:57:37 +01:00
Thomas Lekanger 042772f03a refactor: update comment to clarify connection counting logic in update_active_connections 2026-01-25 02:26:24 +01:00
Thomas Lekanger 4513a0525b refactor: update acknowledgments in documentation to remove redundant references 2026-01-25 02:26:19 +01:00