Anycast: One Address, Many Destinations

· James Thornton · 9 min read

Anycast networking is the routing technique that makes modern CDNs possible — a method where a single IP address is announced from multiple geographic locations simultaneously, and the network automatically routes each user to the nearest one. When you connect to Cloudflare's DNS resolver at 1.1.1.1 or Google's at 8.8.8.8, you're using anycast: those IP addresses exist in hundreds of locations worldwide, and BGP routing ensures your request reaches the closest instance. Anycast is the foundation of CDN geo-routing and DDoS protection.

What Is the History of Anycast?

Anycast's journey from theoretical concept to critical internet infrastructure spans three decades:

Network Addressing Methods — Anycast (used by CDNs) delivers traffic to the nearest of many servers Anycast vs Unicast vs Multicast vs Broadcast — Network addressing comparison Network Addressing Methods Compared Unicast One sender → One receiver S R Anycast One sender → Nearest of many S N Multicast One sender → Group members S Broadcast One sender → All on network S Standard web traffic CDN & DNS Live streaming, IPTV ARP, DHCP (LAN only)
Figure 1: Network Addressing Methods — Anycast (used by CDNs) delivers traffic to the nearest of many servers sharing the same address

How Does Anycast Routing Work?

Anycast works by leveraging BGP's natural behavior. When multiple locations announce the same IP prefix, BGP treats them as different paths to the same destination and selects the "best" path according to its decision process — typically the shortest AS-PATH, which usually correlates with geographic proximity:

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages
  1. Prefix Announcement: A CDN provider assigns the same IP prefix (e.g., 104.26.0.0/20) to servers in all its PoPs (Points of Presence) worldwide — Tokyo, London, New York, São Paulo, etc.
  2. BGP Advertisement: Each PoP's BGP routers announce this prefix to their peering partners and upstream transit providers. The BGP announcements from different locations carry different AS-PATHs (reflecting the local peering topology).
  3. Routing Convergence: ISPs worldwide receive multiple advertisements for the same prefix from different geographic origins. Their BGP decision process selects the "best" path — typically the one with the shortest AS-PATH length.
  4. Traffic Delivery: When a user sends a packet to the anycast IP, their ISP's router forwards it along the selected BGP path to the nearest CDN PoP. The user doesn't know (or care) which physical server receives the packet.

Why Is Anycast Essential for CDN Performance?

Anycast provides several critical advantages for content delivery:

What Are the Challenges of Anycast?

Anycast is not without trade-offs:

Which Major Services Use Anycast?

ServiceAnycast IPsLocationsUse Case
Cloudflare CDNEntire network310+ citiesCDN, DNS, DDoS, edge compute
Google Public DNS8.8.8.8, 8.8.4.430+ countriesDNS resolution
Cloudflare DNS1.1.1.1, 1.0.0.1310+ citiesDNS resolution + privacy
DNS Root Servers13 letter addresses1,700+ instancesDNS root resolution
FastlyEntire network80+ PoPsCDN, edge compute
AWS Route 53DNS infrastructure100+ locationsManaged DNS
Anycast DDoS Absorption — A 1 Tbps attack targeting a single IP is automatically distributed across Anycast DDoS Absorption — Attack traffic distributed across global PoPs Anycast DDoS Absorption 1 Tbps DDoS Attack → 104.26.10.1 Tokyo PoP Absorbs ~250 Gbps London PoP Absorbs ~250 Gbps New York PoP Absorbs ~250 Gbps SP PoP Absorbs ~250 Gbps Each PoP handles 250 Gbps — easily within capacity. Attack mitigated.
Figure 2: Anycast DDoS Absorption — A 1 Tbps attack targeting a single IP is automatically distributed across all CDN PoPs, each absorbing a manageable fraction

External References

References & Standards: RFC 7234 · OWASP CDN Security