Skip to content
Devgo

Anycast

Routing the same IP from many locations, letting the network deliver each request to the nearest one. It's how DNS and CDN edges get low latency and resilience. BGP advertises the IP from multiple nodes.

When to use
  • DNS and stateless edge services.
  • DDoS absorption by spreading attack across many sites.
When not to
  • Stateful long-lived connections needing one specific node.
  • When you need load-aware, not topology-aware, distribution.

Definition

Anycast assigns one IP to multiple servers; routers send packets to the topologically nearest announcement. Contrast unicast (one IP, one server) and multicast (one to many).

Why it exists

To put a service in many places but expose one address, so users hit the closest instance automatically and failed nodes just withdraw their route. It gives geographic latency and DDoS spread for free.

How it works

Each site advertises the same IP prefix via BGP. The internet's routing picks the shortest path. If a site fails, it stops advertising and traffic moves elsewhere within seconds. Used heavily for , edges, and DDoS scrubbing.

Scaling limits

Routing is by network topology, not load, so a nearest node can be overloaded while others sit idle. Not suitable for stateful connections that must stick to one node.

Cost shape

Requires your own IP space and BGP presence (expensive) or a provider that offers it. No per-request cost once set up.

Alternatives

  • DNS geo-routing — Geographic routing without BGP, but TTL lag and resolver caching.
  • Unicast + LB — Simpler, but single region unless you add .

Failure modes

  • A node advertising but unhealthy, attracting traffic it can't serve (needs BGP health gating).
  • Routing flaps causing instability.

, ,