← Lessons

quiz vs the machine

Platinum1820

Networking

Anycast Load Balancing

Announcing one address from many sites so the network routes each user to the nearest.

6 min read · advanced · beat Platinum to climb

One address, many homes

In anycast, the same IP address is announced from multiple locations. The routing system, using BGP on the internet, delivers each client's packets to the topologically nearest announcing site. The network itself becomes the balancer.

Why it is powerful

  • Low latency: users reach the closest point of presence automatically.
  • Built in failover: if a site withdraws its route, traffic reroutes to the next nearest site within routing convergence time.
  • DDoS absorption: attack traffic is spread across many sites rather than hitting one.

This is why content delivery networks and public DNS resolvers rely heavily on anycast.

The TCP concern

Anycast routing can change mid path if BGP reconverges, potentially sending packets of one connection to a different site. For short stateless exchanges like a DNS query this is harmless. For long lived TCP this risks resetting the connection, so operators keep routing stable or terminate connections close to the edge.

Anycast versus DNS balancing

DNS balancing chooses an address; anycast makes one address resolve to many places. They compose: GSLB can hand out an anycast address that then routes to the nearest site.

Key idea

Anycast announces one address from many sites and lets routing carry each user to the nearest, giving low latency and failover, with care needed for long lived TCP if routes change.

Check yourself

Answer to earn rating on the learn ladder.

1. In anycast load balancing, the same IP address is:

2. Why can long lived TCP be tricky over anycast?

3. A security benefit of anycast is: