DOS Defense - Do’s and Don’ts
summary
Argues that the concrete defense is to bound everything and apply back pressure not silent drops, with concrete failure modes: a malicious length prefix that never finishes a read and hangs a coroutine, declaring terabyte sizes to force huge allocations, spawning unbounded goroutines/tasks from channels and pushing into unbounded vectors to exhaust memory, and breaking producer consumer flow. Recommends timeouts, limits per connection, one task per connection, bounded channels or external throttles, and points to libp2p/gossipsub scoring and Rust libp2p guidelines.
AI-written summary · about
chapters (10)
- 0:00Introduction to DOS defense
- 1:29Why DOS attacks are hard
- 2:33Bound everything to prevent attacks
- 3:56Back pressure explained
- 4:40Code examples and pitfalls
- 7:12Unbounded channels risks
- 8:36Language-specific channel issues
- 9:39General unbounded resource risks
- 10:01Call to action: use back pressure
- 10:25Q&A on P2P and DOS defense
