Anycast and load distribution on the network
In short: With anycast the same IP address belongs to many servers in different places. Routing automatically sends requests to the nearest one. This lowers latency and absorbs attacks.
In more detail: Several sites announce the same address via BGP. Routers choose the “nearest” path for each sender. If a site fails it withdraws its announcement and traffic moves to the others. Public DNS services (for example 1.1.1.1, 8.8.8.8) and CDNs use it.
In Depth
- Advantages: Lower latency, built-in fault tolerance, DDoS traffic spreads over many sites.
- Drawback: Long TCP connections can switch site mid-way when routes change. Hence often for stateless services (DNS, UDP, short HTTP requests).
- Unicast/multicast/broadcast/anycast: One-to-one, one-to-group, one-to-all, one-to-nearest.
- Load balancers: Within a site, layer-4/7 balancers distribute further.
- GeoDNS: Alternative that steers via DNS answers.
See also: BGP and routing on the internet, CDN (content delivery network)