awesome-everything RU
↑ Back to the climb

Networking & Protocols

DDoS: what it is and why it works

Crux A DDoS attack overwhelms a service with traffic from many sources simultaneously — making it unavailable to real users without stealing data or breaking code.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at junior altitude — the surface
◷ 10 min

Your service is working fine. Then, without warning, requests start timing out. The traffic looks normal on your monitor — same request count, same sizes — but responses slow from 50 ms to 5 seconds. You check the logs and see 10 million requests per second from a hundred thousand different IPs. An adversary is attacking.

What DDoS means. Distributed Denial of Service — an attacker sends so much traffic from so many different sources that your service cannot respond to real users. The attacker does not steal data or inject commands. They just make your service unavailable. The “distributed” part is what makes it hard to stop: you cannot simply block one IP address.

Why it happens constantly. Cloudflare blocks on average ~110 million DDoS requests per day. Botnets — networks of malware-infected computers and IoT devices — are cheap to rent. Attacker cost: ~$50–500/month for a 10 Gbps-capable botnet service. For a competitor or bad actor, that is a low-cost way to take down a rival’s service.

The three types of attacks.

Volumetric attacks (L3/L4) aim to saturate the network pipe itself — gigabits of UDP, ICMP, or DNS responses flood the link before your server even sees the packets.

Protocol/state-exhaustion attacks (L3/L4) aim to fill connection-tracking tables and exhaust kernel memory — SYN floods force your server to hold thousands of half-open TCP connections until it runs out of slots and drops legitimate connections.

Application-layer attacks (L7) look like legitimate traffic but are expensive to process — HTTP floods, slow requests that hold connections open for minutes (Slowloris), or queries hitting expensive database paths. These are the hardest to stop because they pass every port and rate check.

Attack typeLayerGoalExampleDefense
VolumetricL3/L4Saturate the pipeUDP flood, DNS amplificationCDN scrubbing, anycast absorption
State exhaustionL3/L4Fill connection tablesSYN floodSYN cookies, rate limiting
Application-layerL7Exhaust CPU/memoryHTTP flood, SlowlorisWAF, adaptive concurrency limits

How a CDN scrubbing center helps. When you serve traffic directly from your origin, a 100 Gbps attack saturates your upstream link and legitimate requests never reach your server. A CDN with DDoS scrubbing routes all traffic to its nearest Point of Presence (PoP) first. The PoP has provisioned bandwidth to absorb the attack across its global infrastructure, and only clean traffic is forwarded to your origin. You stay online because the attack is distributed across the CDN’s network, not concentrated on your server.

DDoS scale in 2025–2026
Cloudflare daily DDoS blocks
~110M requests
Largest attack (Dec 2025)
31.4 Tbps
Botnet rental cost
$50–500/month
Legitimate user avg req/sec
10–20 req/s
Quiz

Why is DDoS hard to defend against compared to a single attacker?

The arms race. Bea runs a web service. Sven says “I’ll flood you with so much traffic you cannot serve real users.” Bea replies “I have a rate limiter — I reject the thousandth request per second from any IP.” Sven: “I will use a thousand different IPs.” Bea: “Then I have a WAF to detect the attack pattern. Legitimate users make normal requests; your flood is suspicious.” This back-and-forth is not hypothetical — it describes real attacker adaptations measured over years.

Why this works

Why do most DDoS defenses live at the CDN layer and not at your origin server? Because the economics are asymmetric: an attacker with a botnet can generate 100 Gbps for $500/month. A single origin server cannot buy 100 Gbps of upstream bandwidth. A CDN amortizes that capacity across millions of customers, so the per-customer cost of defense is tiny. This is the fundamental answer to DDoS: you cannot out-scale the attacker alone; you need shared infrastructure.

Order the steps

Order the DDoS defense layers from edge to origin:

  1. 1 DDoS scrubbing center absorbs volumetric traffic
  2. 2 Rate limiter rejects excessive requests
  3. 3 WAF detects application-layer attack patterns
  4. 4 Origin server logs and alerts
Complete the analogy

A DDoS attack is like _______ the coffee shop — the shop is not damaged, but it cannot serve legitimate customers.

Recall before you leave
  1. 01
    In one sentence: why does a CDN with DDoS scrubbing help you survive an attack?
  2. 02
    Name the three types of DDoS attacks and the layer each targets.
  3. 03
    Why can a botnet operator with $500/month threaten a service that costs much more to run?
Recap

DDoS attacks work by saturating a service from many simultaneous sources — volumetric attacks flood the pipe, state-exhaustion attacks fill connection tables, and L7 attacks look like legitimate traffic but consume CPU. No single IP block stops distributed attacks; the attacker’s goal is simply unavailability, not data theft. The practical defense is to route traffic through a CDN with scrubbing centers that can absorb attacks across global PoPs — a 100 Gbps attack becomes manageable when spread across 330+ nodes. Cloudflare alone blocks ~110 million DDoS requests per day, which illustrates how continuous this threat is in production.

Connected lessons
appears again in258
Continue the climb ↑Amplification attacks and state exhaustion
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.