A client sends a packet to the same IP address every time, and the network itself decides which of the many nodes holding that address receives it, usually the nearest. The idea was described in RFC 1546, “Host Anycasting Service”, in 1993; today DNS servers, CDN nodes and the global load balancers of cloud providers run on anycast.
How it works
- Each node assigned the address announces it to its neighbours over BGP as an ordinary route to a network.
- The client doesn’t know how many copies of the service exist: it sends the packet to an ordinary address.
- Routers pick the shortest path by their own metric, so traffic generally arrives at the nearest node.
- The network handles failure by itself: when a node at one location disappears along with its announcement, traffic moves to a neighbouring one.
State and TCP
RFC 1546 defines anycast as a stateless service: the network is not obliged to deliver two consecutive packets to the same node. For a DNS query this doesn’t matter, but a long-lived TCP connection is sensitive to path changes: if packets start arriving at a different location in the middle of a session, the connection may break. That is why an anycast address usually fronts the entry to a service, such as a DNS query or the first request to an edge node, while load balancers inside the location distribute traffic among specific servers.
Where it is used
- DNS servers and CDN nodes: one address serves the whole network of locations, and the request goes to the nearest one.
- Global cloud load balancers: the global external Application Load Balancer in Google Cloud has one anycast address for all regions.
- DDoS protection: attack traffic is scattered across many locations, and each absorbs its share locally.
- IPv6: every subnet has a reserved subnet-router anycast address, and packets sent to it are delivered to any router in the subnet.
Limitations
An anycast address is syntactically indistinguishable from an ordinary unicast address, so nodes have to be configured explicitly, as RFC 4291 notes. A global anycast set with no topological aggregation needs a separate entry in routing tables across the whole internet, which RFC 4291 calls a serious scalability limitation. Diagnostics are also different: different clients reach different locations through the same address, so you have to check each of them.
Sources
the term is written from these pages- RFC 4291 — IP Version 6 Addressing Architecturerfc-editor.org/rfc/rfc4291.html(opens in a new tab)
- RFC 1546 — Host Anycasting Servicerfc-editor.org/rfc/rfc1546.html(opens in a new tab)
- Google Cloud — Cloud Load Balancing overviewcloud.google.com/load-balancing/docs/load-balancing-overview(opens in a new tab)
Verified 9 Nov