Anycast

Networking

A routing technique where the same IP address is announced from multiple locations worldwide. The network routes each request to the nearest location, giving users the lowest latency path automatically.

Updated Mar 9, 2026

Full Explanation

Anycast is the backbone of how modern CDNs work. Instead of giving each server its own IP, you announce the same IP from dozens or hundreds of locations. When a user connects, BGP routing sends them to the closest one. No DNS tricks needed—it happens at the network layer.

This is how CDNs achieve sub-20ms latency globally. Your user in Tokyo hits the Tokyo PoP. Your user in Amsterdam hits AMS. Same IP, different physical servers. If a PoP goes down, BGP automatically reroutes traffic to the next closest one within seconds.

The catch: Anycast works best with stateless protocols like DNS (UDP) and HTTP over TCP/QUIC. Long-lived TCP connections can break during routing changes, though modern CDNs handle this gracefully with connection migration.

Explore the interactive CDN Backbone Map animation in the course to see how Anycast routes traffic across global PoPs.

Examples

Most CDNs use Anycast by default. When you dig a CDN hostname, you get an Anycast IP:

$ dig +short cdn.example.com
104.16.132.229

# Same IP resolves everywhere, but traceroute
# shows different paths depending on your location
$ traceroute 104.16.132.229
# From Amsterdam: routes to AMS PoP
# From Tokyo: routes to NRT PoP

Video Explanation

Frequently Asked Questions

A routing technique where the same IP address is announced from multiple locations worldwide. The network routes each request to the nearest location, giving users the lowest latency path automatically.

Most CDNs use Anycast by default. When you dig a CDN hostname, you get an Anycast IP:

$ dig +short cdn.example.com
104.16.132.229

# Same IP resolves everywhere, but traceroute
# shows different paths depending on your location
$ traceroute 104.16.132.229
# From Amsterdam: routes to AMS PoP
# From Tokyo: routes to NRT PoP

Related CDN concepts include:

  • Autonomous System (AS) — A collection of IP networks under a single administrative domain with a unified routing policy. …
  • BGP (Border Gateway Protocol) — The routing protocol that makes the internet work. BGP allows autonomous systems to exchange routing …
  • Edge Server — A CDN server located at the network edge, close to end users. Handles caching, SSL …
  • Point of Presence (PoP) — A physical location containing CDN edge servers and networking equipment. PoPs are identified by airport …