Skip to main content

7. Anycasting and Multicasting

It has often been suggested that IP multicasting can be used for resource location, so it is useful to compare the services offered by IP multicasting and IP anycasting.

Semantically, the difference between the two services is that an anycast address is the address of a single (virtual) host and that the internetwork will make an effort to deliver anycast datagrams to a single host. There are two implications of this difference. First, applications sending to anycast addresses need not worry about managing the TTLs of their IP datagrams. Applications using multicast to find a service must balance their TTLs to maximize the chance of finding a server while minimizing the chance of sending datagrams to a large number of servers it does not care about. Second, making a TCP connection to an anycast address makes perfectly good sense, while the meaning of making a TCP connection to a multicast address are unclear. (A TCP connection to a multicast address is presumably trying to establish a connection to multiple peers simultaneously, which TCP is not designed to support).

From a practical perspective, the major difference between anycasting and multicasting is that anycasting is a special use of unicast addressing while multicasting requires more sophisticated routing support. The important observation is that multiple routes to an anycast address appear to a router as multiple routes to a unicast destination, and the router can use standard algorithms to choose to the best route.

Another difference between the two approaches is that resource location using multicasting typically causes more datagrams to be sent. To find a server using multicasting, an application is expected to transmit and retransmit a multicast datagram with successively larger IP TTLs. The TTL is initially kept small to try to limit the number of servers contacted. However, if no servers respond, the TTL must be increased on the assumption that the available servers (if any) were farther away than was reachable with the initial TTL. As a result, resource location using multicasting causes one or more multicast datagrams to be sent towards multiple servers, with some datagrams' TTLs expiring before reaching a server. With anycasting, managing the TTL is not required and so (ignoring the case of loss) only one datagram need be sent to locate a server. Furthermore, this datagram will follow only a single path.

A minor difference between the two approaches is that anycast may be less fault tolerant than multicast. When an anycast server fails, some datagrams may continue to be mistakenly routed to the server, whereas if the datagram had been multicast, other servers would have received it.