Skip to content

Add transport setting to cap additional ACK blocks per ACK frame#461

Open
UditDewan wants to merge 1 commit into
facebook:mainfrom
UditDewan:max-ack-blocks-per-frame
Open

Add transport setting to cap additional ACK blocks per ACK frame#461
UditDewan wants to merge 1 commit into
facebook:mainfrom
UditDewan:max-ack-blocks-per-frame

Conversation

@UditDewan

@UditDewan UditDewan commented Jul 14, 2026

Copy link
Copy Markdown

Summary

There is currently no way to bound the number of ack blocks written into an ACK frame. As described in #357, datagram-heavy workloads on lossy networks accumulate ack ranges that are never coalesced (lost packet numbers are never retransmitted), so ACK frames grow until they fill the packet and can consume significant bandwidth relative to the application payload (frames over 1000 bytes were observed with sub-100-byte datagrams).

This adds transportSettings.maxAdditionalAckBlocksPerFrame, which caps the number of additional ack blocks (beyond the required first block) written into each outgoing ACK frame:

  • The cap is enforced in fillFrameWithAckBlocks, the single choke point shared by all ACK variants (ACK, ACK_ECN, ACK_RECEIVE_TIMESTAMPS, ACK_EXTENDED, and the draft-02 receive-timestamps frames), so it applies uniformly.
  • Blocks covering the most recent packet numbers are kept, matching the existing space-limited truncation behavior.
  • The default is unlimited, so existing behavior is unchanged unless the setting is lowered.

Per RFC 9000 §13.2.3, a receiver may limit the number of ACK Ranges it reports, so a capped frame remains fully spec-compliant.

Fixes #357

Test Plan

Added QuicWriteCodecTest.WriteAckFrameWithMaxAdditionalAckBlocks: writes 30 ack blocks with the cap set to 3 and verifies via encode + decode round trip that exactly 4 blocks (first + 3 additional) covering the most recent packet numbers are emitted.

buck test //quic/codec/test:QuicWriteCodecTest

On lossy networks, workloads that never retransmit lost packet numbers
(e.g. QUIC datagrams) accumulate ack ranges faster than they coalesce,
so ACK frames grow until they fill the packet and can consume
significant bandwidth relative to the application data.

Add transportSettings.maxAdditionalAckBlocksPerFrame to bound the
number of additional ack blocks (beyond the required first block)
written into each ACK frame. The blocks covering the most recent packet
numbers are kept. Defaults to unlimited, preserving existing behavior.
The cap applies to all ACK frame variants (ACK, ACK_ECN,
ACK_RECEIVE_TIMESTAMPS, ACK_EXTENDED, and draft-02) since they share
the same base-field writer.

Fixes facebook#357
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

additional ack blocks limitation requirement

1 participant