Skip to content

key the flow table hash with a per-table siphash seed - #2

Merged
aotodev merged 1 commit into
masterfrom
1-demux-hash-floodingmd
Sep 30, 2026
Merged

aotodev merged 1 commit into
masterfrom
1-demux-hash-floodingmd

Conversation

@aotodev

@aotodev aotodev commented Sep 30, 2026

Copy link
Copy Markdown
Owner

The flow table bucketed keys by an unseeded FNV-1a hash masked to the
low bits. Peers choose most of what gets hashed (source ports, IPv6
interface ids, QUIC Initial connection ids), so they could pick keys
that share a bucket and make every lookup walk one long probe chain.

Add a :hash partition with a constexpr streaming SipHash, a 128-bit
hash_seed and random_seed() over getrandom. Keys now feed their
identity to a hasher through hash_append in place of hash_value, and
byte_key feeds its length first so keys built from several fields do
not collide. flow_table::carve takes a seed, or draws one when given
none, and buckets with SipHash-1-3 under it. The load limit drops from
7/8 to 3/4.

std::hash now uses SipHash under a seed drawn once per
process.

Breaking: a custom demux key needs hash_append instead of hash_value.

@aotodev aotodev self-assigned this Sep 30, 2026
@aotodev
aotodev merged commit 50393a7 into master Sep 30, 2026
7 checks passed
@aotodev
aotodev deleted the 1-demux-hash-floodingmd branch September 30, 2026 11:25
@aotodev aotodev linked an issue Sep 30, 2026 that may be closed by this pull request
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.

demux-hash-flooding.md

1 participant