You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
One source IP can hold most of the node's handler slots #2502
One source IP can occupy most of the node's global handler slots (security.max_concurrent_handlers, default 256).
ConnectionLimiter (crates/node/src/dispatch.rs) has two layers: a global semaphore, and a per-source rate limit (token bucket, 100/s, burst 200). The per-source layer limits how fast a source connects, not how many connections it holds. An idle cdn/client/v1 connection keeps its slot until the 30 s application idle-close (APP_IDLE_TIMEOUT) reaps it. Probe and DHT connections keep theirs for up to the 5 s ACCEPT_BI_TIMEOUT. The bucket's burst of 200 plus 100/s lets one source fill all 256 slots in under a second, and it keeps them for as long as it keeps its connections open.
This is slot exhaustion, not memory. #2501 bounds the memory each slot can pin. Honest peers that arrive while the slots are full are closed with RATE_LIMITED (global-full).
Reported alongside the frame-size issue in #2501 (credit: Radeonares32).
Open question
Should ConnectionLimiter also cap concurrent connections per source key (/64 for IPv6)? Run it through the spec-discipline gates before adding it:
Binding: IPv4 addresses cost money; IPv6 /64 prefixes are cheap but grouped.
Redundancy: the token bucket plus the idle reaper may already make this expensive enough.
Relay-only connections: they carry no source key and bypass the per-source layer (dispatch_per_source_skipped_no_addr).
The outcome may be "no mechanism" if the existing layers bound it well enough. Record that reasoning here.
I checked a per-source concurrent-connection cap against the spec-discipline gates. It stays out. The reasoning is below, including one correction to the issue's own framing.
The redundancy argument does not hold
The token bucket limits how fast a source connects, not how many connections it holds. The idle reaper does not limit it either. The APP_IDLE_TIMEOUT clock starts over when a stream closes (handlers/client/mod.rs:116-127). So a source can send one cheap request on each connection every <30 s, for example a random hash that gets NotFound, and keep its slot indefinitely. The existing layers do not bound slot-holding by one determined source.
Binding is what kills the cap (gate 2)
Relay-only connections dodge it for free.rate_limit::peer_ip returns None when the connection has only a relay path. acquire_inner then skips the per-source layer. An attacker who dials through the node's home relay with no direct address carries no source key, so a count cap never charges it. One iroh endpoint can open many connections to the same node, and NodeIds cost nothing.
IPv6 /64 grouping is weak. A /48 gives 65 536 keys.
The cap hits honest users. Many honest clients share one IPv4 egress behind CGNAT or a corporate NAT. A cap of K refuses the (K+1)th honest client there, while the attacker avoids it through the relay.
At accept time there is no costly identity for a per-key cap to bind to. What remains is the general accept-flood exposure that every open QUIC server has.
What already covers it
The client protects itself. A 0x10 RATE_LIMITED close is non-reputational. decdn-client types it as UpstreamRateLimited, and the miss-pull path suppresses the (peer, hash) pair briefly and records no reputation outcome (ADR 013 § Application Error Codes). Requesters move to another source (ADR 039).
MECHANISM: per-source concurrent-connection cap in ConnectionLimiter
VERDICT: keep out
FAILS: gate 2: relay-only connections carry no source key, so the cap is free to evade,
and NAT'd honest clients are the ones it refuses
INSTEAD: nothing new; the client routes around RATE_LIMITED; the operator sizes
max_concurrent_handlers against the per-slot memory bound
A follow-up PR adds one line to ADR 013 recording that the node keeps no per-source connection count, and why.
Activity
thiras commentedon Oct 17, 2026
Outcome: no mechanism
I checked a per-source concurrent-connection cap against the spec-discipline gates. It stays out. The reasoning is below, including one correction to the issue's own framing.
The redundancy argument does not hold
The token bucket limits how fast a source connects, not how many connections it holds. The idle reaper does not limit it either. The
APP_IDLE_TIMEOUTclock starts over when a stream closes (handlers/client/mod.rs:116-127). So a source can send one cheap request on each connection every <30 s, for example a random hash that getsNotFound, and keep its slot indefinitely. The existing layers do not bound slot-holding by one determined source.Binding is what kills the cap (gate 2)
rate_limit::peer_ipreturnsNonewhen the connection has only a relay path.acquire_innerthen skips the per-source layer. An attacker who dials through the node's home relay with no direct address carries no source key, so a count cap never charges it. One iroh endpoint can open many connections to the same node, and NodeIds cost nothing./64grouping is weak. A/48gives 65 536 keys.At accept time there is no costly identity for a per-key cap to bind to. What remains is the general accept-flood exposure that every open QUIC server has.
What already covers it
0x10 RATE_LIMITEDclose is non-reputational.decdn-clienttypes it asUpstreamRateLimited, and the miss-pull path suppresses the(peer, hash)pair briefly and records no reputation outcome (ADR 013 § Application Error Codes). Requesters move to another source (ADR 039).security.max_concurrent_handlersis a trade the operator can measure.A follow-up PR adds one line to ADR 013 recording that the node keeps no per-source connection count, and why.
docs(adr): record why the node keeps no per-source connection count (#…