Understanding Modern DDoS Defense Architecture
A technical deep-dive into CDN, WAF, and origin protection layers
Introduction
This article provides a comprehensive technical overview of modern DDoS defense architecture. We'll examine each layer of protection, how they work together, and where the gaps typically exist.
Target audience: Security engineers, DevOps teams, and architects responsible for infrastructure resilience.
The Defense Stack
Modern DDoS protection consists of multiple layers, each addressing different attack vectors:
1 DNS & Anycast
DNS is the first line of defense. Modern architectures use GeoDNS to return different IP addresses based on client location, and Anycast where multiple servers share the same IP address.
Query: www.example.com from US
Response: 104.16.1.1 (US PoP)
Query: www.example.com from EU
Response: 104.16.2.1 (EU PoP)
2 Edge / CDN
CDNs operate a global network of Points of Presence (PoPs). Major CDNs have 100+ Tbps capacity, absorbing volumetric attacks through distributed scrubbing.
| Provider | CNAME Pattern | Headers | ASN |
|---|---|---|---|
| Cloudflare | *.cloudflare.net | CF-RAY, Server: cloudflare | 13335 |
| CloudFront | *.cloudfront.net | X-Amz-Cf-Id, Via: CloudFront | 16509 |
| Akamai | *.akamaiedge.net | X-Akamai-*, Akamai-* | 20940 |
| Fastly | *.fastly.net | X-Served-By, Fastly-Debug-* | 54113 |
| Azure CDN | *.azureedge.net | X-Azure-Ref | 8075 |
3 Scrubbing Centers
Scrubbing centers are dedicated traffic-cleaning facilities that sit between the internet and the origin infrastructure. During an attack, traffic is diverted through these centers via BGP route announcements, inspected for malicious patterns, and only clean traffic is forwarded to the origin.
How BGP-Based Diversion Works
When an attack is detected, the scrubbing provider advertises more-specific BGP routes for the target's IP prefixes. Internet routers prefer these more-specific routes, causing all traffic destined for the target to flow through the scrubbing center instead. After filtering, clean traffic is returned to the origin via GRE tunnels or direct peering.
Always-On vs On-Demand
- Always-on: All traffic permanently routes through the scrubbing center. Lower latency to detect attacks, but adds a constant hop and potential latency overhead.
- On-demand: BGP diversion activates only when an attack is detected. Reduces latency during normal operation, but introduces a switchover delay (typically 30-90 seconds) while BGP propagates.
Major Scrubbing Center Providers
| Provider | Capacity | Detection Signals |
|---|---|---|
| Akamai Prolexic | 20+ Tbps | ASN 32787, Prolexic-specific headers |
| Radware DefensePro (Cloud) | 12+ Tbps | ASN shifts, Server: rdwr headers |
| Imperva (Incapsula) | 13+ Tbps | Incapsula CNAME, X-Iinfo headers |
| Neustar / UltraDDoS Protect | 15+ Tbps | ASN 19905, Neustar DNS patterns |
| Lumen DDoS Mitigation | 15+ Tbps | ASN 3356, BGP community attributes |
How DDactic Detects Scrubbing Centers
DDactic identifies scrubbing center presence through multiple passive signals:
- BGP analysis: Monitoring route announcements for scrubbing provider ASNs in the path
- ASN ownership: Identifying IP ranges belonging to known scrubbing providers
- Latency patterns: Detecting the additional hop introduced by traffic diversion
- Response headers: Recognizing provider-specific headers injected during scrubbing
4 WAF / Application Firewall
WAFs protect against Layer 7 (application) attacks:
- Rate Limiting: Block IPs exceeding thresholds
- Bot Detection: Block automated/scripted requests
- Geo Blocking: Block traffic from specific countries
- IP Reputation: Block known-bad IPs
- Custom Rules: Block specific patterns/signatures
5 Load Balancer
Load balancers distribute traffic and provide health checks:
- Layer 4 (TCP/UDP): Fast, efficient, no application awareness
- Layer 7 (HTTP/HTTPS): Application-aware routing, can inspect headers
6 Origin Protection
The origin should ONLY accept connections from the CDN. This is the most critical and most often misconfigured layer.
# Nginx: Allow only CDN IPs
geo $allow_cdn {
default 0;
173.245.48.0/20 1;
103.21.244.0/22 1;
# ... other CDN ranges
}
server {
if ($allow_cdn = 0) {
return 403;
}
}
Risk Assessment Matrix
| Configuration | Volumetric | Application (L7) | Origin Exposure | Overall |
|---|---|---|---|---|
| No CDN | Critical | Critical | Critical | Critical |
| CDN only | Low | High | Medium | Medium |
| CDN + WAF | Low | Medium | Medium | Medium |
| CDN + WAF + Origin lockdown | Low | Low | Low | Low |
| Full stack + monitoring | Very Low | Very Low | Very Low | Very Low |
Recommended Architecture
For most organizations, we recommend:
- DNS: Anycast provider (Cloudflare, Route 53)
- CDN: Major provider with DDoS protection
- Scrubbing: Always-on or on-demand scrubbing center for volumetric attack absorption
- WAF: Cloud WAF (same provider as CDN)
- LB: Cloud load balancer with health checks
- Origin: Firewalled to accept only CDN IPs + mTLS validation
- Monitoring: Real-time traffic dashboards, anomaly detection, origin access alerts
Testing Your Architecture
Passive Testing (Safe)
- DNS enumeration: Discover all subdomains
- Header analysis: Identify CDN/WAF/LB
- Certificate scanning: Find origin exposure
- Historical analysis: Check for leaked origins
Active Testing (Requires Authorization)
- Origin accessibility: Can origin be reached directly?
- WAF bypass: Do rules have gaps?
- Rate limit testing: Are limits enforced?
- Failover testing: Does redundancy work?
Load Testing (Controlled)
- Synthetic traffic: Simulate realistic load
- DDoS patterns: Test specific attack vectors
- Capacity testing: Find breaking points
- Recovery testing: Measure MTTR
Test Your Architecture
DDactic provides automated tooling to assess, test, and monitor all layers of your DDoS defense architecture.
Start Your AssessmentConclusion
Effective DDoS defense requires:
- Multiple layers: No single solution is sufficient
- Proper configuration: Misconfiguration is the #1 vulnerability
- Origin protection: CDN is useless if origin is exposed
- Continuous monitoring: Threats evolve; defenses must too
- Regular testing: Theory isn't enough; validate in practice
Related Articles
Why Your CDN Isn't Protecting YouHow attackers bypass CDN protection to reach origin servers.
Introducing OPI: The Open Protection IndexA new open standard for measuring DDoS resilience.
WAF Configuration: 5 Mistakes That Leave You ExposedCommon WAF misconfigurations and how to fix them.