IP anycast is a routing technique in which the same IP address or IP prefix is made reachable from multiple network locations. Internet routing then directs traffic toward one of those locations according to available routes and network policies.
Instead of one IP address representing one physical service location, an anycast service can make the same address available from infrastructure in:
- Singapore;
- Frankfurt;
- São Paulo;
- New York;
- Tokyo;
- and other locations.
A user in Asia might reach the Singapore instance.
A user in Europe might reach Frankfurt.
Both users can connect to exactly the same destination IP address.
The routing system determines which service instance receives their traffic.
This makes anycast useful for distributed infrastructure such as:
- DNS;
- content delivery;
- network-security services;
- global APIs;
- edge infrastructure;
- and DDoS mitigation systems.
However, one important point should be understood from the beginning:
Anycast does not necessarily send a user to the geographically nearest server. It sends traffic according to routing topology and policy.
That distinction explains both the power and the complexity of anycast.
What Is Anycast?
Anycast allows one service address to be reachable from multiple network locations.
RFC 4786 describes the operational model for IP anycast services.
RFC 4786 — Operation of Anycast Services
Consider a service using:
203.0.113.10
With a conventional unicast deployment, that address might lead toward one service location.
With anycast, the same address can be provided from several locations:
Singapore
203.0.113.10
Frankfurt
203.0.113.10
New York
203.0.113.10
The IP address does not change.
What changes is the network path through which the address is reachable.
BGP can advertise reachability for the relevant prefix from multiple locations.
Different parts of the Internet may therefore select different paths toward the same destination address.
How Does IP Anycast Work?
A simplified anycast deployment can be understood in four stages.
1. Multiple Service Locations Use the Same Address
An operator deploys compatible service instances in several locations.
For example:
Singapore node
Frankfurt node
New York node
Each provides the same service.
They share a common service address or prefix.
2. The Prefix Is Announced from Multiple Locations
Each location advertises reachability into the routing system.
For Internet-scale anycast, this commonly involves BGP.
A simplified model might look like:
Singapore → advertises 203.0.113.0/24
Frankfurt → advertises 203.0.113.0/24
New York → advertises 203.0.113.0/24
The global routing system now has several possible paths toward the same prefix.
3. Networks Select Their Preferred Path
Other Autonomous Systems receive those routes.
Their BGP policies determine which path they prefer.
A network in Southeast Asia might use:
User → Regional ISP → Singapore
while a European network might use:
User → European ISP → Frankfurt
4. Traffic Reaches One Anycast Instance
The user sends traffic toward the service IP address.
The routing system forwards that traffic along the selected path.
The application does not necessarily need to know that other service instances exist.
The user simply connects to:
203.0.113.10
Anycast Does Not Mean “Nearest Server”
Anycast is often explained as:
Users are sent to the nearest server.
That explanation is useful but incomplete.
BGP does not normally measure geographic distance.
Routing decisions can be influenced by:
- local preference;
- AS path;
- peering relationships;
- transit relationships;
- route propagation;
- routing policy;
- network topology;
- and traffic-engineering decisions.
A user in Malaysia might therefore not reach the physically closest anycast node.
The network path preferred by BGP could lead elsewhere.
A more accurate description is:
Anycast generally directs traffic toward a topologically preferred reachable service instance, not necessarily the geographically closest one.
This distinction also explains why anycast can complicate IP geolocation.
LARUS Foundation discusses the difference between IP addressing, routing and physical geography in What Is IP Geolocation and Why Can It Be Wrong?.
What Is an Anycast Node?
An anycast node is one location capable of providing the service associated with the shared anycast address.
A node might include:
- routers;
- DNS servers;
- load balancers;
- application servers;
- security infrastructure;
- or several systems operating together.
For example:
Anycast service: 203.0.113.10
may have:
Node A — Singapore
Node B — Tokyo
Node C — Frankfurt
Node D — New York
Together, these nodes form the distributed anycast service.
What Is an Anycast Catchment?
An anycast catchment is the set of users or networks that currently route toward a particular anycast node.
For example:
users across Southeast Asia may route toward Singapore;
European networks may route toward Frankfurt;
and North American networks may route toward New York.
But catchments are not fixed geographic borders.
They can change when:
- BGP routes change;
- providers change routing policy;
- an IXP connection is added;
- a transit link fails;
- a node withdraws its route;
- peering changes;
- or traffic engineering is adjusted.
This makes anycast fundamentally dynamic.
What Is the Role of BGP in Anycast?
BGP is central to most Internet-scale anycast deployments.
BGP allows Autonomous Systems to exchange information about which IP prefixes they can reach.
Suppose an anycast service uses:
203.0.113.0/24
The operator may advertise that same prefix from several locations.
The Internet may see paths toward:
Singapore
Frankfurt
and:
New York
Networks receiving these announcements apply their own routing policies.
Different networks can therefore select different paths toward exactly the same service IP address.
BGP itself does not require a special global “anycast mode.”
The routing system simply sees multiple paths toward the destination.
The combination of:
one service address
plus:
multiple routing locations
creates the anycast behaviour.
The core BGP protocol is defined in RFC 4271 — A Border Gateway Protocol 4.
Anycast vs Unicast
Unicast is the conventional addressing model most Internet users encounter.
Unicast
One destination address normally represents one logical destination.
Example:
User → 203.0.113.10 → Server A
Anycast
The same destination address is reachable from multiple service locations.
Example:
203.0.113.10
might lead one user to:
Server A
while another user reaches:
Server B
| Feature | Unicast | Anycast |
|---|---|---|
| Same service address at multiple locations | Usually no | Yes |
| Routing selects among service locations | Usually no | Yes |
| Useful for distributed infrastructure | Possible | Strong use case |
| Geographic distribution | Architecture-dependent | Common design goal |
| Routing-based failover | Architecture-dependent | Common capability |
An anycast address does not need to look different from a normal unicast address.
RFC 7094 discusses the architectural implications of using IP anycast.
RFC 7094 — Architectural Considerations of IP Anycast
Anycast vs Multicast
Anycast and multicast solve different problems.
Anycast
One sender sends traffic toward:
one selected service instance
from several possible instances.
Multicast
One sender distributes traffic toward:
multiple receivers
participating in a multicast group.
A simplified comparison is:
Unicast
one → one
Anycast
one → one of many
Multicast
one → many
Anycast therefore does not send one user's request to every server sharing the address.
The routing system selects a path toward one reachable instance.
Anycast vs Load Balancing
Anycast can distribute traffic, but it is not the same as precise load balancing.
Suppose an operator has three locations:
Singapore
Frankfurt
New York
Anycast does not automatically guarantee that each site receives exactly one-third of global traffic.
Actual distribution may look more like:
Singapore → 50%
Frankfurt → 30%
New York → 20%
because routing topology and policy influence catchment sizes.
Operators often combine anycast with local load balancing.
The architecture then becomes:
Global BGP routing
↓
selected anycast location
↓
local load balancer
↓
individual server
Anycast can therefore distribute users between locations while another system distributes requests within each location.
Why Is Anycast Commonly Used for DNS?
DNS is one of the best-known anycast use cases.
DNS infrastructure has characteristics well suited to distributed deployment:
- requests are relatively small;
- responses are usually short;
- many transactions are short-lived;
- multiple compatible server instances can exist;
- and high availability is important.
An operator can publish one stable DNS service address while running instances across multiple locations.
Users do not need to manually select:
Singapore DNS,
Frankfurt DNS,
or New York DNS.
They query one address.
Routing determines which instance receives the request.
Is Anycast Used by Root DNS Infrastructure?
Yes.
Anycast has long played an important role in globally distributed DNS infrastructure.
A logical DNS service can be supported by many physical instances distributed across different locations.
This demonstrates an important architectural principle:
One logical Internet service does not necessarily mean one physical server.
One stable service address can be supported by distributed infrastructure.
Why Do Content Networks Use Anycast?
Content and edge networks can also benefit from anycast.
Imagine infrastructure in:
- Tokyo;
- Singapore;
- Frankfurt;
- London;
- Virginia;
- and São Paulo.
Instead of requiring every user to connect to one distant location, the operator can make the service reachable from multiple network locations.
Potential benefits include:
- lower network latency;
- regional capacity;
- geographic redundancy;
- shorter paths;
- and reduced dependency on one data centre.
Anycast is therefore commonly associated with global edge architecture.
Anycast vs CDN
Anycast and a Content Delivery Network are not the same thing.
A CDN is an architecture for distributing and delivering content.
Anycast is a routing technique.
A CDN might use:
- DNS-based steering;
- HTTP redirects;
- application logic;
- anycast;
- or several techniques together.
Therefore:
CDN
describes the distributed service architecture.
Anycast
describes one possible way of directing network traffic.
A service does not automatically become a CDN simply because it uses anycast.
Anycast vs DNS-Based Traffic Steering
DNS-based traffic steering can return different addresses to different users.
For example:
User A:
example.com → 203.0.113.10
User B:
example.com → 198.51.100.20
The DNS system contributes to the traffic-distribution decision.
With anycast:
User A:
example.com → 203.0.113.10
User B:
example.com → 203.0.113.10
Both users receive the same IP address.
But routing may send them to different service locations.
The decision therefore happens at a different layer.
DNS steering and anycast can also be combined.
How Does Anycast Improve Resilience?
Suppose a service exists only in Singapore.
If that site becomes unreachable, the service may fail unless another recovery mechanism exists.
An anycast architecture might instead include:
Singapore
Tokyo
Frankfurt
New York
If Singapore fails and its route is withdrawn appropriately, networks may select alternative paths toward the remaining locations.
Conceptually:
Before failure:
User → Singapore
After route withdrawal:
User → Tokyo
The destination address does not need to change.
The routing system changes the path.
This can make anycast useful for geographic redundancy.
However, successful failover still depends on:
- health detection;
- route withdrawal;
- routing convergence;
- network capacity;
- and application design.
Anycast should not be treated as automatic outage immunity.
Anycast and Internet Exchange Points
Internet Exchange Points can play an important role in anycast architecture.
An operator may deploy a node in a data centre connected to an IXP.
At the exchange, the operator can potentially peer directly with:
- Internet service providers;
- mobile networks;
- cloud networks;
- content providers;
- universities;
- and other Autonomous Systems.
This can improve regional reachability.
Adding a new peering relationship can also change an anycast node's catchment.
This shows why anycast performance depends not only on physical location, but also on the network relationships around that location.
Does Anycast Reduce Latency?
It can.
If routing directs users toward a nearby and well-connected node, the resulting network path may be shorter than sending every request to one distant data centre.
For example:
Without regional infrastructure:
Malaysia → distant global hub → service
With a well-connected regional node:
Malaysia → regional network → service
The second path may provide lower latency.
But anycast does not guarantee minimum latency.
BGP chooses routes according to network policy and topology rather than a universal real-time latency measurement.
A physically closer node can therefore sometimes lose to a more preferred network path.
Does Anycast Protect Against DDoS Attacks?
Anycast can improve DDoS resilience, but it is not a complete DDoS defence by itself.
Suppose an attack generates very large amounts of traffic toward one service IP.
If that address is reachable from only one location, most traffic may converge on the same infrastructure.
In a broad anycast deployment, different attacking networks may route toward different nodes.
The attack load can therefore be distributed across multiple catchments.
RFC 7094 discusses security and denial-of-service considerations associated with IP anycast.
However, anycast does not make malicious traffic disappear.
Operators still need controls such as:
- sufficient network capacity;
- filtering;
- rate limiting;
- upstream mitigation;
- DDoS scrubbing;
- monitoring;
- and incident response.
Anycast is one part of the resilience architecture.
Why Route Withdrawal During a DDoS Attack Can Be Dangerous
Suppose one anycast location receives heavy attack traffic.
It might appear sensible to immediately withdraw that route.
But the attack does not necessarily disappear.
Routing can move the attack traffic toward another node.
For example:
Attack → Singapore
Singapore withdraws
↓
Attack → Tokyo
Tokyo reaches capacity
↓
Attack → Frankfurt
This can create cascading pressure.
Anycast DDoS design therefore needs to consider the capacity of the distributed system as a whole.
What Happens When an Anycast Node Fails?
The desired behaviour is usually:
failed node
→ route withdrawn
→ routing reconverges
→ users reach another node
But the real situation can be more complicated.
Application Failure Without Routing Failure
Suppose the router remains healthy while the application behind it stops working.
BGP may continue advertising the route.
Users then have:
a valid network path to a broken service.
The routing system believes the destination is reachable because the route still exists.
This is why advanced anycast deployments often connect application health with routing decisions.
Network Failure
If connectivity disappears and the route is withdrawn, neighbouring networks may select alternative paths.
Partial Failure
Some users may still reach the node while others cannot.
Distributed monitoring is therefore important.
Why Anycast Monitoring Is More Difficult
Imagine a service with nodes in:
Singapore,
Frankfurt,
and New York.
An operator in Singapore tests the anycast address and receives a successful response.
That does not prove the Frankfurt or New York nodes are healthy.
The operator may simply be routed back to Singapore.
Monitoring should therefore examine the service from multiple network locations.
Useful measurements include:
- application availability;
- BGP announcements;
- route changes;
- latency;
- packet loss;
- regional reachability;
- and individual node health.
Operators should answer two separate questions:
Is the service working?
and:
Is routing directing users toward functioning nodes?
Anycast and Stateful Applications
Anycast becomes more complicated when applications maintain substantial connection state.
Suppose traffic initially reaches:
Node A
and a routing change later sends packets toward:
Node B.
If Node B does not have the session state created by Node A, the connection may fail.
This matters for:
- long-lived sessions;
- stateful firewalls;
- real-time applications;
- databases;
- transaction systems;
- and some TCP-based services.
Anycast is therefore especially straightforward for services that can tolerate requests being handled by different compatible nodes.
Stateful systems require more careful design.
Can TCP Work with Anycast?
Yes.
TCP services can operate over anycast.
But designers need to consider route stability and connection state.
During an established connection, traffic generally needs to continue reaching infrastructure capable of maintaining that session.
If routing moves a flow to an unsynchronised node, the connection may reset.
This does not mean TCP and anycast are incompatible.
It means the architecture should consider:
- connection duration;
- route stability;
- state synchronisation;
- failure behaviour;
- and connection termination.
Anycast and IPv4
Anycast can be implemented using IPv4.
For example:
203.0.113.0/24
might be advertised from:
Singapore,
Frankfurt,
and New York.
Different networks select different paths toward the same prefix.
The destination address remains stable.
Anycast and IPv6
Anycast can also be used with IPv6.
A dual-stack service may advertise:
an IPv4 prefix
and:
an IPv6 prefix
from several locations.
Importantly, IPv4 and IPv6 catchments do not necessarily have to match.
Their routing topologies and peering relationships can differ.
A user might therefore reach one location over IPv4 and another over IPv6.
Anycast and IP Geolocation
Anycast creates an important challenge for IP geolocation.
Suppose:
203.0.113.10
is actively serving traffic from:
Singapore,
Frankfurt,
New York,
and São Paulo.
What is the physical location of the IP address?
There may be no single meaningful answer.
One user reaches Singapore.
Another reaches Frankfurt.
Another reaches New York.
A geolocation database that assigns the address to one city may therefore describe only part of the operational reality.
This reinforces a broader principle:
An IP address does not inherently encode one physical location.
LARUS Foundation explains this distinction in What Is IP Geolocation and Why Can It Be Wrong?.
Anycast and Routing Security
Anycast depends heavily on routing.
That means normal routing-security practices remain important.
Operators should consider:
- RPKI;
- Route Origin Authorisations;
- prefix filtering;
- IRR data;
- BGP monitoring;
- route leaks;
- unexpected origins;
- and routing hijacks.
A distributed service can be healthy while incorrect routing information causes users to reach an unintended path.
Anycast therefore does not replace routing security.
It makes accurate routing coordination even more important.
Can a BGP Route Leak Affect Anycast?
Yes.
An anycast service depends on routing advertisements being propagated correctly.
A route leak can change path selection and unexpectedly alter catchments.
Users who normally reach:
Node A
could suddenly begin reaching:
Node B
through an unintended path.
Traffic may also cross infrastructure that was never supposed to carry it.
LARUS Foundation explains this type of routing failure in What Is a BGP Route Leak and Why Does It Matter?.
This demonstrates why distributed service architecture and routing policy cannot be separated.
Anycast Does Not Eliminate Capacity Planning
Suppose an anycast service has ten locations.
That may sound highly redundant.
But imagine one node handles 60% of normal traffic because of routing topology.
If that node disappears, the remaining infrastructure must have enough capacity to absorb redistributed traffic.
Operators therefore need to understand:
- normal catchment size;
- peak traffic;
- failure scenarios;
- DDoS traffic;
- server capacity;
- network capacity;
- and upstream capacity.
The number of nodes alone does not determine resilience.
A distributed architecture becomes resilient when the remaining system can continue operating after failures.
Anycast Does Not Guarantee Infrastructure Diversity
An operator may advertise an anycast prefix from three data centres.
But all three sites could still depend on:
- the same upstream carrier;
- the same fibre system;
- the same cloud provider;
- the same management platform;
- or another shared dependency.
Logical distribution does not automatically create physical independence.
Resilience analysis therefore needs to examine several layers.
This is especially important when organisations use anycast as part of business-continuity or critical-infrastructure planning.
Advantages of IP Anycast
A well-designed anycast architecture can provide several benefits.
Distributed Service Delivery
The same service address can be reachable from multiple infrastructure locations.
Lower Latency
Users may reach a topologically closer service node.
Resilience
A failed node can potentially be removed from routing while other nodes continue providing the service.
Scalability
Additional nodes can expand the service footprint.
DDoS Resilience
Attack traffic can potentially be distributed across multiple network catchments.
Stable Addressing
Clients can continue using the same service IP even when the serving infrastructure changes.
Regional Interconnection
Anycast nodes connected to local IXPs can improve regional network reachability.
Risks and Limitations of Anycast
Anycast also introduces operational complexity.
Routing Can Change
Catchments depend on BGP topology and policy.
Geography Is Not Guaranteed
The selected node may not be the geographically closest one.
Traffic Can Be Uneven
Some locations may receive far more traffic than others.
Stateful Services Require Care
Routing changes can disrupt sessions.
Monitoring Is More Complex
One monitoring location cannot represent every catchment.
Application and Routing Health Must Be Coordinated
A functioning route does not guarantee a functioning application.
DDoS Traffic Can Move
Removing one node may shift malicious traffic toward another.
Routing Security Remains Necessary
Route leaks and incorrect announcements can change service reachability.
Anycast Deployment Checklist
Before deploying an Internet-scale anycast service, operators should review several areas.
Addressing
- Which IPv4 and IPv6 prefixes will be used?
- Will the same service address be active at every node?
- Is the prefix suitable for the intended routing architecture?
Routing
- Which ASN will originate the prefix?
- Which transit providers are used?
- Which IXPs are used?
- Are routing policies consistent?
- Are RPKI ROAs accurate?
Application Design
- Is the service stateless or stateful?
- Can users move between nodes safely?
- How long do sessions last?
- Is application state synchronised where necessary?
Health Checking
- What happens if the application fails but BGP remains up?
- Can unhealthy nodes stop attracting traffic?
- How quickly is failure detected?
Capacity
- Can remaining nodes absorb traffic after a site failure?
- Can they absorb attack traffic?
- Is capacity distributed appropriately?
Monitoring
- Is the service tested from multiple regions?
- Are individual nodes monitored?
- Are BGP changes visible?
- Are catchment changes understood?
Security
- Are RPKI records maintained?
- Are routing filters appropriate?
- Are unexpected origins monitored?
- Are DDoS response procedures tested?
Anycast should ultimately be treated as a combination of:
routing architecture
and:
distributed systems engineering.
Frequently Asked Questions
What is IP anycast?
IP anycast is a routing technique in which the same IP address or prefix is made reachable from multiple network locations, allowing routing protocols to direct traffic toward one of several service instances.
How does anycast work?
Multiple network locations advertise reachability to the same IP prefix. The routing system evaluates those routes and forwards users toward a selected location.
Does anycast use BGP?
Internet-scale anycast commonly uses BGP to advertise the same service prefix from multiple network locations.
Does anycast always send users to the nearest server?
No. Routing decisions are based on network topology and policy rather than physical distance alone.
What is an anycast node?
An anycast node is one infrastructure location capable of providing the service associated with the shared anycast address.
What is an anycast catchment?
A catchment is the group of users or networks that currently route toward a particular anycast node.
What is the difference between anycast and unicast?
Unicast normally routes an address toward one logical destination. Anycast makes the same service address reachable from multiple locations and lets routing select among them.
What is the difference between anycast and multicast?
Anycast directs traffic to one selected destination from several possible destinations. Multicast distributes traffic to multiple participating receivers.
Is anycast load balancing?
Anycast can distribute traffic between locations, but it does not guarantee equal load distribution.
Why is anycast used for DNS?
DNS services can be deployed at many locations while continuing to use one stable service address. This makes DNS particularly suitable for anycast.
Can anycast reduce latency?
Yes, when routing sends users toward well-connected regional infrastructure. However, it does not guarantee the geographically closest or lowest-latency node.
Does anycast prevent DDoS attacks?
No. It can improve DDoS resilience by distributing traffic across multiple locations, but other mitigation controls are still required.
Can anycast work with TCP?
Yes. However, operators need to consider session state and the possibility of routing changes during long-lived connections.
Does anycast work with IPv6?
Yes. Anycast can be deployed using both IPv4 and IPv6.
Can the same anycast IP exist in different countries?
Yes. The same service address can be announced from network infrastructure operating in several countries or regions.
Does anycast affect IP geolocation?
Yes. A globally distributed anycast address may not correspond to one meaningful physical location, making single-city geolocation potentially misleading.
What happens when an anycast node fails?
If routing is configured appropriately, the failed node's route can be withdrawn and users can move toward another reachable instance.
Conclusion
IP anycast demonstrates an important characteristic of Internet architecture:
an IP address does not always correspond to one physical machine in one physical place.
The same service address can be made reachable from many independent infrastructure locations.
Routing then determines which location receives a user's traffic.
The architecture can be summarised as:
one service address
→ multiple network locations
→ distributed routing decisions
→ one selected service instance
This model can support:
- lower latency;
- geographic distribution;
- resilient DNS infrastructure;
- edge services;
- scalable service delivery;
- and improved DDoS resilience.
But anycast is not automatic resilience.
It does not guarantee that users reach the geographically nearest node.
It does not guarantee equal traffic distribution.
It does not eliminate application-state problems.
It does not replace capacity planning.
And it does not replace routing security.
Its effectiveness depends on the surrounding infrastructure:
BGP policy
peering
transit
IXPs
RPKI
application health
monitoring
and:
physical infrastructure diversity.
Anycast is therefore a useful example of how the Internet combines shared technical standards with distributed operation.
There is no single global router deciding which server every Internet user must reach.
Independent networks exchange routing information and apply their own operational policies.
Distributed services can then use those routing decisions to make one IP address reachable from many locations.
That is the deeper value of anycast:
One stable service address can be supported by many independent service locations, while routing determines which instance serves each part of the Internet.
When designed carefully, anycast can improve availability and distribute infrastructure without requiring users to know where the underlying service is physically located.
