Anycast
Subject: Computer and Technology noun /ˈɛn.iˌkæst/ 1 definition
- computer-networking
- internet-routing
- ip-addressing
- distributed-systems
-
Definition (noun)
Entry #324 · UpdatedAnycast is a network addressing and routing methodology in which multiple geographically or topologically distributed nodes share the same destination IP address. Instead of binding an address to a single physical host, participating sites simultaneously announce the shared IP prefix into the network's routing table—typically via Border Gateway Protocol (BGP) across the internet or interior gateway protocols such as OSPF within an autonomous system—so routers forward each packet to whichever instance is topologically nearest according to routing metrics. By directing clients to nearby points of presence and withdrawing routes from failed or overloaded servers, anycast reduces round-trip latency, absorbs volumetric denial-of-service (DDoS) floods across distributed capacity, and provides transparent failover. Unlike unicast (one-to-one), broadcast (one-to-all), or multicast (one-to-many), anycast implements a one-to-nearest delivery model whose active path can change mid-flow during topology shifts, making it naturally suited to stateless protocols like DNS while requiring route stability or session synchronization for stateful TCP traffic.
Common Forms
Global BGP Anycast: Advertises an identical IP prefix (typically
/24or shorter for IPv4 and/48or shorter for IPv6) from multiple geographically dispersed points of presence over external BGP (eBGP), allowing internet routers to route packets along the shortest autonomous-system path.Intra-Domain IGP Anycast: Announces a shared
/32IPv4 or/128IPv6 loopback address within a single autonomous system or data-center fabric using interior gateway protocols such as OSPF or IS-IS—often combined with Equal-Cost Multi-Path (ECMP) forwarding—to distribute load across nearby service instances.IPv6 Subnet-Router Anycast: Uses a standardized anycast address carved directly from the IPv6 unicast address space (RFC 4291), such as the subnet-router address with an all-zero interface identifier, so hosts automatically reach the nearest configured router on a subnet.
Stateful Edge Anycast: Extends anycast beyond stateless UDP services to long-lived TCP and TLS streams at content delivery networks (CDNs) by pairing BGP route stability, consistent ECMP flow hashing, and local TLS termination to minimize mid-connection path disruptions.
Example
A global DNS provider uses AS 64500 to announce the IPv4 prefix
198.51.100.0/24(hosting resolver198.51.100.1) over BGP from points of presence in both Frankfurt and Tokyo. When a client in Osaka sends a UDP port 53 query to198.51.100.1, its ISP's border router selects the shorter AS path to the Tokyo PoP—resolving the lookup in under 15 milliseconds—and automatically converges onto the Frankfurt path if the Tokyo site withdraws its BGP announcement during maintenance.