What is Anycast? One IP, Many Servers

Anycast is a network addressing method where the same IP address is announced from multiple locations simultaneously. When a client sends traffic to an anycast address, BGP routing delivers it to the nearest announcing location — "nearest" in terms of network topology, not geography, though the two often correlate.

How Anycast Works

In normal unicast routing, each IP address belongs to exactly one server. In anycast, the same prefix is announced from many different locations. BGP treats each announcement as a valid route and selects the best one based on AS path length and local preference.

For example, 1.1.1.1 is announced by Cloudflare (AS13335) from over 300 cities worldwide. When you query 1.1.1.1, your traffic goes to whichever Cloudflare data center BGP determines is closest to your network. Users in Tokyo reach a server in Tokyo; users in London reach a server in London — all using the same IP address.

Where Anycast is Used

Anycast and TCP

Anycast works naturally with UDP protocols like DNS, where each query is independent. For TCP-based services (HTTPS), anycast requires more care — a TCP connection must stay at the same server for its duration. This works because BGP routes are usually stable for minutes or hours, and modern implementations use techniques like ECMP flow hashing to keep connections pinned.

Viewing Anycast in the Routing Table

You can observe anycast in action by looking at how a single prefix is visible from multiple paths. Look up any major anycast address to see the AS paths converging on the same origin AS from different directions:

See BGP routing data in real time

Open Looking Glass
More Articles
What is BGP? The Internet's Routing Protocol Explained
What is an Autonomous System (AS)?
What is a BGP Looking Glass?
How to Look Up an IP Address's BGP Route
Understanding BGP AS Paths
What is RPKI? Securing BGP Routing
What is DNS? The Internet's Phone Book
What is an IP Address?
IPv4 vs IPv6: What's the Difference?
What is a Network Prefix (CIDR)?
What is an Internet Exchange Point (IXP)?
What is Peering? How Networks Interconnect
How Does Traceroute Work?
What is a CDN? Content Delivery Networks Explained
What is DNS over HTTPS (DoH)?
What is a BGP Hijack?
What are TLDs? Top-Level Domains Explained
What is a Subnet? IP Subnetting Explained