Internet Engineering Task Force                 Jun-ichiro itojun Hagino
INTERNET-DRAFT                                   IIJ Research Laboratory
Expires: January 1, 2003                                      K. Ettikan
                                                     Intel ASG, Malaysia
                                                            July 1, 2002


                      An analysis of IPv6 anycast
             draft-ietf-ipngwg-ipv6-anycast-analysis-01.txt

Status of this Memo


This document is an Internet-Draft and is in full conformance with all
provisions of Section 10 of RFC2026.

Internet-Drafts are working documents of the Internet Engineering Task
Force (IETF), its areas, and its working groups.  Note that other groups
may also distribute working documents as Internet-Drafts.

Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time.  It is inappropriate to use Internet-Drafts as reference material
or to cite them other than as ``work in progress.''

To view the list Internet-Draft Shadow Directories, see
http://www.ietf.org/shadow.html.

Distribution of this memo is unlimited.

The internet-draft will expire in 6 months.  The date of expiration will
be January 1, 2003.


Abstract

The memo tries to identify the problems and issues in the use of IPv6
anycast [Hinden, 1998] defined as of today.  The goals of the draft are
(1) to understand the currently-defined IPv6 anycast better, (2) to
provide guidelines for people trying to deploy anycast services, and (3)
to suggest updates to IPv6 anycast protocol specification.

The document was made possible by input from ipngwg DNS discovery design
team.


1.  IPv6 anycast

"Anycast" is a communication model for IP, just like unicast and
multicast are.




HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 1]


DRAFT                   Analysis of IPv6 anycast               July 2002

Anycast can be understood best by comparing with unicast and multicast.
IP unicast allows a source node to transmit IP datagrams to a single
destination node.  The destination node is identified by a unicast
address.  IP multicast allows a source node to transmit IP datagrams to
a group of destination nodes.  The destination nodes are identfied by a
multicast group, and we use a multicast address to identify the
multicast group.

IP anycast allows a source node to transmit IP datagrams to a single
destination node, out of a group of destination nodes.  IP datagrams
will reach the closest destination node in the set of destination nodes,
based on the routing measure of distance.  The source node does not need
to care about how to pick the closest destination node, as the routing
system will figure it out (in other words, the source node has no
control over the selection).  The set of destination nodes is identified
by an anycast address.

Anycast was adopted by IPv6 specification suite.  RFC2373 [Hinden, 1998]
defines the IPv6 anycast address, and its constraints in the usage.  The
following sections try to analyze RFC2373 rules, and understand
limitations with them.  At the end of the draft we compile a couple of
suggestions to exisitng proposals, for extending the usage of the IPv6
anycast.


2.  Existing practices

There are multiple examples of anycast in IPv4.  The section tries to
summarize those practices.

2.1.  RFC1546 anycast

RFC1546 [Partridge, 1993] defines an experimental anycast service for
IPv4.  With RFC1546, anycast address is distinguishable from unicast
address (unlike RFC2373 anycast), as they are allocated from separate
range.  The authors have no knowledge whether RFC1546 anycast is widely
practiced or not; our bet is that it is not.

2.2.  Pseudo-anycast: multiple hosts with single unicast address

There are existing practices of using a single unicast address at
multiple different locations, for load balancing purposes, for DNS
servers and web servers (1992 Olympic games) [Hardie, 2002; Ohta, 2000]
.  We call the technique "pseudo-anycast" for clarity in this document.
The pseudo-anycast works as follows:

o A provider-independent IPv4 address prefix is allocated from an RIR.

o The address prefix is configured at multiple distant locations on the
  Internet.




HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 2]


DRAFT                   Analysis of IPv6 anycast               July 2002

o BGP routes are advertised from all of the locations.

o Clients will reach the nearest location based on the BGP routes.

Pseudo-anycast must not be confused with the one we discuss in the
document (RFC2373 anycast), as the problem domain is different.

Pseudo-anycast tries to replicate unicast servers in distant domains.
The distribution of servers is worldwide.  Pseudo-anycast is being used
for specific upper-layer protocols only, like DNS and HTTP.  There is no
consideration given for the cases when a client contacts multiple
servers by chance (transport layer protocol will get confused), since it
is unlikely to see BGP route changes during the short lifetime of the
transport layer protocols being used.

RFC2373 anycast is defined in more generic manner, and does not limit
the routing infrastructure nor upper-layer protocol.  Therefore, RFC2373
imposes certain limitation to the packet header contents (like IPv6
source address), to prevent confusions due to routing changes during the
lifetime of a transport-layer connection.

This document tries to analyze RFC2373 anycast to understand if we can
use it for site-scoped server replication, upper-layer protocols other
than DNS or HTTP, and such.  Still, it is possible to apply pseudo-
anycast to IPv6.  Issues with pseudo-anycast on IPv6 are outside of the
scope of the document.


3.  Limitations/properties in the current proposals

3.1.  Identifying anycast destination

For anycast addresses, RFC2373 uses the same address format as unicast
addresses.  Therefore, without other specific configurations, a sender
usually cannot identify if the sender is sending a packet to anycast
destination, or unicast destination.  This is different from RFC1546
IPv4 anycast, where anycast address is distinguishable from unicast
addresses.

3.2.  Nondeterministic packet delivery

If multiple packets carry an anycast address in IPv6 destination address
header, these packets may not reach the same destination node, depending
on stability of the routing table.  This property leads to a couple of
interesting symptoms.

If we can assume that the routing table is stable enough during a
protocol exchanges, multiple packets (with anycast address in
destination address field) will reach the same destination node just
fine.  However, there is no such guarantee.




HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 3]


DRAFT                   Analysis of IPv6 anycast               July 2002

If routing table is not stable enough or you would like to take a more
strict approach, a client can only send one packet with anycast address
in the destination address field.  For example, consider the following
packet exchange.  The following exchange can lead us to failure, as we
are not sure if the 1st and 2nd anycast packet have reached the same
destination.

     query: client unicast (Cu) -> server anycast (Sa)
     reply: server unicast (Su) -> client unicast (Cu)
     query: client unicast (Cu) -> server anycast (Sa)
              It may reach a different server!
     reply: server unicast (Su) -> client unicast (Cu)

Because of the non-determinism, if we take a strict approach, we can use
no more than 1 packet with anycast destination address, in a set of
protocol exchange.  If we use more than 2 packets, 1st and 2nd packet
may reach different server and may cause unexpected results.  If the
protocol is completely stateless, and we can consider the first
roundtrip and second roundtrip separate, it is okay.  For stateful
protocols, it is suggested to use anycast for the first packet in the
exchange, to discover unicast address of the (nearest) server.  After we
have discovered the unicast address of the server, we should use the
server's unicast address for the protocol exchange (note that there is
some security implication here - see Security Consideration section).

Also because of non-determinism, if we are to assign an IPv6 anycast
address to servers, those servers must provide uniform services.  For
example, if server A and server B provide different quality of service,
and people wants to differentiate between A and B, we cannot use single
IPv6 anycast address to identify both A and B.

Note that, this is not a bad feature of anycast; this property lets us
use anycast addresses for load balancing.  Also, packets will
automatically be delivered to the nearest node with anycast address
assigned.  Anaycast will ease service locating problem by pusing the
task to network layer rather than handled by upper layers.

Here are situations where multiple packets with anycast destination
address can lead us to problems:

o Fragmented IPv6 packets.  Fragments may reach multiple different
  destinations, and will prevent reassembly.

Because the sending node cannot differentiate between anycast addresses
and unicast addresses, it is hard for the sending node to control the
use of fragmentation.

3.3.  Anycast address assignment to hosts

RFC2373 suggests to assign anycast addresses to a node, only when the
node is a router.  This is because there was no standard way for hosts
to announce their intention to accept packets toward anycast addresses.


HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 4]


DRAFT                   Analysis of IPv6 anycast               July 2002

If no hosts have anycast address on them, it is easier for us to route
an IP datagram to anycast destination.  We just need to follow existing
routing entries, and we will eventually hit a router that has the
anycast address.  If we follow RFC2373 restriction strictly, we could
only assign anycast addresses onto routers.

3.4.  Anycast address in source address

Under RFC2373, IPv6 anycast address can not be put into IPv6 source
address.  This is basically because an IPv6 anycast address does not
identify a single source node.

o Incorrect reassembly of fragmented packets due to multiple anycast
  members sending packets with the same fragment ID to the same
  destination at about the same time; the same the source IP address,
  destination IP address, nextheader, and fragment ID numbers might be
  accidentally used at the same time by different senders.

o Errors and other response packets might be delivered to a different
  anycast member than sent the packet.  This might be very likely since
  asymmetric routing is rather prevalent on the Internet.

  Particular cases of such errors that are known to cause protocol
  problems are (1) ICMP packet too big making path MTU discovery
  impossible.  (2) (could be more) The misdelivery of other errors might
  cause operational problems - making the network harder to trouble-
  shoot when anycast source addresses are used.

3.5.  IPsec

IPsec and IKE identify nodes by using source/destination address pairs.
Due to the combination of issues presented above, it is difficult to use
IPsec on packets with anycast address in source address, destination
address, or both.

Even with manual keying, IPsec trust model with anycast address is
confusing.  As IPsec uses IPv6 destination address to identify which
IPsec key to be used, we need to use the same IPsec key for all of the
anycast destinations that share an anycast address.

IPsec protocol has replay protection mechanism.  If IPsec is used with
an anycast address, it will not work well as replay counter will not be
updated consistently due to the anycast packet delivery.

Dynamic IPsec key exchange (like IKE) is almost impossible.  First of
all, to run IKE session between two nodes, the two nodes need to be able
to communicate with each other.  With nondeterministic packet delivery
provided by anycast, it is not quite easy.  Even if we could circumvent
the issue with IKE, we have exactly the same problem as manual keying
case for actual communication.




HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 5]


DRAFT                   Analysis of IPv6 anycast               July 2002

4.  Possible improvements and protocol changes

4.1.  Assigning anycast address to hosts (non-router nodes)

Under RFC2373 rule, we can only assign anycast addresses to routers, not
to hosts.  The restriction was put into the RFC because it was felt
insecure to permit hosts to inject host routes to anycast address.

If we try to ease the restriction and assign anycast addresses to IPv6
hosts (non-routers), we would need to inject host routes for the anycast
addresses, with prefix length set to /128, into the IPv6 routing system.
We will inject host routes from each of the nodes with anycast
addresses, to make packets routed to a topologically-closest node.  Or,
we may be able to inject host routes from routers adjacent to the
servers (not from the servers themselvers).

Here are possible ways to allow anycast addresses to be assigned to
hosts.  We would need to diagnose each of the following proposals
carefully, as they have different pros and cons.  The most serious issue
would be the security issue with service blackhole attack (malicious
party can blackhole packets toward anycast addresses, by making false
advertisement).

o Let the host with anycast address to participate into routing
  information exchange.  The host does not need to fully participate; it
  only needs to announce the anycast address to the routing system.  To
  secure routing exchange, administrators need to configure secret
  information that protects the routing exchange to the host, as well as
  other routers.

o Develop a protocol for a router, to discover hosts with anycast
  address on the same link.  The router will then advertise the anycast
  address to the routing system.  This could be done by an extension to
  IPv6 Neighbor Discovery or an extension to IPv6 Multicast Listener
  Discovery [Haberman, 2001] .

The impact of host routes depends on the scope of the anycast address
usage.  For example, if we use site-local anycast address to identify a
set of servers, the propagation of host route is limited inside the
site.  If the site administration policy permits it, and the site
routers can handle the additional routing entries, the additional host
routes are okay.  So, we can safely assign anycast address to non-router
nodes (hosts), and inject host route for the anycast address, into the
site IPv6 routing system.  It is still questionable to inject host
routes into worldwide IPv6 routing system, as it has problems in terms
of scalability.  Also, because of IPv6 route aggregation rules [Rockell,
2000] it is normally impossible to propagate IPv6 host routes worldwide.

4.2.  Anycast address in destination address

By using anycast in IPv6 layer, upper-layer protocols may be able to
enjoy redundancy and higher availability of servers.  However, for


HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 6]


DRAFT                   Analysis of IPv6 anycast               July 2002

stateful upper-layer protocols, a client may need to specify a single
node out of nodes that share an anycast address.  Suppose a client C
would like to communicate a specific server with anycast address, Si.
Si shares the same anyast address with other servers, S1 to Sn.  It is
hard for C to selectively communicate with Si.

One possible workaround is to use IPv6 routing header.  By specifying a
unicast address of Si as an intermediate hop, C can deliver the packet
to Si, not to other Sn.

Note that, however, by specifying Si explicitly, C now have lost the
server redundancy provided by the use of anycast address in IPv6 layer.
If Si goes down, the communication between C and Si will be lost.  C
cannot enjoy the failure resistance provided by redundant servers, S1 to
Sn.  Protocol designers should carefully diagnose if any state is
managed by C and/or Si, and decide how the protocol should take
advantage of anycast addresses and their characteristics.

4.3.  Anycast address in source address

Under RFC2373 rule, anycast address cannot be put into source address.
Here is a possible workaround, however, it could not win a consensus in
the past ipngwg meetings:

o When we try to use anycast address in the source address, use a (non-
  anycast) unicast address as the IPv6 source address, and attach home
  address option with anycast address.  In ipngwg discussions, however,
  there seem to be a consensus that the home address option should have
  the same semantics as the source address in the IPv6 header, so we
  cannot put anycast address into the home address option.


5.  Upper layer protocol issues

5.1.  Use of UDP with anycast

Many of the UDP-based protocols use source and destination address pair
to identify the traffic.  One example would be DNS over UDP; most of the
DNS client implementation checks if the source address of the reply is
the same as the destination address of the query, in the fear of the
fabricated reply from a bad guy.

     query: client unicast (Cu) -> server unicast (Su*)
     reply: server unicast (Su*) -> client unicast (Cu)

     addresses marked with (*) must be equal.

If we use server's anycast address as the destination of the query, we
cannot meet the requirement due to RFC2373 restriction (anycast address
cannot be used as the source address of packets).  Effectively, client
will consider the reply is fabricated (hijack attempt), and drops the
packet.


HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 7]


DRAFT                   Analysis of IPv6 anycast               July 2002

     query: client unicast (Cu) -> server anycast (Sa)
     reply: server unicast (Su) -> client unicast (Cu)

Note that, however, bad guys can still inject fabricated results to the
client, even if the client checks the source address of the reply.  The
check does not improve security of the exchange at all.

If we check the existing protocol descriptions, in many cases, it is not
possible to perform sanity checks against IP source address for UDP
exchanges.  Either they are not specified on the protocol documents, or
it is an implementation mistake to check the IP source address.  For
example, from RFC2181 [Elz, 1997] section 4.1, we cannot check IP source
address matches for UDP DNS packets (client shouldn't be checking this).
There is no wording available on the selection of source address, in
TFTP protocol specification [Sollins, 1992] .

So, regarding to this issue, we conclude as follows:

o To use anycast address on the UDP protocol exchange, client side
  should not check the source address of the incoming packet.  Packet
  pairs must be identified by using UDP port numbers or upper-layer
  protocol mechanisms (like cookies).  The source address check itself
  has no real protection.

o If you need to secure UDP protocol exchange, it is suggested to verify
  the authenticity of the reply, by using upper-layer security
  mechanisms like DNSSEC (note that we cannot use IPsec with anycast).

o For many of the existing protocols, we cannot perform sanity checks
  using IP source address address.  More specifically, for UDP DNS
  replies against queries to anycast address, it is not recommended to
  check source address, based on RFC2181 section 4.1.

5.2.  Use of TCP with anycast

We cannot simply use anycast for TCP exchanges, as we identify a TCP
connection by using address/port pair for the source/destination node.
It is desired to implement some of the following, to enable the use of
IPv6 anycast in TCP.  Note, however, security requirement is rather
complicated for the following protocol modifications.

o Define a TCP option which lets us to switch peer's address from IPv6
  anycast address, to IPv6 unicast address.  There are couple of
  proposals in the past.

o Define an additional connection setup protocol that resolves IPv6
  unicast address from IPv6 anycast address.  We first resolve IPv6
  unicast address using the new protocol, and then, make a TCP
  connection using the IPv6 unicast address.  IPv6 node information
  query/reply [Crawford, 2002] could be used for this.




HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 8]


DRAFT                   Analysis of IPv6 anycast               July 2002

5.3.  Use of SCTP with Anycast

SCTP [Stewart, 2000] is a bit more interesting.  An SCTP endpoint is
defined as:

     The logical sender/receiver of SCTP packets.
      On a multi-homed host, an SCTP endpoint is represented to its
     peers as a combination of a set of eligible destination transport
     addresses to which SCTP packets can be sent and a set of eligible
     source transport addresses from which SCTP packets can be received.
      All transport addresses used by an SCTP endpoint must use the same
     port number, but can use multiple IP addresses.

Therefore, it is legal to send packets to a unicast address of an SCTP
peer endpoint, as long as the SCTP peer endpoint replies using a unicast
address which is part of the association.  PP In summary, anycast should
work with SCTP, as long as the SCTP endpoint contains a valid unicast
address.


6.  Summary

The draft tried to diagnose the limitation in currntly-specified IPv6
anycast, and explored couple of ways to extend its use.  Some of the
proposed changes affects IPv6 anycast in general, some are useful in
certain use of IPv6 anycast.  To take advantage of anycast addresses,
protocol designers would need to diagnose their requirements to anycast
address, and introduce some of the tricks described in the draft.

Use of IPsec with anycast address still needs a great amount of
analysis.


7.  Security consideration

The document should introduce no new security issues.

When we use an anycast address to discover a server and then switch to
unicast adddress for the server, upper-layer protocols need to make sure
that the two addresses actually belong to the same node.  Otherwise,
there could be a chance for malicious nodes to hijack the communciation.
One possible way to achieve this is to use public-key based
authentication in the upper-layer protocol.

For secure anycast operation, we may need to enable security mechanisms
in other protocols.  For example, if we were to inject /128 routes from
end hosts by using a routing protocol, we may need to configure the
routing protocol to exchange routes securely, to prevent malicious
parties from injecting bogus routes.





HAGINO, ETTIKAN         Expires: January 1, 2003                [Page 9]


DRAFT                   Analysis of IPv6 anycast               July 2002

References

Hinden, 1998.
R. Hinden and S. Deering, "IP Version 6 Addressing Architecture" in
RFC2373 (July 1998). ftp://ftp.isi.edu/in-notes/rfc2373.txt.

Partridge, 1993.
C. Partridge, T. Mendez, and W. Milliken, "Host Anycasting Service" in
RFC1546 (November 1993). ftp://ftp.isi.edu/in-notes/rfc1546.txt.

Hardie, 2002.
T. Hardie, "Distributing Authoritative Name Servers via Shared Unicast
Addresses" in RFC3258 (April 2002). ftp://ftp.isi.edu/in-
notes/rfc3258.txt.

Ohta, 2000.
Masataka Ohta, "Root Name Servers with Inter Domain Anycast Addresses"
in draft-ietf-dnsop-ohta-shared-root-server-00.txt (July 2000). work in
progress material.

Haberman, 2001.
B. Haberman and D. Thaler, "Host-based Anycast using MLD" in draft-
haberman-ipngwg-host-anycast-00.txt (February 2001). work in progress
material.

Rockell, 2000.
Rob Rockell and Bob Fink, "6Bone Backbone Routing Guidelines" in RFC2772
(February 2000). ftp://ftp.isi.edu/in-notes/rfc2772.txt.

Elz, 1997.
R. Elz and R. Bush, "Clarifications to the DNS Specification" in RFC2181
(July 1997). ftp://ftp.isi.edu/in-notes/rfc2181.txt.

Sollins, 1992.
K. Sollins, "The TFTP Protocol (Revision 2)" in RFC1350 (July 1992).
ftp://ftp.isi.edu/in-notes/rfc1350.txt.

Crawford, 2002.
Matt Crawford, "IPv6 Node Information Queries" in draft-ietf-ipngwg-
icmp-name-lookups-09.txt (May 2002). work in progress material.

Stewart, 2000.
R. Stewart, Q. Xie, K. Morneault, C. Sharp, H. Schwarzbauer, T. Taylor,
I. Rytina, M. Kalla, L. Zhang, and V. Paxson, "Stream Control
Transmission Protocol" in RFC2960 (October 2000). ftp://ftp.isi.edu/in-
notes/rfc2960.txt.


Change history

individual submission, 00 -> 01
     Improve security considerations section.  Remove an invalid use of


HAGINO, ETTIKAN         Expires: January 1, 2003               [Page 10]


DRAFT                   Analysis of IPv6 anycast               July 2002

     home address option from UDP section.  Improve wording on IPsec.

individual submission, 01 -> 02
     Split sections for current status analysis, and future protocol
     design suggestions.

02 -> 00
     Distinguish RFC2373 anycast and BGP anycast.  Ettikan's new
     address.

00 -> 01
     Reflect IESG comments.  BGP anycast is now called "pseudo anycast"
     for clarity.  SCTP section contributed by John Loughney.


Authors' addresses

     Jun-ichiro itojun HAGINO
     Research Laboratory, Internet Initiative Japan Inc.
     Takebashi Yasuda Bldg.,
     3-13 Kanda Nishiki-cho,
     Chiyoda-ku,Tokyo 101-0054, JAPAN
     Tel: +81-3-5259-6350
     Fax: +81-3-5259-6351
     Email: itojun@iijlab.net

     Ettikan Kandasamy Karupiah
     ASG Penang & Shannon Operations,
     Intel Microelectronis (M) Sdn. Bhd.,
     Bayan Lepas Free Trade Zone III,
     Penang, Malaysia.
     Tel: +60-4-859-2591
     Fax: +60-4-859-7899
     Email: ettikan.kandasamy.karuppiah@intel.com




















HAGINO, ETTIKAN         Expires: January 1, 2003               [Page 11]