Networking & Routing

What is Anycast?

Definition

Anycast is a network addressing and routing method where a single IP address is assigned to multiple servers, and routers send traffic to the nearest server based on routing protocol metrics.

Anycast is a routing technique where the same IP address is announced from multiple geographically distributed locations. Unlike unicast (one-to-one) or multicast (one-to-many), anycast provides one-to-nearest communication. The network's routers use metrics like hop count or latency to determine the closest instance.

Border Gateway Protocol (BGP) is commonly used to advertise the anycast prefix from multiple autonomous systems. When a client initiates a connection, BGP routes packets to the nearest destination. This differs from unicast because the destination is not a single host but any of several hosts sharing the same IP. The routing decisions are stateless at the network layer. However, application layer protocols must be anycast-aware to handle potential path changes.

Anycast sits in the network layer and is widely used in DNS root servers, Content Delivery Networks (CDNs), and DDoS mitigation services. It improves reliability and performance by distributing load and providing automatic failover. However, it has limitations for stateful protocols like TCP unless carefully managed, because a change in routing could disrupt an active session.

Key facts

  • A single IP address is advertised from multiple locations.
  • Traffic is routed to the topologically nearest server.
  • Commonly deployed with BGP for global load balancing.
  • Helps mitigate DDoS attacks by distributing traffic.
  • Stateful connections may break if the routing path changes mid-session.

How it works in practice

A prominent example is the DNS root server system. Many root server instances use anycast. For instance, the F-root server operated by ISC is anycasted to dozens of sites worldwide. When a DNS resolver queries the root, it reaches the nearest copy, reducing latency and improving resilience.

Related terms

Unicast Multicast Broadcast Border Gateway Protocol (BGP) Domain Name System (DNS) Content Delivery Network (CDN) IP Anycast

References

More in Networking & Routing

AS Path

A BGP path attribute that lists the sequence of autonomous system numbers a route has passed through, used for loop detection and path selection.

ASN

A globally unique 16 or 32 bit number assigned to an autonomous system for use in BGP routing between organizations on the Internet.

Autonomous System

An Autonomous System (AS) is a group of IP networks under a single administrative routing policy, identified by a unique ASN (Autonomous System Number) for exterior gateway routing.

BGP

BGP (Border Gateway Protocol) is the path vector routing protocol that networks use to exchange reachability information between autonomous systems on the public internet.

CIDR

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing packets using variable-length subnet masks (e.g., /24) instead of fixed classful boundaries.

Hop

A hop is one passage of a packet through a router or other layer-3 forwarding device as it travels from source to destination across an internetwork.

IPv4

IPv4 is the core Internet Protocol using 32-bit addresses, providing roughly 4.3 billion unique identifiers for network interfaces on the global internet.

IPv6

IPv6 is the most recent version of the Internet Protocol, using 128-bit addresses to provide an effectively unlimited number of unique identifiers for networked devices.

Latency

Latency (or round-trip time, RTT) is the time required for a packet to travel from a source to a destination and back, measured in milliseconds, and is a critical metric in network performance.

Looking Glass

A looking glass is a public web-based tool that provides read-only access to a network's BGP routing table, ping, and traceroute diagnostics from that network's perspective.

Who Is Online

In total there are 82 users online: 0 registered, 76 guests and 6 bots.

Bots: Facebook Googlebot Majestic Other Bot Other Spider SemrushBot

Users active in the past 15 minutes. Total registered members: 340