Simple DoS example
Imagine you run an online store hosted on a single server that can handle 2,000 requests per second. An attacker using one machine might run a tiny program that repeatedly sends requests in an infinite loop:Blocking or rate-limiting single malicious IPs is effective against straightforward DoS attacks. However, attackers often distribute traffic across many IPs to evade simple IP-based defenses.
Why distributed attacks (DDoS) are harder
When attackers control thousands of compromised devices (botnets made of routers, cameras, PCs, etc.), they can send traffic from many geographic locations and IP addresses simultaneously. Because some of those IPs may belong to legitimate users or shared infrastructure, indiscriminate blocking is risky and often ineffective at scale. One common DDoS technique targets the TCP handshake. The TCP three-way handshake starts with a client sending a SYN packet to the server. If an attacker sends many forged or incomplete SYN packets (a SYN flood), the server reserves resources while waiting for the handshake to finish. If those reserved slots reach the server’s limit (for example, 2,000 concurrent half-open connections), new legitimate connections are refused. Because of the scale and diversity of sources, organizations commonly rely on specialized DDoS protection services (for example, Cloudflare, AWS Shield, or Akamai) to absorb, filter, and distinguish malicious traffic before it reaches the origin server.
Common DDoS attack vectors
Practical mitigations and best practices
- Use a CDN or DDoS protection provider to absorb and filter attack traffic before it hits your origin.
- Implement rate limiting and per-IP connection caps at the edge (but avoid overly aggressive limits that block legitimate users).
- Use SYN cookies or kernel-level TCP hardening to mitigate SYN floods.
- Deploy a Web Application Firewall (WAF) to block malicious requests at the application layer.
- Use anycast routing and geographically distributed scrubbing centers to spread and dissipate volumetric attacks.
- Monitor traffic patterns and set up automated alerts for sudden spikes or unusual geographic/source distributions.
- Have an incident response plan and a point of contact with your ISP and DDoS provider for emergency mitigation (e.g., BGP blackholing or traffic diversion to a scrubbing center).
Quick reference — DDoS protection options
Blocking traffic by IP without careful analysis can block legitimate users (false positives). Always combine blocking with traffic analysis and prefer upstream filtering or scrubbing services for large-scale attacks.