Skip to content

Rtt jump detection HMM approach - #2556

Merged
hargut merged 1 commit into
cloudflare:masterfrom
eli-lebeau:rtt-jump-detection-hmm
Jul 27, 2026
Merged

Rtt jump detection HMM approach#2556
hargut merged 1 commit into
cloudflare:masterfrom
eli-lebeau:rtt-jump-detection-hmm

Conversation

@eli-lebeau

Copy link
Copy Markdown
Contributor

Goal: Add a detector for counting persistent jumps in RTT using a Hidden Markov Model

Implementation details:

Internal BbrRttJumpDetector setting with three modes:

  • Disabled, which remains the default.
  • GlobalMin, which detects sustained RTT increases above 3x the
    connection-lifetime minimum RTT.
  • Hmm, a 3-state Hidden Markov Model detector using forward filtering,
    warmup, adaptive per-connection elevation, and RTT-scaled dwell gates.

The detector runs from the BBRv2 network model after full bandwidth has been
reached, so startup/self-queueing RTT changes do not immediately count as
persistent jumps.

Confirmed persistent jump episodes are counted in
rtt_persistent_jump_count

Each RTT sample is evaluated as such:

  1. Convert the RTT sample into a discrete elevation bin.
  2. Predict the next state distribution with the transition matrix.
  3. Weight each predicted state by how likely that bin is in the emission matrix.
  4. Normalize the result back to a probability distribution.
  5. Use the most likely state as the raw HMM state, then apply dwell/sample gates before committing any detector state transition.

The bin boundaries and emission matrix use predetermined values derived from offline training.

@eli-lebeau
eli-lebeau requested a review from a team as a code owner July 24, 2026 17:07
@eli-lebeau
eli-lebeau force-pushed the rtt-jump-detection-hmm branch from efdc043 to cff7ed2 Compare July 24, 2026 17:16
@eli-lebeau
eli-lebeau force-pushed the rtt-jump-detection-hmm branch from 209a1da to 15fe648 Compare July 24, 2026 20:53

@jrouviere jrouviere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed

@hargut
hargut merged commit d7c3b1e into cloudflare:master Jul 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants