An IP address serves the purpose of identifying an individual network interface of a host, locating it on the network, and thus permitting the routing of IP packets between hosts. For routing, IP addresses are present in fields of the packet header where they indicate the source and destination of the packet.
IPv6 is the successor to the first addressing infrastructure of the Internet, Internet Protocol version 4 (IPv4). In contrast to IPv4, which defined an IP address as a 32-bit value, IPv6 addresses have a size of 128 bits. Therefore, IPv6 has a vastly enlarged address space compared to IPv4.
- 1 Addressing methods
- 2 Address formats
- 3 Representation
- 4 Address scopes
- 5 Address space
- 6 Special addresses
- 6.1 Unicast addresses
- 6.2 Multicast addresses
- 7 Stateless address autoconfiguration
- 8 Default address selection
- 9 Domain Name System
- 10 Historical notes
- 11 Notes
- 12 References
- 13 External links
IPv6 addresses are classified by the primary addressing and routing methodologies common in networking: unicast addressing, anycast addressing, and multicast addressing.
A unicast address identifies a single network interface. The Internet Protocol delivers packets sent to a unicast address to that specific interface.
An anycast address is assigned to a group of interfaces, usually belonging to different nodes. A packet sent to an anycast address is delivered to just one of the member interfaces, typically the nearest host, according to the routing protocol's definition of distance. Anycast addresses cannot be identified easily, they have the same format as unicast addresses, and differ only by their presence in the network at multiple points. Almost any unicast address can be employed as an anycast address.
A multicast address is also used by multiple hosts, which acquire the multicast address destination by participating in the multicast distribution protocol among the network routers. A packet that is sent to a multicast address is delivered to all interfaces that have joined the corresponding multicast group. IPv6 does not implement broadcast addressing. Broadcast's traditional role is subsumed by multicast addressing to the all-nodes link-local multicast group ff02::1. However, the use of the all-nodes group is not recommended, and most IPv6 protocols use a dedicated link-local multicast group to avoid disturbing every interface in the network.
An IPv6 address consists of 128 bits. For each of the major addressing and routing methodologies, various address formats are recognized by logically dividing the 128 address bits into bit groups and establishing rules for associating the values of these bit groups with special addressing features.
Unicast and anycast address format
General unicast address format (routing prefix size varies) bits 48 (or more) 16 (or fewer) 64 field routing prefix subnet id interface identifier
The network prefix (the routing prefix combined with the subnet id) is contained in the most significant 64 bits of the address. The size of the routing prefix may vary; a larger prefix size means a smaller subnet id size. The bits of the subnet id field are available to the network administrator to define subnets within the given network. The 64-bit interface identifier is either automatically generated from the interface's MAC address using the modified EUI-64 format, obtained from a DHCPv6 server, automatically established randomly, or assigned manually.
A link-local address is also based on the interface identifier, but uses a different format for the network prefix.
Link-local address format bits 10 54 64 field prefix zeroes interface identifier
The prefix field contains the binary value 1111111010. The 54 zeroes that follow make the total network prefix the same for all link-local addresses (fe80::/64 link-local address prefix), rendering them non-routable.
Multicast address format
Multicast addresses are formed according to several specific formatting rules, depending on the application.
General multicast address format bits 8 4 4 112 field prefix flg sc group ID
The prefix holds the binary value 11111111 for any multicast address.
Currently, 3 of the 4 flag bits in the flg field are defined; the most-significant flag bit is reserved for future use.
Multicast address flags bit flag Meaning when 0 Meaning when 1 8 reserved reserved reserved 9 R (Rendezvous) Rendezvous point not embedded Rendezvous point embedded 10 P (Prefix) Without prefix information Address based on network prefix 11 T (Transient) Well-known multicast address Dynamically assigned multicast address
The 4-bit scope field (sc) is used to indicate where the address is valid and unique.
There are special multicast addresses, like Solicited Node.
Solicited-Node multicast address format bits 8 4 4 79 9 24 field prefix flg sc zeroes ones unicast address
The sc(ope) field holds the binary value 0010 (link-local). Solicited-node multicast addresses are computed as a function of a node's unicast or anycast addresses. A solicited-node multicast address is created by copying the last 24 bits of a unicast or anycast address to the last 24 bits of the multicast address.
Unicast-prefix-based multicast address format bits 8 4 4 4 4 8 64 32 field prefix flg sc res riid plen network prefix group ID
Link-scoped multicast addresses use a comparable format.
An IPv6 address is represented as eight groups of four hexadecimal digits, each group representing 16 bits (two octets, a group sometimes also called a hextet). The groups are separated by colons (:). An example of an IPv6 address is:
The hexadecimal digits are case-insensitive, but IETF recommendations suggest the use of lower case letters. The full representation of eight 4-digit groups may be simplified by several techniques, eliminating parts of the representation.
Leading zeroes in a group may be omitted, but each group must retain at least one hexadecimal digit. Thus, the example address may be written as:
One or more consecutive groups containing zeros only may be replaced with a single empty group, using two consecutive colons (::). The substitution may only be applied once in the address, however, because multiple occurrences would create an ambiguous representation. Thus, the example address can be further simplified:
The localhost (loopback) address, 0:0:0:0:0:0:0:1, and the IPv6 unspecified address, 0:0:0:0:0:0:0:0, are reduced to ::1 and ::, respectively.
During the transition of the Internet from IPv4 to IPv6, it is typical to operate in a mixed addressing environment. For such use cases, a special notation has been introduced, which expresses IPv4-mapped and IPv4-compatible IPv6 addresses by writing the least-significant 32 bits of an address in the familiar IPv4 dot-decimal notation, whereas the other 96 (most significant) bits are written in IPv6 format. For example, the IPv4-mapped IPv6 address ::ffff:c000:0280 is written as ::ffff:192.0.2.128, thus expressing clearly the original IPv4 address that was mapped to IPv6.
Recommended representation as text
In an attempt to simplify IPv6 addresses, the standards provide flexibility in their representation. However, this also complicates several common operations: searching for a specific address in a text file or stream, and comparing two addresses to determine their equivalence. To mitigate these problems, a canonical format is defined for rendering IPv6 addresses in text:
- Leading zeros in each 16-bit field are suppressed. For example, 2001:0db8::0001 is rendered as 2001:db8::1, though any all-zero field that is explicitly presented is rendered as 0.
- "::" is not used to shorten just a single 0 field. For example, 2001:db8:0:0:0:0:2:1 is shortened to 2001:db8::2:1, but 2001:db8:0000:1:1:1:1:1 is rendered as 2001:db8:0:1:1:1:1:1.
- Representations are shortened as much as possible. The longest sequence of consecutive all-zero fields is replaced with double-colon. If there are multiple longest runs of all-zero fields, then it is the leftmost that is compressed. E.g., 2001:db8:0:0:1:0:0:1 is rendered as 2001:db8::1:0:0:1 rather than as 2001:db8:0:0:1::1.
- Hexadecimal digits are expressed as lower-case letters. For example, 2001:db8::1 is preferred over 2001:DB8::1.
An IPv6 network uses an address block that is a contiguous group of IPv6 addresses of a size that is a power of two. The leading set of bits of the addresses are identical for all hosts in a given network, and are called the network's address or routing prefix.
Network address ranges are written in CIDR notation. A network is denoted by the first address in the block (ending in all zeroes), a slash (/), and a decimal value equal to the size in bits of the prefix. For example, the network written as 2001:db8:1234::/48 starts at address 2001:db8:1234:0000:0000:0000:0000:0000 and ends at 2001:db8:1234:ffff:ffff:ffff:ffff:ffff.
The routing prefix of an interface address may be directly indicated with the address by CIDR notation. For example, the configuration of an interface with address 2001:db8:a::123 connected to subnet 2001:db8:a::/64 is written as 2001:db8:a::123/64.
Address block sizes
The size of a block of addresses is specified by writing a slash (/) followed by a number in decimal whose value is the length of the network prefix in bits, rather than by explicitly specifying which addresses are in the block. For example, an address block with 48 bits in the prefix is indicated by /48. Such a block contains 2128 − 48 = 280 addresses. The smaller the value of the network prefix, the larger the block: a /21 block is 8 times larger than a /24 block.
Literal IPv6 addresses in network resource identifiers
Colon (:) characters in IPv6 addresses may conflict with the established syntax of resource identifiers, such as URIs and URLs. The colon has traditionally been used to terminate the host path before a port number. To alleviate this conflict, literal IPv6 addresses are enclosed in square brackets in such resource identifiers, for example:
When the URL also contains a port number the notation is:
where the trailing 443 is the example's port number.
Scoped literal IPv6 addresses
For addresses with other than global scope (as described below), and in particular for link-local addresses, the choice of the network interface for sending a packet may depend on which zone the address belongs to: the same address may be valid in different zones, and be in use by a different host in each of those zones. Even if a single address is not in use in different zones, the address prefixes for addresses in those zones may still be identical, which makes the operating system unable to select an outgoing interface based on the information in the routing table (which is prefix-based).
In order to resolve the ambiguity in textual addresses, a zone index must be appended to the address, the two separated by a percent sign (%). The syntax of zone indices is an implementation-dependent string, although numeric zone indices must be universally supported as well. The following link-local address:
could become for instance:
The former (using an interface name) is customary on most Unix-like operating systems (e.g., BSD, Linux, OS X). The latter (using an interface number) is the standard syntax on Microsoft Windows, but as support for this syntax is mandatory, it is also available on other operating systems.
BSD-based operating systems (including OS X) also support an alternative, non-standard syntax, where a numeric zone index is encoded in the second 16-bit word of the address. E.g.:
In all operating systems mentioned above, the zone index for link-local addresses actually refers to an interface, not to a zone. As multiple interfaces may belong to the same zone (e.g. when connected to the same switch), in practice two addresses with different zone-ids may actually be equivalent, and refer to the same host on the same link.
Use of zone indices in URIs
Literal IPv6 addresses in UNC path names
In Microsoft Windows operating systems, IPv4 addresses are valid location identifiers in Uniform Naming Convention (UNC) path names. However, the colon is an illegal character in a UNC path name. Thus, the use of IPv6 addresses is also illegal in UNC names. For this reason, Microsoft implemented a transcription algorithm to represent an IPv6 address in the form of a domain name that can be used in UNC paths. For this purpose, Microsoft registered and reserved the second-level domain ipv6-literal.net on the Internet (although they gave up the domain in January 2014). IPv6 addresses are transcribed as a hostname or subdomain name within this name space, in the following fashion:
is written as
This notation is automatically resolved locally by Microsoft software, without any queries to DNS name servers.
If the IPv6 address contains a zone index, it is appended to the address portion after an 's' character:
is written as
Every IPv6 address, except the unspecified address (::), has a "scope", which specifies in which part of the network it is valid.
For unicast addresses, two scopes are defined: link-local and global.
Link-local addresses and the loopback address have link-local scope, which means they can only be used on a single directly attached network (link). All other addresses (including Unique local addresses) have global (or universal) scope, which means they are (or could be) globally routable, and can be used to connect to addresses with global scope anywhere, or to addresses with link-local scope on the directly attached network.[note 1]
Even though Unique local addresses have global scope, they are not globally administered. As a result, only other hosts inside the same administrative domain (e.g. an organisation), or inside a cooperating administrative domain will be able to reach such addresses (i.e. have a route to them). As their scope is global, these addresses are valid as a source address when communicating with any other global-scope address, even though it may be impossible to route packets from the destination back to the source.
Anycast addresses are syntactically identical to and indistinguishable from unicast addresses. Their only difference is administrative. Scopes for anycast addresses are therefore the same as for unicast addresses.
For multicast addresses, the four least-significant bits of the second address octet (ff0s::) identify the address scope, i.e. the domain in which the multicast packet should be propagated. Predefined and reserved scopes are:
Scope values Value Scope name Notes 0x0 reserved 0x1 interface-local Interface-local scope spans only a single interface on a node, and is useful only for loopback transmission of multicast. 0x2 link-local Link-local scope spans the same topological region as the corresponding unicast scope. 0x3 realm-local Realm-local scope is defined as larger than link-local, automatically determined by network topology and must not be larger than the following scopes. 0x4 admin-local Admin-local scope is the smallest scope that must be administratively configured, i.e., not automatically derived from physical connectivity or other, non-multicast-related configuration. 0x5 site-local Site-local scope is intended to span a single site belonging to an organisation. 0x8 organization-local Organization-local scope is intended to span all sites belonging to a single organization. 0xe global Global scope spans all reachable nodes on the internet - it is unbounded. 0xf reserved
All other scopes are unassigned, and available to administrators for defining additional regions.
The management of IPv6 address allocation process is delegated to the Internet Assigned Numbers Authority (IANA) by the Internet Architecture Board and the Internet Engineering Steering Group. Its main function is the assignment of large address blocks to the regional Internet registries (RIRs), which have the delegated task of allocation to network service providers and other local registries. The IANA has maintained the official list of allocations of the IPv6 address space since December 1995.
Only one eighth of the total address space is currently allocated for use on the Internet, 2000::/3, in order to provide efficient route aggregation, thereby reducing the size of the Internet routing tables; the rest of the IPv6 address space is reserved for future use or for special purposes. The address space is assigned to the RIRs in large blocks of /23 up to /12.
The RIRs assign smaller blocks to local Internet registries that distributes them to users. These are typically in sizes from /19 to /32. The addresses are typically distributed in /48 to /56 sized blocks to the end users.
Global unicast assignment records can be found at the various RIRs or other websites.
IPv6 addresses are assigned to organizations in much larger blocks as compared to IPv4 address assignments—the recommended allocation is a /48 block which contains 280 addresses, being 248 or about ×1014 times larger than the entire IPv4 address space of 232 addresses and about 2.8×1016 times larger than the 7.2/8 blocks of IPv4 addresses, which are the largest allocations of IPv4 addresses. The total pool, however, is sufficient for the foreseeable future, because there are 2128 (exactly 340,282,366,920,938,463,463,374,607,431,768,211,456) or about ×1038 (340 3.4trillion trillion trillion) unique IPv6 addresses.
Each RIR can divide each of its multiple /23 blocks into 512 /32 blocks, typically one for each ISP; an ISP can divide its /32 block into 65536 /48 blocks, typically one for each customer; customers can create 65536 /64 networks from their assigned /48 block, each having 264 (18,446,744,073,709,551,616) addresses. In contrast, the entire IPv4 address space has only 232 (exactly 4,294,967,296 or about ×109) addresses. 4.3
By design, only a very small fraction of the address space will actually be used. The large address space ensures that addresses are almost always available, which makes the use of network address translation (NAT) for the purposes of address conservation completely unnecessary. NAT has been increasingly used for IPv4 networks to help alleviate IPv4 address exhaustion.
To allow for provider changes without renumbering, provider-independent address space – assigned directly to the end user by the RIRs – is taken from the special range 2001:678::/29.
Internet Exchange Points (IXPs) are assigned special addresses from the range 2001:7f8::/29 for communication with their connected ISPs. Root name servers have been assigned addresses from the same range.
Reserved anycast addresses
The lowest address within each subnet prefix (the interface identifier set to all zeroes) is reserved as the "subnet-router" anycast address. Applications may use this address when talking to any one of the available routers, as packets sent to this address are delivered to just one router.
The 128 highest addresses within each /64 subnet prefix are reserved to be used as anycast addresses. These addresses usually have the 57 first bits of the interface identifier set to 1, followed by the 7-bit anycast ID. Prefixes for the network, including subnets, are required to have a length of 64 bits, in which case the universal/local bit must be set to 0 to indicate the address is not globally unique. The address with value 0x7e in the 7 least-significant bits is defined as a mobile IPv6 home agents anycast address. The address with value 0x7f (all bits 1) is reserved and may not be used. No more assignments from this range are made, so values 0x00 through 0x7d are reserved as well.
There are a number of addresses with special meaning in IPv6. They represent less than 2% of the entire address space:
Special address blocks Address block (CIDR) First address Last address Number of addresses Usage Purpose ::/0 :: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 2128 Routing Default route. ::/128 :: 1 Software Unspecified address. ::1/128 ::1 1 Host Loopback address to the local host. ::ffff:0:0/96 ::ffff:0.0.0.0 ::ffff:255.255.255.255 2128−96 = 232 = 294967296 4 Software IPv4 mapped addresses. ::ffff:0:0:0/96 ::ffff:0:0.0.0.0 ::ffff:0:255.255.255.255 232 Software IPv4 translated addresses. 64:ff9b::/96 64:ff9b::0.0.0.0 64:ff9b::255.255.255.255 232 Global Internet IPv4/IPv6 translation. 100::/64 100:: 100::ffff:ffff:ffff:ffff 264 Routing Discard prefix. 2001::/32 2001:: 2001::ffff:ffff:ffff:ffff:ffff:ffff 296 Global Internet Teredo tunneling. 2001:20::/28 2001:20:: 2001:2f:ffff:ffff:ffff:ffff:ffff:ffff 2100 Software ORCHIDv2. 2001:db8::/32 2001:db8:: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff 296 Documentation Addresses used in documentation and example source code. 2002::/16 2002:: 2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff 2112 Global Internet The 6to4 addressing scheme (now deprecated). fc00::/7 fc00:: fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 2121 Private network Unique local address. fe80::/10 fe80:: febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff 2118 Link Link-local address. ff00::/8 ff00:: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 2120 Global Internet Multicast address.
- ::/0 — The default route address (corresponding to 0.0.0.0/0 in IPv4).
This covers all destination addresses (unicast, multicast and others) not specified elsewhere in the routing table.
- ::/128 — The address with all zero bits is called the unspecified address (corresponding to 0.0.0.0/32 in IPv4).
This address must never be assigned to an interface and is to be used only in software before the application has learned its host's source address appropriate for a pending connection. Routers must not forward packets with the unspecified address.
Applications may be listening on one or more specific interfaces for incoming connections, which are shown in listings of active internet connections by a specific IP address (and a port number, separated by a colon). When the unspecified address is shown it means that an application is listening for incoming connections on all available interfaces.
- ::1/128 — The loopback address is a unicast localhost address (corresponding to 127.0.0.1/8 in IPv4).
If an application in a host sends packets to this address, the IPv6 stack will loop these packets back on the same virtual interface.
- fe80::/10 — Addresses in the link-local prefix are only valid and unique on a single link (comparable to the auto-configuration addresses 169.254.0.0/16 of IPv4).
Within this prefix only one subnet is allocated (54 zero bits), yielding an effective format of fe80::/64. The least significant 64 bits are usually chosen as the interface hardware address constructed in modified EUI-64 format. A link-local address is required on every IPv6-enabled interface—in other words, applications may rely on the existence of a link-local address even when there is no IPv6 routing.
Unique local addresses
- fc00::/7 — Unique local addresses (ULAs) are intended for local communication (comparable to IPv4 private addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16).
They are routable only within a set of cooperating sites. The block is split into two halves. The lower half of the block (fc00::/8) was intended for globally allocated prefixes, but an allocation method has yet to be defined. The upper half (fd00::/8) is used for "probabilistically unique" addresses in which the /8 prefix is combined with a 40-bit locally generated pseudorandom number to obtain a /48 private prefix. The way in which such a 40-bit number is chosen results in only a negligible chance that two sites that wish to merge or communicate with each other will use the same 40-bit number, and thus use the same /48 prefix.
Transition from IPv4
- ::ffff:0:0/96 — This prefix is used for IPv6 transition mechanisms and designated as an IPv4-mapped IPv6 address.
With a few exceptions, this address type allows the transparent use of the Transport Layer protocols over IPv4 through the IPv6 networking application programming interface. Server applications only need to open a single listening socket to handle connections from clients using IPv6 or IPv4 protocols. IPv6 clients will be handled natively by default, and IPv4 clients appear as IPv6 clients at their IPv4-mapped IPv6 address. Transmission is handled similarly; established sockets may be used to transmit IPv4 or IPv6 datagram, based on the binding to an IPv6 address, or an IPv4-mapped address.
- ::ffff:0:0:0/96 — A prefix used for IPv4-translated addresses.
These are used by the Stateless IP/ICMP Translation (SIIT) protocol.
- 64:ff9b::/96 — The "Well-Known" Prefix.
Addresses with this prefix are used for automatic IPv4/IPv6 translation.
- 2002::/16 — This prefix was used for 6to4 addressing (an address from the IPv4 network 126.96.36.199/24 was also used).
The 6to4 addressing scheme is now deprecated.
- IANA has reserved a so-called 'Sub-TLA ID' address block for special assignments which consists of 64 network prefixes in the range 2001:0000::/29 through 2001:01f8::/29. Three assignments from this block have been made:
- 2001::/32 — Used for Teredo tunneling.
- 2001:2::/48 — Used for benchmarking IPv6 (corresponding to 198.18.0.0/15 for benchmarking IPv4).
Assigned to the Benchmarking Methodology Working Group (BMWG).
- 2001:20::/28 — ORCHIDv2 (Overlay Routable Cryptographic Hash Identifiers).
These are non-routed IPv6 addresses used for Cryptographic Hash Identifiers.
- 2001:db8::/32 — This prefix is used in documentation (corresponding to 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 in IPv4.)
The addresses should be used anywhere an example IPv6 address is given or model networking scenarios are described.
- 0100::/64 — This prefix is used for discarding traffic.
Deprecated and obsolete addresses
The multicast addresses ff0x:: where x is any hexadecimal value are reserved and should not be assigned to any multicast group. The Internet Assigned Numbers Authority (IANA) manages address reservations.
Some common IPv6 multicast addresses are the following:
Address Description Available Scopes ff0x::1 All nodes address, identify the group of all IPv6 nodes Available in scope 1 (interface-local) and 2 (link-local):
- ff01::1 → All nodes in the interface-local
- ff02::1 → All nodes in the link-local
ff0x::2 All routers Available in scope 1 (interface-local), 2 (link-local) and 5 (site-local):
- ff01::2 → All routers in the interface-local
- ff02::2 → All routers in the link-local
- ff05::2 → All routers in the site-local
ff02::5 OSPFIGP 2 (link-local) ff02::6 OSPFIGP designated routers 2 (link-local) ff02::9 RIP routers 2 (link-local) ff02::a EIGRP routers 2 (link-local) ff02::d All PIM routers 2 (link-local) ff02::1a All RPL routers 2 (link-local) ff0x::fb mDNSv6 Available in all scopes ff0x::101 All Network Time Protocol (NTP) servers Available in all scopes ff02::1:1 Link name 2 (link-local) ff02::1:2 All-dhcp-agents 2 (link-local) ff02::1:3 Link-local multicast name resolution 2 (link-local) ff05::1:3 All-dhcp-servers 5 (site-local) ff02::1:ff00:0/104 Solicited-node multicast address. See below 2 (link-local) ff02::2:ff00:0/104 Node information queries 2 (link-local)
Solicited-node multicast address
The least significant 24 bits of the solicited-node multicast address group ID are filled with the least significant 24 bits of the interface's unicast or anycast address. These addresses allow link layer address resolution via Neighbor Discovery Protocol (NDP) on the link without disturbing all nodes on the local network. A host is required to join a solicited-node multicast group for each of its configured unicast or anycast addresses.
Stateless address autoconfiguration
On system startup, a node automatically creates a link-local address on each IPv6-enabled interface, even if globally routable addresses are manually configured or obtained through "configuration protocols" (see below). It does so independently and without any prior configuration by stateless address autoconfiguration (SLAAC), using a component of the Neighbor Discovery Protocol. This address is selected with the prefix fe80::/64.
In IPv4, typical "configuration protocols" include DHCP or PPP. Although DHCPv6 exists, IPv6 hosts normally use the Neighbor Discovery Protocol to create a globally routable unicast address: the host sends router solicitation requests and an IPv6 router responds with a prefix assignment.
The lower 64 bits of these addresses are populated with a 64-bit interface identifier in modified EUI-64 format. This identifier is usually shared by all automatically configured addresses of that interface, which has the advantage that only one multicast group needs to be joined for neighbor discovery. For this, a multicast address is used, formed from the network prefix ff02::1:ff00:0/104 and the 24 least significant bits of the address.
A 64-bit interface identifier is most commonly derived from its 48-bit MAC address. A MAC address 00-0C-29-0C-47-D5 is turned into a 64-bit EUI-64 by inserting FF-FE in the middle: 00-0C-29-FF-FE-0C-47-D5. When this EUI-64 is used to form an IPv6 address it is modified: the meaning of the Universal/Local bit (the 7th most significant bit of the EUI-64, starting from 1) is inverted, so that a 1 now means Universal. To create an IPv6 address with the network prefix 2001:db8:1:2::/64 it yields the address 2001:db8:1:2:020c:29ff:fe0c:47d5 (with the Universal/Local bit, the second-least-significant bit of the underlined quartet, inverted to 1 in this case because the MAC address is universally unique).
Duplicate address detection
The assignment of a unicast IPv6 address to an interface involves an internal test for the uniqueness of that address using Neighbor Solicitation and Neighbor Advertisement (ICMPv6 type 135 and 136) messages. While in the process of establishing uniqueness an address has a tentative state.
The node joins the solicited-node multicast address for the tentative address (if not already done so) and sends neighbor solicitations, with the tentative address as target address and the unspecified address (::/128) as source address. The node also joins the all-hosts multicast address ff02::1, so it will be able to receive Neighbor Advertisements.
If a node receives a neighbor solicitation with its own tentative address as the target address, then that address is not unique. The same is true if the node receives a neighbor advertisement with the tentative address as the source of the advertisement. Only after having successfully established that an address is unique may it be assigned and used by an interface.
Each IPv6 address that is bound to an interface has a fixed lifetime. Lifetimes are infinite, unless configured to a shorter period. There are two lifetimes that govern the state of an address: the preferred lifetime and the valid lifetime. Lifetimes can be configured in routers that provide the values used for autoconfiguration, or specified when manually configuring addresses on interfaces.
When an address is assigned to an interface it gets the status "preferred", which it holds during its preferred-lifetime. After that lifetime expires the status becomes "deprecated" and no new connections should be made using this address. The address becomes "invalid" after its valid-lifetime also expires; the address is removed from the interface and may be assigned somewhere else on the Internet.
Note: In most cases, the lifetime does not expire because new Router Advertisements (RAs) refresh the timers. But if there are no more RAs, eventually the preferred lifetime elapses and the address becomes "deprecated".
The globally unique and static MAC addresses, used by stateless address autoconfiguration to create interface identifiers, offer an opportunity to track user equipment—across time and IPv6 network prefix changes—and so users. To reduce the prospect of a user identity being permanently tied to an IPv6 address portion, a node may create temporary addresses with interface identifiers based on time-varying random bit strings and relatively short lifetimes (hours to days), after which they are replaced with new addresses.
Temporary addresses may be used as source address for originating connections, while external hosts use a public address by querying the Domain Name System.
Cryptographically generated addresses
Such an address is generated using two hash functions that take several inputs. The first uses a public key and a random modifier; the latter being incremented repeatedly until a specific amount of zero bits of the resulting hash is acquired. (Comparable with the 'proof of work' field in Bitcoin mining.) The second hash function takes the network prefix and the previous hash value. The least significant 64 bits of the second hash result is appended to the 64-bit network prefix to form a 128-bit address.
The hash functions can also be used to verify if a specific IPv6 address satisfies the requirement of being a valid CGA. This way, communication can be set up between trusted addresses exclusively.
Stable privacy addresses
Stateless autoconfigured addresses have some security and privacy related drawbacks, due to the fact that the underlying hardware address (most typically the MAC address) is used to generate it. Users may be tracked and accounts correlated, by means of this embedded hardware address. Attacks may be more successful, since the address space to search for victims is greatly reduced and vendor specific attacks may be launched, as this is part of the address. Another drawback is that if the hardware is replaced, a different address will be used for the same device, which may require updating security policies or hinder log entry correlation.
Since using temporary addresses do not fully alleviate these problems stable privacy addresses were introduced. These addresses are stable within a specific network but change when moving to another, to improve privacy. They are chosen deterministic but randomly in the entire address space of the network, to improve security.
Generation of a stable privacy address is based on a hash function that takes several stable parameters as its arguments. It at least uses the network prefix, the name of the network interface, a duplicate address counter, and a secret key. The resulting hash value is then used to construct the final address: typically the 64 least significant bits of it are concatenated to the 64 bit network prefix, to get a 128-bit address. If the network prefix is smaller than 64 bits, more bits of the hash are used. If the resulting address does not conflict with existing or reserved addresses, it is assigned to the interface.
Default address selection
IPv6-enabled network interfaces usually have more than one IPv6 address, for example, a link-local and a global address, and permanent versus temporary addresses. IPv6 introduces the concepts of address scope and selection preference, yielding multiple choices for source and destination address selections in communication with another host.
The preference selection algorithm, which selects the most appropriate address to use in communications with a particular destination (including the use of IPv4-mapped addresses in dual-stack implementations), is based on a user-customizable preference table that associates each routing prefix with a precedence level. The default table is as follows:
Prefix Precedence Label Usage ::1/128 50 0 Localhost ::/0 40 1 Default unicast ::ffff:0:0/96 35 4 IPv4-mapped IPv6 address 2002::/16 30 2 6to4 2001::/32 5 5 Teredo tunneling fc00::/7 3 13 Unique local address ::/96 1 3 IPv4-compatible addresses (deprecated) fec0::/10 1 11 Site-local address (deprecated) 3ffe::/16 1 12 6bone (returned)
The default configuration places preference on IPv6, rather than IPv4, and on destination addresses within the smallest possible scope, so that link-local communication is preferred over globally routed paths when otherwise equally suitable. The prefix policy table is similar to a routing table, with the precedence value serving as the role of a link cost, where higher preference is expressed as a larger value. Source addresses are preferred to have the same label value as the destination address. Addresses are matched to prefixes based on the longest matching most-significant bit-sequence. Candidate source addresses are obtained from the operating system and candidate destination addresses may be queried via the Domain Name System (DNS).
In order to minimize connection times when multiple addresses are available for communication, the Happy Eyeballs algorithm was devised. It queries the Domain Name System for IPv6 and IPv4 addresses of the target host, sorts candidate addresses using the default address selection table and tries to establish connections in parallel, where the first connection that is thus established aborts current and future attempts to connect to other addresses.
Domain Name System
In the Domain Name System, hostnames are mapped to IPv6 addresses by AAAA resource records, so-called quad-A records. For reverse lookup the IETF reserved the domain ip6.arpa, where the name space is hierarchically divided by the 1-digit hexadecimal representation of nibble units (4 bits) of the IPv6 address.
As in IPv4, each host is represented in the DNS by two DNS records: an address record and a reverse mapping pointer record. For example, a host computer named derrick in zone example.com has the Unique Local Address fdda:5cc1:23:4::1f. Its quad-A address record is
derrick.example.com. IN AAAA fdda:5cc1:23:4::1f
and its IPv6 pointer record is
f.188.8.131.52.0.0.0.0.0.0.0.0.0.0.0.4.0.0.0.3.184.108.40.206.c.c.5.a.d.d.f.ip6.arpa. IN PTR derrick.example.com.
This pointer record may be defined in a number of zones, depending on the chain of delegation of authority in the zone d.f.ip6.arpa.
The DNS protocol is independent of its Transport Layer protocol. Queries and replies may be transmitted over IPv6 or IPv4 transports regardless of the address family of the data requested.
|TTL||Time to live in seconds|
|RDLENGTH||Length of RDATA field|
|RDATA||128-bit IPv6 address, network byte order|
Deprecated and obsolete addresses
- The site-local prefix fec0::/10 specifies that the address is valid only within the site network of an organization. It was part of the original addressing architecture in December 1995, but its use was deprecated in September 2004 because the definition of the term site was ambiguous, which led to confusing routing rules. New networks must not support this special type of address. In October 2005, a new specification replaced this address type with unique local addresses.
- The address block 0200::/7 was defined as an OSI NSAP-mapped prefix set in August 1996, but was deprecated in December 2004.
- The 96-bit zero-value prefix ::/96, originally known as IPv4-compatible addresses, was mentioned in 1995 but first described in 1998. This range of addresses was used to represent IPv4 addresses within an IPv6 transition technology. Such an IPv6 address has its first (most significant) 96 bits set to zero, while its last 32 bits are the IPv4 address that is represented. In February 2006, the Internet Engineering Task Force (IETF) deprecated the use of IPv4-compatible addresses. The only remaining use of this address format is to represent an IPv4 address in a table or database with fixed size members that must also be able to store an IPv6 address.
- Address block 3ffe::/16 was allocated for test purposes for the 6bone network in December 1998. Prior to that, the address block 5f00::/8 was used for this purpose. Both address blocks were returned to the address pool in June 2006.
- Due to operational problems with 6to4 the use of address block 2002::/16 is diminishing, since the 6to4 mechanism is deprecated since May 2015. Although IPv4 address block 220.127.116.11/24 is deprecated, 2002::/16 is not.
- In April 2007 the address block 2001:10::/28 was assigned for Overlay Routable Cryptographic Hash Identifiers (ORCHID). It was intended for experimental use. In September 2014 a second version of ORCHID was specified, and with the introduction of block 2001:20::/28 the original block was returned to IANA.
- For reverse DNS lookup, IPv6 addresses were originally registered in the DNS zone ip6.int, because it was expected that the top-level domain arpa would be retired. In 2000, the Internet Architecture Board (IAB) reverted this intention, and decided in 2001 that arpa should retain its original function. Domains in ip6.int were moved to ip6.arpa and zone ip6.int was officially removed on 6 June 2006.
- In March 2011, the IETF refined the recommendations for allocation of address blocks to end sites. Instead of assigning either a /48, /64, or /128 (according to IAB's and IESG's views of 2001), Internet service providers should consider assigning smaller blocks (for example a /56) to end users. The ARIN, RIPE & APNIC regional registries' policies encourage /56 assignments where appropriate.
- Originally, two proposals existed for translating domain names to IPv6 addresses: one using AAAA records, the other using A6 records. AAAA records, the method that prevailed, are comparable to A records for IPv4, providing a simple mapping from hostname to IPv6 address. The method using A6 records used a hierarchical scheme, in which the mapping of subsequent groups of address bits was specified by additional A6 records, providing the possibility to renumber all hosts in a network by changing a single A6 record. As the perceived benefits of the A6 format were not deemed to outweigh the perceived costs, the method was moved to experimental status in 2002, and finally to historic status in 2012.
- In 2009, many DNS resolvers in home-networking NAT devices and routers were found to handle AAAA records improperly. Some of these simply dropped DNS requests for such records, instead of properly returning the appropriate negative DNS response. Because the request is dropped, the host sending the request has to wait for a timeout to trigger. This often causes a slow-down when connecting to dual-stack IPv6/IPv4 hosts, as the client software will wait for the IPv6 connection to fail before trying IPv4. Whether handling of AAAA records is improved since then is unknown.
- It is not mandatory for the source and destination address of a packet to have the same scope.
- R. Hinden; S. Deering (February 2006). IP Version 6 Addressing Architecture. Network Working Group. doi:10.17487/RFC4291. RFC 4291. https://tools.ietf.org/html/rfc4291. Updated by: RFC 5952, RFC 6052, RFC 7136, RFC 7346, RFC 7371, RFC 8064.
- Silvia Hagen (May 2006). IPv6 Essentials (Second ed.). O'Reilly. ISBN 978-0-596-10058-2.
- P. Savola; B. Haberman (November 2004). Embedding the Rendezvous Point (RP) Address in an IPv6 Multicast Address. Network Working Group. doi:10.17487/RFC3956. RFC 3956. https://tools.ietf.org/html/rfc3956.
- B. Haberman; D. Thaler (August 2002). Unicast-Prefix-based IPv6 Multicast Addresses. Network Working Group. doi:10.17487/RFC3306. RFC 3306. https://tools.ietf.org/html/rfc3306.
- J-S. Park; M-K. Shin; H-J. Kim (April 2006). A Method for Generating Link-Scoped IPv6 Multicast Addresses. Network Working Group. doi:10.17487/RFC4489. RFC 4489. https://tools.ietf.org/html/rfc4489.
- Graziani, Rick (2012). IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6. Cisco Press. p. 55. ISBN 978-0-13-303347-2.
- Coffeen, Tom (2014). IPv6 Address Planning: Designing an Address Plan for the Future. O'Reilly Media. p. 170. ISBN 978-1-4919-0326-1.
- S. Kawamura; M. Kawashima (August 2010). A Recommendation for IPv6 Address Text Representation. IETF. doi:10.17487/RFC5952. ISSN 2070-1721. RFC 5952. https://tools.ietf.org/html/rfc5952.
- T. Berners-Lee; R. Fielding; L. Masinter (January 2005). Uniform Resource Identifier (URI): Generic Syntax. Network Working Group. doi:10.17487/RFC3986. STD 66. RFC 3986. https://tools.ietf.org/html/rfc3986.
- S.Deering; B. Haberman; T. Jinmei; E. Nordmark; B. Zill (March 2005). IPv6 Scoped Address Architecture. Network Working Group. doi:10.17487/RFC4007. RFC 4007. https://tools.ietf.org/html/rfc4007.
- Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers. Tools.ietf.org. Retrieved on 2013-07-09.
- "ipv6-literal.net Domain History". who.is. Retrieved 20 October 2014.
- R Droms (August 2014). IPv6 Multicast Address Scopes. IETF. doi:10.17487/RFC7346. ISSN 2070-1721. RFC 7346. https://tools.ietf.org/html/rfc7346.
- IPv6 Address Allocation Management. Network Working Group, IETF. December 1995. doi:10.17487/RFC1881. RFC 1881. https://tools.ietf.org/html/rfc1881.
- IPv6 address space at IANA. Iana.org (2010-10-29). Retrieved on 2011-09-28.
- IPv6 unicast address assignments, IANA
- DE-TELEKOM-20050113 db.ripe.net. Retrieved 2011-09-28.
- "ARIN Number Resource Policy Manual: Initial allocation to ISPs".
- "RIPE NCC IPv6 Address Allocation and Assignment Policy: Minimum allocation".
- T. Narten; G. Houston; L. Roberts (March 2011). IPv6 Address Assignment to End Sites. IETF. doi:10.17487/RFC6177. BCP 157. RFC 6177. https://tools.ietf.org/html/rfc6177.
- for example. Iana.org. Retrieved on 2011-09-28.
- "IPv6 Addressing Plans". ARIN IPv6 Wiki. Retrieved 2018-07-15.
All customers get one /48 unless they can show that they need more than 65k subnets. [...] If you have lots of consumer customers you may want to assign /56s to private residence sites.
- "Address Space Managed by the RIPE NCC". Retrieved 2011-05-22.
- D. Johnson; S. Deering (March 1999). Reserved IPv6 Subnet Anycast Addresses. Network Working Group. doi:10.17487/RFC2526. RFC 2526. https://tools.ietf.org/html/rfc2526.
- M. Cotton; L. Vegoda; R. Bonica; B. Haberman (April 2013). Special-Purpose IP Address Registries. Internet Engineering Task Force. doi:10.17487/RFC6890. BCP 153. RFC 6890. https://tools.ietf.org/html/rfc6890. Updated by RFC 8190.
- C. Bao; C. Huitema; M. Bagnulo; M. Boucadair; X. Li (October 2010). IPv6 Addressing of IPv4/IPv6 Translators. Internet Engineering Task Force. doi:10.17487/RFC6052. RFC 6052. https://tools.ietf.org/html/rfc6052.
- N. Hilliard; D. Freedman (August 2012). A Discard Prefix for IPv6. Internet Engineering Task Force. doi:10.17487/RFC6666. RFC 6666. https://tools.ietf.org/html/rfc6666.
- J. Laganier; F. Dupont (September 2014). An IPv6 Prefix for Overlay Routable Cryptographic Hash Identifiers Version 2 (ORCHIDv2). Internet Engineering Task Force. doi:10.17487/RFC7343. RFC 7343. https://tools.ietf.org/html/rfc7343.
- G. Huston; A. Lord; P. Smith (July 2004). IPv6 Address Prefix Reserved for Documentation. Network Working Group. doi:10.17487/RFC3849. RFC 3849. https://tools.ietf.org/html/rfc3849.
- O. Troan (May 2015). B. Carpenter. ed. Deprecating the Anycast Prefix for 6to4 Relay Routers. Internet Engineering Task Force. doi:10.17487/RFC7526. BCP 196. RFC 7526. https://tools.ietf.org/html/rfc7526.
- R. Hinden; B. Haberman (October 2005). Unique Local IPv6 Unicast Addresses. Network Working Group. doi:10.17487/RFC4193. RFC 4193. https://tools.ietf.org/html/rfc4193.
- C. Bao; X. Li; F. Baker; T. Anderson; F. Gont (June 2016). Stateless IP/ICMP Translation Algorithm. doi:10.17487/RFC7915. RFC 7915. https://tools.ietf.org/html/rfc7915.
- R. Hinden; S. Deering; R. Fink; T. Hain (September 2000). Initial IPv6 Sub-TLA ID Assignments. Network Working Group. doi:10.17487/RFC2928. RFC 2928. https://tools.ietf.org/html/rfc2928.
- C. Popoviciu; A. Hamza; G. Van de Velde; D. Dugatkin (May 2008). IPv6 Benchmarking Methodology for Network Interconnect Devices. Network Working Group. doi:10.17487/RFC5180. RFC 5180. https://tools.ietf.org/html/rfc5180.
- J. Arkko; M. Cotton; L. Vegoda (January 2010). IPv4 Address Blocks Reserved for Documentation. Internet Engineering Task Force. doi:10.17487/RFC5737. ISSN 2070-1721. RFC 5737. https://tools.ietf.org/html/rfc5737.
- IANA Internet Protocol Version 6 Multicast Addresses.
- S. Thomson; T. Narten; T. Jinmei (September 2007). IPv6 Stateless Address Autoconfiguration. Network Working Group. doi:10.17487/RFC4862. RFC 4862. https://tools.ietf.org/html/rfc4862.
- T. Narten; E. Nordmark; W. Simpson; H. Holiman (September 2007). Neighbor Discovery for IP version 6 (IPv6). Network Working Group. doi:10.17487/RFC4861. RFC 4861. https://tools.ietf.org/html/rfc4861.
- Iljitsch van Beijnum (2006). "IPv6 Internals". The Internet Protocol Journal. 9 (3). pp. 16–29.
- The privacy implications of stateless IPv6 addressing. Portal.acm.org (2010-04-21). Retrieved on 2011-09-28.
- T. Narten; R. Draves; S. Krishnan (September 2007). Privacy Extensions for Stateless Address Autoconfiguration in IPv6. Network Working Group. doi:10.17487/RFC4941. RFC 4941. https://tools.ietf.org/html/rfc4941.
- T. Aura (March 2005). Cryptographically Generated Addresses (CGA). Network Working Group IETF. doi:10.17487/RFC3972. RFC 3972. https://tools.ietf.org/html/rfc3972.
- F. Gont (April 2014). A Method for Generating Semantically Opaque Interface Identifiers with IPv6 Stateless Address Autoconfiguration (SLAAC). IETF. doi:10.17487/RFC7217. ISSN 2070-1721. RFC 7217. https://tools.ietf.org/html/rfc7217.
- D. Thaler; R. Draves; A. Matsumoto; T. Chown (September 2012). D. Thaler. ed. Default Address Selection for Internet Protocol Version 6 (IPv6). IETF. doi:10.17487/RFC6724. ISSN 2070-1721. RFC 6724. https://tools.ietf.org/html/rfc6724.
- S. Thomson; C. Huitema; V. Ksinant; M. Souissi (October 2003). DNS Extensions to Support IP Version 6. Network Working Group. doi:10.17487/RFC3596. RFC 3596. https://tools.ietf.org/html/rfc3596.
- R. Hinden; S. Deering (December 1995). IP Version 6 Addressing Architecture. Network Working Group. doi:10.17487/RFC1884. RFC 1884. https://tools.ietf.org/html/rfc1884.
- C. Huitema; B. Carpenter (September 2004). Deprecating Site Local Addresses. Network Working Group. doi:10.17487/RFC3879. RFC 3879. https://tools.ietf.org/html/rfc3879.
- G. Houston (aug 2005). Proposed Changes to the Format of the IANA IPv6 Registry. Network Working Group. doi:10.17487/RFC4147. RFC 4147. https://tools.ietf.org/html/rfc4147.
- J. Bound; B. Carpenter; D. Harrington; J. Houldsworth; A. Lloyd (aug 1996). OSI NSAPs and IPv6. Network Working Group. doi:10.17487/RFC1888. RFC 1888. https://tools.ietf.org/html/rfc1888. Obsoleted by RFC 4048.
- B. Carpenter (apr 2005). RFC 1888 Is Obsolete. doi:10.17487/RFC4048. RFC 4048. https://tools.ietf.org/html/rfc4048.
- R. Hinden; R. Fink; J. Postel (dec 1998). IPv6 Testing Address Allocation. doi:10.17487/RFC2471. RFC 2471. https://tools.ietf.org/html/rfc2471. Obsoleted by RFC 3701.
- R. Fink; R. Hinden (mar 2004). 6bone (IPv6 Testing Address Allocation) Phaseout. Network Working Group. doi:10.17487/RFC3701. RFC 3701. https://tools.ietf.org/html/rfc3701.
- P. Nikander; J. Laganier; F. Dupont (April 2007). An IPv6 Prefix for Overlay Routable Cryptographic Hash Identifiers (ORCHID). Network Working Group. doi:10.17487/RFC4843. RFC 4843. https://tools.ietf.org/html/rfc4843.
- R. Bush (aug 2001). Delegation of IP6.ARPA. doi:10.17487/RFC3152. RFC 3152. https://tools.ietf.org/html/rfc3152. Obsoleted by RFC 3596
- IAB; IESG (September 2001). IAB/IESG Recommendations on IPv6 Address Allocations to Sites. doi:10.17487/RFC3177. RFC 3177. https://tools.ietf.org/html/rfc3177.
- S. Thomson; C. Huitema (December 1995). DNS Extensions to support IP version 6. Network Working Group. doi:10.17487/RFC1886. RFC 1886. https://tools.ietf.org/html/rfc1886. Obsoleted by RFC 3596.
- M. Crawford; C. Huitema (July 2000). DNS Extensions to Support IPv6 Address Aggregation and Renumbering. doi:10.17487/RFC2874. RFC 2874. https://tools.ietf.org/html/rfc2874.
- Comparison of AAAA and A6 (do we really need A6?), Jun-ichiro itojun Hagino, (July 2001)
- R. Bush; A. Durand; B. Fink; O. Gudmundsson; T. Hain (August 2002). Representing Internet Protocol version 6 (IPv6) Addresses in the Domain Name System (DNS). Network Working Group. doi:10.17487/RFC3363. RFC 3363. https://tools.ietf.org/html/rfc3363. .
- R. Austein (August 2002). Tradeoffs in Domain Name System (DNS) Support for Internet Protocol version 6 (IPv6). Network Working Group. doi:10.17487/RFC3364. RFC 3364. https://tools.ietf.org/html/rfc3364.
- S. Jiang; D. Conrad; B. Carpenter (March 2012). Moving A6 to Historic Status. IETF. doi:10.17487/RFC6536. RFC 6536. https://tools.ietf.org/html/rfc6536.
- Y. Morishita; T. Jinmei (May 2005). Common Misbehavior Against DNS Queries for IPv6 Addresses. doi:10.17487/RFC4074. RFC 4074. https://tools.ietf.org/html/rfc4074.
- IP Version 6 multicast addresses
- Beijnum, van, Iljitsch (2005). Running IPv6. ISBN 978-1-59059-527-5.
- Elz, Robert (1996-04-01). A Compact Representation of IPv6 Addresses (RFC1924). IETF. doi:10.17487/RFC1924. RFC 1924. https://tools.ietf.org/html/rfc1924. "Represent any IPv6 address in 20 octets." This humorous RFC specifies an alternative way of representing IPv6 addresses, using a base-85 encoding.