How does anycast work in IPv6, and what is the subnet-router anycast address?
Show the answer
Say this first
An anycast address is an ordinary unicast address configured on more than one node. Nothing in the address
marks it as anycast; routing delivers each packet to the nearest instance. Nodes skip DAD for it. The
subnet-router anycast address is the subnet prefix with an all-zero interface ID, for example
2001:db8:acad:10::, and it reaches any one router on that subnet.
Go deeper
How it works
Several nodes advertise or are configured with the same address. Routing protocols pick the best path, so each client reaches the closest one by metric. That is how DNS resolvers, root servers and CDNs spread load and survive site failures, in IPv4 and IPv6 alike.
On Cisco
interface Loopback53
ipv6 address 2001:db8:acad:ff::53/128 anycastThe anycast keyword tells IOS to skip DAD for this address. The loopback is then redistributed or
advertised from every site that hosts the service.
Subnet-router anycast
RFC 4291 reserves the address with the interface ID all zeros on every subnet, and routers must answer to it. It is rarely used directly, but it explains two things:
- Why you should not assign
prefix::to a host on a /64. - Why /127 links were once discouraged: one of the two addresses is the subnet-router anycast address. RFC 6164 settles it by saying routers do not use subnet-router anycast on /127 links.
What anycast is not
The "anycast gateway" in data center fabrics is a different idea: the same gateway IP and MAC on every leaf switch, each serving its own locally attached hosts.
They will ask next
What breaks with anycast and TCP?
If routing shifts mid-session, packets start landing on a different instance that has no state for the connection and it resets. That is why anycast is most at home with short UDP exchanges like DNS, and why TCP anycast services keep routing stable.
Is there an IPv4 equivalent?
Yes, the same technique is used with IPv4: one prefix announced from many sites via BGP. IPv6 just names it as an address type and defines the subnet-router anycast address.
Traps
- Saying anycast addresses come from a special prefix.
- Confusing anycast with multicast. Anycast reaches one receiver, multicast reaches all that joined.