Subnet-Router anycast address

term

networking

Kept in this browser · My desk

The Subnet-Router anycast address is the IPv6 (Internet Protocol version 6) address formed by a subnet's prefix followed by an all-zero interface identifier; every router with an interface on that subnet must accept it, so a packet sent to it reaches one of the subnet's routers.

RFC (Request for Comments) 4291, section 2.6.1, predefines it: packets sent to it "will be delivered to one router on the subnet", and all routers are required to support it for the subnets their interfaces are on. In IPv6 (Internet Protocol version 6) the all-zero address of a subnet is therefore not a spare network address, as in IPv4 (version 4), but a reserved anycast one. That is why Python's ipaddress leaves it out of an IPv6 network's hosts(), except on a /127, where both addresses of an RFC 6164 point-to-point link are hosts and routers must disable the anycast address.

What it is. Request for Comments (RFC) 4291, the IPv6 (Internet Protocol version 6) addressing architecture of February 2006, defines one anycast address that exists on every subnet without being configured: the Subnet-Router anycast address, made of the subnet prefix followed by an interface identifier of all zeros, so 2001:db8:1:2::/64 has 2001:db8:1:2:: as its Subnet-Router anycast address. Packets sent to it are delivered to one router on the subnet, and all routers are required to support it for the subnets to which they have interfaces. Its stated purpose is applications where a node needs to talk to any one of the set of routers on the link without knowing which. It is not a network address in the IPv4 (version 4) sense, a value reserved only so that nothing uses it, and it is not a broadcast address: RFC 4291 says plainly that IPv6 has no broadcast addresses, their job being done by multicast.

Anycast in IPv6 generally. RFC 4291 section 2.6 defines an anycast address as one assigned to more than one interface, usually on different nodes, with packets routed to the nearest interface by the routing protocols' measure of distance. Anycast addresses come from the ordinary unicast space and are syntactically indistinguishable from unicast addresses, so a node holding one must be explicitly configured to know that it is anycast. The Subnet-Router address is the one case where nobody has to configure anything: its format is fixed, its meaning is implied by the all-zero identifier, and every IPv6 router is meant to treat it as its own on each subnet it serves.

A family of reserved identifiers. RFC 2526 (March 1999), by David Johnson and Stephen Deering, reserved more anycast addresses in every subnet: the highest 128 interface identifier values. For subnets using 64-bit identifiers in modified EUI-64 (64-bit Extended Unique Identifier) format, they are the identifiers from fdff:ffff:ffff:ff80 to fdff:ffff:ffff:ffff, the last seven bits being an anycast ID; ID 7E (126) is the Mobile IPv6 Home-Agents anycast address, and 7F and 00 to 7D are reserved. RFC 5453 (February 2009) collected these special identifiers in one place, because a node that autoconfigures an identifier in one of these ranges will meet unexpected consequences, and asked the Internet Assigned Numbers Authority (IANA) to keep a registry. That registry, Reserved IPv6 Interface Identifiers, lists 0000:0000:0000:0000 as Subnet-Router Anycast (registered 2008-12-24), the RFC 2526 range, the identifiers that correspond to IANA's own Ethernet address block (with 0200:5eff:fe00:5213 assigned to Proxy Mobile IPv6), and adds a warning that any new reserved value would need updated identifier-generation code in every deployed IPv6 stack, so the bar for one is extremely high. The address generators honour it: RFC 7217, the stable opaque identifier method, says a generated identifier should be checked against the reserved list and regenerated if it collides.

The /127 argument. Because the all-zero address of every subnet belongs to the routers, a point-to-point link numbered with a /127 has a problem: of its two addresses, the lower one is also the link's Subnet-Router anycast address. RFC 3627 (September 2003) therefore declared /127 between routers harmful, while admitting that Subnet-Router anycast is of questionable use on point-to-point links. Operators kept using /127 anyway, and RFC 6164 (April 2011), by Miya Kohno, Becca Nitzan, Randy Bush and others, reversed the advice: routers must support /127 prefixes on point-to-point inter-router links and must disable Subnet-Router anycast for such a prefix. Its reasons were real attacks on /64 links: the ping-pong forwarding loop on links that do not run Neighbor Discovery, such as SONET (Synchronous Optical Network), and neighbour cache exhaustion, where a stream of packets to unused addresses in a /64 makes a router create an incomplete cache entry and send a Neighbor Solicitation for each. RFC 6547 (February 2012) moved RFC 3627 to Historic. RFC 6164 also tells operators who number many /127 links out of one /64 not to assign as unicast the addresses whose last 64 bits are all zero, which collide with the Subnet-Router anycast address, or the highest 128 values, which collide with the RFC 2526 range.

In tools and on hosts. Python's ipaddress module follows the RFC exactly: IPv6Network.hosts() returns every address of the network except the Subnet-Router anycast address, includes it on a /127, where both addresses are usable, and returns the single address of a /128. That is a frequent surprise for people who expect IPv4 behaviour, where hosts() drops both the network and broadcast addresses: an IPv6 /126 yields three hosts, not two. On Linux, the sysctls echo_ignore_anycast, anycast_src_echo_reply and error_anycast_as_unicast decide whether the kernel answers echo requests sent to an anycast address, whether it uses the anycast address as the source of its echo reply, and whether it sends ICMP (Internet Control Message Protocol) errors for packets to anycast addresses as if they were unicast; all three are disabled by default, so a ping to a Linux router's Subnet-Router anycast address is answered, from another address.

Why it matters in practice. The address is easy to collide with by hand: a network engineer who gives a router interface 2001:db8:1:2::/64, the prefix itself, as its unicast address has configured the Subnet-Router anycast address, which other routers on the same subnet also claim. On point-to-point links the choice is between /64, which invites neighbour cache exhaustion, and /127 with Subnet-Router anycast disabled, as RFC 6164 recommends; a /126 or a /64 leaves the zero address reserved for anycast and the rest usable. The numbers worth remembering are the all-zero 64-bit identifier, the reserved range fdff:ffff:ffff:ff80 to fdff:ffff:ffff:ffff, anycast ID 126 for Mobile IPv6 home agents, /127 for router links, and RFCs 4291, 2526, 5453 and 6164.

Also known as: Subnet-Router anycast, subnet router anycast address

Sources

← Back to S Back to the glossary