IPv6 address


An Internet Protocol version 6 address is a numeric label that is used to identify and locate a network interface of a computer or a network node participating in a computer network using IPv6. IP addresses are included in the packet header to indicate the source and the destination of each packet. The IP address of the destination is used to make decisions about routing IP packets to other networks.
IPv6 is the successor to the first addressing infrastructure of the Internet, Internet Protocol version 4. In contrast to IPv4, which defined an IP address as a 32-bit value, IPv6 addresses have a size of 128 bits. Therefore, in comparison, IPv6 has a vastly enlarged address space.

Addressing methods

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 that 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. However, the use of the all-nodes group is not recommended, and most IPv6 protocols use protocol-specific link-local multicast groups to avoid disturbing every interface on a given network.

Address formats

An IPv6 address consists of 128 bits. For each of the major addressing and routing methodologies, various address formats are recognized by dividing the 128 address bits into bit groups and using established rules for associating the values of these bit groups with special addressing features.

Unicast and anycast address format

and anycast addresses are typically composed of two logical parts: a 64-bit network prefix used for routing, and a 64-bit interface identifier used to identify a host's network interface.
bits48 16 64
fieldrouting prefixsubnet IDinterface identifier

The network prefix 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 automatically established randomly, obtained from a DHCPv6 server, or assigned manually.
Unique local addresses are addresses analogous to IPv4 private network addresses.

bits71401664
fieldprefixLrandomsubnet IDinterface identifier
The prefix field contains the binary value 1111110. The L bit is one for locally assigned addresses; the address range with L set to zero is currently not defined. The random field is chosen randomly once, at the inception of the routing prefix.

A link-local address is also based on the interface identifier, but uses a different format for the network prefix.
bits105464
fieldprefixzeroesinterface 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, rendering them non-routable.

Multicast address format

addresses are formed according to several specific formatting rules, depending on the application.

bits844112
fieldprefixflgscgroup ID

For all multicast addresses, the prefix field holds the binary value 11111111.
Currently, three of the four flag bits in the flg field are defined; the most-significant flag bit is reserved for future use.
bitflagMeaning when 0Meaning when 1
8reservedreservedreserved
9R Rendezvous point not embeddedRendezvous point embedded
10P Without prefix informationAddress based on network prefix
11T Well-known multicast addressDynamically assigned multicast address

The four-bit scope field is used to indicate where the address is valid and unique.
In addition, the scope field is used to identify special multicast addresses, like solicited node.
bits84479924
fieldprefixflgsczeroesonesunicast address

The sc field holds the binary value 0010. 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.
bits8444486432
fieldprefixflgscresriidplennetwork prefixgroup ID

Link-scoped multicast addresses use a comparable format.

Representation

An IPv6 address is represented as eight groups of four hexadecimal digits, each group representing 16 bits The groups are separated by colons. An example of an IPv6 address is:
The standards provide flexibility in the representation of IPv6 addresses. The full representation of eight four-digit groups may be simplified by several techniques, eliminating parts of the representation. In general, representations are shortened as much as possible. However, this practice complicates several common operations, namely searching for a specific address or an address pattern in text documents or streams, and comparing addresses to determine equivalence. For mitigation of these complications, the Internet Engineering Task Force has defined a canonical format for rendering IPv6 addresses in text:
  • The hexadecimal digits are always compared in case-insensitive manner, but IETF recommendations suggest the use of only lower case letters. For example, 2001:db8::1 is preferred over 2001:DB8::1;
  • Leading zeros in each 16-bit field are suppressed, but each group must retain at least one digit. For example, is rendered as ;
  • The longest sequence of consecutive all-zero fields is replaced with two colons. If the address contains multiple runs of all-zero fields of the same size, to prevent ambiguities, it is the leftmost that is compressed. For example, is rendered as rather than as. :: is not used to represent just a single all-zero field. For example, is shortened to, but is rendered as.
These methods can lead to very short representations for IPv6 addresses. For example, the localhost address,, and the IPv6 unspecified address,, are reduced to 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 96 most-significant bits are written in IPv6 format. For example, the IPv4-mapped IPv6 address is written as, thus expressing clearly the original IPv4 address that was mapped to IPv6.

Networks

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, a slash, and a decimal value equal to the size in bits of the prefix. For example, the network written as starts at address and ends at.
The routing prefix of an interface address may be directly indicated with the address using CIDR notation. For example, the configuration of an interface with address connected to subnet is written as.

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. For example, an address block with 48 bits in the prefix is indicated by. Such a block contains 2128 − 48 = 280 addresses. The smaller the length of the network prefix, the larger the block: a block is 8 times larger than a block.