Networking Practical By Samson Tanimawo, PhD Published Apr 10, 2025 4 min read

Anycast Deployment

BGP-based.

What anycast deployment is

The same IP address advertised from multiple geographic locations. The internet's BGP routing sends each user to the nearest location.

Replaces or complements DNS-based routing. Anycast is at the IP layer; DNS is at the name layer. Anycast is faster to converge.

Common for DNS, CDN edge, public APIs, DDoS scrubbing services.

Benefits over DNS routing

Faster convergence. DNS TTLs are seconds to minutes; BGP convergence is seconds.

No DNS-resolver-cache confusion. Each user gets to the nearest PoP regardless of resolver.

Failover is implicit. If a PoP withdraws its BGP advertisement, traffic shifts automatically.

Infrastructure requirements

BGP relationships with transit providers. Either own ASN or use a provider's anycast service.

Multiple PoPs in different regions. Single-PoP anycast is just unicast.

Health-checked withdrawal. When a PoP fails, withdraw the BGP advertisement to remove from rotation.

When anycast doesn't work

Stateful services. Anycast is great for stateless requests; problematic for long-lived connections that may shift mid-stream.

TCP works mostly OK due to connection-tracking, but rebalancing during BGP convergence can drop connections.

WebSocket and similar long-lived flows are harder. Often handled with anycast for initial connect, unicast for upgraded protocol.

Operating anycast

Per-PoP health monitoring. Withdraw automatically on failure; advertise after recovery.

Capacity planning per PoP. Each PoP must handle nearby traffic. Over-provision for failover scenarios.

BGP relationship management. Transit providers, peering relationships, route filters. Operational expertise required.