Anycast is a network addressing and routing scheme whereby data is routed to the "nearest" or "best" destination.
- In unicast, there is a one-to-one association between network address and network endpoint: each destination address uniquely identifies a single receiver endpoint.
- In broadcast and multicast, there is a many-to-one association between network addresses and network endpoints: each destination address identifies a set of reciever endpoints, to which all information is replicated.
- In anycast, there is also a many-to-one association between network addresses and network endpoints: each destination address identifies a set of receiver endpoints, but only one of them is chosen at any given time to receive information from any given sender.
Anycast is best suited to connectionless protocols like UDP, rather than connection-oriented protocols such as TCP, since the reciever selected for any given source may change from time to time as optimal routes change, silently breaking any conversations that may be in progress at the time.
For this reason, anycast is generally used as a way to provide high availability and load balancing for stateless services such as access to replicated data.
A number of the Internet root nameservers are implemented as large numbers of clusters of machines using anycast.