feat(router): ECF predictive mux scheduler (proxy mux mode ecf) - #4240
Merged
Conversation
Adds WeightModeECF — an Earliest-Completion-First predictive scheduler that holds the next in-order frame off a slower leg when a faster leg will drain the backlog and deliver it sooner, avoiding the head-of-line stalls that goodput/latency weighting causes under path heterogeneity (the MPTCP/MP-QUIC aggregation result). Adapted to skywire's no-TCP-cwnd model: per-leg cwnd -> BDP (rate x RTT), 'has capacity' -> inflight_bytes < BDP (inflight tracked in the selector, drained at the leg's send rate), backlog -> inflight on the fast leg, sigma -> per-leg RTT jitter EWMA. Filter variant (never returns NO-LEG; queues on the fast leg rather than the scheduler holding a frame) so the send path stays non-blocking. Wired as a new WeightMode + 'ecf' distribution end-to-end (selector, native + wasm policy parsers, SetMuxMode RPC, 'proxy mux mode auto|equal|capacity|ecf' CLI). Adaptive preset default left at 'capacity' — ECF is opt-in and unproven live; flipping the default is a one-liner after a live-tuning pass. Deterministic unit tests incl. the canonical fast+10x-slow-leg case. State refreshes on the 5s data-progress cadence for now (RTT/rate/jitter); a ~1s refresh + E2E latency are noted follow-ups.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
WeightModeECF— an Earliest-Completion-First predictive scheduler that holds the next in-order frame off a slower leg when a faster leg will drain the backlog and deliver it sooner. Goodput/latency-weighted spraying keeps assigning a fraction of in-order frames to slow legs, and since the reorder buffer must deliver in order (never skip), each becomes a head-of-line stall — the MPTCP/MP-QUIC result that weighting alone reaches only ~25% of ideal aggregate. ECF is the predictive hold-back that fixes it.Adapted to skywire’s no-TCP-cwnd model: per-leg cwnd → BDP (
rate × RTT); "has capacity" →inflight_bytes < BDP(inflight tracked in the selector, drained at the leg’s send rate — skywire has no per-leg ack); backlog → inflight on the fast leg; σ → per-leg RTT-jitter EWMA. Filter variant (never returns NO-LEG; queues on the fast leg rather than the scheduler holding a frame) so the send path stays non-blocking — zero send/queue-machinery changes.Wired end-to-end as a new WeightMode +
ecfdistribution (selector, native + wasm policy parsers,SetMuxModeRPC,proxy mux mode auto|equal|capacity|ecfCLI). Adaptive preset default left atcapacity— ECF is opt-in and unproven live, so merging changes no fleet behavior; flipping the default is a one-liner after a live-tuning pass. Deterministic unit tests incl. the canonical fast + 10×-slow-leg case. State refreshes on the 5s data-progress cadence (RTT/rate/jitter); ~1s refresh + E2E latency are noted follow-ups. Developed with AI assistance (Claude).