Repository navigation
Conversation
The FEC reorder queue started a block's 52 ms retransmission wait, and sent its first NACK, only when the block reached the head of the queue. A loss that damaged N blocks therefore held the queue for N x 52 ms, and with it the reference-invalidation request (queued when the next frame assembles) and the recovery frame the server sends in reply. The backlog was then released at once, which overflowed the decoder hand-off and cost another IDR round trip. A block's wait now starts when a packet from a later block arrives, and a hole's when the block behind it arrives. All waits run in parallel: - every gap is requested as soon as it is evident, with up to eight NACK reports per 4 ms tick instead of one; - a stalled block asks for every missing data run it needs to reconstruct, because its wait is no longer extended for a second round; - giving up on a gap forgets only that gap's NACK requests instead of all; - the queue reports one discontinuity per pass, so a complete frame between two abandoned gaps is delivered instead of discarded. Evidence, five 2-minute 3840x2160@120 AV1 sessions on a link that loses packets every 15 s (48 loss episodes): 21 gave up on two or more gaps in series, 52 ms apart, before the first invalidation left. The six longest (0.65-1.5 s) gave up on 15 to 66 gaps each, and in five of them a recovery keyframe was released 4-52 ms before another keyframe that the server had sent 0.3-0.5 s after it: both had been waiting in the queue. The plain reorder queue (streams without an FEC layout) is unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… until they arrive The Mjolnir server answers most NACKs with copies sent as payload type 106 on the video SSRC without SRTP protection: no authentication tag, and the body is the plaintext GameStream payload. In a live dump all 3 rejected first shards began with the GameStream frame header, and two copies of one packet differed only in the re-stamped RTP timestamp. The receiver ran them through SRTP unprotect and dropped them as authentication failures; 46 of 46 sampled failures answered a NACK sent 100-218 ms earlier. NACK repair never filled a gap. - A datagram that fails authentication is accepted only as the answer to one of this receiver's NACKs from the last 500 ms, on the bound SSRC, once, through the replay window. - The answers complete frames 150-200 ms after the gap opens, well after the 52 ms give-up. While frame types are known, a gap is now held for 220 ms. The recovery frame is still requested at 52 ms (an early invalidation request), and a complete recovery frame queued behind the gap ends the hold at once, so holding does not delay recovery. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Depends on #1450 (FEC gap waits side by side). This branch includes that commit, so please review the last commit.
Problem
The server answers NACK-v2 requests with copies sent as payload type 106 on the video SSRC, and those copies have no SRTP protection: there is no authentication tag, and the body is the plaintext GameStream payload. OpenNOW runs every video datagram through SRTP unprotect, so every one of these copies fails authentication and is dropped. Until now this only showed up as the gap between inbound and authenticated packets, about 500–1,900 per 10 s window during loss episodes.
Evidence from a live session:
81 08 01 01 …), the same structure as a decrypted original's.A tagged 1304-byte type-106 form also exists and already authenticates. This change does not affect it.
Even when accepted, these answers complete their frames 150–200 ms after the gap opens (9 of 9 measured), well after the 52 ms give-up.
Change
take_retransmission_request,accept_unprotected).anticipate).recovery_frame_ready).unprotectedRtxcounter.Security note
These packets are unauthenticated. Acceptance is limited to:
An on-path attacker who can observe those requests could still inject payload for those indices. The server chose to send them this way, and the alternative is NACKs that can never repair anything. Please weigh this.
Results
This is one Starlink session before and one after, with each session's first minute excluded.
Freezes of about 1 s are unchanged. In those, frames had lost a third to most of their packets, which no retransmission window covers.
For reference, static analysis of the official Linux client (
libBifrost2.so, the sourcedocs/mjolnir-nack-v2.mdalready uses) shows waiting-queue limits of 52/68 ms, with a maximum frame wait of 68/84 ms. This change waits longer because the answers measured here take 150–200 ms to arrive.Tests
nacked_packets_are_accepted_unprotected_once_within_the_window.cargo test --workspacewithlinux-ffmpeg-bundled,linux-vaapi: 1547 passed, 0 failed, 27 ignored.🤖 Generated with Claude Code