Skip to main content
Cloud / DevOpsTraffic & ScalingDiagramAdvanced

Anycast

KO: 애니캐스트·EN: Anycast·JA: エニーキャスト

A network routing technique where multiple globally distributed servers advertise the same single IP address via BGP, automatically routing users to the topologically nearest healthy location

Table of Contents

Structure Diagram

Single Anycast IP Routed to Nearest Healthy BGP PoPsTap a node
NearestNearestNearestBypassedAnycast IPSeoul PoPUS-East P…Frankfurt…Failed Po…
HUBAnycast IP
4 links
Quick Answer

What is Anycast?

A network routing technique where multiple globally distributed servers advertise the same single IP address via BGP, automatically routing users to the topologically nearest healthy location. It is a core concept in Traffic & Scaling within Cloud / DevOps.

Core Principles

Unlike Unicast (one IP maps to one location), Anycast allows multiple geographically distributed data centers to advertise the exact same IP prefix via BGP. Internet routers automatically forward each user's packets to the topologically closest healthy location.

When a data center fails, it withdraws its BGP route and traffic seamlessly shifts to the next nearest PoP within seconds. Anycast also naturally absorbs massive DDoS attacks by diffusing attack traffic across local PoPs close to the botnet sources.

Practical Takeaways

  • Faster failover than DNS: Because the IP address never changes, Anycast bypasses stale client DNS TTL caches and reroutes traffic at the L3 routing layer.
  • Account for BGP route flaps on long-lived TCP: Sudden BGP path changes can steer mid-stream TCP packets to a different PoP and reset the connection. Anycast pairs naturally with stateless DNS, HTTP/QUIC, or cloud global accelerators.
  • Leverage managed global Anycast: Operating your own ASN and global peering is expensive; services like AWS Global Accelerator, GCP Global Load Balancing, and Cloudflare provide turnkey Anycast.

Notable Examples

  • Public DNS Resolvers (1.1.1.1, 8.8.8.8): Route billions of queries worldwide to the nearest PoP using a single memorable IP.
  • Cloudflare & Fastly: Rely on global Anycast networks for ultra-low-latency CDN delivery and distributed DDoS scrubbing.
  • AWS Global Accelerator: Provides static Anycast IPs that onboard user traffic onto the private AWS backbone at the nearest edge.